forked from M-Labs/artiq-zynq
frameline GW: remove eop marker
This commit is contained in:
parent
7ea3d563e6
commit
26d940fbc3
@ -21,27 +21,6 @@ def switch_endianness(s):
|
||||
char = [s[i*8:(i+1)*8] for i in range(len(s)//8)]
|
||||
return Cat(char[::-1])
|
||||
|
||||
class EOP_Inserter(Module):
|
||||
def __init__(self):
|
||||
self.sink = stream.Endpoint(word_layout_dchar)
|
||||
self.source = stream.Endpoint(word_layout_dchar)
|
||||
|
||||
# # #
|
||||
|
||||
self.sync += [
|
||||
If((~self.source.stb | self.source.ack),
|
||||
If(~((self.sink.dchar == KCode["pak_end"]) & (self.sink.dchar_k == 1)),
|
||||
self.sink.connect(self.source, omit={"ack", "eop"}),
|
||||
).Else(
|
||||
self.source.stb.eq(0),
|
||||
)
|
||||
),
|
||||
]
|
||||
self.comb += [
|
||||
self.sink.ack.eq(~self.source.stb | self.source.ack),
|
||||
self.source.eop.eq(((self.sink.dchar == KCode["pak_end"]) & (self.sink.dchar_k == 1))),
|
||||
]
|
||||
|
||||
class End_Of_Line_Inserter(Module):
|
||||
def __init__(self):
|
||||
self.l_size = Signal(3*char_width)
|
||||
@ -76,26 +55,6 @@ class End_Of_Line_Inserter(Module):
|
||||
self.source.eop.eq(cnt == 1),
|
||||
]
|
||||
|
||||
class EOP_Marker(Module):
|
||||
def __init__(self):
|
||||
self.sink = stream.Endpoint(word_layout_dchar)
|
||||
self.source = stream.Endpoint(word_layout_dchar)
|
||||
|
||||
# # #
|
||||
|
||||
last_stb = Signal()
|
||||
self.sync += [
|
||||
If((~self.source.stb | self.source.ack),
|
||||
self.source.stb.eq(self.sink.stb),
|
||||
self.source.payload.eq(self.sink.payload),
|
||||
),
|
||||
last_stb.eq(self.sink.stb),
|
||||
]
|
||||
self.comb += [
|
||||
self.sink.ack.eq(~self.source.stb | self.source.ack),
|
||||
self.source.eop.eq(~self.sink.stb & last_stb),
|
||||
]
|
||||
|
||||
class Stream_Arbiter(Module):
|
||||
def __init__(self, n_downconn):
|
||||
self.n_ext_active = Signal(max=n_downconn)
|
||||
@ -657,11 +616,11 @@ class Frame_Packet_Router(Module):
|
||||
|
||||
# # #
|
||||
|
||||
# +----------+ +-------------+
|
||||
# eop marker ----->| | | |------> crc checker
|
||||
# | arbiter |---->| broadcaster |
|
||||
# eop marker ----->| need eop | | |------> crc checker
|
||||
# +----------+ +-------------+
|
||||
# +---------+ +-------------+
|
||||
# rx pipline ----->| | | |------> crc checker ------> raw stream data
|
||||
# | arbiter |---->| broadcaster |
|
||||
# rx pipline ----->| | | |------> crc checker ------> raw stream data
|
||||
# +---------+ +-------------+
|
||||
#
|
||||
|
||||
self.submodules.arbiter = arbiter = Stream_Arbiter(n_downconn)
|
||||
@ -672,15 +631,8 @@ class Frame_Packet_Router(Module):
|
||||
self.sync += broadcaster.routing_table[i].eq(s)
|
||||
|
||||
for i, d in enumerate(downconns):
|
||||
# eop is needed for arbiter and crc checker to work correctly
|
||||
# TODO: move eop inserter inside of broadcaster
|
||||
# TODO: change arbiter to use K27.7 as eop instead
|
||||
eop_marker = EOP_Inserter()
|
||||
self.submodules += eop_marker
|
||||
self.comb += [
|
||||
d.source.connect(eop_marker.sink),
|
||||
eop_marker.source.connect(arbiter.sinks[i])
|
||||
]
|
||||
# Assume downconns pipeline already marks the eop
|
||||
self.comb += d.source.connect(arbiter.sinks[i])
|
||||
|
||||
self.comb += arbiter.source.connect(broadcaster.sink)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user