aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorWade Fife <wade.fife@ettus.com>2020-10-08 20:42:38 -0500
committermichael-west <michael.west@ettus.com>2021-06-02 22:00:40 -0700
commit51295c42bcebed2f6c8f9a512e3d177a54098759 (patch)
treec0f57e380935a1de7877b9063f573a7480f15558 /host
parent5f8142e543bb3f5b948c246ca648327849e96faa (diff)
downloaduhd-51295c42bcebed2f6c8f9a512e3d177a54098759.tar.gz
uhd-51295c42bcebed2f6c8f9a512e3d177a54098759.tar.bz2
uhd-51295c42bcebed2f6c8f9a512e3d177a54098759.zip
python: Update RFNoC image builder to use CHDR_W parameter
CHDR_W was previosly hard coded to be 64, regardless of what the YAML indicated. This updates to code to pull in the chdr_width from the YAML image configuration file.
Diffstat (limited to 'host')
-rw-r--r--host/python/uhd/imgbuilder/templates/modules/device_transport.v.mako16
-rw-r--r--host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako11
2 files changed, 17 insertions, 10 deletions
diff --git a/host/python/uhd/imgbuilder/templates/modules/device_transport.v.mako b/host/python/uhd/imgbuilder/templates/modules/device_transport.v.mako
index 252917189..0bd2c15e7 100644
--- a/host/python/uhd/imgbuilder/templates/modules/device_transport.v.mako
+++ b/host/python/uhd/imgbuilder/templates/modules/device_transport.v.mako
@@ -3,12 +3,12 @@
%for i, transport in enumerate(transports):
// Transport ${i} (${transport["name"]})
- input wire [${"%4d" % (transport["width"]-1)}:0] s_${transport["name"]}_tdata,
- input wire s_${transport["name"]}_tlast,
- input wire s_${transport["name"]}_tvalid,
- output wire s_${transport["name"]}_tready,
- output wire [${"%4d" % (transport["width"]-1)}:0] m_${transport["name"]}_tdata,
- output wire m_${transport["name"]}_tlast,
- output wire m_${transport["name"]}_tvalid,
- input wire m_${transport["name"]}_tready${"," if i < len(transports) - 1 else ""}
+ input wire [CHDR_W-1:0] s_${transport["name"]}_tdata,
+ input wire s_${transport["name"]}_tlast,
+ input wire s_${transport["name"]}_tvalid,
+ output wire s_${transport["name"]}_tready,
+ output wire [CHDR_W-1:0] m_${transport["name"]}_tdata,
+ output wire m_${transport["name"]}_tlast,
+ output wire m_${transport["name"]}_tvalid,
+ input wire m_${transport["name"]}_tready${"," if i < len(transports) - 1 else ""}
%endfor
diff --git a/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako b/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako
index c83ddf5f5..549a469ee 100644
--- a/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako
+++ b/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako
@@ -26,8 +26,12 @@
`default_nettype none
+`include "${config.device.type}_rfnoc_image_core.vh"
+
module rfnoc_image_core #(
+ parameter CHDR_W = `CHDR_WIDTH,
+ parameter MTU = 10,
parameter [15:0] PROTOVER = {8'd1, 8'd0}
) (
// Clocks
@@ -44,13 +48,16 @@ module rfnoc_image_core #(
<%include file="/modules/device_transport.v.mako" args="transports=config.device.transports"/>\
);
- localparam CHDR_W = 64;
- localparam MTU = 10;
localparam EDGE_TBL_FILE = `"`RFNOC_EDGE_TBL_FILE`";
wire rfnoc_chdr_clk, rfnoc_chdr_rst;
wire rfnoc_ctrl_clk, rfnoc_ctrl_rst;
+ // Check that CHDR_W parameter matches value used by RFNoC Image Builder
+ if (CHDR_W != `CHDR_WIDTH) begin
+ ERROR_CHDR_W_values_do_not_match();
+ end
+
//---------------------------------------------------------------------------
// CHDR Crossbar