sipeed_wiki icon indicating copy to clipboard operation
sipeed_wiki copied to clipboard

Tang 9K Block SRAM Write Corruption

Open SparkyNZ opened this issue 9 months ago • 1 comments

Has anybody had any success in creating a large framebuffer with inferred Block SRAM?

Image

If I load a .hex file into the RAM, that data is written (and read) from the inferred block RAM perfectly. But when I try to dynamically write to the RAM, I am not getting consistent writes (see the stray pixels on the attached picture).

You'll notice random pixels which typically seem to occur when 0 is being written to the RAM (within the black lines of the pattern).

The attached design does the following:

  1. Initialises the RAM with a .hex file
  2. Fills part of the RAM with a 7, 0, 7, 0 ... pattern which corresponds to yellow-black pixels in my framebuffer.
  3. Enables reading of the RAM once writing has been completed (this proves I do not have reads and writes at the same time)

I have tried lengthening the duration that the write enable signal remains high, double-registering the address, data and write enable signals.

No matter what I have tried, I cannot get my RAM writing to work properly. I have confirmed the same behaviour on a second Tang Nano 9K also.

Can somebody please help? I'll attach my design for reference.

Tang9Test_RamIssue.zip

SparkyNZ avatar Jul 08 '25 00:07 SparkyNZ

I have the same issue with explicit SP RAM (64k x 4bits).

SparkyNZ avatar Jul 09 '25 13:07 SparkyNZ