tb: axis_mii_tx: Fix failures on newer versions of cocotb
Since cocotb/cocotb#2793, writes happen before the clock instead of after the clock. This breaks the collision test, since we test for differing behavior over a difference of 1 ns. Fix the failure by applying an adjustment for newer versions. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
ec04874781
commit
a5d1eff22b
|
@ -143,7 +143,12 @@ async def start(mac, packet, **kwargs):
|
||||||
BIT_TIME_NS = 10
|
BIT_TIME_NS = 10
|
||||||
BYTE_TIME_NS = 8 * BIT_TIME_NS
|
BYTE_TIME_NS = 8 * BIT_TIME_NS
|
||||||
|
|
||||||
|
COCOTB_17 = tuple(int(part) for part in cocotb.__version__.split('.')[:2]) >= (1, 7)
|
||||||
|
|
||||||
async def collide(mac, ns, duration=16):
|
async def collide(mac, ns, duration=16):
|
||||||
|
# newer cocotbs order writes before the clock
|
||||||
|
ns += COCOTB_17
|
||||||
|
|
||||||
while not mac.mii_tx_en.value:
|
while not mac.mii_tx_en.value:
|
||||||
await FallingEdge(mac.clk)
|
await FallingEdge(mac.clk)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue