From 89caa01c127d59b7b3ee2bdf57bee75f3d2effcd Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Tue, 30 Jul 2024 12:04:17 -0500 Subject: [PATCH] hdl: test: added variable length gpif support to fx3_model --- hdl/fpga/ip/nuand/simulation/fx3_model.vhd | 8 +++++--- .../platforms/bladerf-micro/vhdl/tb/fx3_model.vhd | 13 +++++++------ hdl/fpga/platforms/bladerf/modelsim/compile.do | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hdl/fpga/ip/nuand/simulation/fx3_model.vhd b/hdl/fpga/ip/nuand/simulation/fx3_model.vhd index fc2da9e1..b13b55c1 100644 --- a/hdl/fpga/ip/nuand/simulation/fx3_model.vhd +++ b/hdl/fpga/ip/nuand/simulation/fx3_model.vhd @@ -26,6 +26,8 @@ library ieee; library work; use work.util.all; + use work.fx3_gpif_p.all; + entity fx3_model is port ( @@ -102,7 +104,7 @@ begin done <= rx_done and tx_done; rx_sample_stream : process - constant BLOCK_SIZE : natural := 512; + constant BLOCK_SIZE : natural := GPIF_BUF_SIZE_SS; variable count : natural := START_COUNT; variable req_time : time; begin @@ -155,7 +157,7 @@ begin end process; tx_sample_stream : process - constant BLOCK_SIZE : natural := 512; + constant BLOCK_SIZE : natural := GPIF_BUF_SIZE_SS; variable count : natural := START_COUNT; variable timestamp_cntr : natural := 80; variable header_len : natural := 0; @@ -201,7 +203,7 @@ begin data_out := x"12341234"; when 2 => data_out(31 downto 0) := std_logic_vector(to_signed(timestamp_cntr, 32)); - timestamp_cntr := timestamp_cntr + 508 * 2; + timestamp_cntr := timestamp_cntr + (GPIF_BUF_SIZE_SS-4) * 2; when 3 => data_out := (others => '0'); when 4 => diff --git a/hdl/fpga/platforms/bladerf-micro/vhdl/tb/fx3_model.vhd b/hdl/fpga/platforms/bladerf-micro/vhdl/tb/fx3_model.vhd index 29a39001..be1682a9 100644 --- a/hdl/fpga/platforms/bladerf-micro/vhdl/tb/fx3_model.vhd +++ b/hdl/fpga/platforms/bladerf-micro/vhdl/tb/fx3_model.vhd @@ -26,6 +26,7 @@ library ieee; library work; use work.util.all; + use work.fx3_gpif_p.all; architecture micro_dma of fx3_model is @@ -98,7 +99,7 @@ begin done <= rx_done and tx_done; rx_sample_stream : process - constant BLOCK_SIZE : natural := 512; + constant BLOCK_SIZE : natural := GPIF_BUF_SIZE_SS; variable count : natural := START_COUNT; variable req_time : time; begin @@ -151,8 +152,8 @@ begin end process; tx_sample_stream : process - constant TIME_BETWEEN_ITERATIONS : natural := 4593; - constant BLOCK_SIZE : natural := 512; + constant TIME_BETWEEN_ITERATIONS : natural := 7000; + constant BLOCK_SIZE : natural := GPIF_BUF_SIZE_SS; variable count : natural := START_COUNT; variable timestamp_cntr : natural := 400; variable header_len : natural := 0; @@ -242,7 +243,7 @@ begin nop(fx3_pclk, 10); end loop; - wait for 1 ms; + wait for 1.5 ms; dma_tx_enable <= '0'; wait for 10 us; end loop; @@ -333,7 +334,7 @@ begin done <= rx_done and tx_done; rx_sample_stream : process - constant BLOCK_SIZE : natural := 512; + constant BLOCK_SIZE : natural := GPIF_BUF_SIZE_SS; variable count : natural := START_COUNT; variable req_time : time; begin @@ -387,7 +388,7 @@ begin tx_sample_stream : process constant TIME_BETWEEN_ITERATIONS : natural := 4556; - constant BLOCK_SIZE : natural := 512; + constant BLOCK_SIZE : natural := GPIF_BUF_SIZE_SS; variable count : natural := START_COUNT; variable timestamp_cntr : natural := 250; variable header_len : natural := 0; diff --git a/hdl/fpga/platforms/bladerf/modelsim/compile.do b/hdl/fpga/platforms/bladerf/modelsim/compile.do index 289bc60f..06e95382 100644 --- a/hdl/fpga/platforms/bladerf/modelsim/compile.do +++ b/hdl/fpga/platforms/bladerf/modelsim/compile.do @@ -10,6 +10,7 @@ vcom -work nuand -2008 ../../../ip/altera/rx_meta_fifo/rx_meta_fifo.vhd vcom -work nuand -2008 ../vhdl/tb/nios_system.vhd +vcom -work nuand -2008 ../vhdl/fx3_gpif_p.vhd vcom -work nuand -2008 ../vhdl/fx3_gpif.vhd vcom -work nuand -2008 ../vhdl/bladerf.vhd