Commit 7b3abf92 authored by Dimitris Lampridis's avatar Dimitris Lampridis

Merge branch '14-hdl-use-fifo-from-general-cores-part-2' into 'master'

Resolve "HDL: use fifo from general-cores (part 2)"

Closes #14

See merge request be-cem-edl/fec/hardware-modules/vme-sbc-a25-pcie-vme-bridge!10
parents 91bfd3f8 68069660
Subproject commit 225dd70e4cf4f93954414916f57ef1366e12e13b Subproject commit 3c636a53f7c6605fbb8c66093a3dcb08132a572c
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
library ieee; library ieee;
use ieee.std_logic_1164.all; use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
entity generic_dcfifo_mixedw is entity generic_dcfifo_mixedw is
generic ( generic (
g_device_family : string := "Cyclone IV GX"; g_device_family : string := "Cyclone IV GX";
...@@ -45,37 +42,28 @@ entity generic_dcfifo_mixedw is ...@@ -45,37 +42,28 @@ entity generic_dcfifo_mixedw is
end generic_dcfifo_mixedw; end generic_dcfifo_mixedw;
architecture syn of generic_dcfifo_mixedw is architecture syn of generic_dcfifo_mixedw is
signal rst_n_a : std_logic;
begin begin
rst_n_a <= not aclr;
dcfifo_mixed_widths_component : dcfifo_mixed_widths inst_fifo: entity work.generic_async_fifo_mixedw
generic map( generic map (
intended_device_family => g_device_family, g_wr_width => g_data_width,
lpm_numwords => g_fifo_depth, -- value assigned must comply with this equation g_rd_width => g_q_width,
-- 2^(LPM_WIDTHU -1) < LPM_NUMWORDS <= 2^(LPM_WIDTHU) g_size => g_fifo_depth,
lpm_showahead => g_showahead, -- off: normal mode, on: show ahead mode g_show_ahead => g_showahead = "ON",
lpm_type => "dcfifo_mixed_widths", -- DON'T CHANGE / FIFO type g_memory_implementation_hint => open
lpm_width => g_data_width, -- width for _data_ port )
lpm_widthu => g_data_widthu, -- size of write usedw port map (
lpm_width_r => g_q_width, -- width for _q_ port rst_n_a_i => rst_n_a,
lpm_widthu_r => g_q_widthu, -- size of read usedw clk_wr_i => wrclk,
overflow_checking => "ON", -- DON'T CHANGE / protection circuit for overflow checking d_i => data,
rdsync_delaypipe => 4, -- nbr of read synchronization stages, internally reduced by 2 => 2 stages we_i => wrreq,
read_aclr_synch => "OFF", wr_full_o => wrfull,
underflow_checking => "ON", -- DON'T CHANGE / protection circuit for underflow checking wr_count_o => wrusedw,
use_eab => "ON", -- off: FIFO implemented in logic, on: FIFO implemented using RAM blocks clk_rd_i => rdclk,
write_aclr_synch => "OFF", q_o => q,
wrsync_delaypipe => 4 -- nbr of write synchronization stages, internally reduced by 2 => 2 stages rd_i => rdreq,
) rd_empty_o => rdempty,
port map ( rd_count_o => open
aclr => aclr, );
data => data,
rdclk => rdclk,
rdreq => rdreq,
wrclk => wrclk,
wrreq => wrreq,
q => q,
rdempty => rdempty,
wrfull => wrfull,
wrusedw => wrusedw);
end syn; end syn;
...@@ -215,7 +215,7 @@ signal tx_fifo_w_data_enable_int : std_logic; ...@@ -215,7 +215,7 @@ signal tx_fifo_w_data_enable_int : std_logic;
signal tx_fifo_w_data_in_int : std_logic_vector(31 downto 0); signal tx_fifo_w_data_in_int : std_logic_vector(31 downto 0);
signal tx_fifo_w_data_full_int : std_logic; signal tx_fifo_w_data_full_int : std_logic;
signal tx_fifo_w_data_usedw_int : std_logic_vector(9 downto 0); signal tx_fifo_w_data_usedw_int : std_logic_vector(9 downto 0);
signal tx_fifo_wr_head_usedw_int : std_logic_vector(4 downto 0); signal tx_fifo_wr_head_usedw_int : std_logic_vector(6 downto 0);
-- error: -- error:
signal ecrc_err_wb_int : std_logic; signal ecrc_err_wb_int : std_logic;
......
...@@ -117,11 +117,11 @@ signal int_fifo_action_done : std_logic; ...@@ -117,11 +117,11 @@ signal int_fifo_action_done : std_logic;
-- FIFO signals -- FIFO signals
signal int_c_wr_enable : std_logic; signal int_c_wr_enable : std_logic;
signal int_c_wr_full : std_logic; signal int_c_wr_full : std_logic;
signal int_rx_fifo_c_usedw : unsigned(RX_LPM_WIDTHU-1 downto 0); signal int_rx_fifo_c_usedw : unsigned(RX_LPM_WIDTHU downto 0);
signal int_wr_wr_enable : std_logic; signal int_wr_wr_enable : std_logic;
signal int_wr_wr_full : std_logic; signal int_wr_wr_full : std_logic;
signal int_rx_fifo_wr_usedw : unsigned(RX_LPM_WIDTHU-1 downto 0); signal int_rx_fifo_wr_usedw : unsigned(RX_LPM_WIDTHU downto 0);
signal int_rx_fifo_data : std_logic_vector(63 downto 0); signal int_rx_fifo_data : std_logic_vector(63 downto 0);
...@@ -295,7 +295,7 @@ begin ...@@ -295,7 +295,7 @@ begin
g_device_family => DEVICE_FAMILY, g_device_family => DEVICE_FAMILY,
g_fifo_depth => RX_FIFO_DEPTH, g_fifo_depth => RX_FIFO_DEPTH,
g_data_width => 64, g_data_width => 64,
g_data_widthu => RX_LPM_WIDTHU, g_data_widthu => RX_LPM_WIDTHU+1,
g_q_width => 32, g_q_width => 32,
g_q_widthu => RX_LPM_WIDTHU+1, g_q_widthu => RX_LPM_WIDTHU+1,
g_showahead => "ON") g_showahead => "ON")
...@@ -317,7 +317,7 @@ begin ...@@ -317,7 +317,7 @@ begin
g_device_family => DEVICE_FAMILY, g_device_family => DEVICE_FAMILY,
g_fifo_depth => RX_FIFO_DEPTH, g_fifo_depth => RX_FIFO_DEPTH,
g_data_width => 64, g_data_width => 64,
g_data_widthu => RX_LPM_WIDTHU, g_data_widthu => RX_LPM_WIDTHU+1,
g_q_width => 32, g_q_width => 32,
g_q_widthu => RX_LPM_WIDTHU+1, g_q_widthu => RX_LPM_WIDTHU+1,
g_showahead => "OFF") g_showahead => "OFF")
......
...@@ -99,7 +99,7 @@ entity tx_module is ...@@ -99,7 +99,7 @@ entity tx_module is
tx_fifo_wr_head_full : out std_logic; tx_fifo_wr_head_full : out std_logic;
tx_fifo_w_data_full : out std_logic; tx_fifo_w_data_full : out std_logic;
tx_fifo_w_data_usedw : out std_logic_vector(9 downto 0); tx_fifo_w_data_usedw : out std_logic_vector(9 downto 0);
tx_fifo_wr_head_usedw : out std_logic_vector(4 downto 0); tx_fifo_wr_head_usedw : out std_logic_vector(6 downto 0);
-- init -- init
bus_dev_func : in std_logic_vector(15 downto 0); bus_dev_func : in std_logic_vector(15 downto 0);
...@@ -153,8 +153,8 @@ signal tx_fifo_w_data_enable_int : std_logic; ...@@ -153,8 +153,8 @@ signal tx_fifo_w_data_enable_int : std_logic;
signal tx_fifo_w_data_empty_int : std_logic; signal tx_fifo_w_data_empty_int : std_logic;
signal tx_fifo_w_data_out_int : std_logic_vector(63 downto 0); signal tx_fifo_w_data_out_int : std_logic_vector(63 downto 0);
signal tx_wrusedw_c : std_logic_vector (TX_DATA_LPM_WIDTHU-1 downto 0); signal tx_wrusedw_c : std_logic_vector (TX_DATA_LPM_WIDTHU+1 downto 0);
signal tx_wrusedw_w : std_logic_vector (TX_DATA_LPM_WIDTHU-1 downto 0); signal tx_wrusedw_w : std_logic_vector (TX_DATA_LPM_WIDTHU+1 downto 0);
begin begin
-- instanciate components ----------------------------------------------------- -- instanciate components -----------------------------------------------------
...@@ -285,7 +285,7 @@ begin ...@@ -285,7 +285,7 @@ begin
g_device_family => DEVICE_FAMILY, g_device_family => DEVICE_FAMILY,
g_fifo_depth => TX_HEADER_FIFO_DEPTH, g_fifo_depth => TX_HEADER_FIFO_DEPTH,
g_data_width => 32, g_data_width => 32,
g_data_widthu => TX_HEADER_LPM_WIDTHU, g_data_widthu => TX_HEADER_LPM_WIDTHU+2,
g_q_width => 64, g_q_width => 64,
g_q_widthu => TX_HEADER_LPM_WIDTHU-1, g_q_widthu => TX_HEADER_LPM_WIDTHU-1,
g_showahead => "OFF") g_showahead => "OFF")
...@@ -306,7 +306,7 @@ begin ...@@ -306,7 +306,7 @@ begin
g_device_family => DEVICE_FAMILY, g_device_family => DEVICE_FAMILY,
g_fifo_depth => TX_HEADER_FIFO_DEPTH, g_fifo_depth => TX_HEADER_FIFO_DEPTH,
g_data_width => 32, g_data_width => 32,
g_data_widthu => TX_HEADER_LPM_WIDTHU, g_data_widthu => TX_HEADER_LPM_WIDTHU+2,
g_q_width => 64, g_q_width => 64,
g_q_widthu => TX_HEADER_LPM_WIDTHU-1, g_q_widthu => TX_HEADER_LPM_WIDTHU-1,
g_showahead => "OFF") g_showahead => "OFF")
...@@ -328,7 +328,7 @@ begin ...@@ -328,7 +328,7 @@ begin
g_device_family => DEVICE_FAMILY, g_device_family => DEVICE_FAMILY,
g_fifo_depth => TX_DATA_FIFO_DEPTH, g_fifo_depth => TX_DATA_FIFO_DEPTH,
g_data_width => 32, g_data_width => 32,
g_data_widthu => TX_DATA_LPM_WIDTHU, g_data_widthu => TX_DATA_LPM_WIDTHU+2,
g_q_width => 64, g_q_width => 64,
g_q_widthu => TX_DATA_LPM_WIDTHU-1, g_q_widthu => TX_DATA_LPM_WIDTHU-1,
g_showahead => "OFF") g_showahead => "OFF")
...@@ -349,7 +349,7 @@ begin ...@@ -349,7 +349,7 @@ begin
g_device_family => DEVICE_FAMILY, g_device_family => DEVICE_FAMILY,
g_fifo_depth => TX_DATA_FIFO_DEPTH, g_fifo_depth => TX_DATA_FIFO_DEPTH,
g_data_width => 32, g_data_width => 32,
g_data_widthu => TX_DATA_LPM_WIDTHU, g_data_widthu => TX_DATA_LPM_WIDTHU+2,
g_q_width => 64, g_q_width => 64,
g_q_widthu => TX_DATA_LPM_WIDTHU-1, g_q_widthu => TX_DATA_LPM_WIDTHU-1,
g_showahead => "OFF") g_showahead => "OFF")
...@@ -365,7 +365,7 @@ begin ...@@ -365,7 +365,7 @@ begin
wrfull => tx_fifo_w_data_full, wrfull => tx_fifo_w_data_full,
wrusedw => tx_wrusedw_w); wrusedw => tx_wrusedw_w);
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
tx_fifo_c_data_usedw <= "000" & tx_wrusedw_c(6 downto 0); tx_fifo_c_data_usedw <= "0" & tx_wrusedw_c(8 downto 0);
tx_fifo_w_data_usedw <= "000" & tx_wrusedw_w(6 downto 0); tx_fifo_w_data_usedw <= "0" & tx_wrusedw_w(8 downto 0);
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
end architecture tx_module_arch; end architecture tx_module_arch;
...@@ -87,7 +87,7 @@ entity z091_01_wb_slave is ...@@ -87,7 +87,7 @@ entity z091_01_wb_slave is
tx_fifo_wr_head_full : in std_logic; tx_fifo_wr_head_full : in std_logic;
tx_fifo_w_data_full : in std_logic; tx_fifo_w_data_full : in std_logic;
tx_fifo_w_data_usedw : in std_logic_vector(9 downto 0); tx_fifo_w_data_usedw : in std_logic_vector(9 downto 0);
tx_fifo_wr_head_usedw : in std_logic_vector(4 downto 0); tx_fifo_wr_head_usedw : in std_logic_vector(6 downto 0);
tx_fifo_wr_head_clr : out std_logic; tx_fifo_wr_head_clr : out std_logic;
tx_fifo_wr_head_enable : out std_logic; tx_fifo_wr_head_enable : out std_logic;
tx_fifo_wr_head_in : out std_logic_vector(31 downto 0); tx_fifo_wr_head_in : out std_logic_vector(31 downto 0);
......
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