From fc895feacb8dde3b02c9a4eccb4b4f4a654f2881 Mon Sep 17 00:00:00 2001 From: Wade Fife Date: Fri, 21 Feb 2020 08:35:24 -0600 Subject: 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); --- fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_fft/rfnoc_block_fft_tb.sv | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_fft') diff --git a/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_fft/rfnoc_block_fft_tb.sv b/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_fft/rfnoc_block_fft_tb.sv index 05b38ddeb..412963dc7 100644 --- a/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_fft/rfnoc_block_fft_tb.sv +++ b/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_fft/rfnoc_block_fft_tb.sv @@ -30,6 +30,7 @@ module rfnoc_block_fft_tb(); // Block configuration localparam int NOC_ID = 32'hFF70_0000; localparam int CHDR_W = 64; + localparam int SAMP_W = 32; localparam int THIS_PORTID = 'h123; localparam int MTU = 10; localparam int NUM_PORTS = 1; @@ -60,6 +61,8 @@ module rfnoc_block_fft_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); -- cgit v1.2.3