Skip to content

Commit b54dc40

Browse files
wkkunakgugala
authored andcommitted
tests: Reduce / remove excessive waits
Signed-off-by: Wiktoria Kuna <[email protected]>
1 parent ae7588a commit b54dc40

File tree

21 files changed

+43
-183
lines changed

21 files changed

+43
-183
lines changed

verification/cocotb/block/axi_adapter/test_bus_stress.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ async def initialize(dut, timeout=50):
5959
tb = get_frontend_bus_if()(dut)
6060
tb.log = dut._log
6161
await tb.register_test_interfaces()
62-
await ClockCycles(tb.clk, 20)
6362
await reset_n(tb.clk, tb.rst_n, cycles=5)
6463

6564
# Generate test data

verification/cocotb/block/bus_tx/test_bus_tx.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@ async def setup_test(dut, timings=None, scl_clk_ratio=SCL_CLK_RATIO):
5757
dut.scl_stable_low_i.value = 0
5858
dut.sel_od_pp_i.value = 0
5959

60-
await ClockCycles(dut.clk_i, 10)
61-
6260
await reset(dut)
6361

64-
await ClockCycles(dut.clk_i, 10)
65-
6662
assert dut.tx_idle_o.value == 1
6763
assert dut.tx_done_o.value == 0
6864
assert dut.sda_o.value == 1
@@ -158,7 +154,6 @@ async def test_bit_tx_negedge(dut, value, timings, ratio):
158154
dut.drive_value_i.value = value
159155

160156
await assert_drive_start(dut, value)
161-
await ClockCycles(dut.clk_i, 10)
162157

163158

164159
tf = TestFactory(test_function=test_bit_tx_negedge)
@@ -177,7 +172,6 @@ async def test_bit_tx_pre_posedge(dut, value):
177172
dut.drive_value_i.value = value
178173

179174
await assert_drive_start(dut, value)
180-
await ClockCycles(dut.clk_i, 10)
181175

182176

183177
tf = TestFactory(test_function=test_bit_tx_pre_posedge)
@@ -194,7 +188,6 @@ async def test_bit_tx_high_level(dut, value):
194188
dut.drive_value_i.value = value
195189

196190
await assert_drive_start(dut, value)
197-
await ClockCycles(dut.clk_i, 10)
198191

199192

200193
tf = TestFactory(test_function=test_bit_tx_high_level)
@@ -211,7 +204,6 @@ async def test_bit_tx_low_level(dut, value):
211204
dut.drive_value_i.value = value
212205

213206
await assert_drive_start(dut, value)
214-
await ClockCycles(dut.clk_i, 10)
215207

216208

217209
tf = TestFactory(test_function=test_bit_tx_low_level)
@@ -241,4 +233,3 @@ async def test_byte_tx(dut):
241233

242234
# Ensure that the bus is free
243235
assert dut.sda_o.value == 1
244-
await ClockCycles(dut.clk_i, 10)

verification/cocotb/block/bus_tx_flow/test_bus_tx_flow.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ async def setup_test(dut):
5252
dut.scl_stable_low_i.value = 0
5353
dut.sel_od_pp_i.value = 0
5454

55-
await ClockCycles(dut.clk_i, 10)
5655
await reset(dut)
57-
await ClockCycles(dut.clk_i, 10)
5856

5957
assert dut.bus_tx_idle_o.value == 1
6058
assert dut.bus_tx_done_o.value == 0
@@ -99,7 +97,6 @@ async def test_bit_tx_negedge(dut, value):
9997
dut.req_value_i.value = value
10098

10199
await assert_bit_request(dut, value)
102-
await ClockCycles(dut.clk_i, 10)
103100

104101

105102
tf = TestFactory(test_function=test_bit_tx_negedge)
@@ -116,7 +113,6 @@ async def test_bit_tx_pre_posedge(dut, value):
116113
dut.req_value_i.value = value
117114

118115
await assert_bit_request(dut, value)
119-
await ClockCycles(dut.clk_i, 10)
120116

121117

122118
tf = TestFactory(test_function=test_bit_tx_pre_posedge)
@@ -133,7 +129,6 @@ async def test_bit_tx_high_level(dut, value):
133129
dut.req_value_i.value = value
134130

135131
await assert_bit_request(dut, value)
136-
await ClockCycles(dut.clk_i, 10)
137132

138133

139134
tf = TestFactory(test_function=test_bit_tx_high_level)
@@ -150,7 +145,6 @@ async def test_bit_tx_low_level(dut, value):
150145
dut.req_value_i.value = value
151146

152147
await assert_bit_request(dut, value)
153-
await ClockCycles(dut.clk_i, 10)
154148

155149

156150
tf = TestFactory(test_function=test_bit_tx_low_level)
@@ -199,5 +193,3 @@ async def test_byte_tx(dut):
199193
await ReadOnly()
200194
# Ensure that the bus is free
201195
assert dut.sda_o.value == 1
202-
203-
await ClockCycles(dut.clk_i, 100)

verification/cocotb/block/ccc/test_ccc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ async def get_status(dut):
126126

127127
# Stop the frame
128128
await cycle(dut.clk_i, dut.bus_stop_det_i)
129-
await ClockCycles(dut.clk_i, 5)
130-
131129
return status
132130

133131

verification/cocotb/block/ctrl_bus_monitor/test_bus_monitor.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ async def setup(dut):
1919
dut.t_hd_dat_i.value = 0x05
2020
dut.t_r_i.value = 0x02
2121
dut.t_f_i.value = 0x02
22-
await ClockCycles(dut.clk_i, 10)
2322

2423

2524
async def count_high_cycles(clk, sig, e_terminate):
@@ -100,5 +99,3 @@ async def test_bus_monitor(dut: SimHandleBase):
10099
assert num_stops == 1
101100

102101
e_terminate.clear()
103-
104-
await ClockCycles(clk, 10)

verification/cocotb/block/ctrl_bus_timers/test_bus_timers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ async def setup(dut):
1919
dut.t_bus_available_i.value = 10
2020
dut.t_bus_idle_i.value = 50
2121
dut.restart_counter_i.value = 0
22-
await ClockCycles(dut.clk_i, 10)
2322

2423

2524
@cocotb.test()

verification/cocotb/block/ctrl_i3c_bus_monitor/test_i3c_bus_monitor.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ async def setup(dut):
2020
dut.t_r_i.value = 0x02
2121
dut.t_f_i.value = 0x02
2222
dut.is_in_hdr_mode_i.value = 0
23-
await ClockCycles(dut.clk_i, 10)
2423

2524

2625
async def count_high_cycles(clk, sig, e_terminate):
@@ -114,7 +113,7 @@ async def test_target_reset_detection(dut: SimHandleBase):
114113
)
115114
await i3c_controller.target_reset()
116115

117-
await ClockCycles(dut.clk_i, 32)
116+
await ClockCycles(dut.clk_i, 10)
118117
e_terminate.set()
119118
await RisingEdge(dut.clk_i)
120119

@@ -123,5 +122,3 @@ async def test_target_reset_detection(dut: SimHandleBase):
123122
assert num_resets == 1
124123

125124
e_terminate.clear()
126-
127-
await ClockCycles(dut.clk_i, 10)

verification/cocotb/block/flow_standby_i3c/test_flow_standby_i3c.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,3 @@ async def test_rx(dut: SimHandleBase):
139139
cocotb.start_soon(tx_queue.bfm(dut))
140140

141141
await bus_tx(dut)
142-
143-
await ClockCycles(clk, 50)

verification/cocotb/block/i2c_controller_fsm/test_mem_rw.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ async def test_mem_rw(dut):
3838

3939
# Execute single I2C command test -----------------------------------------
4040
await i2c_cmd(dut, I2C_REG_ADDR << 1, sta_before=True, sto_after=True)
41-
await ClockCycles(dut.clk_i, 100)
4241

4342
# Execute single read & write test ----------------------------------------
4443
# Write single byte to I2C memory
4544
TEST_PAYLOAD = [random.randint(0, 255)]
4645
await i2c_mem_write(dut, I2C_DEV_ADDR, I2C_REG_ADDR, TEST_PAYLOAD)
47-
await ClockCycles(dut.clk_i, 100)
46+
await ClockCycles(dut.clk_i, 10)
4847

4948
# Read the byte I2C memory
5049
received = await i2c_mem_read(dut, I2C_DEV_ADDR, I2C_REG_ADDR, 1)
@@ -57,11 +56,8 @@ async def test_mem_rw(dut):
5756
# Write test payload to I2C memory
5857
TEST_PAYLOAD = [random.randint(0, 255) for _ in range(20)]
5958
await i2c_mem_write(dut, I2C_DEV_ADDR, I2C_REG_ADDR, TEST_PAYLOAD)
60-
await ClockCycles(dut.clk_i, 100)
59+
await ClockCycles(dut.clk_i, 10)
6160

6261
# Read payload from I2C memory
6362
received = await i2c_mem_read(dut, I2C_DEV_ADDR, I2C_REG_ADDR, len(TEST_PAYLOAD))
6463
assert received == TEST_PAYLOAD
65-
66-
# Dummy
67-
await ClockCycles(dut.clk_i, 100)

verification/cocotb/block/i2c_standby_controller/test_read.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
async def reset(dut):
1818
dut.rst_ni.value = 0
19-
await ClockCycles(dut.clk_i, 100)
19+
await ClockCycles(dut.clk_i, 2)
2020
await FallingEdge(dut.clk_i)
2121
dut.rst_ni.value = 1
2222
await ClockCycles(dut.clk_i, 2)

0 commit comments

Comments
 (0)