QNICE-FPGA icon indicating copy to clipboard operation
QNICE-FPGA copied to clipboard

MEGA65: HyperRAM: 16-bit write/read not stable

Open sy2002 opened this issue 3 years ago • 1 comments

Using test_programs/MEGA65/hyperram.asm. What it does:

Start at address 0x00333333 and fill 1MB of data with 16-bit values starting from 0x0000 and then count them up by one at every address, so:

Address    ==> Value
0x00333333 ==> 0x0000
0x00333331 ==> 0x0001
0x00333332 ==> 0x0002
[...]
0x00343332 ==> 0xFFFF
0x00343333 ==> 0x000
[...]

After filling 1MB like this, it is read. If something goes wrong, then the address where this happens, the actual value and the expected value is printed.

STEP 1: Run from a freshly programmed FPGA (means: HRAM driver and wrapper fresh)

8-bit part works, and the very first 255 words of the 16-bit part work, too. But then word number 256 and 257 have a problem. And from there on, every 256 words of the 16-bit part has errors:

16-bit linear test: Fill 1MB from 0x0333333 with 16-bit values, then test:
16-bit linear test: FAILED
Read Errors: 0x0198 (decimal: 408)
Address   Actual  Expected
00333433: 0000    0100
00333434: 0001    0101
00333533: 0100    0200
00333534: 0101    0201
00333633: 0200    0300
00333634: 0201    0301
00333733: 0300    0400
00333734: 0301    0401
00333833: 0400    0500
00333834: 0401    0501
00333933: 0500    0600
00333934: 0501    0601
00333A33: 0600    0700
00333A34: 0601    0701
00333B33: 0700    0800
00333B34: 0701    0801
00333C33: 0800    0900
00333C34: 0801    0901
00333D33: 0900    0A00
00333D34: 0901    0A01
00333E33: 0A00    0B00
00333E34: 0A01    0B01
[ ... output shortened, but the pattern continues every 256 bytes ...]
0033FC33: C800    C900
0033FC34: C801    C901
0033FD33: C900    CA00
0033FD34: C901    CA01
0033FE33: CA00    CB00
0033FE34: CA01    CB01
0033FF33: CB00    CC00
0033FF34: CB01    CC01

STEP 2: Re-run via C R 8000 directly after STEP 1

Similar result, but there are two more errors (410 errors instead of 408) and those two additional errors are at the very beginning.

16-bit linear test: Fill 1MB from 0x0333333 with 16-bit values, then test:
16-bit linear test: FAILED
Read Errors: 0x019A (decimal: 410)
Address   Actual  Expected
00333333: CC00    0000
00333334: CC01    0001
00333433: 0000    0100
00333434: 0001    0101
00333533: 0100    0200
00333534: 0101    0201
00333633: 0200    0300
00333634: 0201    0301
00333733: 0300    0400
00333734: 0301    0401
00333833: 0400    0500
00333834: 0401    0501
[ ... output shortened, but the pattern continues every 256 bytes ...]
0033FE33: CA00    CB00
0033FE34: CA01    CB01
0033FF33: CB00    CC00
0033FF34: CB01    CC01

sy2002 avatar Aug 21 '20 21:08 sy2002

The operative work on this issue is happening in the MEGA65 core repo:

https://github.com/MEGA65/mega65-core/issues/280

sy2002 avatar Oct 10 '20 13:10 sy2002