sim: update to use word_width

This commit is contained in:
morgan 2025-01-14 15:22:50 +08:00
parent eefc172860
commit a02d6fce85
6 changed files with 144 additions and 144 deletions

View File

@ -85,17 +85,17 @@ def testbench(n_downconn):
frame_packets = [
# frame #0
[
{"data": C((i+1)<< 28 | 0x1111, word_dw), "k": Replicate(1, 4)},
{"data": C((i+1)<< 28 | 0x2222, word_dw), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x3333, word_dw), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x4444, word_dw), "k": Replicate(0, 4), "eop":0},
{"data": C((i+1)<< 28 | 0x1111, word_width), "k": Replicate(1, 4)},
{"data": C((i+1)<< 28 | 0x2222, word_width), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x3333, word_width), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x4444, word_width), "k": Replicate(0, 4), "eop":0},
],
# frame #1
[
{"data": C((i+1)<< 28 | 0x5555, word_dw), "k": Replicate(1, 4)},
{"data": C((i+1)<< 28 | 0x6666, word_dw), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x7777, word_dw), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x8888, word_dw), "k": Replicate(0, 4), "eop":0},
{"data": C((i+1)<< 28 | 0x5555, word_width), "k": Replicate(1, 4)},
{"data": C((i+1)<< 28 | 0x6666, word_width), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x7777, word_width), "k": Replicate(0, 4)},
{"data": C((i+1)<< 28 | 0x8888, word_width), "k": Replicate(0, 4), "eop":0},
],
]

View File

@ -64,26 +64,26 @@ def testbench():
{"data": Replicate(C(0, char_width), 4), "k": Replicate(0, 4)},
{"data": Replicate(C(4, 2 * char_width)[8:], 4), "k": Replicate(0, 4)},
{"data": Replicate(C(4, 2 * char_width)[:8], 4), "k": Replicate(0, 4)}, # CRC doesn't count
{"data": C(0x7C7C7C7C, word_dw), "k": Replicate(1, 4)},
{"data": C(0x01010101, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0xF6ACEF6A, word_dw), "k": Replicate(0, 4)},
{"data": C(0x7C7C7C7C, word_width), "k": Replicate(1, 4)},
{"data": C(0x01010101, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0xF6ACEF6A, word_width), "k": Replicate(0, 4)},
{"data": Replicate(C(0, char_width), 4), "k": Replicate(0, 4)},
{"data": Replicate(C(1, char_width), 4), "k": Replicate(0, 4)},
{"data": Replicate(C(8, 2 * char_width)[8:], 4), "k": Replicate(0, 4)},
{"data": Replicate(C(8, 2 * char_width)[:8], 4), "k": Replicate(0, 4)}, # CRC doesn't count
{"data": C(0x19191919, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x09090909, word_dw), "k": Replicate(0, 4)},
{"data": C(0x90909090, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x985EFDB2, word_dw), "k": Replicate(0, 4)},
{"data": C(0x19191919, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x09090909, word_width), "k": Replicate(0, 4)},
{"data": C(0x90909090, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x985EFDB2, word_width), "k": Replicate(0, 4)},
]
yield from packet_sim(paks)

View File

@ -56,23 +56,23 @@ def packet_sim(packets=[]):
def testbench():
paks = [
{"data": C(0x7C7C7C7C, word_dw), "k": Replicate(1, 4)},
{"data": C(0x01010101, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x7C7C7C7C, word_width), "k": Replicate(1, 4)},
{"data": C(0x01010101, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
# {"data": C(0xF6ACEF6B, word_dw), "k": Replicate(0, 4), "eop":1},
{"data": C(0x6AEFACF6, word_dw), "k": Replicate(0, 4), "eop":1},
{"data": C(0x6AEFACF6, word_width), "k": Replicate(0, 4), "eop":1},
{"data": C(0x19191919, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x09090909, word_dw), "k": Replicate(0, 4)},
{"data": C(0x90909090, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k": Replicate(0, 4)},
{"data": C(0xB2FD5E98, word_dw), "k": Replicate(0, 4), "eop":1},
{"data": C(0x19191919, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x09090909, word_width), "k": Replicate(0, 4)},
{"data": C(0x90909090, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k": Replicate(0, 4)},
{"data": C(0xB2FD5E98, word_width), "k": Replicate(0, 4), "eop":1},
]
yield from packet_sim(paks)

View File

@ -53,17 +53,17 @@ def packet_sim(packets=[]):
def testbench():
paks = [
{"data": Replicate(KCode["pak_start"], 4), "k": Replicate(1, 4)},
{"data": C(0x1111, word_dw), "k": Replicate(1, 4)},
{"data": C(0x2222, word_dw), "k": Replicate(0, 4)},
{"data": C(0x3333, word_dw), "k": Replicate(0, 4)},
{"data": C(0x4444, word_dw), "k": Replicate(0, 4)},
{"data": C(0x1111, word_width), "k": Replicate(1, 4)},
{"data": C(0x2222, word_width), "k": Replicate(0, 4)},
{"data": C(0x3333, word_width), "k": Replicate(0, 4)},
{"data": C(0x4444, word_width), "k": Replicate(0, 4)},
{"data": Replicate(KCode["pak_end"], 4), "k": Replicate(1, 4)},
{"data": Replicate(KCode["pak_start"], 4), "k": Replicate(1, 4)},
{"data": C(0xAAAA, word_dw), "k": Replicate(1, 4)},
{"data": C(0xBBBB, word_dw), "k": Replicate(0, 4)},
{"data": C(0xCCCC, word_dw), "k": Replicate(0, 4)},
{"data": C(0xDDDD, word_dw), "k": Replicate(0, 4)},
{"data": C(0xAAAA, word_width), "k": Replicate(1, 4)},
{"data": C(0xBBBB, word_width), "k": Replicate(0, 4)},
{"data": C(0xCCCC, word_width), "k": Replicate(0, 4)},
{"data": C(0xDDDD, word_width), "k": Replicate(0, 4)},
{"data": Replicate(KCode["pak_end"], 4), "k": Replicate(1, 4)},
]
yield from packet_sim(paks)

View File

@ -12,7 +12,7 @@ class CXPCRC32Inserter(Module):
# # #
self.submodules.crc = crc = CXPCRC32(word_dw)
self.submodules.crc = crc = CXPCRC32(word_width)
self.submodules.fsm = fsm = FSM(reset_state="IDLE")
# WARNING: this will eat data if the source don't care about ack

View File

@ -72,81 +72,81 @@ def packet_sim(packets=[]):
def testbench():
paks = [
{"data": C(0x7C7C7C7C, word_dw), "k" : Replicate(1, 4)},
{"data": C(0x01010101, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # stream id
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x6AEFACF6, word_dw), "k" : Replicate(0, 4), "eop":0}, # crc
{"data": C(0x7C7C7C7C, word_width), "k" : Replicate(1, 4)},
{"data": C(0x01010101, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # stream id
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x6AEFACF6, word_width), "k" : Replicate(0, 4), "eop":0}, # crc
{"data": C(0x02020202, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # Xsize[23:16]
{"data": C(0x09090909, word_dw), "k" : Replicate(0, 4)}, # Xsize[15:8]
{"data": C(0x90909090, word_dw), "k" : Replicate(0, 4)}, # Xsize[7:0]
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x8EE1DAA1, word_dw), "k" : Replicate(0, 4), "eop":0}, # crc
{"data": C(0x02020202, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # Xsize[23:16]
{"data": C(0x09090909, word_width), "k" : Replicate(0, 4)}, # Xsize[15:8]
{"data": C(0x90909090, word_width), "k" : Replicate(0, 4)}, # Xsize[7:0]
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x8EE1DAA1, word_width), "k" : Replicate(0, 4), "eop":0}, # crc
{"data": C(0x08080808, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x08080808, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # DsizeL[23:16]
{"data": C(0x02020202, word_dw), "k" : Replicate(0, 4)}, # DsizeL[15:8]
{"data": C(0x64646464, word_dw), "k" : Replicate(0, 4)}, # DsizeL[7:0]
{"data": C(0x01010101, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x01010101, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x51C243EA, word_dw), "k" : Replicate(0, 4), "eop":0}, # crc
{"data": C(0x08080808, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x08080808, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # DsizeL[23:16]
{"data": C(0x02020202, word_width), "k" : Replicate(0, 4)}, # DsizeL[15:8]
{"data": C(0x64646464, word_width), "k" : Replicate(0, 4)}, # DsizeL[7:0]
{"data": C(0x01010101, word_width), "k" : Replicate(0, 4)},
{"data": C(0x01010101, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x51C243EA, word_width), "k" : Replicate(0, 4), "eop":0}, # crc
# the new line + pixel data
{"data": C(0x7C7C7C7C, word_dw), "k" : Replicate(1, 4)},
{"data": C(0x02020202, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0D0D0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0D, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0D0B0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0A0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0D0A, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0A0B0D, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0D0C0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0A0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0D0D0B0A, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0B, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0C, word_dw), "k" : Replicate(0, 4)},
{"data": C(0xCB5DCDD6, word_dw), "k" : Replicate(0, 4), "eop": 0}, # crc
{"data": C(0x7C7C7C7C, word_width), "k" : Replicate(1, 4)},
{"data": C(0x02020202, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0D0D0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0D, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0D0B0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0A0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0C0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0D0A, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0A0B0D, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0D0C0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0A0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0D0D0B0A, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0C0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0C0B0B0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0C0C0B, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0x0B0B0B0C, word_width), "k" : Replicate(0, 4)},
{"data": C(0xCB5DCDD6, word_width), "k" : Replicate(0, 4), "eop": 0}, # crc
# {"data": C(0x0C0B0C0B, word_dw), "k" : Replicate(0, 4)},
# {"data": C(0x0D0B0B0B, word_dw), "k" : Replicate(0, 4)},
@ -246,36 +246,36 @@ def testbench_fake_data():
}
# frame header
paks = [
{"data": C(0x7C7C7C7C, word_dw), "k" : Replicate(1, 4)},
{"data": C(0x01010101, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # stream id
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x6AEFACF6, word_dw), "k" : Replicate(0, 4), "eop":0}, # fake crc
{"data": C(0x7C7C7C7C, word_width), "k" : Replicate(1, 4)},
{"data": C(0x01010101, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # stream id
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x6AEFACF6, word_width), "k" : Replicate(0, 4), "eop":0}, # fake crc
{"data": C(0x02020202, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # Xsize[23:16]
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # Xsize[15:8]
{"data": C(0x02020202, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # Xsize[23:16]
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # Xsize[15:8]
{"data": Replicate(C(x_size, char_width), 4), "k" : Replicate(0, 4)}, # Xsize[7:0]
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # Ysize[23:16]
{"data": C(0x8EE1DAA1, word_dw), "k" : Replicate(0, 4), "eop":0}, # fake crc
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # Ysize[23:16]
{"data": C(0x8EE1DAA1, word_width), "k" : Replicate(0, 4), "eop":0}, # fake crc
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # Ysize[15:8]
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # Ysize[15:8]
{"data": Replicate(C(y_size, char_width), 4), "k" : Replicate(0, 4)}, # Ysize[7:0]
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x08080808, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # DsizeL[23:16]
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)}, # DsizeL[15:8]
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x08080808, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # DsizeL[23:16]
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)}, # DsizeL[15:8]
{"data": Replicate(C(l_size, char_width), 4), "k" : Replicate(0, 4)}, # DsizeL[7:0]
{"data": Replicate(C(pix_fmt[pix_size] >> 8, char_width), 4), "k" : Replicate(0, 4)}, # PixelF[15:8]
{"data": Replicate(C(pix_fmt[pix_size] & 0xFF, char_width), 4), "k" : Replicate(0, 4)}, # PixelF[7:0]
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x51C243EA, word_dw), "k" : Replicate(0, 4), "eop":0}, # fake crc
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x00000000, word_width), "k" : Replicate(0, 4)},
{"data": C(0x51C243EA, word_width), "k" : Replicate(0, 4), "eop":0}, # fake crc
]
# pixel data
@ -294,15 +294,15 @@ def testbench_fake_data():
# new line indicator
paks += [
{"data": C(0x7C7C7C7C, word_dw), "k" : Replicate(1, 4)},
{"data": C(0x02020202, word_dw), "k" : Replicate(0, 4)},
{"data": C(0x7C7C7C7C, word_width), "k" : Replicate(1, 4)},
{"data": C(0x02020202, word_width), "k" : Replicate(0, 4)},
]
for i in range(l_size):
serialized = (packed & (0xFFFF_FFFF << i*word_dw)) >> i*word_dw
serialized = (packed & (0xFFFF_FFFF << i*word_width)) >> i*word_width
print(f"{serialized:08X}")
paks.append({"data": C(serialized, word_dw), "k" : Replicate(0, 4)})
paks.append({"data": C(serialized, word_width), "k" : Replicate(0, 4)})
paks.append({"data": C(0xCB5DCDD6, word_dw), "k" : Replicate(0, 4), "eop": 0}) # fake crc
paks.append({"data": C(0xCB5DCDD6, word_width), "k" : Replicate(0, 4), "eop": 0}) # fake crc
yield from packet_sim(paks)