Closed Thomasb81 closed 1 year ago
By instrumenting https://github.com/aignacio/cocotbext-ahb/blob/4b8262ed63cc8f0721b9819a31c7638e57a6ae61/cocotbext/ahb/ahb_monitor.py#L47
For icarus:
cocotb:simulator.py:302 39910.00ns INFO ..b.ahb_monitor.slave.ahb_template comparaison prev hsel: 1 vs current hsel: 1
INFO cocotb:simulator.py:302 39910.00ns INFO ..b.ahb_monitor.slave.ahb_template current hready: 1
INFO cocotb:simulator.py:302 39920.00ns INFO ..b.ahb_monitor.slave.ahb_template comparaison prev hsel: 1 vs current hsel: z
INFO cocotb:simulator.py:302 39920.00ns INFO ..b.ahb_monitor.slave.ahb_template current hready: 0
On below waveform gtkwave show that at time 33910 ns hsel is not at at 1 but at z. While cocotb sample hsel at 1 with hready at 1 : assertion does not rise.
For verilator:
INFO cocotb:simulator.py:302 39910.00ns INFO ..b.ahb_monitor.slave.ahb_template comparaison prev hsel: 1 vs current hsel: 0
INFO cocotb:simulator.py:302 39910.00ns INFO ..b.ahb_monitor.slave.ahb_template current hready: 1
INFO cocotb:simulator.py:302 39920.00ns INFO ..b.ahb_monitor.slave.ahb_template comparaison prev hsel: 1 vs current hsel: 0
INFO cocotb:simulator.py:302 39920.00ns INFO ..b.ahb_monitor.slave.ahb_template current hready: 0
On below waveform gtkwave show that at time 33910 ns hsel is at 0. hsel has change while hready is still at 1 : assertion rise.
Hey @Thomasb81, the issue is related to the way the different simulators work, seems related to the VPI event and how it gets the values while sampling the AHB bus signals in the AHBMonitor. Fixed by sampling on the Falling Edge which works for most of typical use cases, this class is still a WIP so I plan to move to the BusMonitor in the future. Update
Hi
I have similar issue to drive signals on rtl. For which I hack https://github.com/aignacio/cocotbext-ahb/blob/master/cocotbext/ahb/ahb_master.py this way:
await RisingEdge(self.clk)
await Timer(1,"ns")
Some time people wait a 0 time to work-arround this. It have the side effect to give the opportunity to simulator to execute other statement then after execute local statement. But I did not try that. Having a real delay allow to stick to spec waveform, where we see precisely event succession :
But the drawback is the VIP become frequency dependent, this hard-coded delay in the VIP may be an issue if you need to simulate back-annotate design.
I did not look at https://github.com/cocotb/cocotb-bus/blob/2c846dca8d3293b7676c70dd51dbc9c7f51029f0/src/cocotb_bus/monitors/__init__.py#L145
Hello
with https://github.com/verilator/verilator/pull/4618 I am able to run cocotbext-ahb with verilator.
While with icarus the testsuite is 100% pass. It is not the case with verilator.
Some seed of this test are passing.
Thing remarkable is that the failure occured on last write item before the read and it seems related to back pressure feature...