From 2ca9a3191db241f5de6fee3c3414aa55ee83a2ac Mon Sep 17 00:00:00 2001 From: morgan Date: Mon, 7 Oct 2024 11:57:18 +0800 Subject: [PATCH] cxp GW: add mem size getter for each mem region --- src/gateware/cxp.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gateware/cxp.py b/src/gateware/cxp.py index 0c5b26b..fca9f19 100644 --- a/src/gateware/cxp.py +++ b/src/gateware/cxp.py @@ -25,14 +25,20 @@ class CXP_Interface(Module, AutoCSR): def get_tx_port(self): return self.upconn.command.mem.get_port(write_capable=True) + def get_tx_mem_size(self): + return self.upconn.command.mem.depth*self.upconn.command.mem.width + def get_rx_port(self): return self.downconn.packet_decoder.mem.get_port(write_capable=False) + def get_rx_mem_size(self): + return self.downconn.packet_decoder.mem.depth*self.downconn.packet_decoder.mem.width + def get_loopback_tx_port(self): return self.downconn.command.mem.get_port(write_capable=True) - def get_mem_size(self): - return buffer_depth*word_dw + def get_loopback_tx_mem_size(self): + return self.downconn.command.mem.depth*self.downconn.command.mem.width class DownConn_Interface(Module, AutoCSR): def __init__(self, phy, debug_sma, pmod_pads):