Add missing ready, fix constant endianness

This commit is contained in:
Byron Lathi
2025-07-02 09:39:55 -07:00
parent a617277005
commit 2afe869dee
3 changed files with 15 additions and 13 deletions

View File

@@ -57,7 +57,7 @@ class TB:
data_in.extend(struct.unpack("8I", key.to_bytes(32, "little")))
data_in.extend(struct.unpack("2I", counter.to_bytes(8, "little")))
data_in.extend(struct.unpack("2I", nonce.to_bytes(8, "little")))
data_out = chacha_block(data_in)
await self.expected_queue.put(data_out)
@@ -72,6 +72,8 @@ class TB:
self.dut.i_ready.value = 1
self.dut.i_valid.value = 1
await RisingEdge(self.dut.i_clk)
while not self.dut.o_ready.value == 1:
await RisingEdge(self.dut.i_clk)
self.dut.i_valid.value = 0
async def run_output(self):
@@ -91,7 +93,7 @@ async def test_sanity(dut):
await tb.cycle_reset()
count = 1
count = 200
for i in range(count):
key = random.randint(0, 2**256-1)