Skip to content

Commit

Permalink
style: improve error messages in the Cocotb MFB monitor considering d…
Browse files Browse the repository at this point in the history
…uplicit SOFs and EOFs
  • Loading branch information
danielkondys committed Nov 8, 2024
1 parent 84a975b commit f1423f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/cocotbext/cocotbext/ofm/mfb/monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ async def _monitor_recv(self):
# Checking for beginning of a packet.
self.log.debug("Frame Start")
if in_frame:
raise MFBProtocolError("Duplicate start-of-frame received on MFB bus!")
raise MFBProtocolError("MFB error: a start-of-frame received without an end-of-frame!")
in_frame = True
frame = b""

if (self._eof_arr[rr] == 1) and (not eof_done):
# Checking if the packet ends in the same regions where it began.
self.log.debug("Frame End in single region")
if not in_frame:
raise MFBProtocolError("Duplicate end-of-frame received on MFB bus!")
raise MFBProtocolError("MFB error: an end-of-frame received without a start-of-frame!")
in_frame = False
frame += data_bytes[ss_idx:ee_idx]
self.item_cnt += len(data_bytes[ss_idx:ee_idx])*8 // self._item_width
Expand Down

0 comments on commit f1423f3

Please sign in to comment.