From 52c9413bd94b160028edc086624b57ae8764a035 Mon Sep 17 00:00:00 2001 From: morgan Date: Tue, 24 Sep 2024 16:02:46 +0800 Subject: [PATCH] pipeline GW: add docs & remove unused code --- src/gateware/cxp_pipeline.py | 46 ++++-------------------------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/src/gateware/cxp_pipeline.py b/src/gateware/cxp_pipeline.py index 4507c14..b9aebb3 100644 --- a/src/gateware/cxp_pipeline.py +++ b/src/gateware/cxp_pipeline.py @@ -265,46 +265,6 @@ class TX_Test_Packet(Module, AutoCSR): # # # - # testdata_src = stream.Endpoint(upconn_layout) - - # # Section 9.9.2 (CXP-001-2021) - # # 0x00, 0x01 ... 0xFF need to be send 16 times - # # cnt[8:12] is used to count up 16 times while cnt[:8] is the data - # cnt = Signal(max=0x1000) - # clr_cnt = Signal() - # inc_cnt = Signal() - - # self.sync += [ - # If(clr_cnt, - # cnt.eq(cnt.reset), - # ).Elif(inc_cnt, - # cnt.eq(cnt + 1), - # ), - # ] - - # self.submodules.fsm = fsm = FSM(reset_state="IDLE") - - # fsm.act("IDLE", - # clr_cnt.eq(1), - # If(self.stb.re, - # NextState("WRITE") - # ) - # ) - - # fsm.act("WRITE", - # testdata_src.stb.eq(1), - # testdata_src.data.eq(cnt[:8]), - # testdata_src.k.eq(0), - # If(cnt == 0xFFF, - # testdata_src.eop.eq(1), - # If(testdata_src.ack, NextState("IDLE")) - # ).Else( - # inc_cnt.eq(testdata_src.ack) - # ) - # ) - - # TODO: figure out why only 16 times doesn't work on the decoder - self.submodules.test_pattern_src = test_pattern_src = Code_Source(upconn_layout, [*range(0x100)]*16, [0]*0x100*16) self.submodules.pak_type_inserter = pak_type_inserter = Code_Inserter(upconn_layout, [0x04]*4, [0]*4) self.submodules.pak_wrp = pak_wrp = Packet_Wrapper(upconn_layout) @@ -314,7 +274,6 @@ class TX_Test_Packet(Module, AutoCSR): ] self.source = pak_wrp.source - self.sync += [ test_pattern_src.stb.eq(self.stb.re), If(self.stb.re, @@ -430,7 +389,7 @@ class CXP_Data_Packet_Decode(Module): ) ) - # TODO: decode packet type here + # TODO: decode all packet type here cnt = Signal(max=0x100) @@ -455,6 +414,9 @@ class CXP_Data_Packet_Decode(Module): ) ) + # Section 9.9.1 (CXP-001-2021) + # the received test data packet (0x00, 0x01 ... 0xFF) + # need to be compared against the local test sequence generator fsm.act("VERIFY_TEST_PATTERN", self.sink.ack.eq(1), If(self.sink.stb,