Cache clock edge event objects

This commit is contained in:
Alex Forencich
2021-12-03 19:06:43 -08:00
parent 3325568406
commit 2af7852006
12 changed files with 68 additions and 41 deletions

View File

@@ -272,8 +272,10 @@ class XgmiiSource(Reset):
deficit_idle_cnt = 0
self.active = False
clock_edge_event = RisingEdge(self.clock)
while True:
await RisingEdge(self.clock)
await clock_edge_event
if self.enable is None or self.enable.value:
if ifg_cnt + deficit_idle_cnt > self.byte_lanes-1 or (not self.enable_dic and ifg_cnt > 4):
@@ -456,8 +458,10 @@ class XgmiiSink(Reset):
frame = None
self.active = False
clock_edge_event = RisingEdge(self.clock)
while True:
await RisingEdge(self.clock)
await clock_edge_event
if self.enable is None or self.enable.value:
for offset in range(self.byte_lanes):