Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed monitor sample to prepone region of correct clock edge #28

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/cocotb_bus/monitors/avalon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"):
Expand All @@ -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"]
Expand Down Expand Up @@ -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
Expand All @@ -143,7 +140,6 @@ def valid():

while True:
await clkedge
await rdonly

if self.in_reset:
continue
Expand Down