Skip to content

Commit d45c4f2

Browse files
committed
MVB Hash Table Simple - cocotb [STYLE] use the walrus operator to avoid doing the same calculation twice (also, it's cool)
1 parent 24df3e6 commit d45c4f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

comp/mvb_tools/storage/mvb_hash_table_simple/cocotb/cocotb_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ async def run_test(dut, config_file: str = "test_configs/test_config_1B.yaml", c
253253
last_num = 0
254254

255255
while (tb.stream_out.item_cnt < pkt_count):
256-
if (tb.stream_out.item_cnt // 1000) > last_num:
257-
last_num = tb.stream_out.item_cnt // 1000
256+
if (num := tb.stream_out.item_cnt // 1000) > last_num:
257+
last_num = num
258258
cocotb.log.info(f"Number of random transactions processed: {tb.stream_out.item_cnt}/{pkt_count}")
259259
await ClockCycles(dut.CLK, 100)
260260

0 commit comments

Comments
 (0)