From 6943a2b17e2d5a81926faebfae91aabb26a1d7c0 Mon Sep 17 00:00:00 2001 From: morgan Date: Wed, 11 Sep 2024 16:05:13 +0800 Subject: [PATCH] pipeline GW: add busy csr --- src/gateware/cxp_pipeline.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gateware/cxp_pipeline.py b/src/gateware/cxp_pipeline.py index f440642..61a7787 100644 --- a/src/gateware/cxp_pipeline.py +++ b/src/gateware/cxp_pipeline.py @@ -283,6 +283,7 @@ class TX_Test_Packet(Module, AutoCSR): def __init__(self, layout): self.stb = CSR() + self.busy = CSRStatus() # # # @@ -292,7 +293,6 @@ class TX_Test_Packet(Module, AutoCSR): # 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() @@ -337,3 +337,10 @@ class TX_Test_Packet(Module, AutoCSR): ] self.source = pak_wrp.source + + self.sync += \ + If(self.stb.re, + self.busy.status.eq(1), + ).Elif(self.source.eop & self.source.ack, + self.busy.status.eq(0) + )