Commit 99dd22f0 authored by Lucas Russo's avatar Lucas Russo

hdl/modules/*/wb_acq_core/*: Rework output data aggregation

This commit introduces a relatively big change in the way
we make tranfers to external memory.

Prior to this, the acq_ddr3_iface module aggregated the
received data (usually 64 or 128 bits) into a DDR3 UI data
packet (usually 256 or 512 bits) in the DDR3 clock domain.
This worked fine, as the DDR3 clock was 200 MHz for Virtex6
(working in 2:1 PHY clock ratio) and the maximum input date
rate was 117 MHz.

But, for Artix7, the DDR3 clock is 100 MHz (working in 4:1 PHY
clock ratio) and the maximum input data rate is still 117 MHz.
This forced the async FIFO to become full and to drop valid data.

However, the UI data width is still 256 or 512 bits and the incoming
data is 64 or 128 bits. This allows us to use two, for or even
eight data buffers (in the incoming clock domain) to aggregate
the whole 256 or 512 bits (which should happen at minimum of 2
clock cycles and can take up to 8 clock cycles) and only then
send it to the DDR3 clock domain.

Now, the data aggregatrion was moved to the incoming clock domain,
in acq_fc_fifo and the acq_ddr3_iface module was simplified, as it
only has to generate the DDR3 addresses and drive the UI lines.

This fixes #37 github issue.
parent dd16cd28
...@@ -1151,17 +1151,17 @@ package dbe_wishbone_pkg is ...@@ -1151,17 +1151,17 @@ package dbe_wishbone_pkg is
fs_clk_i : in std_logic; fs_clk_i : in std_logic;
fs_ce_i : in std_logic; fs_ce_i : in std_logic;
fs_rst_n_i : in std_logic; fs_rst_n_i : in std_logic;
sys_clk_i : in std_logic; sys_clk_i : in std_logic;
sys_rst_n_i : in std_logic; sys_rst_n_i : in std_logic;
ext_clk_i : in std_logic; ext_clk_i : in std_logic;
ext_rst_n_i : in std_logic; ext_rst_n_i : in std_logic;
----------------------------- -----------------------------
-- Wishbone Control Interface signals -- Wishbone Control Interface signals
----------------------------- -----------------------------
wb_adr_i : in std_logic_vector(c_wishbone_address_width-1 downto 0) := (others => '0'); wb_adr_i : in std_logic_vector(c_wishbone_address_width-1 downto 0) := (others => '0');
wb_dat_i : in std_logic_vector(c_wishbone_data_width-1 downto 0) := (others => '0'); wb_dat_i : in std_logic_vector(c_wishbone_data_width-1 downto 0) := (others => '0');
wb_dat_o : out std_logic_vector(c_wishbone_data_width-1 downto 0); wb_dat_o : out std_logic_vector(c_wishbone_data_width-1 downto 0);
...@@ -1173,7 +1173,7 @@ package dbe_wishbone_pkg is ...@@ -1173,7 +1173,7 @@ package dbe_wishbone_pkg is
wb_err_o : out std_logic; wb_err_o : out std_logic;
wb_rty_o : out std_logic; wb_rty_o : out std_logic;
wb_stall_o : out std_logic; wb_stall_o : out std_logic;
----------------------------- -----------------------------
-- External Interface -- External Interface
----------------------------- -----------------------------
...@@ -1181,24 +1181,24 @@ package dbe_wishbone_pkg is ...@@ -1181,24 +1181,24 @@ package dbe_wishbone_pkg is
acq_val_high_i : in t_acq_val_half_array(g_acq_num_channels-1 downto 0); acq_val_high_i : in t_acq_val_half_array(g_acq_num_channels-1 downto 0);
acq_dvalid_i : in std_logic_vector(g_acq_num_channels-1 downto 0); acq_dvalid_i : in std_logic_vector(g_acq_num_channels-1 downto 0);
acq_trig_i : in std_logic_vector(g_acq_num_channels-1 downto 0); acq_trig_i : in std_logic_vector(g_acq_num_channels-1 downto 0);
----------------------------- -----------------------------
-- DRRAM Interface -- DRRAM Interface
----------------------------- -----------------------------
dpram_dout_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0); dpram_dout_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0);
dpram_valid_o : out std_logic; dpram_valid_o : out std_logic;
----------------------------- -----------------------------
-- External Interface (w/ FLow Control) -- External Interface (w/ FLow Control)
----------------------------- -----------------------------
ext_dout_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0); ext_dout_o : out std_logic_vector(g_ddr_payload_width-1 downto 0);
ext_valid_o : out std_logic; ext_valid_o : out std_logic;
ext_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0); ext_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0);
ext_sof_o : out std_logic; ext_sof_o : out std_logic;
ext_eof_o : out std_logic; ext_eof_o : out std_logic;
ext_dreq_o : out std_logic; -- for debbuging purposes ext_dreq_o : out std_logic; -- for debbuging purposes
ext_stall_o : out std_logic; -- for debbuging purposes ext_stall_o : out std_logic; -- for debbuging purposes
----------------------------- -----------------------------
-- DDR3 SDRAM Interface -- DDR3 SDRAM Interface
----------------------------- -----------------------------
...@@ -1206,24 +1206,24 @@ package dbe_wishbone_pkg is ...@@ -1206,24 +1206,24 @@ package dbe_wishbone_pkg is
ui_app_cmd_o : out std_logic_vector(2 downto 0); ui_app_cmd_o : out std_logic_vector(2 downto 0);
ui_app_en_o : out std_logic; ui_app_en_o : out std_logic;
ui_app_rdy_i : in std_logic; ui_app_rdy_i : in std_logic;
ui_app_wdf_data_o : out std_logic_vector(g_ddr_payload_width-1 downto 0); ui_app_wdf_data_o : out std_logic_vector(g_ddr_payload_width-1 downto 0);
ui_app_wdf_end_o : out std_logic; ui_app_wdf_end_o : out std_logic;
ui_app_wdf_mask_o : out std_logic_vector(g_ddr_payload_width/8-1 downto 0); ui_app_wdf_mask_o : out std_logic_vector(g_ddr_payload_width/8-1 downto 0);
ui_app_wdf_wren_o : out std_logic; ui_app_wdf_wren_o : out std_logic;
ui_app_wdf_rdy_i : in std_logic; ui_app_wdf_rdy_i : in std_logic;
ui_app_rd_data_i : in std_logic_vector(g_ddr_payload_width-1 downto 0); ui_app_rd_data_i : in std_logic_vector(g_ddr_payload_width-1 downto 0);
ui_app_rd_data_end_i : in std_logic; ui_app_rd_data_end_i : in std_logic;
ui_app_rd_data_valid_i : in std_logic; ui_app_rd_data_valid_i : in std_logic;
ui_app_req_o : out std_logic; ui_app_req_o : out std_logic;
ui_app_gnt_i : in std_logic; ui_app_gnt_i : in std_logic;
----------------------------- -----------------------------
-- Debug Interface -- Debug Interface
----------------------------- -----------------------------
dbg_ddr_rb_data_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0); dbg_ddr_rb_data_o : out std_logic_vector(g_ddr_payload_width-1 downto 0);
dbg_ddr_rb_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0); dbg_ddr_rb_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0);
dbg_ddr_rb_valid_o : out std_logic dbg_ddr_rb_valid_o : out std_logic
); );
...@@ -1249,41 +1249,41 @@ package dbe_wishbone_pkg is ...@@ -1249,41 +1249,41 @@ package dbe_wishbone_pkg is
fs_clk_i : in std_logic; fs_clk_i : in std_logic;
fs_ce_i : in std_logic; fs_ce_i : in std_logic;
fs_rst_n_i : in std_logic; fs_rst_n_i : in std_logic;
sys_clk_i : in std_logic; sys_clk_i : in std_logic;
sys_rst_n_i : in std_logic; sys_rst_n_i : in std_logic;
ext_clk_i : in std_logic; ext_clk_i : in std_logic;
ext_rst_n_i : in std_logic; ext_rst_n_i : in std_logic;
----------------------------- -----------------------------
-- Wishbone Control Interface signals -- Wishbone Control Interface signals
----------------------------- -----------------------------
wb_slv_i : in t_wishbone_slave_in; wb_slv_i : in t_wishbone_slave_in;
wb_slv_o : out t_wishbone_slave_out; wb_slv_o : out t_wishbone_slave_out;
----------------------------- -----------------------------
-- External Interface -- External Interface
----------------------------- -----------------------------
acq_chan_array_i : in t_acq_chan_array(g_acq_num_channels-1 downto 0); acq_chan_array_i : in t_acq_chan_array(g_acq_num_channels-1 downto 0);
----------------------------- -----------------------------
-- DRRAM Interface -- DRRAM Interface
----------------------------- -----------------------------
dpram_dout_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0); dpram_dout_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0);
dpram_valid_o : out std_logic; dpram_valid_o : out std_logic;
----------------------------- -----------------------------
-- External Interface (w/ FLow Control) -- External Interface (w/ FLow Control)
----------------------------- -----------------------------
ext_dout_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0); ext_dout_o : out std_logic_vector(g_ddr_payload_width-1 downto 0);
ext_valid_o : out std_logic; ext_valid_o : out std_logic;
ext_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0); ext_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0);
ext_sof_o : out std_logic; ext_sof_o : out std_logic;
ext_eof_o : out std_logic; ext_eof_o : out std_logic;
ext_dreq_o : out std_logic; -- for debbuging purposes ext_dreq_o : out std_logic; -- for debbuging purposes
ext_stall_o : out std_logic; -- for debbuging purposes ext_stall_o : out std_logic; -- for debbuging purposes
----------------------------- -----------------------------
-- DDR3 SDRAM Interface -- DDR3 SDRAM Interface
----------------------------- -----------------------------
...@@ -1291,24 +1291,24 @@ package dbe_wishbone_pkg is ...@@ -1291,24 +1291,24 @@ package dbe_wishbone_pkg is
ui_app_cmd_o : out std_logic_vector(2 downto 0); ui_app_cmd_o : out std_logic_vector(2 downto 0);
ui_app_en_o : out std_logic; ui_app_en_o : out std_logic;
ui_app_rdy_i : in std_logic; ui_app_rdy_i : in std_logic;
ui_app_wdf_data_o : out std_logic_vector(g_ddr_payload_width-1 downto 0); ui_app_wdf_data_o : out std_logic_vector(g_ddr_payload_width-1 downto 0);
ui_app_wdf_end_o : out std_logic; ui_app_wdf_end_o : out std_logic;
ui_app_wdf_mask_o : out std_logic_vector(g_ddr_payload_width/8-1 downto 0); ui_app_wdf_mask_o : out std_logic_vector(g_ddr_payload_width/8-1 downto 0);
ui_app_wdf_wren_o : out std_logic; ui_app_wdf_wren_o : out std_logic;
ui_app_wdf_rdy_i : in std_logic; ui_app_wdf_rdy_i : in std_logic;
ui_app_rd_data_i : in std_logic_vector(g_ddr_payload_width-1 downto 0); ui_app_rd_data_i : in std_logic_vector(g_ddr_payload_width-1 downto 0);
ui_app_rd_data_end_i : in std_logic; ui_app_rd_data_end_i : in std_logic;
ui_app_rd_data_valid_i : in std_logic; ui_app_rd_data_valid_i : in std_logic;
ui_app_req_o : out std_logic; ui_app_req_o : out std_logic;
ui_app_gnt_i : in std_logic; ui_app_gnt_i : in std_logic;
----------------------------- -----------------------------
-- Debug Interface -- Debug Interface
----------------------------- -----------------------------
dbg_ddr_rb_data_o : out std_logic_vector(f_acq_chan_find_widest(g_acq_channels)-1 downto 0); dbg_ddr_rb_data_o : out std_logic_vector(g_ddr_payload_width-1 downto 0);
dbg_ddr_rb_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0); dbg_ddr_rb_addr_o : out std_logic_vector(g_acq_addr_width-1 downto 0);
dbg_ddr_rb_valid_o : out std_logic dbg_ddr_rb_valid_o : out std_logic
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment