From 905935b1b2a47234a6b6a7b9ffedfefcacab0ba1 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Tue, 21 Sep 2021 15:49:28 -0500 Subject: [PATCH] Avalon: Sample in the postpone region Fixes #26 --- src/cocotb_bus/monitors/avalon.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cocotb_bus/monitors/avalon.py b/src/cocotb_bus/monitors/avalon.py index e07c842e..7b4b095a 100644 --- a/src/cocotb_bus/monitors/avalon.py +++ b/src/cocotb_bus/monitors/avalon.py @@ -14,7 +14,7 @@ import warnings from cocotb.utils import hexdump -from cocotb.triggers import RisingEdge, ReadOnly +from cocotb.triggers import RisingEdge from cocotb.binary import BinaryValue from cocotb_bus.monitors import BusMonitor @@ -49,7 +49,6 @@ async def _monitor_recv(self): # Avoid spurious object creation by recycling clkedge = RisingEdge(self.clock) - rdonly = ReadOnly() def valid(): if hasattr(self.bus, "ready"): @@ -59,7 +58,6 @@ def valid(): # NB could await on valid here more efficiently? while True: await clkedge - await rdonly if valid(): vec = self.bus.data.value vec.big_endian = self.config["firstSymbolInHighOrderBits"] @@ -130,7 +128,6 @@ async def _monitor_recv(self): # Avoid spurious object creation by recycling clkedge = RisingEdge(self.clock) - rdonly = ReadOnly() pkt = b"" in_pkt = False invalid_cyclecount = 0 @@ -143,7 +140,6 @@ def valid(): while True: await clkedge - await rdonly if self.in_reset: continue