Minor reorganization

This commit is contained in:
Alex Forencich
2020-11-14 01:29:24 -08:00
parent 62bcaaf6bf
commit 028acd6c2d

View File

@@ -320,6 +320,9 @@ class AxiStreamSource(object):
self.bus.tuser <= 0 self.bus.tuser <= 0
continue continue
await RisingEdge(self.clock)
if (tready_sample and tvalid_sample) or not tvalid_sample:
if frame is None and self.queue: if frame is None and self.queue:
frame = self.queue.popleft() frame = self.queue.popleft()
self.queue_occupancy_bytes -= len(frame) self.queue_occupancy_bytes -= len(frame)
@@ -328,9 +331,6 @@ class AxiStreamSource(object):
frame.normalize() frame.normalize()
self.active = True self.active = True
await RisingEdge(self.clock)
if (tready_sample and tvalid_sample) or not tvalid_sample:
if frame and not self.pause: if frame and not self.pause:
tdata_val = 0 tdata_val = 0
tlast_val = 0 tlast_val = 0
@@ -339,8 +339,6 @@ class AxiStreamSource(object):
tdest_val = 0 tdest_val = 0
tuser_val = 0 tuser_val = 0
offset = 0
for offset in range(self.byte_width): for offset in range(self.byte_width):
tdata_val |= (frame.tdata.pop(0) & self.byte_mask) << (offset * self.byte_size) tdata_val |= (frame.tdata.pop(0) & self.byte_mask) << (offset * self.byte_size)
tkeep_val |= (frame.tkeep.pop(0) & 1) << offset tkeep_val |= (frame.tkeep.pop(0) & 1) << offset