eth: Reorganize clock enable in BASE-R model

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich
2025-05-27 23:56:28 -07:00
parent 9bce7f4165
commit aa8f19bf3b

View File

@@ -137,7 +137,10 @@ class BaseRSerdesSource():
while True:
await RisingEdge(self.clock)
if self.enable is None or self.enable.value:
# clock enable
if self.enable is not None and not self.enable.value:
continue
if ifg_cnt + deficit_idle_cnt > self.byte_lanes-1 or (not self.enable_dic and ifg_cnt > 4):
# in IFG
ifg_cnt = ifg_cnt - self.byte_lanes
@@ -436,7 +439,10 @@ class BaseRSerdesSink:
while True:
await RisingEdge(self.clock)
if self.enable is None or self.enable.value:
# clock enable
if self.enable is not None and not self.enable.value:
continue
data = self.data.value.integer
hdr = self.hdr.value.integer