SpinalHDL / VexRiscv

A FPGA friendly 32 bit RISC-V CPU implementation
MIT License
2.41k stars 408 forks source link

Briey SDRAM Reverse Writing / Reading Error #195

Closed nvitya closed 3 years ago

nvitya commented 3 years ago

Hi,

Now I can debug the Briey SoC over JTAG! Tank you!

Clock Speed: 50 MHz Test board: QMTECH Cyclone IV Starter Kit (SDRAM = W9825G6JH6)

Unfortunatelly the SDRAM does not work properly like with QSYS, when tested backwards. It seems that the byte masking does not work somehow.

Here are the results of a 8-bit backward test with the Briey (2th Sep.):

SDRAM-8-reverse test 0 ...
  Filling...   clocks: 5157
  Comparing... 
ERR at 0x400003FF = 0x47 instead of 0x44 !
ERR at 0x400003FE = 0x47 instead of 0x45 !
ERR at 0x400003FD = 0x47 instead of 0x46 !
ERR at 0x400003FB = 0x4B instead of 0x48 !
ERR at 0x400003FA = 0x4B instead of 0x49 !
ERR at 0x400003F9 = 0x4B instead of 0x4A !
ERR at 0x400003F7 = 0x4F instead of 0x4C !
ERR at 0x400003F6 = 0x4F instead of 0x4D !
ERR at 0x400003F5 = 0x4F instead of 0x4E !
ERR at 0x400003F3 = 0x53 instead of 0x50 !
ERR at 0x400003F2 = 0x53 instead of 0x51 !
ERR at 0x400003F1 = 0x53 instead of 0x52 !
ERR at 0x400003EF = 0x57 instead of 0x54 !
ERR at 0x400003EE = 0x57 instead of 0x55 !
ERR at 0x400003ED = 0x57 instead of 0x56 !
ERR at 0x400003EB = 0x5B instead of 0x58 !
ERR at 0x400003EA = 0x5B instead of 0x59 !
ERR at 0x400003E9 = 0x5B instead of 0x5A !
ERR at 0x400003E7 = 0x5F instead of 0x5C !
ERR at 0x400003E6 = 0x5F instead of 0x5D !
ERR at 0x400003E5 = 0x5F instead of 0x5E !
ERR at 0x400003E3 = 0x63 instead of 0x60 !
ERR at 0x400003E2 = 0x63 instead of 0x61 !
ERR at 0x400003E1 = 0x63 instead of 0x62 !
ERR at 0x400003DF = 0x67 instead of 0x64 !
ERR at 0x400003DE = 0x67 instead of 0x65 !
ERR at 0x400003DD = 0x67 instead of 0x66 !
ERR at 0x400003DB = 0x6B instead of 0x68 !
ERR at 0x400003DA = 0x6B instead of 0x69 !
ERR at 0x400003D9 = 0x6B instead of 0x6A !
ERR at 0x400003D7 = 0x6F instead of 0x6C !
ERR at 0x400003D6 = 0x6F instead of 0x6D !
ERR at 0x400003D5 = 0x6F instead of 0x6E !
ERR at 0x400003D3 = 0x73 instead of 0x70 !
ERR at 0x400003D2 = 0x73 instead of 0x71 !
ERR at 0x400003D1 = 0x73 instead of 0x72 !
ERR at 0x400003CF = 0x77 instead of 0x74 !
ERR at 0x400003CE = 0x77 instead of 0x75 !
ERR at 0x400003CD = 0x77 instead of 0x76 !
ERR at 0x400003CB = 0x7B instead of 0x78 !
ERR at 0x400003CA = 0x7B instead of 0x79 !
ERR at 0x400003C9 = 0x7B instead of 0x7A !
ERR at 0x400003C7 = 0x7F instead of 0x7C !
ERR at 0x400003C6 = 0x7F instead of 0x7D !
ERR at 0x400003C5 = 0x7F instead of 0x7E !
ERR at 0x400003C3 = 0x83 instead of 0x80 !
ERR at 0x400003C2 = 0x83 instead of 0x81 !
ERR at 0x400003C1 = 0x83 instead of 0x82 !
ERR at 0x400003BF = 0x87 instead of 0x84 !
ERR at 0x400003BE = 0x87 instead of 0x85 !
ERR at 0x400003BD = 0x87 instead of 0x86 !
ERR at 0x400003BB = 0x8B instead of 0x88 !
ERR at 0x400003BA = 0x8B instead of 0x89 !
ERR at 0x400003B9 = 0x8B instead of 0x8A !
ERR at 0x400003B7 = 0x8F instead of 0x8C !
ERR at 0x400003B6 = 0x8F instead of 0x8D !
ERR at 0x400003B5 = 0x8F instead of 0x8E !
ERR at 0x400003B3 = 0x93 instead of 0x90 !
ERR at 0x400003B2 = 0x93 instead of 0x91 !
ERR at 0x400003B1 = 0x93 instead of 0x92 !
ERR at 0x400003AF = 0x97 instead of 0x94 !
ERR at 0x400003AE = 0x97 instead of 0x95 !
ERR at 0x400003AD = 0x97 instead of 0x96 !
ERR at 0x400003AB = 0x9B instead of 0x98 !
ERR at 0x400003AA = 0x9B instead of 0x99 !
ERR at 0x400003A9 = 0x9B instead of 0x9A !
ERR at 0x400003A7 = 0x9F instead of 0x9C !
ERR at 0x400003A6 = 0x9F instead of 0x9D !
ERR at 0x400003A5 = 0x9F instead of 0x9E !
ERR at 0x400003A3 = 0xA3 instead of 0xA0 !
ERR at 0x400003A2 = 0xA3 instead of 0xA1 !
ERR at 0x400003A1 = 0xA3 instead of 0xA2 !
ERR at 0x4000039F = 0xA7 instead of 0xA4 !
ERR at 0x4000039E = 0xA7 instead of 0xA5 !
ERR at 0x4000039D = 0xA7 instead of 0xA6 !
ERR at 0x4000039B = 0xAB instead of 0xA8 !
ERR at 0x4000039A = 0xAB instead of 0xA9 !
ERR at 0x40000399 = 0xAB instead of 0xAA !
ERR at 0x40000397 = 0xAF instead of 0xAC !
ERR at 0x40000396 = 0xAF instead of 0xAD !
ERR at 0x40000395 = 0xAF instead of 0xAE !
ERR at 0x40000393 = 0xB3 instead of 0xB0 !
ERR at 0x40000392 = 0xB3 instead of 0xB1 !
ERR at 0x40000391 = 0xB3 instead of 0xB2 !
ERR at 0x4000038F = 0xB7 instead of 0xB4 !
ERR at 0x4000038E = 0xB7 instead of 0xB5 !
ERR at 0x4000038D = 0xB7 instead of 0xB6 !
ERR at 0x4000038B = 0xBB instead of 0xB8 !
ERR at 0x4000038A = 0xBB instead of 0xB9 !
ERR at 0x40000389 = 0xBB instead of 0xBA !
ERR at 0x40000387 = 0xBF instead of 0xBC !
ERR at 0x40000386 = 0xBF instead of 0xBD !
ERR at 0x40000385 = 0xBF instead of 0xBE !
ERR at 0x40000383 = 0xC3 instead of 0xC0 !
ERR at 0x40000382 = 0xC3 instead of 0xC1 !
ERR at 0x40000381 = 0xC3 instead of 0xC2 !
ERR at 0x4000037F = 0xC7 instead of 0xC4 !
ERR at 0x4000037E = 0xC7 instead of 0xC5 !
ERR at 0x4000037D = 0xC7 instead of 0xC6 !
ERR at 0x4000037B = 0xCB instead of 0xC8 !
ERR at 0x4000037A = 0xCB instead of 0xC9 !
ERR at 0x40000379 = 0xCB instead of 0xCA !
ERR at 0x40000377 = 0xCF instead of 0xCC !
ERR at 0x40000376 = 0xCF instead of 0xCD !
ERR at 0x40000375 = 0xCF instead of 0xCE !
ERR at 0x40000373 = 0xD3 instead of 0xD0 !
ERR at 0x40000372 = 0xD3 instead of 0xD1 !
ERR at 0x40000371 = 0xD3 instead of 0xD2 !
ERR at 0x4000036F = 0xD7 instead of 0xD4 !
ERR at 0x4000036E = 0xD7 instead of 0xD5 !
ERR at 0x4000036D = 0xD7 instead of 0xD6 !
ERR at 0x4000036B = 0xDB instead of 0xD8 !
ERR at 0x4000036A = 0xDB instead of 0xD9 !
ERR at 0x40000369 = 0xDB instead of 0xDA !
ERR at 0x40000367 = 0xDF instead of 0xDC !
ERR at 0x40000366 = 0xDF instead of 0xDD !
ERR at 0x40000365 = 0xDF instead of 0xDE !
ERR at 0x40000363 = 0xE3 instead of 0xE0 !
ERR at 0x40000362 = 0xE3 instead of 0xE1 !
ERR at 0x40000361 = 0xE3 instead of 0xE2 !
ERR at 0x4000035F = 0xE7 instead of 0xE4 !
ERR at 0x4000035E = 0xE7 instead of 0xE5 !
ERR at 0x4000035D = 0xE7 instead of 0xE6 !
ERR at 0x4000035B = 0xEB instead of 0xE8 !
ERR at 0x4000035A = 0xEB instead of 0xE9 !
ERR at 0x40000359 = 0xEB instead of 0xEA !
ERR at 0x40000357 = 0xEF instead of 0xEC !
ERR at 0x40000356 = 0xEF instead of 0xED !
ERR at 0x40000355 = 0xEF instead of 0xEE !
ERR at 0x40000353 = 0xF3 instead of 0xF0 !
ERR at 0x40000352 = 0xF3 instead of 0xF1 !
ERR at 0x40000351 = 0xF3 instead of 0xF2 !
ERR at 0x4000034F = 0xF7 instead of 0xF4 !
ERR at 0x4000034E = 0xF7 instead of 0xF5 !
ERR at 0x4000034D = 0xF7 instead of 0xF6 !
ERR at 0x4000034B = 0xFB instead of 0xF8 !
ERR at 0x4000034A = 0xFB instead of 0xF9 !
ERR at 0x40000349 = 0xFB instead of 0xFA !
ERR at 0x40000347 = 0xFF instead of 0xFC !
ERR at 0x40000346 = 0xFF instead of 0xFD !
ERR at 0x40000345 = 0xFF instead of 0xFE !
ERR at 0x40000343 = 0x03 instead of 0x00 !
ERR at 0x40000342 = 0x03 instead of 0x01 !
ERR at 0x40000341 = 0x03 instead of 0x02 !
ERR at 0x4000033F = 0x07 instead of 0x04 !
ERR at 0x4000033E = 0x07 instead of 0x05 !
ERR at 0x4000033D = 0x07 instead of 0x06 !
ERR at 0x4000033B = 0x0B instead of 0x08 !
ERR at 0x4000033A = 0x0B instead of 0x09 !
ERR at 0x40000339 = 0x0B instead of 0x0A !
ERR at 0x40000337 = 0x0F instead of 0x0C !
ERR at 0x40000336 = 0x0F instead of 0x0D !
ERR at 0x40000335 = 0x0F instead of 0x0E !
ERR at 0x40000333 = 0x13 instead of 0x10 !
ERR at 0x40000332 = 0x13 instead of 0x11 !
ERR at 0x40000331 = 0x13 instead of 0x12 !
ERR at 0x4000032F = 0x17 instead of 0x14 !
ERR at 0x4000032E = 0x17 instead of 0x15 !
ERR at 0x4000032D = 0x17 instead of 0x16 !
ERR at 0x4000032B = 0x1B instead of 0x18 !
ERR at 0x4000032A = 0x1B instead of 0x19 !
ERR at 0x40000329 = 0x1B instead of 0x1A !
ERR at 0x40000327 = 0x1F instead of 0x1C !
ERR at 0x40000326 = 0x1F instead of 0x1D !
ERR at 0x40000325 = 0x1F instead of 0x1E !
ERR at 0x40000323 = 0x23 instead of 0x20 !
ERR at 0x40000322 = 0x23 instead of 0x21 !
ERR at 0x40000321 = 0x23 instead of 0x22 !
ERR at 0x4000031F = 0x27 instead of 0x24 !
ERR at 0x4000031E = 0x27 instead of 0x25 !
ERR at 0x4000031D = 0x27 instead of 0x26 !
ERR at 0x4000031B = 0x2B instead of 0x28 !
ERR at 0x4000031A = 0x2B instead of 0x29 !
ERR at 0x40000319 = 0x2B instead of 0x2A !
ERR at 0x40000317 = 0x2F instead of 0x2C !
ERR at 0x40000316 = 0x2F instead of 0x2D !
ERR at 0x40000315 = 0x2F instead of 0x2E !
ERR at 0x40000313 = 0x33 instead of 0x30 !
ERR at 0x40000312 = 0x33 instead of 0x31 !
ERR at 0x40000311 = 0x33 instead of 0x32 !
ERR at 0x4000030F = 0x37 instead of 0x34 !
ERR at 0x4000030E = 0x37 instead of 0x35 !
ERR at 0x4000030D = 0x37 instead of 0x36 !
ERR at 0x4000030B = 0x3B instead of 0x38 !
ERR at 0x4000030A = 0x3B instead of 0x39 !
ERR at 0x40000309 = 0x3B instead of 0x3A !
ERR at 0x40000307 = 0x3F instead of 0x3C !
ERR at 0x40000306 = 0x3F instead of 0x3D !
ERR at 0x40000305 = 0x3F instead of 0x3E !
ERR at 0x40000303 = 0x43 instead of 0x40 !
ERR at 0x40000302 = 0x43 instead of 0x41 !
ERR at 0x40000301 = 0x43 instead of 0x42 !
ERR at 0x400002FF = 0x47 instead of 0x44 !
ERR at 0x400002FE = 0x47 instead of 0x45 !
ERR at 0x400002FD = 0x47 instead of 0x46 !
ERR at 0x400002FB = 0x4B instead of 0x48 !
ERR at 0x400002FA = 0x4B instead of 0x49 !
ERR at 0x400002F9 = 0x4B instead of 0x4A !
ERR at 0x400002F7 = 0x4F instead of 0x4C !
ERR at 0x400002F6 = 0x4F instead of 0x4D !
ERR at 0x400002F5 = 0x4F instead of 0x4E !
ERR at 0x400002F3 = 0x53 instead of 0x50 !
ERR at 0x400002F2 = 0x53 instead of 0x51 !
ERR at 0x400002F1 = 0x53 instead of 0x52 !
ERR at 0x400002EF = 0x57 instead of 0x54 !
ERR at 0x400002EE = 0x57 instead of 0x55 !
ERR at 0x400002ED = 0x57 instead of 0x56 !
ERR at 0x400002EB = 0x5B instead of 0x58 !
ERR at 0x400002EA = 0x5B instead of 0x59 !
ERR at 0x400002E9 = 0x5B instead of 0x5A !
ERR at 0x400002E7 = 0x5F instead of 0x5C !
ERR at 0x400002E6 = 0x5F instead of 0x5D !
ERR at 0x400002E5 = 0x5F instead of 0x5E !
ERR at 0x400002E3 = 0x63 instead of 0x60 !
ERR at 0x400002E2 = 0x63 instead of 0x61 !
ERR at 0x400002E1 = 0x63 instead of 0x62 !
ERR at 0x400002DF = 0x67 instead of 0x64 !
ERR at 0x400002DE = 0x67 instead of 0x65 !
ERR at 0x400002DD = 0x67 instead of 0x66 !
ERR at 0x400002DB = 0x6B instead of 0x68 !
ERR at 0x400002DA = 0x6B instead of 0x69 !
ERR at 0x400002D9 = 0x6B instead of 0x6A !
ERR at 0x400002D7 = 0x6F instead of 0x6C !
ERR at 0x400002D6 = 0x6F instead of 0x6D !
ERR at 0x400002D5 = 0x6F instead of 0x6E !
ERR at 0x400002D3 = 0x73 instead of 0x70 !
ERR at 0x400002D2 = 0x73 instead of 0x71 !
ERR at 0x400002D1 = 0x73 instead of 0x72 !
ERR at 0x400002CF = 0x77 instead of 0x74 !
ERR at 0x400002CE = 0x77 instead of 0x75 !
ERR at 0x400002CD = 0x77 instead of 0x76 !
ERR at 0x400002CB = 0x7B instead of 0x78 !
ERR at 0x400002CA = 0x7B instead of 0x79 !
ERR at 0x400002C9 = 0x7B instead of 0x7A !
ERR at 0x400002C7 = 0x7F instead of 0x7C !
ERR at 0x400002C6 = 0x7F instead of 0x7D !
ERR at 0x400002C5 = 0x7F instead of 0x7E !
ERR at 0x400002C3 = 0x83 instead of 0x80 !
ERR at 0x400002C2 = 0x83 instead of 0x81 !
ERR at 0x400002C1 = 0x83 instead of 0x82 !
ERR at 0x400002BF = 0x87 instead of 0x84 !
ERR at 0x400002BE = 0x87 instead of 0x85 !
ERR at 0x400002BD = 0x87 instead of 0x86 !
ERR at 0x400002BB = 0x8B instead of 0x88 !
ERR at 0x400002BA = 0x8B instead of 0x89 !
ERR at 0x400002B9 = 0x8B instead of 0x8A !
ERR at 0x400002B7 = 0x8F instead of 0x8C !
ERR at 0x400002B6 = 0x8F instead of 0x8D !
ERR at 0x400002B5 = 0x8F instead of 0x8E !
ERR at 0x400002B3 = 0x93 instead of 0x90 !
ERR at 0x400002B2 = 0x93 instead of 0x91 !
ERR at 0x400002B1 = 0x93 instead of 0x92 !
ERR at 0x400002AF = 0x97 instead of 0x94 !
ERR at 0x400002AE = 0x97 instead of 0x95 !
ERR at 0x400002AD = 0x97 instead of 0x96 !
ERR at 0x400002AB = 0x9B instead of 0x98 !
ERR at 0x400002AA = 0x9B instead of 0x99 !
clocks: 48850569
  !!! ERRORS = 257
END SDRAM Test

Reverse SDRAM Test with the QSYS:

BEGIN SDRAM Test
SDRAM-8-reverse test 0 ...
  Filling...   clocks: 7340051
  Comparing... 
ERR at 0x100FFFFF = 0x00 instead of 0x44 !
ERR at 0x100FFFFE = 0x00 instead of 0x45 !
ERR at 0x100FFFDF = 0x52 instead of 0x64 !
ERR at 0x100FFFDE = 0x53 instead of 0x65 !
ERR at 0x100FFFDD = 0x52 instead of 0x66 !
ERR at 0x100FFFDC = 0x53 instead of 0x67 !
ERR at 0x100FFFDB = 0x52 instead of 0x68 !
ERR at 0x100FFFDA = 0x53 instead of 0x69 !
ERR at 0x100FFFD9 = 0x52 instead of 0x6A !
ERR at 0x100FFFD8 = 0x53 instead of 0x6B !
ERR at 0x100FFFD7 = 0x52 instead of 0x6C !
ERR at 0x100FFFD6 = 0x53 instead of 0x6D !
ERR at 0x100FFFD5 = 0x52 instead of 0x6E !
ERR at 0x100FFFD4 = 0x53 instead of 0x6F !
ERR at 0x100FFFD3 = 0x52 instead of 0x70 !
ERR at 0x100FFFD2 = 0x53 instead of 0x71 !
ERR at 0x100FFFD1 = 0x52 instead of 0x72 !
ERR at 0x100FFFD0 = 0x53 instead of 0x73 !
ERR at 0x100FFFCF = 0x52 instead of 0x74 !
ERR at 0x100FFFCE = 0x53 instead of 0x75 !
ERR at 0x100FFFCD = 0x52 instead of 0x76 !
ERR at 0x100FFFCC = 0x53 instead of 0x77 !
ERR at 0x100FFFCB = 0x52 instead of 0x78 !
ERR at 0x100FFFCA = 0x53 instead of 0x79 !
ERR at 0x100FFFC9 = 0x52 instead of 0x7A !
ERR at 0x100FFFC8 = 0x53 instead of 0x7B !
ERR at 0x100FFFC7 = 0x52 instead of 0x7C !
ERR at 0x100FFFC6 = 0x53 instead of 0x7D !
ERR at 0x100FFFC5 = 0x52 instead of 0x7E !
ERR at 0x100FFFC4 = 0x53 instead of 0x7F !
ERR at 0x100FFFC3 = 0x52 instead of 0x80 !
ERR at 0x100FFFC2 = 0x53 instead of 0x81 !
ERR at 0x100FFFC1 = 0x52 instead of 0x82 !
ERR at 0x100FFFC0 = 0x53 instead of 0x83 !
ERR at 0x100FFFBF = 0x52 instead of 0x84 !
ERR at 0x100FFFBE = 0x53 instead of 0x85 !
ERR at 0x100FFF9F = 0x92 instead of 0xA4 !
ERR at 0x100FFF9E = 0x93 instead of 0xA5 !
ERR at 0x100FFF7F = 0xB2 instead of 0xC4 !
ERR at 0x100FFF7E = 0xB3 instead of 0xC5 !
ERR at 0x100FFF5F = 0xD2 instead of 0xE4 !
ERR at 0x100FFF5E = 0xD3 instead of 0xE5 !
ERR at 0x100FFF5D = 0xD2 instead of 0xE6 !
ERR at 0x100FFF5C = 0xD3 instead of 0xE7 !
ERR at 0x100FFF5B = 0xD2 instead of 0xE8 !
ERR at 0x100FFF5A = 0xD3 instead of 0xE9 !
ERR at 0x100FFF59 = 0xD2 instead of 0xEA !
ERR at 0x100FFF58 = 0xD3 instead of 0xEB !
ERR at 0x100FFF57 = 0xD2 instead of 0xEC !
ERR at 0x100FFF56 = 0xD3 instead of 0xED !
ERR at 0x100FFF55 = 0xD2 instead of 0xEE !
ERR at 0x100FFF54 = 0xD3 instead of 0xEF !
ERR at 0x100FFF53 = 0xD2 instead of 0xF0 !
ERR at 0x100FFF52 = 0xD3 instead of 0xF1 !
ERR at 0x100FFF51 = 0xD2 instead of 0xF2 !
ERR at 0x100FFF50 = 0xD3 instead of 0xF3 !
ERR at 0x100FFF4F = 0xD2 instead of 0xF4 !
ERR at 0x100FFF4E = 0xD3 instead of 0xF5 !
ERR at 0x100FFF4D = 0xD2 instead of 0xF6 !
ERR at 0x100FFF4C = 0xD3 instead of 0xF7 !
ERR at 0x100FFF4B = 0xD2 instead of 0xF8 !
ERR at 0x100FFF4A = 0xD3 instead of 0xF9 !
ERR at 0x100FFF49 = 0xD2 instead of 0xFA !
ERR at 0x100FFF48 = 0xD3 instead of 0xFB !
ERR at 0x100FFF47 = 0xD2 instead of 0xFC !
clocks: 12423847
  !!! ERRORS = 65
END SDRAM Test

The 8-bit and 16-bit forward tests work error-free on both Briey and QSYS. The 32-bit backward test works error-free on both Briey and QSYS. The 16-bit backward test works error-free on on QSYS with DBusSimplePlugin.

nvitya commented 3 years ago

Sorry my fault ! The DQM signal was commented out. Now the reverse testing also works with the Briey!. Thank you for your support.

Dolu1990 commented 3 years ago

Cool ^^ Welcome :)