Cast to int instead of using .integer

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich
2025-09-07 11:25:34 -07:00
parent 40908b1b92
commit 6a5faf9ebf
28 changed files with 95 additions and 95 deletions

View File

@@ -87,11 +87,11 @@ class TB:
return (await self.data_sink.recv()).tdata
async def i2c_wait(self):
if self.dut.busy.value.integer:
if int(self.dut.busy.value):
await FallingEdge(self.dut.busy)
async def i2c_wait_bus_idle(self):
if self.dut.bus_active.value.integer:
if int(self.dut.bus_active.value):
await FallingEdge(self.dut.bus_active)

View File

@@ -58,7 +58,7 @@ async def run_test_write(dut):
await tb.i2c_master.write(0x70, b'\x11\xAA')
await tb.i2c_master.send_stop()
assert dut.data_out.value.integer == 0xAA
assert int(dut.data_out.value) == 0xAA
await RisingEdge(dut.clk)
await RisingEdge(dut.clk)
@@ -79,7 +79,7 @@ async def run_test_null_write(dut):
await tb.i2c_master.write(0x70, b'')
await tb.i2c_master.send_stop()
assert dut.data_out.value.integer == 0xAA
assert int(dut.data_out.value) == 0xAA
await RisingEdge(dut.clk)
await RisingEdge(dut.clk)
@@ -123,7 +123,7 @@ async def run_test_nack(dut):
await tb.i2c_master.write(0x55, b'\x00\x04'+b'\xde\xad\xbe\xef')
await tb.i2c_master.send_stop()
assert dut.data_out.value.integer == 0xAA
assert int(dut.data_out.value) == 0xAA
# assert missed ack