File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
python/cocotbext/cocotbext/ofm/mfb Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,19 @@ async def _monitor_recv(self):
78
78
self .log .debug (f"ee_idx { str (ee_idx )} " )
79
79
self .log .debug (f"ss_idx { str (ss_idx )} " )
80
80
81
- if (self ._eof_arr [rr ] == 1 ) and (in_frame ):
82
- # Checks if there is a packet that is being processed and if it ends in this region.
83
- self .log .debug ("Frame End" )
84
- in_frame = False
85
- eof_done = True
86
- frame += data_bytes [rs_inx :ee_idx ]
87
- self .item_cnt += len (data_bytes [rs_inx :ee_idx ])* 8 // self ._item_width
88
- self .log .debug (f"frame done { frame .hex ()} " )
89
- self ._recv (frame )
90
- self .frame_cnt += 1
81
+ if self ._eof_arr [rr ] == 1 :
82
+ if in_frame :
83
+ # Checks if there is a packet that is being processed and if it ends in this region.
84
+ self .log .debug ("Frame End" )
85
+ in_frame = False
86
+ eof_done = True
87
+ frame += data_bytes [rs_inx :ee_idx ]
88
+ self .item_cnt += len (data_bytes [rs_inx :ee_idx ])* 8 // self ._item_width
89
+ self .log .debug (f"frame done { frame .hex ()} " )
90
+ self ._recv (frame )
91
+ self .frame_cnt += 1
92
+ elif self ._sof_arr [rr ] == 1 and (self ._eof_pos_arr [rr ] < self ._sof_pos_arr [rr ]):
93
+ raise MFBProtocolError ("MFB error: an end-of-frame received before a start-of-frame!" )
91
94
92
95
if in_frame :
93
96
# Region with a valid 'middle of packet'.
You can’t perform that action at this time.
0 commit comments