diff options
author | Wade Fife <wade.fife@ettus.com> | 2020-02-21 08:35:24 -0600 |
---|---|---|
committer | Wade Fife <wade.fife@ettus.com> | 2020-03-09 13:43:05 -0500 |
commit | fc895feacb8dde3b02c9a4eccb4b4f4a654f2881 (patch) | |
tree | 0325ce379611fae9e9902e0e9a5fd299c1c48243 /fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc | |
parent | 369594ef16d7b2d519940269d2af035cfe648f50 (diff) | |
download | uhd-fc895feacb8dde3b02c9a4eccb4b4f4a654f2881.tar.gz uhd-fc895feacb8dde3b02c9a4eccb4b4f4a654f2881.tar.bz2 uhd-fc895feacb8dde3b02c9a4eccb4b4f4a654f2881.zip |
sim: Parameterize chdr_word_t data type
This replaces chdr_word_t, which was a statically defined 64-bit data
type, with a paramaterizable data type that matches the defined CHDR_W.
Code that formerly referenced the chdr_word_t data type can now define
the data type for their desired CHDR_W and ITEM_W as follows:
// Define the CHDR word and item/sample data types
typedef ChdrData #(CHDR_W, ITEM_W)::chdr_word_t chdr_word_t;
typedef ChdrData #(CHDR_W, ITEM_W)::item_t item_t;
ITEM_W is optional when defining chdr_word_t if items are not
needed. Static methods in the ChdrData class also provide the ability to
convert between CHDR words and data items. For example:
// Convert CHDR data buffer to a buffer of samples
samples = ChdrData#(CHDR_W, ITEM_W)::chdr_to_item(data);
Diffstat (limited to 'fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc')
-rw-r--r-- | fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc/rfnoc_block_duc_tb.sv | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc/rfnoc_block_duc_tb.sv b/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc/rfnoc_block_duc_tb.sv index de54d5ee0..8151ed761 100644 --- a/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc/rfnoc_block_duc_tb.sv +++ b/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_duc/rfnoc_block_duc_tb.sv @@ -35,6 +35,7 @@ module rfnoc_block_duc_tb(); // Block configuration localparam int CHDR_W = 64; + localparam int SAMP_W = 32; localparam int THIS_PORTID = 'h123; localparam int MTU = 8; localparam int NUM_PORTS = 1; @@ -49,6 +50,7 @@ module rfnoc_block_duc_tb(); bit rfnoc_chdr_clk; bit rfnoc_ctrl_clk; + bit ce_clk; sim_clock_gen #(CHDR_CLK_PER) rfnoc_chdr_clk_gen (.clk(rfnoc_chdr_clk), .rst()); sim_clock_gen #(CHDR_CLK_PER) rfnoc_ctrl_clk_gen (.clk(rfnoc_ctrl_clk), .rst()); @@ -59,6 +61,8 @@ module rfnoc_block_duc_tb(); // Bus Functional Models //--------------------------------------------------------------------------- + typedef ChdrData #(CHDR_W, SAMP_W)::chdr_word_t chdr_word_t; + RfnocBackendIf backend (rfnoc_chdr_clk, rfnoc_ctrl_clk); AxiStreamIf #(32) m_ctrl (rfnoc_ctrl_clk, 1'b0); AxiStreamIf #(32) s_ctrl (rfnoc_ctrl_clk, 1'b0); |