CORE-798 Make EL GIP Library FPGA Vendor Independent.

All memory components are now routed via a shim, where any device specialisations can be actioned
This commit is contained in:
David Steele 2022-09-22 14:54:35 +01:00
commit ef79fde4fa
52 changed files with 253298 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# Compile the code into the appropriate libraries
foreach lib [list work tb_pkg] {
file delete -force -- $lib
vlib $lib
}
vlog -quiet glbl.v -work work
vcom -quiet -2008 -f files.tcl -work work
vlog -quiet ../src/efinix/efx_fifo.v -work work

View file

@ -0,0 +1,18 @@
../../0/src/common_pkg.vhd
../../0/src/sync_pulse.vhd
../../1/src/vendor_pkg.vhd
../src/altera/alt_async_fifo.vhd
../src/inferred/inferred_async_fifo.vhd
../src/shim/async_fifo.vhd
tb_async_fifo.vhd
../src/altera/alt_sync_fifo.vhd
../src/inferred/inferred_sync_fifo.vhd
../src/shim/sync_fifo.vhd
tb_sync_fifo.vhd
../src/inferred/inferred_dpram.vhd
../src/altera/alt_dp_ram.vhd
../src/shim/dp_ram.vhd
tb_dp_ram.vhd
../src/altera/alt_rw_dp_ram.vhd
../src/shim/rw_dp_ram.vhd
tb_rw_dp_ram.vhd

View file

@ -0,0 +1,84 @@
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $
`ifndef GLBL
`define GLBL
`timescale 1 ps / 1 ps
module glbl ();
parameter ROC_WIDTH = 100000;
parameter TOC_WIDTH = 0;
parameter GRES_WIDTH = 10000;
parameter GRES_START = 10000;
//-------- STARTUP Globals --------------
wire GSR;
wire GTS;
wire GWE;
wire PRLD;
wire GRESTORE;
tri1 p_up_tmp;
tri (weak1, strong0) PLL_LOCKG = p_up_tmp;
wire PROGB_GLBL;
wire CCLKO_GLBL;
wire FCSBO_GLBL;
wire [3:0] DO_GLBL;
wire [3:0] DI_GLBL;
reg GSR_int;
reg GTS_int;
reg PRLD_int;
reg GRESTORE_int;
//-------- JTAG Globals --------------
wire JTAG_TDO_GLBL;
wire JTAG_TCK_GLBL;
wire JTAG_TDI_GLBL;
wire JTAG_TMS_GLBL;
wire JTAG_TRST_GLBL;
reg JTAG_CAPTURE_GLBL;
reg JTAG_RESET_GLBL;
reg JTAG_SHIFT_GLBL;
reg JTAG_UPDATE_GLBL;
reg JTAG_RUNTEST_GLBL;
reg JTAG_SEL1_GLBL = 0;
reg JTAG_SEL2_GLBL = 0 ;
reg JTAG_SEL3_GLBL = 0;
reg JTAG_SEL4_GLBL = 0;
reg JTAG_USER_TDO1_GLBL = 1'bz;
reg JTAG_USER_TDO2_GLBL = 1'bz;
reg JTAG_USER_TDO3_GLBL = 1'bz;
reg JTAG_USER_TDO4_GLBL = 1'bz;
assign (strong1, weak0) GSR = GSR_int;
assign (strong1, weak0) GTS = GTS_int;
assign (weak1, weak0) PRLD = PRLD_int;
assign (strong1, weak0) GRESTORE = GRESTORE_int;
initial begin
GSR_int = 1'b1;
PRLD_int = 1'b1;
#(ROC_WIDTH)
GSR_int = 1'b0;
PRLD_int = 1'b0;
end
initial begin
GTS_int = 1'b1;
#(TOC_WIDTH)
GTS_int = 1'b0;
end
initial begin
GRESTORE_int = 1'b0;
#(GRES_START);
GRESTORE_int = 1'b1;
#(GRES_WIDTH);
GRESTORE_int = 1'b0;
end
endmodule
`endif

View file

@ -0,0 +1,9 @@
To sim
1/. open cmd. Type modelsim
2/. In modelsim transcript : type do compile.do
3/. In modelsim transcript : type vsim work.tb_xxxx glbl
4/. In modelsim transcript : type run 10us.
5/. Test pass prints :"# ** Error: Test complete (Not an Error - just stops testbench)"
Test fails prints :"# ** Failure:"

View file

@ -0,0 +1,309 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Self checking test bench to ensure Xilinx xil_lvds_serdes_tx_2 is functionally equivalent to alt_lvds_serdes_tx_2
library modelsim_lib;
use modelsim_lib.util.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
use STD.textio.all;
--pragma translate_off
--{{{
entity tb_async_fifo is end;
--}}}
--{{{
architecture sim of tb_async_fifo is
constant ALT_DEVICE_FAMILY : string := "Cyclone V";
constant XIL_DEVICE_FAMILY : string := "Ultrascale+";
constant EFX_DEVICE_FAMILY : string := "Efinix T20";
constant DATA_WIDTH : natural range 1 to 256 := 32;
constant DEPTH : natural range 2 to 131072 := 64;
constant SHOWAHEAD : string := "ON"; -- "OFF"
--{{{ signals
signal wrclk : std_logic := '0';
signal rdclk : std_logic := '0';
signal clr : std_logic;
signal wrreq : std_logic;
signal wrdata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal alt_wrusedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal alt_wrfull : std_logic;
signal xil_wrusedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal xil_wrfull : std_logic;
signal efx_wrusedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal efx_wrfull : std_logic;
signal alt_rdempty : std_logic;
signal alt_rdreq : std_logic;
signal alt_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal alt_rdusedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal xil_rdempty : std_logic;
signal xil_rdreq : std_logic;
signal xil_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal xil_rdusedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal efx_rdempty : std_logic;
signal efx_rdreq : std_logic;
signal efx_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal efx_rdusedw : std_logic_vector (log2(DEPTH)-1 downto 0);
--}}}
--{{{
component async_fifo
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
--}}}
--constant mem_depth : integer := 256;
--type mem is array (mem_depth-1 downto 0) of std_logic_vector (NUM_CHANS*SER_FACTOR - 1 DOWNTO 0);
--shared variable test_array : mem;
begin
--{{{
c_alt_async_fifo : async_fifo -- altera version
generic map (
DEVICE_FAMILY => ALT_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
SHOWAHEAD => SHOWAHEAD
)
port map (
clr => clr,
wrclk => wrclk,
wrreq => wrreq,
wrdata => wrdata,
wrfull => alt_wrfull,
wrusedw => alt_wrusedw,
rdclk => rdclk,
rdreq => alt_rdreq,
rddata => alt_rddata,
rdempty => alt_rdempty,
rdusedw => alt_rdusedw
);
--}}}
--{{{
c_xil_async_fifo : async_fifo -- xilinx version
generic map (
DEVICE_FAMILY => XIL_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
SHOWAHEAD => SHOWAHEAD
)
port map (
clr => clr,
wrclk => wrclk,
wrreq => wrreq,
wrdata => wrdata,
wrfull => xil_wrfull,
wrusedw => xil_wrusedw,
rdclk => rdclk,
rdreq => xil_rdreq,
rddata => xil_rddata,
rdempty => xil_rdempty,
rdusedw => xil_rdusedw
);
--}}}
--{{{
c_efx_async_fifo : async_fifo -- efinix version
generic map (
DEVICE_FAMILY => EFX_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
SHOWAHEAD => SHOWAHEAD
)
port map (
clr => clr,
wrclk => wrclk,
wrreq => wrreq,
wrdata => wrdata,
wrfull => efx_wrfull,
wrusedw => efx_wrusedw,
rdclk => rdclk,
rdreq => efx_rdreq,
rddata => efx_rddata,
rdempty => efx_rdempty,
rdusedw => efx_rdusedw
);
--}}}
--{{{
p_wrclk : process
begin
wrclk <= not wrclk;
wait for 5 ns;
--wait for 13 ns;
end process;
--}}}
--{{{
p_rdclk : process
begin
rdclk <= not rdclk;
wait for 10 ns;
end process;
--}}}
--{{{
p_tb : process
begin
clr <= '1';
alt_rdreq <= '0';
xil_rdreq <= '0';
efx_rdreq <= '0';
wrreq <= '0';
wait for 0.1 us;
wait until wrclk'event and wrclk = '1';
clr <= '0' after 0.1 ns;
-- ************ xilinx native fifo takes 28 clocks to recover after reset
for i in 0 to 29 loop
wait until wrclk'event and wrclk = '1';
end loop;
wrreq <= '1' after 0.1 ns;
wait until wrclk'event and wrclk = '1';
wrreq <= '1' after 0.1 ns;
wait until wrclk'event and wrclk = '1';
for i in 0 to 9 loop
wait until wrclk'event and wrclk = '1';
end loop;
wait until rdclk'event and rdclk = '1';
alt_rdreq <= '1' after 0.1 ns;
xil_rdreq <= '1' after 0.1 ns;
efx_rdreq <= '1' after 0.1 ns;
wait until rdclk'event and rdclk = '1';
alt_rdreq <= '0' after 0.1 ns;
xil_rdreq <= '0' after 0.1 ns;
efx_rdreq <= '0' after 0.1 ns;
for i in 0 to 55 loop
wait until wrclk'event and wrclk = '1';
end loop;
wrreq <= '1' after 0.1 ns;
wait until wrclk'event and wrclk = '1';
wait until wrclk'event and wrclk = '1';
wait until wrclk'event and wrclk = '1';
alt_rdreq <= '1' after 0.1 ns;
xil_rdreq <= '1' after 0.1 ns;
efx_rdreq <= '1' after 0.1 ns;
for i in 0 to 55 loop
wait until wrclk'event and wrclk = '1';
end loop;
assert false
report "Test complete (Not an Error - just stops testbench)"
severity error;
wait;
end process;
--}}}
--{{{
p_writedata : process (wrclk, clr)
begin
if clr = '1' then
wrdata <= (others => '0');
elsif rising_edge(wrclk) then
wrdata <= x"12345600" after 0.1 ns;
if wrreq = '1' then
wrdata <= std_logic_vector(unsigned(wrdata)+1) after 0.1 ns;
end if;
end if;
end process;
--}}}
--{{{
--p_tx_in : process
--variable addr : integer;
--begin
--wait until rising_edge(clk);
--if tx_in_enable = '0' then
--addr := 0;
--elsif addr < mem_depth then
--test_array(addr) := tx_in;
--addr := addr + 1;
--end if;
--end process;
--}}}
--{{{
--p_check_alt : process
--variable addr : integer := 0;
--variable mem_data : std_logic_vector (NUM_CHANS*SER_FACTOR - 1 DOWNTO 0);
--variable run : boolean := false;
--begin
--wait until rising_edge(xil_clk);
--if unsigned(xil_data) /= 0 then
--run := true;
--end if;
--if run and addr < mem_depth then
--mem_data := test_array(addr);
--addr := addr + 1;
--assert (mem_data(6 downto 0) = xil_data(6 downto 0))
--report "************Altera Check data Error***************"
--severity error;
--end if;
--end process;
--}}}
--{{{
--p_check_xil : process
--variable addr : integer := 0;
--variable mem_data : std_logic_vector (NUM_CHANS*SER_FACTOR - 1 DOWNTO 0);
--variable run : boolean := false;
--begin
--wait until rising_edge(xil_clk);
--if unsigned(xil_data) /= 0 then
--run := true;
--end if;
--if run and addr < mem_depth then
--mem_data := test_array(addr);
--addr := addr + 1;
--assert (mem_data(6 downto 0) = xil_data(6 downto 0))
--report "************Xilinx Check data Error***************"
--severity error;
--end if;
--end process;
--}}}
end sim;
--}}}
--pragma translate_on

View file

@ -0,0 +1,177 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Self checking test bench to ensure Xilinx xil_lvds_serdes_tx_2 is functionally equivalent to alt_lvds_serdes_tx_2
library modelsim_lib;
use modelsim_lib.util.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
use STD.textio.all;
--pragma translate_off
--{{{
entity tb_dp_ram is end;
--}}}
--{{{
architecture sim of tb_dp_ram is
constant ALT_DEVICE_FAMILY : string := "Cyclone V";
constant XIL_DEVICE_FAMILY : string := "Ultrascale+";
constant DATA_WIDTH : natural range 1 to 256 := 32;
constant DEPTH : natural range 2 to 131072 := 64;
constant REGISTER_OUTPUT : string := "UNREGISTERED";
--constant REGISTER_OUTPUT : string := "CLOCK0";
--constant READ_WRITE_MODE : string := "OLD_DATA";
constant READ_WRITE_MODE : string := "DONT_CARE";
--{{{ signals
signal clk : std_logic := '0';
signal wren : std_logic;
signal wrdata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal wraddr : std_logic_vector (log2(DEPTH)-1 downto 0);
signal rdaddr : std_logic_vector (log2(DEPTH)-1 downto 0);
signal alt_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal xil_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal docheck : boolean := false;
--}}}
--{{{
component dp_ram
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
clk : in std_logic := '1';
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wraddr : in std_logic_vector (log2(DEPTH)-1 downto 0);
wren : in std_logic := '0';
rdaddr : in std_logic_vector (log2(DEPTH)-1 downto 0);
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end component;
--}}}
begin
--{{{
c_alt_dp_ram : dp_ram -- altera version
generic map (
DEVICE_FAMILY => ALT_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
READ_WRITE_MODE => READ_WRITE_MODE
)
port map (
clk => clk,
wren => wren,
wraddr => wraddr,
wrdata => wrdata,
rdaddr => rdaddr,
rddata => alt_rddata
);
--}}}
--{{{
c_xil_dp_ram : dp_ram -- xilinx version
generic map (
DEVICE_FAMILY => XIL_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT
)
port map (
clk => clk,
wren => wren,
wraddr => wraddr,
wrdata => wrdata,
rdaddr => rdaddr,
rddata => xil_rddata
);
--}}}
--{{{
p_clk : process
begin
clk <= not clk;
wait for 13 ns;
end process;
--}}}
--{{{
p_tb : process
begin
docheck <= false;
wren <= '0';
wraddr <= (others => '0');
rdaddr <= (others => '0');
wrdata <= (others => '0');
rdaddr <= (others => '0');
wait for 0.1 us;
wait until clk'event and clk = '1';
wait until clk'event and clk = '1';
wait until clk'event and clk = '1';
wren <= '1' after 0.1 ns;
wrdata <= x"12345678" after 0.1 ns;
wait until clk'event and clk = '1';
wren <= '0' after 0.1 ns;
wrdata <= (others => '0') after 0.1 ns;
docheck <= true after 0.1 ns;
wait until clk'event and clk = '1';
for i in 0 to 9 loop
wren <= '1' after 0.1 ns;
wraddr <= std_logic_vector(unsigned(wraddr)+1) after 0.1 ns;
wrdata <= std_logic_vector(unsigned(wrdata)+1) after 0.1 ns;
wait until clk'event and clk = '1';
wren <= '0' after 0.1 ns;
wait until clk'event and clk = '1';
end loop;
wait until clk'event and clk = '1';
rdaddr <= std_logic_vector(unsigned(rdaddr)+1) after 0.1 ns;
wait until clk'event and clk = '1';
rdaddr <= std_logic_vector(unsigned(rdaddr)+1) after 0.1 ns;
wait until clk'event and clk = '1';
wait until clk'event and clk = '1';
assert false
report "Test complete (Not an Error - just stops testbench)"
severity error;
wait;
end process;
--}}}
--{{{
p_check : process
begin
wait until rising_edge(clk);
if docheck and unsigned(alt_rddata) /= 0 then
assert (alt_rddata = xil_rddata)
report "************Check data Error - Altera and Xilinx different***************"
severity error;
end if;
end process;
--}}}
end sim;
--}}}
--pragma translate_on

View file

@ -0,0 +1,191 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Self checking test bench to ensure Xilinx xil_lvds_serdes_tx_2 is functionally equivalent to alt_lvds_serdes_tx_2
library modelsim_lib;
use modelsim_lib.util.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
use STD.textio.all;
--pragma translate_off
--{{{
entity tb_rw_dp_ram is end;
--}}}
--{{{
architecture sim of tb_rw_dp_ram is
constant ALT_DEVICE_FAMILY : string := "Cyclone V";
constant XIL_DEVICE_FAMILY : string := "Ultrascale+";
constant DATA_WIDTH : natural range 1 to 256 := 32;
constant DEPTH : natural range 2 to 131072 := 64;
constant REGISTER_OUTPUT : string := "UNREGISTERED";
--constant REGISTER_OUTPUT : string := "CLOCK0";
--constant READ_WRITE_MODE : string := "OLD_DATA";
constant READ_WRITE_MODE : string := "DONT_CARE";
--{{{ signals
signal clk : std_logic := '0';
signal wren_a : std_logic;
signal wren_b : std_logic;
signal wrdata_a : std_logic_vector (DATA_WIDTH-1 downto 0);
signal wrdata_b : std_logic_vector (DATA_WIDTH-1 downto 0);
signal addr_a : std_logic_vector (log2(DEPTH)-1 downto 0);
signal addr_b : std_logic_vector (log2(DEPTH)-1 downto 0);
signal alt_rddata_a : std_logic_vector (DATA_WIDTH-1 downto 0);
signal alt_rddata_b : std_logic_vector (DATA_WIDTH-1 downto 0);
signal xil_rddata_a : std_logic_vector (DATA_WIDTH-1 downto 0);
signal xil_rddata_b : std_logic_vector (DATA_WIDTH-1 downto 0);
signal docheck : boolean := false;
--}}}
--{{{
component rw_dp_ram
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
addr_a : in std_logic_vector (log2(DEPTH)-1 downto 0);
addr_b : in std_logic_vector (log2(DEPTH)-1 downto 0);
clk : in std_logic := '1';
wrdata_a : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrdata_b : in std_logic_vector (DATA_WIDTH-1 downto 0);
wren_a : in std_logic := '0';
wren_b : in std_logic := '0';
rddata_a : out std_logic_vector (DATA_WIDTH-1 downto 0);
rddata_b : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end component;
--}}}
begin
--{{{
c_alt_rw_dp_ram : rw_dp_ram -- altera version
generic map (
DEVICE_FAMILY => ALT_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
READ_WRITE_MODE => READ_WRITE_MODE
)
port map (
clk => clk,
wren_a => wren_a,
wren_b => wren_b,
addr_a => addr_a,
addr_b => addr_b,
wrdata_a => wrdata_a,
wrdata_b => wrdata_b,
rddata_a => alt_rddata_a,
rddata_b => alt_rddata_b
);
--}}}
--{{{
c_xil_rw_dp_ram : rw_dp_ram -- xilinx version
generic map (
DEVICE_FAMILY => XIL_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT
)
port map (
clk => clk,
wren_a => wren_a,
wren_b => wren_b,
addr_a => addr_a,
addr_b => addr_b,
wrdata_a => wrdata_a,
wrdata_b => wrdata_b,
rddata_a => xil_rddata_a,
rddata_b => xil_rddata_b
);
--}}}
--{{{
p_clk : process
begin
clk <= not clk;
wait for 13 ns;
end process;
--}}}
--{{{
p_tb : process
begin
docheck <= false;
wren_a <= '0';
wren_b <= '0';
addr_a <= (others => '0');
addr_b <= (others => '0');
wrdata_a <= (others => '0');
addr_b <= (others => '0');
wait for 0.1 us;
wait until clk'event and clk = '1';
wait until clk'event and clk = '1';
wait until clk'event and clk = '1';
wren_a <= '1' after 0.1 ns;
wrdata_a <= x"12345678" after 0.1 ns;
wait until clk'event and clk = '1';
wren_a <= '0' after 0.1 ns;
wrdata_a <= (others => '0') after 0.1 ns;
docheck <= true after 0.1 ns;
wait until clk'event and clk = '1';
for i in 0 to 9 loop
wren_a <= '1' after 0.1 ns;
addr_a <= std_logic_vector(unsigned(addr_a)+1) after 0.1 ns;
wrdata_a <= std_logic_vector(unsigned(wrdata_a)+1) after 0.1 ns;
wait until clk'event and clk = '1';
wren_a <= '0' after 0.1 ns;
wait until clk'event and clk = '1';
end loop;
wait until clk'event and clk = '1';
addr_b <= std_logic_vector(unsigned(addr_b)+1) after 0.1 ns;
wait until clk'event and clk = '1';
addr_b <= std_logic_vector(unsigned(addr_b)+1) after 0.1 ns;
wait until clk'event and clk = '1';
wait until clk'event and clk = '1';
assert false
report "Test complete (Not an Error - just stops testbench)"
severity error;
wait;
end process;
--}}}
--{{{
p_check : process
begin
wait until rising_edge(clk);
if docheck and unsigned(alt_rddata_b) /= 0 then
assert (alt_rddata_b = xil_rddata_b)
report "************Check data Error - Altera and Xilinx B port different***************"
severity error;
assert (alt_rddata_a = xil_rddata_a)
report "************Check data Error - Altera and Xilinx A port different***************"
severity error;
end if;
end process;
--}}}
end sim;
--}}}
--pragma translate_on

View file

@ -0,0 +1,336 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Self checking test bench to ensure Xilinx xil_sync_fifo is functionally equivalent to alt_sync_fifo
library modelsim_lib;
use modelsim_lib.util.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
use STD.textio.all;
--pragma translate_off
--{{{
entity tb_sync_fifo is end;
--}}}
--{{{
architecture sim of tb_sync_fifo is
constant ALT_DEVICE_FAMILY : string := "Cyclone V";
constant XIL_DEVICE_FAMILY : string := "Ultrascale+";
constant EFX_DEVICE_FAMILY : string := "Efinix T20";
constant DATA_WIDTH : natural range 1 to 256 := 32;
constant DEPTH : natural range 2 to 131072 := 64;
constant SHOWAHEAD : string := "ON"; -- "OFF"
--constant SHOWAHEAD : string := "OFF"; -- "OFF"
constant CHECKING : string := "ON"; -- "OFF"
constant REGISTER_OUTPUT : string := "ON"; -- "OFF"
constant NEARLY_FULL : natural range 1 to 131072 := 62;
constant NEARLY_EMPTY : natural range 1 to 131072 := 2;
--{{{ signals
signal clk : std_logic := '0';
signal sclr : std_logic;
signal wrreq : std_logic;
signal wrdata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal alt_usedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal alt_almost_full : std_logic;
signal alt_full : std_logic;
signal xil_usedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal xil_almost_full : std_logic;
signal xil_full : std_logic;
signal efx_usedw : std_logic_vector (log2(DEPTH)-1 downto 0);
signal efx_almost_full : std_logic;
signal efx_full : std_logic;
signal alt_empty : std_logic;
signal alt_almost_empty : std_logic;
signal alt_rdreq : std_logic;
signal alt_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal xil_empty : std_logic;
signal xil_almost_empty : std_logic;
signal xil_rdreq : std_logic;
signal xil_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal efx_empty : std_logic;
signal efx_almost_empty : std_logic;
signal efx_rdreq : std_logic;
signal efx_rddata : std_logic_vector (DATA_WIDTH-1 downto 0);
signal docheck : boolean;
--}}}
--{{{
component sync_fifo
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
--}}}
--constant mem_depth : integer := 256;
--type mem is array (mem_depth-1 downto 0) of std_logic_vector (NUM_CHANS*SER_FACTOR - 1 DOWNTO 0);
--shared variable test_array : mem;
begin
--{{{
c_alt_sync_fifo : sync_fifo -- altera version
generic map (
DEVICE_FAMILY => ALT_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
NEARLY_FULL => NEARLY_FULL,
NEARLY_EMPTY => NEARLY_EMPTY,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING
)
port map (
sclr => sclr,
clk => clk,
wrreq => wrreq,
wrdata => wrdata,
almost_full => alt_almost_full,
full => alt_full,
rdreq => alt_rdreq,
rddata => alt_rddata,
almost_empty => alt_almost_empty,
empty => alt_empty,
usedw => alt_usedw
);
--}}}
--{{{
c_xil_sync_fifo : sync_fifo -- xilinx version
generic map (
DEVICE_FAMILY => XIL_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
NEARLY_FULL => NEARLY_FULL,
NEARLY_EMPTY => NEARLY_EMPTY,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING
)
port map (
sclr => sclr,
clk => clk,
wrreq => wrreq,
wrdata => wrdata,
almost_full => xil_almost_full,
full => xil_full,
rdreq => xil_rdreq,
rddata => xil_rddata,
almost_empty => xil_almost_empty,
empty => xil_empty,
usedw => xil_usedw
);
--}}}
--{{{
c_efx_sync_fifo : sync_fifo -- xilinx version
generic map (
DEVICE_FAMILY => EFX_DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
NEARLY_FULL => NEARLY_FULL,
NEARLY_EMPTY => NEARLY_EMPTY,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING
)
port map (
sclr => sclr,
clk => clk,
wrreq => wrreq,
wrdata => wrdata,
almost_full => efx_almost_full,
full => efx_full,
rdreq => efx_rdreq,
rddata => efx_rddata,
almost_empty => efx_almost_empty,
empty => efx_empty,
usedw => efx_usedw
);
--}}}
--{{{
p_clk : process
begin
clk <= not clk;
wait for 13 ns;
end process;
--}}}
--{{{
p_tb : process
begin
sclr <= '1';
alt_rdreq <= '0';
xil_rdreq <= '0';
efx_rdreq <= '0';
wrreq <= '0';
wrdata <= (others => '0');
docheck <= false;
wait for 0.1 us;
wait until clk'event and clk = '1';
sclr <= '0' after 0.1 ns;
-- ************ xilinx takes 28 clocks to recover after reset
for i in 0 to 29 loop
wait until clk'event and clk = '1';
end loop;
docheck <= true;
wrreq <= '1' after 0.1 ns;
wrdata <= x"12345678" after 0.1 ns;
wait until clk'event and clk = '1';
wrreq <= '0' after 0.1 ns;
wrdata <= (others => '0') after 0.1 ns;
wait until clk'event and clk = '1';
for i in 0 to 9 loop
wrdata <= std_logic_vector(unsigned(wrdata) + 1) after 0.1 ns;
wrreq <= '1' after 0.1 ns;
wait until clk'event and clk = '1';
wrreq <= '0' after 0.1 ns;
wait until clk'event and clk = '1';
end loop;
wait until clk'event and clk = '1';
alt_rdreq <= '1' after 0.1 ns;
xil_rdreq <= '1' after 0.1 ns;
efx_rdreq <= '1' after 0.1 ns;
wait until clk'event and clk = '1';
alt_rdreq <= '0' after 0.1 ns;
xil_rdreq <= '0' after 0.1 ns;
efx_rdreq <= '0' after 0.1 ns;
for i in 0 to 60 loop
if alt_full = '0' then
wrreq <= '1' after 0.1 ns;
wrdata <= std_logic_vector(unsigned(wrdata) + 1) after 0.1 ns;
end if;
wait until clk'event and clk = '1';
wrreq <= '0' after 0.1 ns;
wait until clk'event and clk = '1';
end loop;
for i in 0 to 66 loop
if alt_empty = '0' then
alt_rdreq <= '1' after 0.1 ns;
xil_rdreq <= '1' after 0.1 ns;
efx_rdreq <= '1' after 0.1 ns;
end if;
wait until clk'event and clk = '1';
alt_rdreq <= '0' after 0.1 ns;
xil_rdreq <= '0' after 0.1 ns;
efx_rdreq <= '0' after 0.1 ns;
wait until clk'event and clk = '1';
end loop;
assert false
report "Test complete (Not an Error - just stops testbench)"
severity error;
wait;
end process;
--}}}
--{{{
p_check : process
begin
wait until rising_edge(clk);
if docheck then
assert (alt_rddata = xil_rddata)
report "************Check data Error - Altera and Xilinx different***************"
severity warning;
assert (alt_full = xil_full)
report "************Check flag full Error - Altera and Xilinx different***************"
severity warning;
assert (alt_almost_full = xil_almost_full)
report "************Check flag almost_full Error - Altera and Xilinx different***************"
severity warning;
assert (alt_almost_empty = xil_almost_empty)
report "************Check flag almost_empty Error - Altera and Xilinx different***************"
severity warning;
assert (alt_empty = xil_empty)
report "************Check flag empty Error - Altera and Xilinx different***************"
severity warning;
assert (alt_usedw = xil_usedw)
report "************Check usedw count Error - Altera and Xilinx different***************"
severity warning;
assert (alt_rddata = efx_rddata or efx_empty = '1') -- efx output is undefined vs altera 0
report "************Check data Error - Altera and Efinix different***************"
severity warning;
assert (alt_full = efx_full)
report "************Check flag full Error - Altera and Efinix different***************"
severity warning;
assert (alt_almost_full = efx_almost_full)
report "************Check flag almost_full Error - Altera and Efinix different***************"
severity warning;
assert (alt_almost_empty = efx_almost_empty)
report "************Check flag almost_empty Error - Altera and Efinix different***************"
severity warning;
assert (alt_empty = efx_empty)
report "************Check flag empty Error - Altera and Efinix different***************"
severity warning;
assert (alt_usedw = efx_usedw)
report "************Check usedw count Error - Altera and Efinix different***************"
severity warning;
end if;
end process;
--}}}
end sim;
--}}}
--pragma translate_on

View file

@ -0,0 +1,86 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /tb_async_fifo/wrclk
add wave -noupdate /tb_async_fifo/rdclk
add wave -noupdate /tb_async_fifo/clr
add wave -noupdate /tb_async_fifo/wrreq
add wave -noupdate /tb_async_fifo/wrdata
add wave -noupdate -radix unsigned /tb_async_fifo/alt_wrusedw
add wave -noupdate /tb_async_fifo/alt_wrfull
add wave -noupdate /tb_async_fifo/alt_rdempty
add wave -noupdate /tb_async_fifo/alt_rdreq
add wave -noupdate -radix unsigned /tb_async_fifo/alt_rdusedw
add wave -noupdate /tb_async_fifo/alt_rddata
add wave -noupdate -divider {New Divider}
add wave -noupdate -radix unsigned /tb_async_fifo/xil_wrusedw
add wave -noupdate /tb_async_fifo/xil_wrfull
add wave -noupdate /tb_async_fifo/xil_rdempty
add wave -noupdate /tb_async_fifo/xil_rdreq
add wave -noupdate /tb_async_fifo/xil_rddata
add wave -noupdate -radix unsigned /tb_async_fifo/xil_rdusedw
add wave -noupdate -divider {New Divider}
add wave -noupdate -radix unsigned /tb_async_fifo/efx_wrusedw
add wave -noupdate /tb_async_fifo/efx_wrfull
add wave -noupdate /tb_async_fifo/efx_rdempty
add wave -noupdate /tb_async_fifo/efx_rdreq
add wave -noupdate /tb_async_fifo/efx_rddata
add wave -noupdate -radix unsigned /tb_async_fifo/efx_rdusedw
TreeUpdate [SetDefaultTree]
quietly WaveActivateNextPane
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/clr
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrclk
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrreq
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrdata
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wr_addr
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wr_rst_d
add wave -noupdate -radix unsigned /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrcount
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrfull
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrreq_int
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrreq_sync
add wave -noupdate -expand /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrreq_wr_clk
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_in
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_in_hold
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_in_sync
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_out
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_out_hold
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_out_hold_dly
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/g(0)/wr_sync/pulse_out_sync
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrusedw
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/CHECKING
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/DATA_WIDTH
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/DEPTH
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/SHOWAHEAD
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/SYNC_CLR
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/numSyncs
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/ram
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdclk
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdempty
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdreq
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rddata
add wave -noupdate -radix unsigned /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdusedw
add wave -noupdate -radix unsigned /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdcount
add wave -noupdate -expand /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/wrreq_rd_clk
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rd_addr
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rd_rst_d
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdreq_int
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdreq_rd_clk
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdreq_sync
add wave -noupdate /tb_async_fifo/c_xil_async_fifo/GEN_VENDOR/inferred_async_fifo_inst/rdreq_wr_clk
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {1492677 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 154
configure wave -valuecolwidth 76
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {3447224 ps}

View file

@ -0,0 +1,48 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/DATA_WIDTH
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/DEPTH
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/DEVICE_FAMILY
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/READ_WRITE_MODE
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/REGISTER_OUTPUT
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/clk
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/wrdata
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/wraddr
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/wren
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/rdaddr
add wave -noupdate /tb_dp_ram/c_alt_dp_ram/rddata
add wave -noupdate -divider {New Divider}
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/rddata
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/clk
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/wraddr
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/wren
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/wrdata
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/rdaddr
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(9)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(8)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(7)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(6)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(5)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(4)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(3)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(2)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(1)
add wave -noupdate /tb_dp_ram/c_xil_dp_ram/GEN_USCALE_P/dp_ram_inst/pPORT_A_rd/ram(0)
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {533818 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 178
configure wave -valuecolwidth 87
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {2337455 ps}

View file

@ -0,0 +1,73 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /tb_rw_dp_ram/ALT_DEVICE_FAMILY
add wave -noupdate /tb_rw_dp_ram/DATA_WIDTH
add wave -noupdate /tb_rw_dp_ram/DEPTH
add wave -noupdate /tb_rw_dp_ram/READ_WRITE_MODE
add wave -noupdate /tb_rw_dp_ram/REGISTER_OUTPUT
add wave -noupdate /tb_rw_dp_ram/XIL_DEVICE_FAMILY
add wave -noupdate /tb_rw_dp_ram/clk
add wave -noupdate /tb_rw_dp_ram/docheck
add wave -noupdate /tb_rw_dp_ram/addr_a
add wave -noupdate /tb_rw_dp_ram/wren_a
add wave -noupdate /tb_rw_dp_ram/wrdata_a
add wave -noupdate /tb_rw_dp_ram/alt_rddata_a
add wave -noupdate /tb_rw_dp_ram/xil_rddata_a
add wave -noupdate /tb_rw_dp_ram/addr_b
add wave -noupdate /tb_rw_dp_ram/wren_b
add wave -noupdate /tb_rw_dp_ram/wrdata_b
add wave -noupdate /tb_rw_dp_ram/alt_rddata_b
add wave -noupdate /tb_rw_dp_ram/xil_rddata_b
TreeUpdate [SetDefaultTree]
quietly WaveActivateNextPane
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/clk
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/addr_a
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/we_a
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/data_a
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/q_a
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/addr_b
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/we_b
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/data_b
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/q_b
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/addr_a_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/addr_a_sel
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/data_a_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/data_a_sel
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/we_a_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/we_a_sel
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(7)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(6)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(5)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(4)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(3)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(2)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(1)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/ram(0)
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/read_a
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/read_a_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/addr_b_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/addr_b_sel
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/data_b_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/data_b_sel
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/we_b_reg
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/we_b_sel
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/read_b
add wave -noupdate /tb_rw_dp_ram/c_xil_rw_dp_ram/GEN_USCALE_P/rw_dp_ram_inst/read_b_reg
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {321450 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 170
configure wave -valuecolwidth 98
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {2333056 ps}

View file

@ -0,0 +1,48 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /tb_sync_fifo/clk
add wave -noupdate /tb_sync_fifo/sclr
add wave -noupdate /tb_sync_fifo/wrreq
add wave -noupdate /tb_sync_fifo/wrdata
add wave -noupdate -radix unsigned -radixshowbase 0 /tb_sync_fifo/alt_usedw
add wave -noupdate /tb_sync_fifo/alt_full
add wave -noupdate /tb_sync_fifo/alt_almost_full
add wave -noupdate /tb_sync_fifo/alt_almost_empty
add wave -noupdate /tb_sync_fifo/alt_empty
add wave -noupdate /tb_sync_fifo/alt_rdreq
add wave -noupdate /tb_sync_fifo/alt_rddata
add wave -noupdate -divider {New Divider}
add wave -noupdate -radix unsigned -radixshowbase 0 /tb_sync_fifo/xil_usedw
add wave -noupdate /tb_sync_fifo/xil_full
add wave -noupdate /tb_sync_fifo/xil_almost_full
add wave -noupdate /tb_sync_fifo/xil_almost_empty
add wave -noupdate /tb_sync_fifo/xil_empty
add wave -noupdate /tb_sync_fifo/xil_rdreq
add wave -noupdate /tb_sync_fifo/xil_rddata
add wave -noupdate -divider {New Divider}
add wave -noupdate -radix unsigned /tb_sync_fifo/efx_usedw
add wave -noupdate /tb_sync_fifo/efx_almost_full
add wave -noupdate /tb_sync_fifo/efx_full
add wave -noupdate /tb_sync_fifo/efx_almost_empty
add wave -noupdate /tb_sync_fifo/efx_empty
add wave -noupdate /tb_sync_fifo/efx_rdreq
add wave -noupdate /tb_sync_fifo/efx_rddata
TreeUpdate [SetDefaultTree]
quietly WaveActivateNextPane
WaveRestoreCursors {{Cursor 1} {976402 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 182
configure wave -valuecolwidth 113
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {6233952 ps}

View file

@ -0,0 +1,6 @@
the alt_* memory components are fully configurable Altera/Intel RAMs and
FIFOs and supersede all other memory components. The others are kept here
for backwards compatibility until they can be obsoleted. No local RAMs or
FIFOs should be added to any project code. If a particular configuration
is required, but not present here, then add this and make generic so it may
be used in other projects.

View file

@ -0,0 +1,216 @@
-- megafunction wizard: %FIFO%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: dcfifo
-- ============================================================
-- File Name: alt_async_fifo.vhd
-- Megafunction Name(s):
-- dcfifo
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.all;
use work.common_pkg.all;
entity alt_async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end alt_async_fifo;
architecture syn of alt_async_fifo is
signal sub_wire0 : std_logic_vector (DATA_WIDTH-1 downto 0);
signal sub_wire1 : std_logic ;
signal sub_wire2 : std_logic ;
signal sub_wire3 : std_logic_vector (log2(DEPTH)-1 downto 0);
signal sub_wire4 : std_logic_vector (log2(DEPTH)-1 downto 0);
component dcfifo
generic (
intended_device_family : string;
lpm_numwords : natural;
lpm_showahead : string;
lpm_type : string;
lpm_width : natural;
lpm_widthu : natural;
overflow_checking : string;
rdsync_delaypipe : natural;
underflow_checking : string;
use_eab : string;
read_aclr_synch : string;
write_aclr_synch : string;
wrsync_delaypipe : natural
);
port (
aclr : in std_logic ;
data : in std_logic_vector (DATA_WIDTH-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
wrclk : in std_logic ;
wrreq : in std_logic ;
q : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
wrfull : out std_logic ;
wrusedw : out std_logic_vector(log2(DEPTH)-1 downto 0);
rdusedw : out std_logic_vector(log2(DEPTH)-1 downto 0)
);
end component;
begin
rddata <= sub_wire0;
rdempty <= sub_wire1;
wrfull <= sub_wire2;
wrusedw <= sub_wire3;
rdusedw <= sub_wire4;
dcfifo_component : dcfifo
generic map (
intended_device_family => DEVICE_FAMILY,
lpm_numwords => DEPTH,
lpm_showahead => SHOWAHEAD,
lpm_type => "dcfifo",
lpm_width => DATA_WIDTH,
lpm_widthu => log2(DEPTH),
overflow_checking => CHECKING,
underflow_checking => CHECKING,
read_aclr_synch => SYNC_CLR,
write_aclr_synch => SYNC_CLR,
use_eab => "ON",
rdsync_delaypipe => 4,
wrsync_delaypipe => 4
)
port map (
aclr => clr,
data => wrdata,
rdclk => rdclk,
rdreq => rdreq,
wrclk => wrclk,
wrreq => wrreq,
q => sub_wire0,
rdempty => sub_wire1,
wrfull => sub_wire2,
wrusedw => sub_wire3,
rdusedw => sub_wire4
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-- Retrieval info: PRIVATE: Clock NUMERIC "4"
-- Retrieval info: PRIVATE: Depth NUMERIC "64"
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
-- Retrieval info: PRIVATE: Full NUMERIC "1"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: Optimize NUMERIC "0"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
-- Retrieval info: PRIVATE: Width NUMERIC "32"
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: diff_widths NUMERIC "0"
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-- Retrieval info: PRIVATE: output_width NUMERIC "32"
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "0"
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: wsFull NUMERIC "1"
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "64"
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "32"
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "6"
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: RDSYNC_DELAYPIPE NUMERIC "4"
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
-- Retrieval info: CONSTANT: WRSYNC_DELAYPIPE NUMERIC "4"
-- Retrieval info: USED_PORT: wrdata 0 0 32 0 INPUT NODEFVAL "wrdata[31..0]"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL "rdclk"
-- Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL "rdempty"
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq"
-- Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL "wrclk"
-- Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL "wrfull"
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq"
-- Retrieval info: CONNECT: @wrdata 0 0 32 0 wrdata 0 0 32 0
-- Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-- Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @rddata 0 0 32 0
-- Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0
-- Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL async_fifo_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,204 @@
-- megafunction wizard: %FIFO%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: dcfifo_mixed_widths
-- ============================================================
-- File Name: alt_async_fifo_mixed_width.vhd
-- Megafunction Name(s):
-- dcfifo_mixed_widths
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
use work.common_pkg.all;
library altera_mf;
use altera_mf.all;
entity alt_async_fifo_mixed_width is
generic (
WDATA_WIDTH : natural range 1 to 256 := 8;
RDATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64; -- As seen at input
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (WDATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (RDATA_WIDTH-1 downto 0);
rdempty : out std_logic
);
end alt_async_fifo_mixed_width;
architecture syn of alt_async_fifo_mixed_width is
signal sub_wire0 : std_logic_vector (RDATA_WIDTH-1 downto 0);
signal sub_wire1 : std_logic ;
signal sub_wire2 : std_logic ;
component dcfifo_mixed_widths
generic (
intended_device_family : string;
lpm_numwords : natural;
lpm_showahead : string;
lpm_type : string;
lpm_width : natural;
lpm_widthu : natural;
lpm_widthu_r : natural;
lpm_width_r : natural;
overflow_checking : string;
rdsync_delaypipe : natural;
underflow_checking : string;
use_eab : string;
wrsync_delaypipe : natural
);
port (
data : in std_logic_vector (WDATA_WIDTH-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
wrclk : in std_logic ;
wrreq : in std_logic ;
q : out std_logic_vector (RDATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
wrfull : out std_logic
);
end component;
begin
rddata <= sub_wire0(RDATA_WIDTH-1 downto 0);
rdempty <= sub_wire1;
wrfull <= sub_wire2;
dcfifo_mixed_widths_component : dcfifo_mixed_widths
generic map (
intended_device_family => DEVICE_FAMILY,
lpm_numwords => DEPTH,
lpm_showahead => SHOWAHEAD,
lpm_type => "dcfifo_mixed_widths",
lpm_width => WDATA_WIDTH,
lpm_widthu => log2(DEPTH),
lpm_widthu_r => log2(DEPTH*WDATA_WIDTH/RDATA_WIDTH),
lpm_width_r => RDATA_WIDTH,
overflow_checking => CHECKING,
underflow_checking => CHECKING,
use_eab => "ON",
rdsync_delaypipe => 4,
wrsync_delaypipe => 4
)
port map (
data => wrdata,
rdclk => rdclk,
rdreq => rdreq,
wrclk => wrclk,
wrreq => wrreq,
q => sub_wire0,
rdempty => sub_wire1,
wrfull => sub_wire2
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-- Retrieval info: PRIVATE: Clock NUMERIC "4"
-- Retrieval info: PRIVATE: Depth NUMERIC "64"
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
-- Retrieval info: PRIVATE: Full NUMERIC "1"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0"
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: Optimize NUMERIC "0"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
-- Retrieval info: PRIVATE: Width NUMERIC "8"
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: diff_widths NUMERIC "1"
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-- Retrieval info: PRIVATE: output_width NUMERIC "32"
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "0"
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: wsFull NUMERIC "1"
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "64"
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo_mixed_widths"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "8"
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "6"
-- Retrieval info: CONSTANT: LPM_WIDTHU_R NUMERIC "4"
-- Retrieval info: CONSTANT: LPM_WIDTH_R NUMERIC "32"
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: RDSYNC_DELAYPIPE NUMERIC "4"
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
-- Retrieval info: CONSTANT: WRSYNC_DELAYPIPE NUMERIC "4"
-- Retrieval info: USED_PORT: wrdata 0 0 8 0 INPUT NODEFVAL "wrdata[7..0]"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL "rdclk"
-- Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL "rdempty"
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq"
-- Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL "wrclk"
-- Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL "wrfull"
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq"
-- Retrieval info: CONNECT: @wrdata 0 0 8 0 wrdata 0 0 8 0
-- Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-- Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @rddata 0 0 32 0
-- Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0
-- Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_fifo_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,201 @@
-- megafunction wizard: %RAM: 2-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: alt_dp_ram.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
use work.common_pkg.all;
entity alt_dp_ram is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
clk : in std_logic := '1';
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wraddr : in std_logic_vector (log2(DEPTH)-1 downto 0);
wren : in std_logic := '0';
rdaddr : in std_logic_vector (log2(DEPTH)-1 downto 0);
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end alt_dp_ram;
architecture syn of alt_dp_ram is
signal sub_wire0 : std_logic_vector (DATA_WIDTH-1 downto 0);
begin
rddata <= sub_wire0(DATA_WIDTH-1 downto 0);
altsyncram_component : altsyncram
generic map (
address_aclr_b => "NONE",
address_reg_b => "CLOCK0",
clock_enable_input_a => "BYPASS",
clock_enable_input_b => "BYPASS",
clock_enable_output_b => "BYPASS",
intended_device_family => DEVICE_FAMILY,
lpm_type => "altsyncram",
numwords_a => DEPTH,
numwords_b => DEPTH,
operation_mode => "DUAL_PORT",
outdata_aclr_b => "NONE",
outdata_reg_b => REGISTER_OUTPUT,
power_up_uninitialized => "FALSE",
read_during_write_mode_mixed_ports => READ_WRITE_MODE,
widthad_a => LOG2(DEPTH),
widthad_b => LOG2(DEPTH),
width_a => DATA_WIDTH,
width_b => DATA_WIDTH,
width_byteena_a => 1
)
port map (
address_a => wraddr,
address_b => rdaddr,
clock0 => clk,
data_a => wrdata,
wren_a => wren,
q_b => sub_wire0
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: ADDRESSSTALL_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTEENA_ACLR_A NUMERIC "0"
-- Retrieval info: PRIVATE: BYTEENA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE_A NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "1"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_B NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_B NUMERIC "0"
-- Retrieval info: PRIVATE: CLRdata NUMERIC "0"
-- Retrieval info: PRIVATE: CLRq NUMERIC "0"
-- Retrieval info: PRIVATE: CLRrdaddress NUMERIC "0"
-- Retrieval info: PRIVATE: CLRrren NUMERIC "0"
-- Retrieval info: PRIVATE: CLRwraddress NUMERIC "0"
-- Retrieval info: PRIVATE: CLRwren NUMERIC "0"
-- Retrieval info: PRIVATE: clk NUMERIC "0"
-- Retrieval info: PRIVATE: Clock_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clock_B NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INDATA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: INDATA_REG_B NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_B"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MEMSIZE NUMERIC "4096"
-- Retrieval info: PRIVATE: MEM_IN_BITS NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING ""
-- Retrieval info: PRIVATE: OPERATION_MODE NUMERIC "2"
-- Retrieval info: PRIVATE: OUTDATA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: OUTDATA_REG_B NUMERIC "1"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_MIXED_PORTS NUMERIC "1"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_A NUMERIC "3"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_B NUMERIC "3"
-- Retrieval info: PRIVATE: REGdata NUMERIC "1"
-- Retrieval info: PRIVATE: REGq NUMERIC "0"
-- Retrieval info: PRIVATE: REGrdaddress NUMERIC "1"
-- Retrieval info: PRIVATE: REGrren NUMERIC "1"
-- Retrieval info: PRIVATE: REGwraddress NUMERIC "1"
-- Retrieval info: PRIVATE: REGwren NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_DIFF_CLKEN NUMERIC "0"
-- Retrieval info: PRIVATE: UseDPRAM NUMERIC "1"
-- Retrieval info: PRIVATE: VarWidth NUMERIC "0"
-- Retrieval info: PRIVATE: WIDTH_READ_A NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_READ_B NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_WRITE_A NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_WRITE_B NUMERIC "32"
-- Retrieval info: PRIVATE: WRADDR_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: WRADDR_REG_B NUMERIC "0"
-- Retrieval info: PRIVATE: WRCTRL_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: enable NUMERIC "0"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: ADDRESS_ACLR_B STRING "NONE"
-- Retrieval info: CONSTANT: ADDRESS_REG_B STRING "CLOCK0"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_B STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_B STRING "BYPASS"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "128"
-- Retrieval info: CONSTANT: NUMWORDS_B NUMERIC "128"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "DUAL_PORT"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_B STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_B STRING "CLOCK0"
-- Retrieval info: CONSTANT: POWER_UP_UNINITIALIZED STRING "FALSE"
-- Retrieval info: CONSTANT: READ_DURING_WRITE_MODE_MIXED_PORTS STRING "OLD_DATA"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "7"
-- Retrieval info: CONSTANT: WIDTHAD_B NUMERIC "7"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "32"
-- Retrieval info: CONSTANT: WIDTH_B NUMERIC "32"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: clk 0 0 0 0 INPUT VCC "clk"
-- Retrieval info: USED_PORT: wrdata 0 0 32 0 INPUT NODEFVAL "wrdata[31..0]"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdaddr 0 0 7 0 INPUT NODEFVAL "rdaddr[6..0]"
-- Retrieval info: USED_PORT: wraddr 0 0 7 0 INPUT NODEFVAL "wraddr[6..0]"
-- Retrieval info: USED_PORT: wren 0 0 0 0 INPUT GND "wren"
-- Retrieval info: CONNECT: @address_a 0 0 7 0 wraddr 0 0 7 0
-- Retrieval info: CONNECT: @address_b 0 0 7 0 rdaddr 0 0 7 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clk 0 0 0 0
-- Retrieval info: CONNECT: @data_a 0 0 32 0 wrdata 0 0 32 0
-- Retrieval info: CONNECT: @wren_a 0 0 0 0 wren 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @q_b 0 0 32 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL dp_ram_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,207 @@
-- megafunction wizard: %RAM: 2-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: alt_dp_ram_mixed_width.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
use work.common_pkg.all;
entity alt_dp_ram_mixed_width is
generic (
WDATA_WIDTH : natural range 1 to 256 := 32;
RDATA_WIDTH : natural range 1 to 256 := 32;
WDEPTH : natural range 2 to 131072 := 128;
RDEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
INIT_FILE : string := ""; -- e.g "ram.mif" or "ram.hex"
INIT_FILE_LAYOUT : string := "PORT_A"; -- "PORT_A", "PORT_B"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
clk : in std_logic := '1';
wrdata : in std_logic_vector (WDATA_WIDTH-1 downto 0);
wraddr : in std_logic_vector (log2(WDEPTH)-1 downto 0);
wren : in std_logic := '0';
rdaddr : in std_logic_vector (log2(RDEPTH)-1 downto 0);
rddata : out std_logic_vector (RDATA_WIDTH-1 downto 0)
);
end alt_dp_ram_mixed_width;
architecture syn of alt_dp_ram_mixed_width is
signal sub_wire0 : std_logic_vector (RDATA_WIDTH-1 downto 0);
begin
rddata <= sub_wire0;
altsyncram_component : altsyncram
generic map (
address_aclr_b => "NONE",
address_reg_b => "CLOCK0",
clock_enable_input_a => "BYPASS",
clock_enable_input_b => "BYPASS",
clock_enable_output_b => "BYPASS",
init_file => INIT_FILE,
init_file_layout => INIT_FILE_LAYOUT,
intended_device_family => DEVICE_FAMILY,
lpm_type => "altsyncram",
numwords_a => WDEPTH,
numwords_b => RDEPTH,
operation_mode => "DUAL_PORT",
outdata_aclr_b => "NONE",
outdata_reg_b => REGISTER_OUTPUT,
power_up_uninitialized => "FALSE",
read_during_write_mode_mixed_ports => READ_WRITE_MODE,
widthad_a => LOG2(WDEPTH),
widthad_b => LOG2(RDEPTH),
width_a => WDATA_WIDTH,
width_b => RDATA_WIDTH,
width_byteena_a => 1
)
port map (
address_a => wraddr,
address_b => rdaddr,
clock0 => clk,
data_a => wrdata,
wren_a => wren,
q_b => sub_wire0
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: ADDRESSSTALL_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTEENA_ACLR_A NUMERIC "0"
-- Retrieval info: PRIVATE: BYTEENA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE_A NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "1"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_B NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_B NUMERIC "0"
-- Retrieval info: PRIVATE: CLRdata NUMERIC "0"
-- Retrieval info: PRIVATE: CLRq NUMERIC "0"
-- Retrieval info: PRIVATE: CLRrdaddress NUMERIC "0"
-- Retrieval info: PRIVATE: CLRrren NUMERIC "0"
-- Retrieval info: PRIVATE: CLRwraddress NUMERIC "0"
-- Retrieval info: PRIVATE: CLRwren NUMERIC "0"
-- Retrieval info: PRIVATE: clk NUMERIC "0"
-- Retrieval info: PRIVATE: Clock_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clock_B NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INDATA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: INDATA_REG_B NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_B"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MEMSIZE NUMERIC "4096"
-- Retrieval info: PRIVATE: MEM_IN_BITS NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING ""
-- Retrieval info: PRIVATE: OPERATION_MODE NUMERIC "2"
-- Retrieval info: PRIVATE: OUTDATA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: OUTDATA_REG_B NUMERIC "1"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_MIXED_PORTS NUMERIC "1"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_A NUMERIC "3"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_B NUMERIC "3"
-- Retrieval info: PRIVATE: REGdata NUMERIC "1"
-- Retrieval info: PRIVATE: REGq NUMERIC "0"
-- Retrieval info: PRIVATE: REGrdaddress NUMERIC "1"
-- Retrieval info: PRIVATE: REGrren NUMERIC "1"
-- Retrieval info: PRIVATE: REGwraddress NUMERIC "1"
-- Retrieval info: PRIVATE: REGwren NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_DIFF_CLKEN NUMERIC "0"
-- Retrieval info: PRIVATE: UseDPRAM NUMERIC "1"
-- Retrieval info: PRIVATE: VarWidth NUMERIC "0"
-- Retrieval info: PRIVATE: WIDTH_READ_A NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_READ_B NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_WRITE_A NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_WRITE_B NUMERIC "32"
-- Retrieval info: PRIVATE: WRADDR_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: WRADDR_REG_B NUMERIC "0"
-- Retrieval info: PRIVATE: WRCTRL_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: enable NUMERIC "0"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: ADDRESS_ACLR_B STRING "NONE"
-- Retrieval info: CONSTANT: ADDRESS_REG_B STRING "CLOCK0"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_B STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_B STRING "BYPASS"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "128"
-- Retrieval info: CONSTANT: NUMWORDS_B NUMERIC "128"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "DUAL_PORT"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_B STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_B STRING "CLOCK0"
-- Retrieval info: CONSTANT: POWER_UP_UNINITIALIZED STRING "FALSE"
-- Retrieval info: CONSTANT: READ_DURING_WRITE_MODE_MIXED_PORTS STRING "OLD_DATA"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "7"
-- Retrieval info: CONSTANT: WIDTHAD_B NUMERIC "7"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "32"
-- Retrieval info: CONSTANT: WIDTH_B NUMERIC "32"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: clk 0 0 0 0 INPUT VCC "clk"
-- Retrieval info: USED_PORT: wrdata 0 0 32 0 INPUT NODEFVAL "wrdata[31..0]"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdaddr 0 0 7 0 INPUT NODEFVAL "rdaddr[6..0]"
-- Retrieval info: USED_PORT: wraddr 0 0 7 0 INPUT NODEFVAL "wraddr[6..0]"
-- Retrieval info: USED_PORT: wren 0 0 0 0 INPUT GND "wren"
-- Retrieval info: CONNECT: @address_a 0 0 7 0 wraddr 0 0 7 0
-- Retrieval info: CONNECT: @address_b 0 0 7 0 rdaddr 0 0 7 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clk 0 0 0 0
-- Retrieval info: CONNECT: @data_a 0 0 32 0 wrdata 0 0 32 0
-- Retrieval info: CONNECT: @wren_a 0 0 0 0 wren 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @q_b 0 0 32 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL dp_ram_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,234 @@
-- megafunction wizard: %FIFO%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: scfifo
-- ============================================================
-- File Name: alt_sync_fifo.vhd
-- Megafunction Name(s):
-- scfifo
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.all;
use work.common_pkg.all;
entity alt_sync_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end alt_sync_fifo;
architecture syn of alt_sync_fifo is
signal sub_wire0 : std_logic ;
signal sub_wire1 : std_logic ;
signal sub_wire2 : std_logic ;
signal sub_wire3 : std_logic ;
signal sub_wire4 : std_logic_vector (DATA_WIDTH-1 downto 0);
signal sub_wire5 : std_logic_vector (log2(DEPTH)-1 downto 0);
component scfifo
generic (
add_ram_output_register : string;
almost_empty_value : natural;
almost_full_value : natural;
intended_device_family : string;
lpm_numwords : natural;
lpm_showahead : string;
lpm_type : string;
lpm_width : natural;
lpm_widthu : natural;
overflow_checking : string;
underflow_checking : string;
use_eab : string
);
port (
aclr : in std_logic ;
clock : in std_logic ;
data : in std_logic_vector (DATA_WIDTH-1 downto 0);
rdreq : in std_logic ;
sclr : in std_logic ;
wrreq : in std_logic ;
almost_empty : out std_logic ;
almost_full : out std_logic ;
empty : out std_logic ;
full : out std_logic ;
q : out std_logic_vector (DATA_WIDTH-1 downto 0);
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
begin
almost_empty <= sub_wire0;
almost_full <= sub_wire1;
empty <= sub_wire2;
full <= sub_wire3;
rddata <= sub_wire4(DATA_WIDTH-1 downto 0);
usedw <= sub_wire5(log2(DEPTH)-1 downto 0);
scfifo_component : scfifo
generic map (
add_ram_output_register => REGISTER_OUTPUT,
almost_empty_value => NEARLY_EMPTY,
almost_full_value => NEARLY_FULL,
intended_device_family => DEVICE_FAMILY,
lpm_numwords => DEPTH,
lpm_showahead => SHOWAHEAD,
lpm_type => "scfifo",
lpm_width => DATA_WIDTH,
lpm_widthu => log2(DEPTH),
overflow_checking => CHECKING,
underflow_checking => CHECKING,
use_eab => "ON"
)
port map (
aclr => not rst_n,
clock => clk,
data => wrdata,
rdreq => rdreq,
sclr => sclr,
wrreq => wrreq,
almost_empty => sub_wire0,
almost_full => sub_wire1,
empty => sub_wire2,
full => sub_wire3,
q => sub_wire4,
usedw => sub_wire5
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "2"
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "1"
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "32"
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-- Retrieval info: PRIVATE: clk NUMERIC "0"
-- Retrieval info: PRIVATE: Depth NUMERIC "64"
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
-- Retrieval info: PRIVATE: Full NUMERIC "1"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: Optimize NUMERIC "1"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
-- Retrieval info: PRIVATE: Width NUMERIC "32"
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: diff_widths NUMERIC "0"
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-- Retrieval info: PRIVATE: output_width NUMERIC "32"
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "1"
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "1"
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: wsFull NUMERIC "1"
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "ON"
-- Retrieval info: CONSTANT: ALMOST_EMPTY_VALUE NUMERIC "2"
-- Retrieval info: CONSTANT: ALMOST_FULL_VALUE NUMERIC "32"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "64"
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "32"
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "6"
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
-- Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT NODEFVAL "aclr"
-- Retrieval info: USED_PORT: almost_empty 0 0 0 0 OUTPUT NODEFVAL "almost_empty"
-- Retrieval info: USED_PORT: almost_full 0 0 0 0 OUTPUT NODEFVAL "almost_full"
-- Retrieval info: USED_PORT: clk 0 0 0 0 INPUT NODEFVAL "clk"
-- Retrieval info: USED_PORT: wrdata 0 0 32 0 INPUT NODEFVAL "wrdata[31..0]"
-- Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL "empty"
-- Retrieval info: USED_PORT: full 0 0 0 0 OUTPUT NODEFVAL "full"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq"
-- Retrieval info: USED_PORT: sclr 0 0 0 0 INPUT NODEFVAL "sclr"
-- Retrieval info: USED_PORT: usedw 0 0 6 0 OUTPUT NODEFVAL "usedw[5..0]"
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq"
-- Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0
-- Retrieval info: CONNECT: @clk 0 0 0 0 clk 0 0 0 0
-- Retrieval info: CONNECT: @wrdata 0 0 32 0 wrdata 0 0 32 0
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-- Retrieval info: CONNECT: @sclr 0 0 0 0 sclr 0 0 0 0
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-- Retrieval info: CONNECT: almost_empty 0 0 0 0 @almost_empty 0 0 0 0
-- Retrieval info: CONNECT: almost_full 0 0 0 0 @almost_full 0 0 0 0
-- Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0
-- Retrieval info: CONNECT: full 0 0 0 0 @full 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @rddata 0 0 32 0
-- Retrieval info: CONNECT: usedw 0 0 6 0 @usedw 0 0 6 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_sync_fifo.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_sync_fifo.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_sync_fifo.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_sync_fifo.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL try_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,196 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Inferred RAM Async FIFO, modified from Damians in Firmware/Common
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
entity inferred_async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end inferred_async_fifo;
architecture rtl OF inferred_async_fifo is
constant numSyncs : integer := 14; -- need 14 for approx 2:1 write clock faster than read clock
type memory_t is array (DEPTH-1 downto 0) of std_logic_vector (DATA_WIDTH-1 downto 0) ;
signal ram : memory_t := (others => (others => '0')); -- make simulation same as Altera
attribute syn_ramstyle: string;
attribute syn_ramstyle of ram : signal is "block_ram";
-----------------------------------------------------------------------------
-- Internal signal declarations
-----------------------------------------------------------------------------
signal wrreq_int : std_logic;
signal rdreq_int : std_logic;
signal rd_addr, wr_addr : unsigned(log2(DEPTH-1)-1 downto 0);
signal wrcount : integer range 0 to DEPTH;
signal rdcount : integer range 0 to DEPTH;
signal wrreq_sync : integer range 0 to numSyncs-1;
signal rdreq_sync : integer range 0 to numSyncs-1;
signal wrreq_wr_clk : std_logic_vector(numSyncs-1 downto 0);
signal wrreq_rd_clk : std_logic_vector(numSyncs-1 downto 0);
signal rdreq_rd_clk : std_logic_vector(numSyncs-1 downto 0);
signal rdreq_wr_clk : std_logic_vector(numSyncs-1 downto 0);
signal wr_rst_d, rd_rst_d : std_logic_vector(1 downto 0) := (others => '1');
function count_bits(bits : std_logic_vector) return integer is
variable count : integer range 0 to numSyncs-1;
begin
count := 0;
for i in bits'range loop
if bits(i) = '1' then
count := count + 1;
end if;
end loop;
return count;
end function count_bits;
begin
wrreq_int <= wrreq when wrfull = '0' else '0';
rdreq_int <= rdreq when rdempty = '0' else '0';
wrfull <= '1' when (wrcount = DEPTH) else '0';
rdempty <= '1' when (rdcount = 0) else '0';
wrusedw <= std_logic_vector(to_unsigned(wrcount, wrusedw'high+1));
rdusedw <= std_logic_vector(to_unsigned(rdcount, rdusedw'high+1));
-- cross domain
wr_rst_d <= wr_rst_d(0) & clr when rising_edge(wrclk);
rd_rst_d <= rd_rst_d(0) & clr when rising_edge(rdclk);
-- pragma translate_off
assert not(wrfull = '1' and rising_edge(wrreq_int))
report "Tried to Write while full" severity warning;
assert not (rdempty = '1' and rising_edge(rdreq_int))
report "Tried to Read while empty" severity warning;
-- pragma translate_on
-----------------------------------------------------------------------------
-- WRITING:
-- Increments the Write Pointer
-- No protection against overflow
-----------------------------------------------------------------------------
g : for i in 0 to numSyncs-1 generate
wr_sync : entity work.sync_pulse
port map (clk_in => wrclk, rst_n => not wr_rst_d(1), pulse_in => wrreq_wr_clk(i),
clk_out => rdclk, pulse_out => wrreq_rd_clk(i));
wrreq_wr_clk(i) <= wrreq_int when wrreq_sync = i else '0';
rd_sync : entity work.sync_pulse
port map (clk_in => rdclk, rst_n => not rd_rst_d(1), pulse_in => rdreq_rd_clk(i),
clk_out => wrclk, pulse_out => rdreq_wr_clk(i));
rdreq_rd_clk(i) <= rdreq_int when rdreq_sync = i else '0';
end generate;
writing : process (wrclk, wr_rst_d(1))
begin -- process writing
if wr_rst_d(1) = '1' then
wr_addr <= (others => '0');
wrcount <= 0;
wrreq_sync <= 0;
elsif rising_edge(wrclk) then
if wrreq_int = '1' then
-- increment pointer
wr_addr <= wr_addr + 1;
if wrreq_sync = numSyncs-1 then
wrreq_sync <= 0;
else
wrreq_sync <= wrreq_sync + 1;
end if;
end if;
if wrreq_int = '1' then
wrcount <= wrcount - count_bits(rdreq_wr_clk) + 1;
else
wrcount <= wrcount - count_bits(rdreq_wr_clk) + 0;
end if;
end if;
end process writing;
-----------------------------------------------------------------------------
-- READING:
-- Increments Read Pointer
-----------------------------------------------------------------------------
reading : process (rdclk, rd_rst_d(1))
begin -- process reading
if rd_rst_d(1) = '1' then
rd_addr <= (others => '0');
rdcount <= 0;
rdreq_sync <= 0;
elsif rising_edge(rdclk) then
if rdreq_int = '1' then
rd_addr <= rd_addr + 1;
if rdreq_sync = numSyncs-1 then
rdreq_sync <= 0;
else
rdreq_sync <= rdreq_sync + 1;
end if;
end if;
if rdreq_int = '1' then
rdcount <= rdcount + count_bits(wrreq_rd_clk) - 1;
else
rdcount <= rdcount + count_bits(wrreq_rd_clk) + 0;
end if;
end if;
end process reading;
--dout_valid <= dout_valid_int;
ram_wr : process (wrclk) is
begin
if rising_edge(wrclk) then
if wrreq_int = '1' then
ram(to_integer(wr_addr)) <= wrdata;
end if;
end if;
end process ram_wr;
--ram_rd : process (rdclk) is
--begin
--if rising_edge(rdclk) then
rddata <= ram(to_integer(rd_addr));
--end if;
--end process ram_rd;
end rtl;

View file

@ -0,0 +1,138 @@
-------------------------------------------------------------------------------
-- Title : dpram_sclk
-- Project : Dual-Port, single clock RAM
-------------------------------------------------------------------------------
-- File : inferred_dpram.vhd
-- Author : DCS
-- Company : Global Inkjet Systems
-- Created : 2022-07-20
-- Last update:
-- SVN ID : Git
-- Standard : VHDL'2008
-------------------------------------------------------------------------------
-- Description:
-- True Dual-Port, single clock RAM
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
entity inferred_dpram is
generic(
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_ADDRA : string := "UNREGISTERED"; -- "CLOCK0"
REGISTER_ADDRB : string := "UNREGISTERED"; -- "CLOCK0"
REGISTER_OUTPUTA : string := "UNREGISTERED"; -- "CLOCK0"
REGISTER_OUTPUTB : string := "UNREGISTERED"; -- "CLOCK0"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Ultrascale+"
);
port(
clk : in std_logic;
-- Port-A
addr_a : in std_logic_vector(log2(DEPTH)-1 downto 0);
we_a : in std_logic := '0';
data_a : in std_logic_vector(DATA_WIDTH-1 downto 0) := (others => '0');
q_a : out std_logic_vector(DATA_WIDTH-1 downto 0);
-- Port-B
addr_b : in std_logic_vector(log2(DEPTH)-1 downto 0);
we_b : in std_logic := '0';
data_b : in std_logic_vector(DATA_WIDTH-1 downto 0) := (others => '0');
q_b : out std_logic_vector(DATA_WIDTH-1 downto 0));
end inferred_dpram;
architecture rtl of inferred_dpram is
-- Build a 2-D array type for the RAM
subtype word_t is std_logic_vector(DATA_WIDTH-1 downto 0);
type memory_t is array(DEPTH-1 downto 0) of word_t;
-- Declare the RAM
shared variable ram : memory_t := (others => (others => '0')); -- Must Init to zero or avs_seq_reads don't work.
signal addr_a_reg : std_logic_vector(log2(DEPTH)-1 downto 0);
signal addr_a_sel : std_logic_vector(log2(DEPTH)-1 downto 0);
signal data_a_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
signal data_a_sel : std_logic_vector(DATA_WIDTH-1 downto 0);
signal we_a_reg : std_logic;
signal we_a_sel : std_logic;
signal read_a : std_logic_vector(DATA_WIDTH-1 downto 0);
signal read_a_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
signal addr_b_reg : std_logic_vector(log2(DEPTH)-1 downto 0);
signal addr_b_sel : std_logic_vector(log2(DEPTH)-1 downto 0);
signal data_b_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
signal data_b_sel : std_logic_vector(DATA_WIDTH-1 downto 0);
signal we_b_reg : std_logic;
signal we_b_sel : std_logic;
signal read_b : std_logic_vector(DATA_WIDTH-1 downto 0);
signal read_b_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
begin
-- Port A
pPORT_A_wr : process(clk)
begin
if(clk = '1' and clk'event) then
if(we_a_sel = '1') then
ram(to_integer(unsigned(addr_a_sel))) := data_a_sel;
end if;
addr_a_reg <= addr_a;
data_a_reg <= data_a;
we_a_reg <= we_a;
end if;
end process;
addr_a_sel <= addr_a_reg when ((REGISTER_ADDRA = "CLOCK0") or (REGISTER_ADDRA = "CLOCK1")) else addr_a;
data_a_sel <= data_a_reg when ((REGISTER_ADDRA = "CLOCK0") or (REGISTER_ADDRA = "CLOCK1")) else data_a;
we_a_sel <= we_a_reg when ((REGISTER_ADDRA = "CLOCK0") or (REGISTER_ADDRA = "CLOCK1")) else we_a;
q_a <= read_a_reg when ((REGISTER_OUTPUTA = "CLOCK0") or (REGISTER_OUTPUTA = "CLOCK1")) else read_a;
pPORT_A_rd : process(clk)
begin
if(clk = '1' and clk'event) then
if (we_a_sel = '1') and READ_WRITE_MODE = "OLD_DATA" then
-- hold old data
else
read_a <= ram(to_integer(unsigned(addr_a_sel)));
end if;
read_a_reg <= read_a;
end if;
end process;
-- Port B
pPORT_B_wr : process(clk)
begin
if(clk = '1' and clk'event) then
if(we_b_sel = '1') then
ram(to_integer(unsigned(addr_b_sel))) := data_b_sel;
end if;
addr_b_reg <= addr_b;
data_b_reg <= data_b;
we_b_reg <= we_b;
end if;
end process;
addr_b_sel <= addr_b_reg when ((REGISTER_ADDRB = "CLOCK0") or (REGISTER_ADDRB = "CLOCK1")) else addr_b;
data_b_sel <= data_b_reg when ((REGISTER_ADDRB = "CLOCK0") or (REGISTER_ADDRB = "CLOCK1")) else data_b;
we_b_sel <= we_b_reg when ((REGISTER_ADDRB = "CLOCK0") or (REGISTER_ADDRB = "CLOCK1")) else we_b;
q_b <= read_b_reg when ((REGISTER_OUTPUTB = "CLOCK0") or (REGISTER_OUTPUTB = "CLOCK1")) else read_b;
pPORT_B_rd : process(clk)
begin
if(clk = '1' and clk'event) then
if (we_b_sel = '1') and READ_WRITE_MODE = "OLD_DATA" then
-- hold old data
else
read_b <= ram(to_integer(unsigned(addr_b_sel)));
end if;
read_b_reg <= read_b;
end if;
end process;
end rtl;

View file

@ -0,0 +1,203 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Inferred RAM Sync FIFO
library ieee;
use ieee.std_logic_1164.all;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
-- ****** REGISTER_OUTPUT : string := "ON"; -- "OFF"
-- never used in all current instances. Doesn't seem to make any difference to Altera sim dcs
-- Note usedw goes to 0 when fifo is full. This is the same as Altera
entity inferred_sync_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end inferred_sync_fifo;
architecture rtl OF inferred_sync_fifo is
type memory_t is array (DEPTH-1 downto 0) of std_logic_vector (DATA_WIDTH-1 downto 0) ;
signal ram : memory_t := (others => (others => '0')); -- make simulation same as Altera
signal wr_addr : integer range 0 to DEPTH-1;
signal rd_addr : integer range 0 to DEPTH-1;
signal rd_addr_reg : integer range 0 to DEPTH-1;
signal count : integer range 0 to DEPTH;
signal empty_int : std_logic;
signal empty_d : std_logic;
begin
usedw <= std_logic_vector(to_unsigned(count, usedw'high+1));
PROC_WRITE : process(rst_n, clk)
begin
if rst_n = '0' then
elsif(clk'event and clk = '1') then
if(wrreq = '1') and full = '0' and sclr = '0' then
ram(wr_addr) <= wrdata;
end if;
end if;
end process;
PROC_READ : process(rst_n, clk)
begin
if rst_n = '0' then
rddata <= (others => '0');
elsif(clk'event and clk = '1') then
if sclr = '1' then
rddata <= (others => '0');
elsif SHOWAHEAD = "ON" then
rddata <= ram(rd_addr);
elsif rdreq = '1' then
rddata <= ram(rd_addr_reg);
end if;
end if;
end process;
PROC_WR_ADDR : process(rst_n, clk)
begin
if rst_n = '0' then
wr_addr <= 0;
elsif(clk'event and clk = '1') then
if sclr = '1' then
wr_addr <= 0;
elsif wrreq = '1' then -- write
if full = '0' then
if wr_addr = DEPTH-1 then
wr_addr <= 0;
else
wr_addr <= wr_addr + 1;
end if;
end if;
end if;
end if;
end process;
PROC_RD_ADDR : process(all)
begin
if rst_n = '0' then
rd_addr <= 0;
elsif sclr = '1' then
rd_addr <= 0;
elsif rdreq = '1' then -- read
if empty = '0' then
if rd_addr_reg = DEPTH-1 then
rd_addr <= 0;
else
rd_addr <= rd_addr_reg + 1;
end if;
else
rd_addr <= rd_addr_reg;
end if;
else
rd_addr <= rd_addr_reg;
end if;
end process;
PROC_ADDR_REG : process(rst_n, clk)
begin
if rst_n = '0' then
rd_addr_reg <= 0;
elsif(clk'event and clk = '1') then
rd_addr_reg <= rd_addr;
end if;
end process;
PROC_FLAGS : process(rst_n, clk)
begin
if rst_n = '0' then
count <= 0;
full <= '0';
empty_int <= '1';
empty_d <= '1';
almost_full <= '0';
almost_empty <= '1';
elsif(clk'event and clk = '1') then
empty_d <= empty_int;
if sclr = '1' then
count <= 0;
full <= '0';
empty_int <= '1';
almost_full <= '0';
almost_empty <= '1';
elsif wrreq = '1' and rdreq = '0' then -- Count goes up by 1
if full = '0' then
count <= count + 1;
if count = DEPTH-1 then
full <= '1';
end if;
if (NEARLY_FULL-1) = count then
almost_full <= '1';
end if;
end if;
if (NEARLY_EMPTY-1) = count then
almost_empty <= '0';
end if;
empty_int <= '0';
elsif wrreq = '0' and rdreq = '1' then
if empty_int = '0' then
count <= count - 1;
if count = 1 then
empty_int <= '1';
end if;
end if;
if NEARLY_EMPTY = count then
almost_empty <= '1';
end if;
if NEARLY_FULL = count then
almost_full <= '0';
end if;
full <= '0';
end if;
end if;
end process;
ASSERT_PROC : process(clk)
begin
assert DEPTH > 1
report "**** Config error Fifo Depth must be grester than 1!"
severity error;
end process;
empty <= empty_int or empty_d when SHOWAHEAD = "ON" else empty_int; -- delay going not empty to match Altera when SHOWAHEAD
end rtl;

View file

@ -0,0 +1,288 @@
-------------------------------------------------------------------------------
-- Title : queue_and_delay_1
-- Project : project independent
-------------------------------------------------------------------------------
-- File : queue_and_delay_1.vhd
-- Author : Gianmarco Girau
-- Company : Global Inkjet Systems
-- Created : 2016-05-28
-- Last update: 2019-11-18
-- SVN ID : Git
-- Standard : VHDL'93
-------------------------------------------------------------------------------
-- Description:
-- Generic component implementing a queue and delay functionality: Apply a
-- static programmable delay to the input signal. Since the block is FIFO based
-- (2048 words), the user must make sure that the number of transitions on the
-- input signal happening within the programmed delay is lower than the size of the FIFO.
-- E.g.: if the user program a delay of 2 ms, the input signal must have less
-- than 1024 pulses in 2 ms => max pulse rate = 512kHz. The block rises the
-- error bit when this condition is violated.
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.common_pkg.all;
entity queue_and_delay_1 is
generic(
DELAY_WIDTH : integer range 8 to 32 := 32;
USE_EXT_TIME : boolean := false;
QUEUE_SIZE : natural range 16 to 8192 := 1024;
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port (
rstN : in std_logic;
clk : in std_logic;
init : in std_logic;
cnt_dir : in std_logic; -- specify the direction of the cnt (0 => up, 1
-- => down), when use_ext_time is set to true
delay : in std_logic_vector(DELAY_WIDTH-1 downto 0);
ext_time : in std_logic_vector(31 downto 0);
wave_in : in std_logic;
wave_out : out std_logic;
no_edge_detect : in std_logic := '0';
ovf_error : out std_logic);
end queue_and_delay_1;
architecture RTL of queue_and_delay_1 is
component sync_fifo
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port (
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
signal toggle_in, toggle_out,time_elapsed : std_logic;
signal wave_in_d, wave_out_i, pending_trans : std_logic;
signal fifo_rd_en, fifo_empty, fifo_full : std_logic;
signal cnt_dir_i, wave_out_i_d, new_event : std_logic;
signal wave_out_ii, shf_enable, ext_msb : std_logic;
signal delay_line : std_logic_vector( 7 downto 0);
signal int_time, local_time_d, event_time : std_logic_vector(31 downto 0);
signal diff_time, time_entry : std_logic_vector(31 downto 0);
begin -- RTL
-----------------------------------------------------------------------------
-- Detect transitions in the input signal and memorize those events in a
-- FIFO, together with a timetag. This process can be seen as a representation
-- of the input signal in a compressed format.
-----------------------------------------------------------------------------
toggle_in <= '1' when wave_in /= wave_in_d else '0';
pInputEdgeDetect : process(clk)
begin
if(clk = '1' and clk'event) then
wave_in_d <= wave_in;
end if;
end process pInputEdgeDetect;
iENTRY_QUEUE: sync_fifo
generic map(
DATA_WIDTH => 32,
DEPTH => QUEUE_SIZE,
REGISTER_OUTPUT => "OFF",
DEVICE_FAMILY => DEVICE_FAMILY,
SHOWAHEAD => "OFF"
)
port map (
clk => clk,
wrdata => time_entry,
rdreq => fifo_rd_en,
sclr => init,
wrreq => toggle_in,
empty => fifo_empty,
full => fifo_full,
rddata => event_time,
usedw => open
);
-- Check Overflow error:
pCHECK_OVF : process(rstN, clk)
begin
if(rstN = '0') then
ovf_error <= '0';
elsif(clk = '1' and clk'event) then
if(init = '1') then
ovf_error <= '0';
elsif(toggle_in = '1' and fifo_full = '1') then
ovf_error <= '1';
end if;
end if;
end process pCHECK_OVF;
-- Time reference: either use the external one or generate it locally
gTIME_REF0: if USE_EXT_TIME = true generate
int_time <= ext_time;
shf_enable <= '1' when int_time /= local_time_d else '0';
pTimeElapsed : process(clk)
begin
if(clk = '1' and clk'event) then
if(cnt_dir_i = '0') then
time_entry <= std_logic_vector(signed(int_time) + signed(delay));
else
time_entry <= std_logic_vector(signed(int_time) - signed(delay) + 1);
end if;
local_time_d <= int_time;
cnt_dir_i <= cnt_dir;
if(cnt_dir_i = '0') then
time_elapsed <= not diff_time(diff_time'left);
else
time_elapsed <= diff_time(diff_time'left);
end if;
new_event <= fifo_rd_en;
end if;
end process pTimeElapsed;
diff_time <= std_logic_vector(signed(ext_time)-signed(event_time));
end generate gTIME_REF0;
gTIME_REF1: if USE_EXT_TIME = false generate
pGEN_LOC_REF : process(rstN, clk)
begin
if(rstN = '0') then
int_time <= (others => '0');
elsif(clk = '1' and clk'event) then
if(init = '1') then
int_time <= (others => '0');
else
int_time <= std_logic_vector(unsigned(int_time)+1);
end if;
end if;
end process pGEN_LOC_REF;
new_event <= fifo_rd_en;
pTimeElapsed : process(clk)
begin
if(clk = '1' and clk'event) then
time_entry <= std_logic_vector(signed(int_time) + signed(delay));
end if;
end process pTimeElapsed;
diff_time <= std_logic_vector(unsigned(int_time)-unsigned(event_time));
time_elapsed <= '1' when diff_time(diff_time'left) = '0' else '0';
shf_enable <= '1';
end generate gTIME_REF1;
-----------------------------------------------------------------------------
-- Delay the input signal
-----------------------------------------------------------------------------
-- Read the signal transitions recorded in the FIFO, apply the static delay
pDELAY_WAVE_GEN : process(clk)
begin
if(clk = '1' and clk'event) then
if(init = '1' or (time_elapsed = '1' and new_event = '0')) then
pending_trans <= '0';
elsif(new_event = '1') then
pending_trans <= '1';
end if;
if(pending_trans = '0' and fifo_empty = '0' and fifo_rd_en = '0' and new_event = '0') then
fifo_rd_en <= '1';
else
fifo_rd_en <= '0';
end if;
end if;
end process pDELAY_WAVE_GEN;
pGEN_OUT : process(rstN, clk)
begin
if(rstN = '0') then
wave_out_i <= '0';
elsif(clk = '1' and clk'event) then
if(init = '1') then
wave_out_i <= wave_in_d;
elsif(toggle_out = '1') then
wave_out_i <= not wave_out_i;
end if;
end if;
end process pGEN_OUT;
-- Because of the intrinsic latency with the FIFO, a shift register is used
-- to achieve small delays (< 8).
pDELAY_THROUGH_SHF : process(clk)
begin
if(clk = '1' and clk'event) then
if(shf_enable = '1') then
delay_line <= delay_line(6 downto 0) & wave_in;
end if;
end if;
end process pDELAY_THROUGH_SHF;
toggle_out <= time_elapsed and pending_trans;
-- When using the external counter, the input signal might have multiple rising and
-- falling events whitout a change a value in the counter. When this happens,
-- the pulse width is not properly replicated in the output of the delay
-- block. To make the behaviour more predictable, when using the external
-- counter, a positive edge detector is inserted at the output.
gOUT_GEN0: if use_ext_time = false generate
wave_out_ii <= wave_out_i when unsigned(delay) >= 8 else delay_line(to_integer(unsigned(delay(2 downto 0))));
pOUT_GEN0: process(clk)
begin
if(clk = '1' and clk'event) then
wave_out <= wave_out_ii;
end if;
end process pOUT_GEN0;
end generate gOUT_GEN0;
gOUT_GEN1: if use_ext_time = true generate
pOUT_GEN1: process(clk)
begin
if(clk = '1' and clk'event) then
wave_out_i_d <= wave_out_i;
if(no_edge_detect = '0') then
wave_out <= wave_out_i and not wave_out_i_d;
else
wave_out <= wave_out_i;
end if;
end if;
end process pOUT_GEN1;
end generate gOUT_GEN1;
end RTL;

View file

@ -0,0 +1,222 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.common_pkg.all;
use work.vendor_pkg.all;
entity async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end async_fifo;
architecture struct of async_fifo is
--{{{
component alt_async_fifo
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
--}}}
--{{{
component efx_fifo is
generic (
FAMILY : string := "TRION";
SYNC_CLK : integer := 0;
BYPASS_RESET_SYNC : integer := 0;
SYNC_STAGE : integer := 2;
MODE : string := "FWFT"; -- STANDARD
DEPTH : integer := 512;
DATA_WIDTH : integer := 16;
PIPELINE_REG : integer := 0;
OPTIONAL_FLAGS : integer := 0;
OUTPUT_REG : integer := 1;
PROGRAMMABLE_FULL : string := "NONE";
PROG_FULL_ASSERT : integer := 128;
PROG_FULL_NEGATE : integer := 128;
PROGRAMMABLE_EMPTY : string := "NONE";
PROG_EMPTY_ASSERT : integer := 0;
PROG_EMPTY_NEGATE : integer := 2;
ASYM_WIDTH_RATIO : integer := 4 -- 1:1
);
port (
full_o : out std_logic;
empty_o : out std_logic;
rdata : out std_logic_vector(DATA_WIDTH-1 downto 0);
wr_clk_i : in std_logic;
rd_clk_i : in std_logic;
wr_en_i : in std_logic;
rd_en_i : in std_logic;
wdata : in std_logic_vector(DATA_WIDTH-1 downto 0);
wr_datacount_o : out std_logic_vector(log2(DEPTH) downto 0);
rst_busy : out std_logic;
rd_datacount_o : out std_logic_vector(log2(DEPTH) downto 0);
clk_i : in std_logic := '0';
a_wr_rst_i : in std_logic := '0';
a_rd_rst_i : in std_logic := '0';
a_rst_i : in std_logic
);
end component;
--}}}
--{{{
component inferred_async_fifo
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
--}}}
signal wr_datacount_o : std_logic_vector(log2(DEPTH) downto 0);
signal rd_datacount_o : std_logic_vector(log2(DEPTH) downto 0);
begin
GEN_VENDOR : if IS_ALTERA(DEVICE_FAMILY) generate
alt_async_fifo_inst : alt_async_fifo
generic map(
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
DEVICE_FAMILY => DEVICE_FAMILY,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING,
SYNC_CLR => SYNC_CLR
)
port map(
clr => clr,
wrclk => wrclk,
wrreq => wrreq,
wrdata => wrdata,
wrfull => wrfull,
wrusedw => wrusedw,
rdclk => rdclk,
rdreq => rdreq,
rddata => rddata,
rdempty => rdempty,
rdusedw => rdusedw);
elsif IS_EFINIX(DEVICE_FAMILY) generate
efx_async_fifo_inst : efx_fifo
generic map (
SYNC_CLK => 0,
MODE => EFX_MODE(SHOWAHEAD),
OUTPUT_REG => 0,
DEPTH => DEPTH,
DATA_WIDTH => DATA_WIDTH
)
port map (
full_o => wrfull,
empty_o => rdempty,
rdata => rddata,
wr_clk_i => wrclk,
rd_clk_i => rdclk,
wr_en_i => wrreq,
rd_en_i => rdreq,
wdata => wrdata,
wr_datacount_o => wr_datacount_o,
rd_datacount_o => rd_datacount_o,
rst_busy => open,
a_rst_i => clr
);
wrusedw <= wr_datacount_o(wrusedw'range);
rdusedw <= rd_datacount_o(rdusedw'range) when rdempty = '0' else (others => '0'); -- rdused is quicker than empty
else generate
inferred_async_fifo_inst : inferred_async_fifo
generic map(
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING,
SYNC_CLR => SYNC_CLR
)
port map(
clr => clr,
wrclk => wrclk,
wrreq => wrreq,
wrdata => wrdata,
wrfull => wrfull,
wrusedw => wrusedw,
rdclk => rdclk,
rdreq => rdreq,
rddata => rddata,
rdempty => rdempty,
rdusedw => rdusedw);
end generate;
end struct;

View file

@ -0,0 +1,204 @@
-- megafunction wizard: %FIFO%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: dcfifo_mixed_widths
-- ============================================================
-- File Name: alt_async_fifo_mixed_width.vhd
-- Megafunction Name(s):
-- dcfifo_mixed_widths
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
use work.common_pkg.all;
library altera_mf;
use altera_mf.all;
entity alt_async_fifo_mixed_width is
generic (
WDATA_WIDTH : natural range 1 to 256 := 8;
RDATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64; -- As seen at input
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (WDATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (RDATA_WIDTH-1 downto 0);
rdempty : out std_logic
);
end alt_async_fifo_mixed_width;
architecture syn of alt_async_fifo_mixed_width is
signal sub_wire0 : std_logic_vector (RDATA_WIDTH-1 downto 0);
signal sub_wire1 : std_logic ;
signal sub_wire2 : std_logic ;
component dcfifo_mixed_widths
generic (
intended_device_family : string;
lpm_numwords : natural;
lpm_showahead : string;
lpm_type : string;
lpm_width : natural;
lpm_widthu : natural;
lpm_widthu_r : natural;
lpm_width_r : natural;
overflow_checking : string;
rdsync_delaypipe : natural;
underflow_checking : string;
use_eab : string;
wrsync_delaypipe : natural
);
port (
data : in std_logic_vector (WDATA_WIDTH-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
wrclk : in std_logic ;
wrreq : in std_logic ;
q : out std_logic_vector (RDATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
wrfull : out std_logic
);
end component;
begin
rddata <= sub_wire0(RDATA_WIDTH-1 downto 0);
rdempty <= sub_wire1;
wrfull <= sub_wire2;
dcfifo_mixed_widths_component : dcfifo_mixed_widths
generic map (
intended_device_family => DEVICE_FAMILY,
lpm_numwords => DEPTH,
lpm_showahead => SHOWAHEAD,
lpm_type => "dcfifo_mixed_widths",
lpm_width => WDATA_WIDTH,
lpm_widthu => log2(DEPTH),
lpm_widthu_r => log2(DEPTH*WDATA_WIDTH/RDATA_WIDTH),
lpm_width_r => RDATA_WIDTH,
overflow_checking => CHECKING,
underflow_checking => CHECKING,
use_eab => "ON",
rdsync_delaypipe => 4,
wrsync_delaypipe => 4
)
port map (
data => wrdata,
rdclk => rdclk,
rdreq => rdreq,
wrclk => wrclk,
wrreq => wrreq,
q => sub_wire0,
rdempty => sub_wire1,
wrfull => sub_wire2
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-- Retrieval info: PRIVATE: Clock NUMERIC "4"
-- Retrieval info: PRIVATE: Depth NUMERIC "64"
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
-- Retrieval info: PRIVATE: Full NUMERIC "1"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0"
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: Optimize NUMERIC "0"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
-- Retrieval info: PRIVATE: Width NUMERIC "8"
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: diff_widths NUMERIC "1"
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-- Retrieval info: PRIVATE: output_width NUMERIC "32"
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "0"
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: wsFull NUMERIC "1"
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "64"
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo_mixed_widths"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "8"
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "6"
-- Retrieval info: CONSTANT: LPM_WIDTHU_R NUMERIC "4"
-- Retrieval info: CONSTANT: LPM_WIDTH_R NUMERIC "32"
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: RDSYNC_DELAYPIPE NUMERIC "4"
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
-- Retrieval info: CONSTANT: WRSYNC_DELAYPIPE NUMERIC "4"
-- Retrieval info: USED_PORT: wrdata 0 0 8 0 INPUT NODEFVAL "wrdata[7..0]"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL "rdclk"
-- Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL "rdempty"
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq"
-- Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL "wrclk"
-- Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL "wrfull"
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq"
-- Retrieval info: CONNECT: @wrdata 0 0 8 0 wrdata 0 0 8 0
-- Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-- Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @rddata 0 0 32 0
-- Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0
-- Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_async_fifo_mixed_width.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL sync_fifo_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,77 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.common_pkg.all;
use work.vendor_pkg.all;
entity dp_ram is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
clk : in std_logic := '1';
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wraddr : in std_logic_vector (log2(DEPTH)-1 downto 0);
wren : in std_logic := '0';
rdaddr : in std_logic_vector (log2(DEPTH)-1 downto 0);
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end dp_ram;
architecture struct of dp_ram is
begin
GEN_VENDOR : if IS_ALTERA(DEVICE_FAMILY) generate
dp_ram_inst : entity work.alt_dp_ram
generic map(
DEVICE_FAMILY => DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
READ_WRITE_MODE => READ_WRITE_MODE,
REGISTER_OUTPUT => REGISTER_OUTPUT
)
port map(
clk => clk,
wren => wren,
wraddr => wraddr,
wrdata => wrdata,
rdaddr => rdaddr,
rddata => rddata
);
else generate
dp_ram_inst : entity work.inferred_dpram
generic map(
DEVICE_FAMILY => DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
READ_WRITE_MODE => READ_WRITE_MODE,
REGISTER_OUTPUTB => REGISTER_OUTPUT
)
port map(
clk => clk,
we_a => wren,
addr_a => wraddr,
data_a => wrdata,
addr_b => rdaddr,
q_b => rddata
);
end generate;
end struct;

View file

@ -0,0 +1,207 @@
-- megafunction wizard: %RAM: 2-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: alt_dp_ram_mixed_width.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 18.1.0 Build 625 09/12/2018 SJ Standard Edition
-- ************************************************************
--Copyright (C) 2018 Intel Corporation. All rights reserved.
--Your use of Intel Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Intel Program License
--Subscription Agreement, the Intel Quartus Prime License Agreement,
--the Intel FPGA IP License Agreement, or other applicable license
--agreement, including, without limitation, that your use is for
--the sole purpose of programming logic devices manufactured by
--Intel and sold by Intel or its authorized distributors. Please
--refer to the applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
use work.common_pkg.all;
entity alt_dp_ram_mixed_width is
generic (
WDATA_WIDTH : natural range 1 to 256 := 32;
RDATA_WIDTH : natural range 1 to 256 := 32;
WDEPTH : natural range 2 to 131072 := 128;
RDEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
INIT_FILE : string := ""; -- e.g "ram.mif" or "ram.hex"
INIT_FILE_LAYOUT : string := "PORT_A"; -- "PORT_A", "PORT_B"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
clk : in std_logic := '1';
wrdata : in std_logic_vector (WDATA_WIDTH-1 downto 0);
wraddr : in std_logic_vector (log2(WDEPTH)-1 downto 0);
wren : in std_logic := '0';
rdaddr : in std_logic_vector (log2(RDEPTH)-1 downto 0);
rddata : out std_logic_vector (RDATA_WIDTH-1 downto 0)
);
end alt_dp_ram_mixed_width;
architecture syn of alt_dp_ram_mixed_width is
signal sub_wire0 : std_logic_vector (RDATA_WIDTH-1 downto 0);
begin
rddata <= sub_wire0;
altsyncram_component : altsyncram
generic map (
address_aclr_b => "NONE",
address_reg_b => "CLOCK0",
clock_enable_input_a => "BYPASS",
clock_enable_input_b => "BYPASS",
clock_enable_output_b => "BYPASS",
init_file => INIT_FILE,
init_file_layout => INIT_FILE_LAYOUT,
intended_device_family => DEVICE_FAMILY,
lpm_type => "altsyncram",
numwords_a => WDEPTH,
numwords_b => RDEPTH,
operation_mode => "DUAL_PORT",
outdata_aclr_b => "NONE",
outdata_reg_b => REGISTER_OUTPUT,
power_up_uninitialized => "FALSE",
read_during_write_mode_mixed_ports => READ_WRITE_MODE,
widthad_a => LOG2(WDEPTH),
widthad_b => LOG2(RDEPTH),
width_a => WDATA_WIDTH,
width_b => RDATA_WIDTH,
width_byteena_a => 1
)
port map (
address_a => wraddr,
address_b => rdaddr,
clock0 => clk,
data_a => wrdata,
wren_a => wren,
q_b => sub_wire0
);
end syn;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
-- Retrieval info: PRIVATE: ADDRESSSTALL_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTEENA_ACLR_A NUMERIC "0"
-- Retrieval info: PRIVATE: BYTEENA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE_A NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_ENABLE_B NUMERIC "0"
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "1"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_B NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_B NUMERIC "0"
-- Retrieval info: PRIVATE: CLRdata NUMERIC "0"
-- Retrieval info: PRIVATE: CLRq NUMERIC "0"
-- Retrieval info: PRIVATE: CLRrdaddress NUMERIC "0"
-- Retrieval info: PRIVATE: CLRrren NUMERIC "0"
-- Retrieval info: PRIVATE: CLRwraddress NUMERIC "0"
-- Retrieval info: PRIVATE: CLRwren NUMERIC "0"
-- Retrieval info: PRIVATE: clk NUMERIC "0"
-- Retrieval info: PRIVATE: Clock_A NUMERIC "0"
-- Retrieval info: PRIVATE: Clock_B NUMERIC "0"
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
-- Retrieval info: PRIVATE: INDATA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: INDATA_REG_B NUMERIC "0"
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_B"
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-- Retrieval info: PRIVATE: MEMSIZE NUMERIC "4096"
-- Retrieval info: PRIVATE: MEM_IN_BITS NUMERIC "0"
-- Retrieval info: PRIVATE: MIFfilename STRING ""
-- Retrieval info: PRIVATE: OPERATION_MODE NUMERIC "2"
-- Retrieval info: PRIVATE: OUTDATA_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: OUTDATA_REG_B NUMERIC "1"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_MIXED_PORTS NUMERIC "1"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_A NUMERIC "3"
-- Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_B NUMERIC "3"
-- Retrieval info: PRIVATE: REGdata NUMERIC "1"
-- Retrieval info: PRIVATE: REGq NUMERIC "0"
-- Retrieval info: PRIVATE: REGrdaddress NUMERIC "1"
-- Retrieval info: PRIVATE: REGrren NUMERIC "1"
-- Retrieval info: PRIVATE: REGwraddress NUMERIC "1"
-- Retrieval info: PRIVATE: REGwren NUMERIC "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_DIFF_CLKEN NUMERIC "0"
-- Retrieval info: PRIVATE: UseDPRAM NUMERIC "1"
-- Retrieval info: PRIVATE: VarWidth NUMERIC "0"
-- Retrieval info: PRIVATE: WIDTH_READ_A NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_READ_B NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_WRITE_A NUMERIC "32"
-- Retrieval info: PRIVATE: WIDTH_WRITE_B NUMERIC "32"
-- Retrieval info: PRIVATE: WRADDR_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: WRADDR_REG_B NUMERIC "0"
-- Retrieval info: PRIVATE: WRCTRL_ACLR_B NUMERIC "0"
-- Retrieval info: PRIVATE: enable NUMERIC "0"
-- Retrieval info: PRIVATE: rden NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: ADDRESS_ACLR_B STRING "NONE"
-- Retrieval info: CONSTANT: ADDRESS_REG_B STRING "CLOCK0"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_B STRING "BYPASS"
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_B STRING "BYPASS"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone 10 LP"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "128"
-- Retrieval info: CONSTANT: NUMWORDS_B NUMERIC "128"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "DUAL_PORT"
-- Retrieval info: CONSTANT: OUTDATA_ACLR_B STRING "NONE"
-- Retrieval info: CONSTANT: OUTDATA_REG_B STRING "CLOCK0"
-- Retrieval info: CONSTANT: POWER_UP_UNINITIALIZED STRING "FALSE"
-- Retrieval info: CONSTANT: READ_DURING_WRITE_MODE_MIXED_PORTS STRING "OLD_DATA"
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "7"
-- Retrieval info: CONSTANT: WIDTHAD_B NUMERIC "7"
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "32"
-- Retrieval info: CONSTANT: WIDTH_B NUMERIC "32"
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-- Retrieval info: USED_PORT: clk 0 0 0 0 INPUT VCC "clk"
-- Retrieval info: USED_PORT: wrdata 0 0 32 0 INPUT NODEFVAL "wrdata[31..0]"
-- Retrieval info: USED_PORT: rddata 0 0 32 0 OUTPUT NODEFVAL "rddata[31..0]"
-- Retrieval info: USED_PORT: rdaddr 0 0 7 0 INPUT NODEFVAL "rdaddr[6..0]"
-- Retrieval info: USED_PORT: wraddr 0 0 7 0 INPUT NODEFVAL "wraddr[6..0]"
-- Retrieval info: USED_PORT: wren 0 0 0 0 INPUT GND "wren"
-- Retrieval info: CONNECT: @address_a 0 0 7 0 wraddr 0 0 7 0
-- Retrieval info: CONNECT: @address_b 0 0 7 0 rdaddr 0 0 7 0
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clk 0 0 0 0
-- Retrieval info: CONNECT: @data_a 0 0 32 0 wrdata 0 0 32 0
-- Retrieval info: CONNECT: @wren_a 0 0 0 0 wren 0 0 0 0
-- Retrieval info: CONNECT: rddata 0 0 32 0 @q_b 0 0 32 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL alt_dp_ram_mixed_width.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL dp_ram_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,198 @@
-- megafunction wizard: %FIFO%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: scfifo
-- ============================================================
-- File Name: fifo_1024x32.vhd
-- Megafunction Name(s):
-- scfifo
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 14.1.1 Build 190 01/19/2015 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
--Your use of Altera Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Altera Program License
--Subscription Agreement, the Altera Quartus II License Agreement,
--the Altera MegaCore Function License Agreement, or other
--applicable license agreement, including, without limitation,
--that your use is for the sole purpose of programming logic
--devices manufactured by Altera and sold by Altera or its
--authorized distributors. Please refer to the applicable
--agreement for further details.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY fifo_1024x32 IS
PORT
(
clock : IN STD_LOGIC ;
data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
rdreq : IN STD_LOGIC ;
sclr : IN STD_LOGIC ;
wrreq : IN STD_LOGIC ;
empty : OUT STD_LOGIC ;
full : OUT STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
usedw : OUT STD_LOGIC_VECTOR (9 DOWNTO 0)
);
END fifo_1024x32;
ARCHITECTURE SYN OF fifo_1024x32 IS
SIGNAL sub_wire0 : STD_LOGIC ;
SIGNAL sub_wire1 : STD_LOGIC ;
SIGNAL sub_wire2 : STD_LOGIC_VECTOR (31 DOWNTO 0);
SIGNAL sub_wire3 : STD_LOGIC_VECTOR (9 DOWNTO 0);
COMPONENT scfifo
GENERIC (
add_ram_output_register : STRING;
intended_device_family : STRING;
lpm_numwords : NATURAL;
lpm_showahead : STRING;
lpm_type : STRING;
lpm_width : NATURAL;
lpm_widthu : NATURAL;
overflow_checking : STRING;
underflow_checking : STRING;
use_eab : STRING
);
PORT (
clock : IN STD_LOGIC ;
data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
rdreq : IN STD_LOGIC ;
sclr : IN STD_LOGIC ;
wrreq : IN STD_LOGIC ;
empty : OUT STD_LOGIC ;
full : OUT STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
usedw : OUT STD_LOGIC_VECTOR (9 DOWNTO 0)
);
END COMPONENT;
BEGIN
empty <= sub_wire0;
full <= sub_wire1;
q <= sub_wire2(31 DOWNTO 0);
usedw <= sub_wire3(9 DOWNTO 0);
scfifo_component : scfifo
GENERIC MAP (
add_ram_output_register => "OFF",
intended_device_family => "Cyclone IV GX",
lpm_numwords => 1024,
lpm_showahead => "OFF",
lpm_type => "scfifo",
lpm_width => 32,
lpm_widthu => 10,
overflow_checking => "ON",
underflow_checking => "ON",
use_eab => "ON"
)
PORT MAP (
clock => clock,
data => data,
rdreq => rdreq,
sclr => sclr,
wrreq => wrreq,
empty => sub_wire0,
full => sub_wire1,
q => sub_wire2,
usedw => sub_wire3
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-- Retrieval info: PRIVATE: Clock NUMERIC "0"
-- Retrieval info: PRIVATE: Depth NUMERIC "1024"
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
-- Retrieval info: PRIVATE: Full NUMERIC "1"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV GX"
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: Optimize NUMERIC "0"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
-- Retrieval info: PRIVATE: Width NUMERIC "32"
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: diff_widths NUMERIC "0"
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-- Retrieval info: PRIVATE: output_width NUMERIC "32"
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "1"
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: wsFull NUMERIC "1"
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV GX"
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "1024"
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "32"
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "10"
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL "clock"
-- Retrieval info: USED_PORT: data 0 0 32 0 INPUT NODEFVAL "data[31..0]"
-- Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL "empty"
-- Retrieval info: USED_PORT: full 0 0 0 0 OUTPUT NODEFVAL "full"
-- Retrieval info: USED_PORT: q 0 0 32 0 OUTPUT NODEFVAL "q[31..0]"
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq"
-- Retrieval info: USED_PORT: sclr 0 0 0 0 INPUT NODEFVAL "sclr"
-- Retrieval info: USED_PORT: usedw 0 0 10 0 OUTPUT NODEFVAL "usedw[9..0]"
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq"
-- Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: @data 0 0 32 0 data 0 0 32 0
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-- Retrieval info: CONNECT: @sclr 0 0 0 0 sclr 0 0 0 0
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-- Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0
-- Retrieval info: CONNECT: full 0 0 0 0 @full 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 32 0 @q 0 0 32 0
-- Retrieval info: CONNECT: usedw 0 0 10 0 @usedw 0 0 10 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1024x32.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1024x32.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1024x32.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1024x32.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1024x32_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,198 @@
-- megafunction wizard: %FIFO%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: scfifo
-- ============================================================
-- File Name: fifo_256x32.vhd
-- Megafunction Name(s):
-- scfifo
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 14.1.1 Build 190 01/19/2015 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
--Your use of Altera Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Altera Program License
--Subscription Agreement, the Altera Quartus II License Agreement,
--the Altera MegaCore Function License Agreement, or other
--applicable license agreement, including, without limitation,
--that your use is for the sole purpose of programming logic
--devices manufactured by Altera and sold by Altera or its
--authorized distributors. Please refer to the applicable
--agreement for further details.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY fifo_256x32 IS
PORT
(
clock : IN STD_LOGIC ;
data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
rdreq : IN STD_LOGIC ;
sclr : IN STD_LOGIC ;
wrreq : IN STD_LOGIC ;
empty : OUT STD_LOGIC ;
full : OUT STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
usedw : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END fifo_256x32;
ARCHITECTURE SYN OF fifo_256x32 IS
SIGNAL sub_wire0 : STD_LOGIC ;
SIGNAL sub_wire1 : STD_LOGIC ;
SIGNAL sub_wire2 : STD_LOGIC_VECTOR (31 DOWNTO 0);
SIGNAL sub_wire3 : STD_LOGIC_VECTOR (7 DOWNTO 0);
COMPONENT scfifo
GENERIC (
add_ram_output_register : STRING;
intended_device_family : STRING;
lpm_numwords : NATURAL;
lpm_showahead : STRING;
lpm_type : STRING;
lpm_width : NATURAL;
lpm_widthu : NATURAL;
overflow_checking : STRING;
underflow_checking : STRING;
use_eab : STRING
);
PORT (
clock : IN STD_LOGIC ;
data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
rdreq : IN STD_LOGIC ;
sclr : IN STD_LOGIC ;
wrreq : IN STD_LOGIC ;
empty : OUT STD_LOGIC ;
full : OUT STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
usedw : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END COMPONENT;
BEGIN
empty <= sub_wire0;
full <= sub_wire1;
q <= sub_wire2(31 DOWNTO 0);
usedw <= sub_wire3(7 DOWNTO 0);
scfifo_component : scfifo
GENERIC MAP (
add_ram_output_register => "OFF",
intended_device_family => "Cyclone V",
lpm_numwords => 256,
lpm_showahead => "OFF",
lpm_type => "scfifo",
lpm_width => 32,
lpm_widthu => 8,
overflow_checking => "ON",
underflow_checking => "ON",
use_eab => "ON"
)
PORT MAP (
clock => clock,
data => data,
rdreq => rdreq,
sclr => sclr,
wrreq => wrreq,
empty => sub_wire0,
full => sub_wire1,
q => sub_wire2,
usedw => sub_wire3
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-- Retrieval info: PRIVATE: Clock NUMERIC "0"
-- Retrieval info: PRIVATE: Depth NUMERIC "256"
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
-- Retrieval info: PRIVATE: Full NUMERIC "1"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone V"
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: Optimize NUMERIC "0"
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
-- Retrieval info: PRIVATE: Width NUMERIC "32"
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: diff_widths NUMERIC "0"
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-- Retrieval info: PRIVATE: output_width NUMERIC "32"
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "1"
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-- Retrieval info: PRIVATE: wsFull NUMERIC "1"
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone V"
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "256"
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "32"
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "8"
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL "clock"
-- Retrieval info: USED_PORT: data 0 0 32 0 INPUT NODEFVAL "data[31..0]"
-- Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL "empty"
-- Retrieval info: USED_PORT: full 0 0 0 0 OUTPUT NODEFVAL "full"
-- Retrieval info: USED_PORT: q 0 0 32 0 OUTPUT NODEFVAL "q[31..0]"
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq"
-- Retrieval info: USED_PORT: sclr 0 0 0 0 INPUT NODEFVAL "sclr"
-- Retrieval info: USED_PORT: usedw 0 0 8 0 OUTPUT NODEFVAL "usedw[7..0]"
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq"
-- Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0
-- Retrieval info: CONNECT: @data 0 0 32 0 data 0 0 32 0
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-- Retrieval info: CONNECT: @sclr 0 0 0 0 sclr 0 0 0 0
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-- Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0
-- Retrieval info: CONNECT: full 0 0 0 0 @full 0 0 0 0
-- Retrieval info: CONNECT: q 0 0 32 0 @q 0 0 32 0
-- Retrieval info: CONNECT: usedw 0 0 8 0 @usedw 0 0 8 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_256x32.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_256x32.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_256x32.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_256x32.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL fifo_256x32_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf

View file

@ -0,0 +1,110 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.common_pkg.all;
use work.vendor_pkg.all;
entity rw_dp_ram is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
addr_a : in std_logic_vector (log2(DEPTH)-1 downto 0);
addr_b : in std_logic_vector (log2(DEPTH)-1 downto 0);
clk : in std_logic := '1';
wrdata_a : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrdata_b : in std_logic_vector (DATA_WIDTH-1 downto 0);
wren_a : in std_logic := '0';
wren_b : in std_logic := '0';
rddata_a : out std_logic_vector (DATA_WIDTH-1 downto 0);
rddata_b : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end rw_dp_ram;
architecture struct of rw_dp_ram is
--{{{
component alt_rw_dp_ram
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_OUTPUT : string := "CLOCK0"; -- "UNREGISTERED"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
addr_a : in std_logic_vector (log2(DEPTH)-1 downto 0);
addr_b : in std_logic_vector (log2(DEPTH)-1 downto 0);
clk : in std_logic := '1';
wrdata_a : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrdata_b : in std_logic_vector (DATA_WIDTH-1 downto 0);
wren_a : in std_logic := '0';
wren_b : in std_logic := '0';
rddata_a : out std_logic_vector (DATA_WIDTH-1 downto 0);
rddata_b : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end component;
--}}}
begin
GEN_VENDOR : if IS_ALTERA(DEVICE_FAMILY) generate
alt_rw_dp_ram_inst : alt_rw_dp_ram
generic map(
DEVICE_FAMILY => DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
READ_WRITE_MODE => READ_WRITE_MODE,
REGISTER_OUTPUT => REGISTER_OUTPUT
)
port map(
clk => clk,
addr_a => addr_a,
addr_b => addr_b,
wrdata_a => wrdata_a,
wrdata_b => wrdata_b,
wren_a => wren_a,
wren_b => wren_b,
rddata_a => rddata_a,
rddata_b => rddata_b
);
else generate
inferred_rw_dp_ram_inst : entity work.inferred_dpram
generic map(
DEVICE_FAMILY => DEVICE_FAMILY,
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
READ_WRITE_MODE => READ_WRITE_MODE,
REGISTER_OUTPUTA => REGISTER_OUTPUT
)
port map(
clk => clk,
addr_a => addr_a,
we_a => wren_a,
data_a => wrdata_a,
q_a => rddata_a,
addr_b => addr_b,
we_b => wren_b,
data_b => wrdata_b,
q_b => rddata_b
);
end generate;
end struct;

View file

@ -0,0 +1,218 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.common_pkg.all;
use work.vendor_pkg.all;
entity sync_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end sync_fifo;
architecture struct of sync_fifo is
--{{{
component alt_sync_fifo
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end component;
--}}}
--{{{
component efx_fifo is
generic (
FAMILY : string := "TRION";
SYNC_CLK : integer := 1;
BYPASS_RESET_SYNC : integer := 0;
SYNC_STAGE : integer := 2;
MODE : string := "FWFT"; -- STANDARD
DEPTH : integer := 512;
DATA_WIDTH : integer := 16;
PIPELINE_REG : integer := 0;
OPTIONAL_FLAGS : integer := 0;
OUTPUT_REG : integer := 0;
PROGRAMMABLE_FULL : string := "STATIC_SINGLE";
PROG_FULL_ASSERT : integer := 128;
PROG_FULL_NEGATE : integer := 128;
PROGRAMMABLE_EMPTY : string := "STATIC_SINGLE";
PROG_EMPTY_ASSERT : integer := 0;
PROG_EMPTY_NEGATE : integer := 2;
ASYM_WIDTH_RATIO : integer := 4 -- 1:1
);
port (
full_o : out std_logic;
prog_full_o : out std_logic;
empty_o : out std_logic;
prog_empty_o : out std_logic;
rdata : out std_logic_vector(DATA_WIDTH-1 downto 0);
clk_i : in std_logic;
wr_en_i : in std_logic;
rd_en_i : in std_logic;
wdata : in std_logic_vector(DATA_WIDTH-1 downto 0);
datacount_o : out std_logic_vector(log2(DEPTH) downto 0);
rst_busy : out std_logic;
a_rst_i : in std_logic
);
end component;
--}}}
function calc_nearly_full_legal(nearly_full : integer; depth : integer) return integer is
begin
if nearly_full >= depth then
return depth-1;
end if;
return nearly_full;
end function calc_nearly_full_legal;
CONSTANT NEARLY_FULL_LEGAL : integer := calc_nearly_full_legal(NEARLY_FULL, DEPTH);
signal datacount_o : std_logic_vector(log2(DEPTH) downto 0);
begin
GEN_VENDOR : if IS_ALTERA(DEVICE_FAMILY) generate
alt_sync_fifo_inst : alt_sync_fifo
generic map(
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
NEARLY_FULL => NEARLY_FULL_LEGAL,
NEARLY_EMPTY => NEARLY_EMPTY,
DEVICE_FAMILY => DEVICE_FAMILY,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING
)
port map(
clk => clk,
rst_n => rst_n,
sclr => sclr,
wrreq => wrreq,
wrdata => wrdata,
almost_full => almost_full,
full => full,
rdreq => rdreq,
rddata => rddata,
almost_empty => almost_empty,
empty => empty,
usedw => usedw);
elsif IS_EFINIX(DEVICE_FAMILY) generate
efx_sync_fifo_inst : efx_fifo
generic map (
SYNC_CLK => 1,
MODE => EFX_MODE(SHOWAHEAD),
OUTPUT_REG => 0,
DEPTH => DEPTH,
DATA_WIDTH => DATA_WIDTH,
PROG_FULL_ASSERT => NEARLY_FULL_LEGAL,
PROG_FULL_NEGATE => NEARLY_FULL_LEGAL,
PROG_EMPTY_ASSERT => NEARLY_EMPTY-1, -- Make same as Altera
PROG_EMPTY_NEGATE => NEARLY_EMPTY-1
)
port map (
full_o => full,
empty_o => empty,
rdata => rddata,
clk_i => clk,
wr_en_i => wrreq,
rd_en_i => rdreq,
wdata => wrdata,
prog_full_o => almost_full,
prog_empty_o => almost_empty,
datacount_o => datacount_o,
rst_busy => open,
a_rst_i => sclr or not rst_n
);
usedw <= datacount_o(usedw'range);
else generate
inferred_sync_fifo_inst : entity work.inferred_sync_fifo
generic map(
DATA_WIDTH => DATA_WIDTH,
DEPTH => DEPTH,
REGISTER_OUTPUT => REGISTER_OUTPUT,
NEARLY_FULL => NEARLY_FULL_LEGAL,
NEARLY_EMPTY => NEARLY_EMPTY,
DEVICE_FAMILY => DEVICE_FAMILY,
SHOWAHEAD => SHOWAHEAD,
CHECKING => CHECKING
)
port map(
clk => clk,
rst_n => rst_n,
sclr => sclr,
wrreq => wrreq,
wrdata => wrdata,
almost_full => almost_full,
full => full,
rdreq => rdreq,
rddata => rddata,
almost_empty => almost_empty,
empty => empty,
usedw => usedw);
end generate;
end struct;

View file

@ -0,0 +1,72 @@
-------------------------------------------------------------------------------
-- Title : Vendor Package
-- Project : Common
-------------------------------------------------------------------------------
-- File : vendor_pkg.vhd
-- Author : DCS
-- Company : Global Inkjet Systems
-- Created : 2022-09-21
-- Last update: 2022-09-21
-- SVN ID : GIT
-- Standard : VHDL'2008
-------------------------------------------------------------------------------
-- Description: Vendor identity functions
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
package vendor_pkg is
function IS_ALTERA (DEVICE_FAMILY : string) return boolean;
function IS_EFINIX (DEVICE_FAMILY : string) return boolean;
function IS_XILINX (DEVICE_FAMILY : string) return boolean;
function EFX_MODE(SHOWAHEAD : string) return string;
end vendor_pkg;
package body vendor_pkg is
function IS_ALTERA(DEVICE_FAMILY : string) return boolean is
begin
if DEVICE_FAMILY = "Cyclone V"
or DEVICE_FAMILY = "Cyclone 10 LP" then
return true;
else
return false;
end if;
end function IS_ALTERA;
function IS_EFINIX(DEVICE_FAMILY : string) return boolean is
begin
if DEVICE_FAMILY = "Efinix T20" then
return true;
else
return false;
end if;
end function IS_EFINIX;
function IS_XILINX(DEVICE_FAMILY : string) return boolean is
begin
if DEVICE_FAMILY = "Ultrascale+" then
return true;
else
return false;
end if;
end function IS_XILINX;
function EFX_MODE(SHOWAHEAD : string) return string is
begin
if SHOWAHEAD = "ON" then
return "FWFT";
else
return "STANDARD";
end if;
end function EFX_MODE;
end vendor_pkg;

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,286 @@
-------------------------------------------------------------------------------
-- Title : Asynchronous FIFO
-- Project :
-------------------------------------------------------------------------------
-- File : async_fifo.vhd
-- Author : <Damian@JERSEY>
-- Company : Global Inkjet Systems
-- Created : 2008-02-22
-- Last update: 2015-08-19
-- SVN ID : $Id$
-- Standard : VHDL'87
-------------------------------------------------------------------------------
-- Description:
-- Buffers data
-- This is a wrapper for a block-ram
-- Space is the distance from the read pointer to the write pointer
-- empty is when the read and write pointers are coincident
-- full is when space is zero.
-- FIFO will be first-word fall-through. Valid declared once data is ready,
-- next_dout fetches the next word.
-- Synthesis information
-- False Path from rd_claim_count TO data_added_var
-- False Path from wr_claim_count TO data_removed_var
-------------------------------------------------------------------------------
-- Copyright (c) 2015 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Revisions :
-- Date Version Author Description
-- 2008-02-28 1.0 Damian Created
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.pkg_functions.all;
-------------------------------------------------------------------------------
entity async_fifo is
generic (
RAM_WIDTH : positive := 8;
RAM_DEPTH : positive := 2048; -- fits into single BRAM
PROG_FULL_LEVEL : positive := 32); -- fill level at which AF true
port (
wr_clk : in std_logic;
rd_clk : in std_logic;
rst : in std_logic := '0';
---------------------------------------------------------------------------
-- Data input to FIFO
---------------------------------------------------------------------------
din : in std_logic_vector(RAM_WIDTH-1 downto 0);
din_valid : in std_logic;
wr_data_count : out std_logic_vector(log2(RAM_DEPTH) - 1 downto 0);
dout : out std_logic_vector(RAM_WIDTH-1 downto 0);
dout_valid : out std_logic;
rd_data_count : out std_logic_vector(log2(RAM_DEPTH) - 1 downto 0);
next_dout : in std_logic;
prog_full : out std_logic;
empty : out std_logic;
full : out std_logic
);
end async_fifo;
-------------------------------------------------------------------------------
architecture rtl of async_fifo is
-----------------------------------------------------------------------------
-- Internal signal declarations
-----------------------------------------------------------------------------
signal rd_addr, wr_addr : unsigned(log2(RAM_DEPTH-1)-1 downto 0);
signal int_full, int_empty : std_logic;
subtype word is std_logic_vector(din'range);
type ram_var_t is array (RAM_DEPTH - 1 downto 0) of word;
signal ram_var : ram_var_t;
signal dout_valid_int : std_logic;
signal data_added, data_removed : unsigned(log2(RAM_DEPTH) - 1 downto 0);
signal wr_claim_count, rd_claim_count : unsigned(log2(RAM_DEPTH) - 1 downto 0);
signal wr_rst_d, rd_rst_d : std_logic_vector(1 downto 0) := (others => '1');
signal rd_claim, rd_claim_ack : std_logic;
signal wr_claim, wr_claim_ack : std_logic;
begin
full <= int_full;
empty <= int_empty;
-- cross domain
wr_rst_d <= wr_rst_d(0) & rst when rising_edge(wr_clk);
rd_rst_d <= rd_rst_d(0) & rst when rising_edge(rd_clk);
-- pragma translate_off
assert not(int_full = '1' and rising_edge(din_valid))
report "Tried to Write while full" severity warning;
assert not (int_empty = '1' and rising_edge(next_dout))
report "Tried to Read while empty" severity warning;
-- pragma translate_on
-----------------------------------------------------------------------------
-- WRITING:
-- Increments the Write Pointer
-- No protection against overflow
-----------------------------------------------------------------------------
writing : process (wr_clk, wr_rst_d(1))
variable rd_claim_d : std_logic_vector(1 downto 0);
variable wr_used : unsigned(log2(RAM_DEPTH) - 1 downto 0);
variable wr_claim_ack_d : std_logic_vector(1 downto 0);
variable data_removed_d, data_removed_d2 : unsigned(data_removed'range);
variable data_added_var : unsigned(data_added'range);
begin -- process writing
if wr_rst_d(1) = '1' then
wr_addr <= (others => '0');
wr_used := (others => '0'); -- track fill level on write side
data_added <= (others => '0'); -- top up the count on read side
data_added_var := (others => '0');
int_full <= '1';
prog_full <= '1';
rd_claim_d := (others => '0');
data_removed_d := (others => '0');
data_removed_d2 := (others => '0');
wr_claim_count <= (others => '0');
wr_claim <= '0';
wr_data_count <= (others => '0');
rd_claim_ack <= '0';
elsif rising_edge(wr_clk) then
if din_valid = '1' then
-- increment pointer
wr_addr <= wr_addr + 1;
end if;
-- pass information on added data to read side
-- and monitor own fill levels
if din_valid = '1' then
data_added_var := data_added_var + 1;
wr_used := wr_used + 1;
end if;
-- read side is claiming some of data added to allow it to output data
if rd_claim_d(1) = '1' and rd_claim_ack = '0' then
data_added_var := data_added_var - rd_claim_count;
rd_claim_ack <= '1';
elsif rd_claim_d(1) = '0' then
rd_claim_ack <= '0';
end if;
data_added <= data_added_var;
-- read side has output some data - subtract it from our used level
if data_removed_d2 > 0 and wr_claim = '0' and wr_claim_ack_d(1) = '0' then
wr_claim_count <= data_removed_d2;
wr_claim <= '1';
wr_used := wr_used - data_removed_d2;
elsif wr_claim_ack_d(1) = '1' then
wr_claim <= '0';
end if;
int_full <= '0';
if wr_used = RAM_DEPTH then
int_full <= '1';
end if;
prog_full <= '0';
if wr_used >= PROG_FULL_LEVEL then
prog_full <= '1';
end if;
wr_data_count <= std_logic_vector(wr_used);
-- X-Domain
rd_claim_d := rd_claim_d(0) & rd_claim;
data_removed_d2 := data_removed_d;
data_removed_d := data_removed;
wr_claim_ack_d := wr_claim_ack_d(0) & wr_claim_ack;
end if;
end process writing;
-----------------------------------------------------------------------------
-- READING:
-- Increments Read Pointer
-----------------------------------------------------------------------------
reading : process (rd_clk, rd_rst_d(1))
variable wr_claim_d : std_logic_vector(1 downto 0);
variable rd_used : unsigned(log2(RAM_DEPTH) - 1 downto 0);
variable rd_claim_ack_d : std_logic_vector(1 downto 0);
variable data_added_d, data_added_d2 : unsigned(data_added'range);
variable data_removed_var : unsigned(data_removed'range);
begin -- process reading
if rd_rst_d(1) = '1' then
rd_addr <= (others => '0');
dout_valid_int <= '0';
rd_used := (others => '0');
int_empty <= '1';
rd_data_count <= (others => '0');
data_removed <= (others => '0');
data_removed_var := (others => '0');
wr_claim_ack <= '0';
rd_claim <= '0';
rd_claim_count <= (others => '0');
wr_claim_d := (others => '0');
rd_claim_ack_d := (others => '0');
data_added_d2 := (others => '0');
data_added_d := (others => '0');
elsif rising_edge(rd_clk) then
int_empty <= '0';
dout_valid_int <= '1';
if next_dout = '1' then
rd_addr <= rd_addr + 1;
end if;
-- pass information on removed data to write side
-- and monitor own fill levels
if next_dout = '1' then
data_removed_var := data_removed_var + 1;
rd_used := rd_used - 1;
end if;
-- write side is claiming some of data removed to allow it to input data
if wr_claim_d(1) = '1' and wr_claim_ack = '0' then
data_removed_var := data_removed_var - wr_claim_count;
wr_claim_ack <= '1';
elsif wr_claim_d(1) = '0' then
wr_claim_ack <= '0';
end if;
data_removed <= data_removed_var;
-- write side has input some data - add it to our used level
if data_added_d2 > 0 and rd_claim = '0' and rd_claim_ack_d(1) = '0' then
rd_claim_count <= data_added_d2;
rd_claim <= '1';
rd_used := rd_used + data_added_d2;
elsif rd_claim_ack_d(1) = '1' then
rd_claim <= '0';
end if;
if rd_used = 0 then
int_empty <= '1';
dout_valid_int <= '0';
end if;
rd_data_count <= std_logic_vector(rd_used);
-- X-Domain
wr_claim_d := wr_claim_d(0) & wr_claim;
rd_claim_ack_d := rd_claim_ack_d(0) & rd_claim_ack;
data_added_d2 := data_added_d;
data_added_d := data_added;
end if;
end process reading;
dout_valid <= dout_valid_int;
blockram_wr : process (wr_clk) is
begin
if rising_edge(wr_clk) then
if din_valid = '1' then
ram_var(to_integer(wr_addr)) <= din;
end if;
end if;
end process blockram_wr;
blockram_rd : process (rd_clk) is
begin
if rising_edge(rd_clk) then
dout <= ram_var(to_integer(rd_addr));
end if;
end process blockram_rd;
end rtl;
-------------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
At time of check in, none of these files are used.
There are various methods to have parameterised macros in xilinx, but they all seem to have a very long reset time. E.g. XPM async fifo 14 clocks.
So inferred FIFOs etc are used now.
These are kept in case they need to be revived in the future

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

View file

@ -0,0 +1,193 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Inferred RAM Async FIFO, modified from Damians in Firmware/Common
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
entity xil_async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_async_fifo;
architecture rtl OF xil_async_fifo is
constant numSyncs : integer := 8;
type memory_t is array (DEPTH-1 downto 0) of std_logic_vector (DATA_WIDTH-1 downto 0) ;
signal ram : memory_t := (others => (others => '0')); -- make simulation same as Altera
-----------------------------------------------------------------------------
-- Internal signal declarations
-----------------------------------------------------------------------------
signal wrreq_int : std_logic;
signal rdreq_int : std_logic;
signal rd_addr, wr_addr : unsigned(log2(DEPTH-1)-1 downto 0);
signal wrcount : integer range 0 to DEPTH;
signal rdcount : integer range 0 to DEPTH;
signal wrreq_sync : integer range 0 to numSyncs-1;
signal rdreq_sync : integer range 0 to numSyncs-1;
signal wrreq_wr_clk : std_logic_vector(numSyncs-1 downto 0);
signal wrreq_rd_clk : std_logic_vector(numSyncs-1 downto 0);
signal rdreq_rd_clk : std_logic_vector(numSyncs-1 downto 0);
signal rdreq_wr_clk : std_logic_vector(numSyncs-1 downto 0);
signal wr_rst_d, rd_rst_d : std_logic_vector(1 downto 0) := (others => '1');
function count_bits(bits : std_logic_vector) return integer is
variable count : integer range 0 to numSyncs-1;
begin
count := 0;
for i in bits'range loop
if bits(i) = '1' then
count := count + 1;
end if;
end loop;
return count;
end function count_bits;
begin
wrreq_int <= wrreq when wrfull = '0' else '0';
rdreq_int <= rdreq when rdempty = '0' else '0';
wrfull <= '1' when (wrcount = DEPTH) else '0';
rdempty <= '1' when (rdcount = 0) else '0';
wrusedw <= std_logic_vector(to_unsigned(wrcount, wrusedw'high+1));
rdusedw <= std_logic_vector(to_unsigned(rdcount, rdusedw'high+1));
-- cross domain
wr_rst_d <= wr_rst_d(0) & clr when rising_edge(wrclk);
rd_rst_d <= rd_rst_d(0) & clr when rising_edge(rdclk);
-- pragma translate_off
assert not(wrfull = '1' and rising_edge(wrreq_int))
report "Tried to Write while full" severity warning;
assert not (rdempty = '1' and rising_edge(rdreq_int))
report "Tried to Read while empty" severity warning;
-- pragma translate_on
-----------------------------------------------------------------------------
-- WRITING:
-- Increments the Write Pointer
-- No protection against overflow
-----------------------------------------------------------------------------
g : for i in 0 to numSyncs-1 generate
wr_sync : entity work.sync_pulse
port map (clk_in => wrclk, rst_n => not wr_rst_d(1), pulse_in => wrreq_wr_clk(i),
clk_out => rdclk, pulse_out => wrreq_rd_clk(i));
wrreq_wr_clk(i) <= wrreq_int when wrreq_sync = i else '0';
rd_sync : entity work.sync_pulse
port map (clk_in => rdclk, rst_n => not rd_rst_d(1), pulse_in => rdreq_rd_clk(i),
clk_out => wrclk, pulse_out => rdreq_wr_clk(i));
rdreq_rd_clk(i) <= rdreq_int when rdreq_sync = i else '0';
end generate;
writing : process (wrclk, wr_rst_d(1))
begin -- process writing
if wr_rst_d(1) = '1' then
wr_addr <= (others => '0');
wrcount <= 0;
wrreq_sync <= 0;
elsif rising_edge(wrclk) then
if wrreq_int = '1' then
-- increment pointer
wr_addr <= wr_addr + 1;
if wrreq_sync = numSyncs-1 then
wrreq_sync <= 0;
else
wrreq_sync <= wrreq_sync + 1;
end if;
end if;
if wrreq_int = '1' then
wrcount <= wrcount - count_bits(rdreq_wr_clk) + 1;
else
wrcount <= wrcount - count_bits(rdreq_wr_clk) + 0;
end if;
end if;
end process writing;
-----------------------------------------------------------------------------
-- READING:
-- Increments Read Pointer
-----------------------------------------------------------------------------
reading : process (rdclk, rd_rst_d(1))
begin -- process reading
if rd_rst_d(1) = '1' then
rd_addr <= (others => '0');
rdcount <= 0;
rdreq_sync <= 0;
elsif rising_edge(rdclk) then
if rdreq_int = '1' then
rd_addr <= rd_addr + 1;
if rdreq_sync = numSyncs-1 then
rdreq_sync <= 0;
else
rdreq_sync <= rdreq_sync + 1;
end if;
end if;
if rdreq_int = '1' then
rdcount <= rdcount + count_bits(wrreq_rd_clk) - 1;
else
rdcount <= rdcount + count_bits(wrreq_rd_clk) + 0;
end if;
end if;
end process reading;
--dout_valid <= dout_valid_int;
ram_wr : process (wrclk) is
begin
if rising_edge(wrclk) then
if wrreq_int = '1' then
ram(to_integer(wr_addr)) <= wrdata;
end if;
end if;
end process ram_wr;
--ram_rd : process (rdclk) is
--begin
--if rising_edge(rdclk) then
rddata <= ram(to_integer(rd_addr));
--end if;
--end process ram_rd;
end rtl;

View file

@ -0,0 +1,244 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Inferred RAM Async FIFO, modified from Damians in Firmware/Common
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
entity xil_async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_async_fifo;
architecture rtl OF xil_async_fifo is
type memory_t is array (DEPTH-1 downto 0) of std_logic_vector (DATA_WIDTH-1 downto 0) ;
signal ram : memory_t := (others => (others => '0')); -- make simulation same as Altera
-----------------------------------------------------------------------------
-- Internal signal declarations
-----------------------------------------------------------------------------
signal rd_addr, wr_addr : unsigned(log2(DEPTH-1)-1 downto 0);
signal int_full, int_empty : std_logic;
signal dout_valid_int : std_logic;
signal data_added, data_removed : unsigned(log2(DEPTH) - 1 downto 0);
signal wr_claim_count, rd_claim_count : unsigned(log2(DEPTH) - 1 downto 0);
signal wr_rst_d, rd_rst_d : std_logic_vector(1 downto 0) := (others => '1');
signal rd_claim, rd_claim_ack : std_logic;
signal wr_claim, wr_claim_ack : std_logic;
begin
wrfull <= int_full;
rdempty <= int_empty;
-- cross domain
wr_rst_d <= wr_rst_d(0) & clr when rising_edge(wrclk);
rd_rst_d <= rd_rst_d(0) & clr when rising_edge(rdclk);
-- pragma translate_off
assert not(int_full = '1' and rising_edge(wrreq))
report "Tried to Write while full" severity warning;
assert not (int_empty = '1' and rising_edge(rdreq))
report "Tried to Read while empty" severity warning;
-- pragma translate_on
-----------------------------------------------------------------------------
-- WRITING:
-- Increments the Write Pointer
-- No protection against overflow
-----------------------------------------------------------------------------
writing : process (wrclk, wr_rst_d(1))
variable rd_claim_d : std_logic_vector(1 downto 0);
variable wr_used : unsigned(log2(DEPTH) - 1 downto 0);
variable wr_claim_ack_d : std_logic_vector(1 downto 0);
variable data_removed_d, data_removed_d2 : unsigned(data_removed'range);
variable data_added_var : unsigned(data_added'range);
begin -- process writing
if wr_rst_d(1) = '1' then
wr_addr <= (others => '0');
wr_used := (others => '0'); -- track fill level on write side
data_added <= (others => '0'); -- top up the count on read side
data_added_var := (others => '0');
int_full <= '1';
rd_claim_d := (others => '0');
data_removed_d := (others => '0');
data_removed_d2 := (others => '0');
wr_claim_count <= (others => '0');
wr_claim <= '0';
wrusedw <= (others => '0');
rd_claim_ack <= '0';
elsif rising_edge(wrclk) then
if wrreq = '1' then
-- increment pointer
wr_addr <= wr_addr + 1;
end if;
-- pass information on added data to read side
-- and monitor own fill levels
if wrreq = '1' then
data_added_var := data_added_var + 1;
wr_used := wr_used + 1;
end if;
-- read side is claiming some of data added to allow it to output data
if rd_claim_d(1) = '1' and rd_claim_ack = '0' then
data_added_var := data_added_var - rd_claim_count;
rd_claim_ack <= '1';
elsif rd_claim_d(1) = '0' then
rd_claim_ack <= '0';
end if;
data_added <= data_added_var;
-- read side has output some data - subtract it from our used level
if data_removed_d2 > 0 and wr_claim = '0' and wr_claim_ack_d(1) = '0' then
wr_claim_count <= data_removed_d2;
wr_claim <= '1';
wr_used := wr_used - data_removed_d2;
elsif wr_claim_ack_d(1) = '1' then
wr_claim <= '0';
end if;
int_full <= '0';
if wr_used = DEPTH then
int_full <= '1';
end if;
wrusedw <= std_logic_vector(wr_used);
-- X-Domain
rd_claim_d := rd_claim_d(0) & rd_claim;
data_removed_d2 := data_removed_d;
data_removed_d := data_removed;
wr_claim_ack_d := wr_claim_ack_d(0) & wr_claim_ack;
end if;
end process writing;
-----------------------------------------------------------------------------
-- READING:
-- Increments Read Pointer
-----------------------------------------------------------------------------
reading : process (rdclk, rd_rst_d(1))
variable wr_claim_d : std_logic_vector(1 downto 0);
variable rd_used : unsigned(log2(DEPTH) - 1 downto 0);
variable rd_claim_ack_d : std_logic_vector(1 downto 0);
variable data_added_d, data_added_d2 : unsigned(data_added'range);
variable data_removed_var : unsigned(data_removed'range);
begin -- process reading
if rd_rst_d(1) = '1' then
rd_addr <= (others => '0');
dout_valid_int <= '0';
rd_used := (others => '0');
int_empty <= '1';
rdusedw <= (others => '0');
data_removed <= (others => '0');
data_removed_var := (others => '0');
wr_claim_ack <= '0';
rd_claim <= '0';
rd_claim_count <= (others => '0');
wr_claim_d := (others => '0');
rd_claim_ack_d := (others => '0');
data_added_d2 := (others => '0');
data_added_d := (others => '0');
elsif rising_edge(rdclk) then
int_empty <= '0';
dout_valid_int <= '1';
if rdreq = '1' then
rd_addr <= rd_addr + 1;
end if;
-- pass information on removed data to write side
-- and monitor own fill levels
if rdreq = '1' then
data_removed_var := data_removed_var + 1;
rd_used := rd_used - 1;
end if;
-- write side is claiming some of data removed to allow it to input data
if wr_claim_d(1) = '1' and wr_claim_ack = '0' then
data_removed_var := data_removed_var - wr_claim_count;
wr_claim_ack <= '1';
elsif wr_claim_d(1) = '0' then
wr_claim_ack <= '0';
end if;
data_removed <= data_removed_var;
-- write side has input some data - add it to our used level
if data_added_d2 > 0 and rd_claim = '0' and rd_claim_ack_d(1) = '0' then
rd_claim_count <= data_added_d2;
rd_claim <= '1';
rd_used := rd_used + data_added_d2;
elsif rd_claim_ack_d(1) = '1' then
rd_claim <= '0';
end if;
if rd_used = 0 then
int_empty <= '1';
dout_valid_int <= '0';
end if;
rdusedw <= std_logic_vector(rd_used);
-- X-Domain
wr_claim_d := wr_claim_d(0) & wr_claim;
rd_claim_ack_d := rd_claim_ack_d(0) & rd_claim_ack;
data_added_d2 := data_added_d;
data_added_d := data_added;
end if;
end process reading;
--dout_valid <= dout_valid_int;
ram_wr : process (wrclk) is
begin
if rising_edge(wrclk) then
if wrreq = '1' then
ram(to_integer(wr_addr)) <= wrdata;
end if;
end if;
end process ram_wr;
--ram_rd : process (rdclk) is
--begin
--if rising_edge(rdclk) then
rddata <= ram(to_integer(rd_addr));
--end if;
--end process ram_rd;
end rtl;

View file

@ -0,0 +1,844 @@
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
LIBRARY fifo_generator_v13_2_7;
USE fifo_generator_v13_2_7.fifo_generator_v13_2_7;
entity xil_async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_async_fifo;
ARCHITECTURE xil_async_fifo_arch OF xil_async_fifo IS
ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING;
ATTRIBUTE DowngradeIPIdentifiedWarnings OF xil_async_fifo_arch: ARCHITECTURE IS "yes";
--{{{
COMPONENT fifo_generator_v13_2_7 IS
GENERIC (
C_COMMON_CLOCK : INTEGER;
C_SELECT_XPM : INTEGER;
C_COUNT_TYPE : INTEGER;
C_DATA_COUNT_WIDTH : INTEGER;
C_DEFAULT_VALUE : STRING;
C_DIN_WIDTH : INTEGER;
C_DOUT_RST_VAL : STRING;
C_DOUT_WIDTH : INTEGER;
C_ENABLE_RLOCS : INTEGER;
C_FAMILY : STRING;
C_FULL_FLAGS_RST_VAL : INTEGER;
C_HAS_ALMOST_EMPTY : INTEGER;
C_HAS_ALMOST_FULL : INTEGER;
C_HAS_BACKUP : INTEGER;
C_HAS_DATA_COUNT : INTEGER;
C_HAS_INT_CLK : INTEGER;
C_HAS_MEMINIT_FILE : INTEGER;
C_HAS_OVERFLOW : INTEGER;
C_HAS_RD_DATA_COUNT : INTEGER;
C_HAS_RD_RST : INTEGER;
C_HAS_RST : INTEGER;
C_HAS_SRST : INTEGER;
C_HAS_UNDERFLOW : INTEGER;
C_HAS_VALID : INTEGER;
C_HAS_WR_ACK : INTEGER;
C_HAS_WR_DATA_COUNT : INTEGER;
C_HAS_WR_RST : INTEGER;
C_IMPLEMENTATION_TYPE : INTEGER;
C_INIT_WR_PNTR_VAL : INTEGER;
C_MEMORY_TYPE : INTEGER;
C_MIF_FILE_NAME : STRING;
C_OPTIMIZATION_MODE : INTEGER;
C_OVERFLOW_LOW : INTEGER;
C_PRELOAD_LATENCY : INTEGER;
C_PRELOAD_REGS : INTEGER;
C_PRIM_FIFO_TYPE : STRING;
C_PROG_EMPTY_THRESH_ASSERT_VAL : INTEGER;
C_PROG_EMPTY_THRESH_NEGATE_VAL : INTEGER;
C_PROG_EMPTY_TYPE : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL : INTEGER;
C_PROG_FULL_THRESH_NEGATE_VAL : INTEGER;
C_PROG_FULL_TYPE : INTEGER;
C_RD_DATA_COUNT_WIDTH : INTEGER;
C_RD_DEPTH : INTEGER;
C_RD_FREQ : INTEGER;
C_RD_PNTR_WIDTH : INTEGER;
C_UNDERFLOW_LOW : INTEGER;
C_USE_DOUT_RST : INTEGER;
C_USE_ECC : INTEGER;
C_USE_EMBEDDED_REG : INTEGER;
C_USE_PIPELINE_REG : INTEGER;
C_POWER_SAVING_MODE : INTEGER;
C_USE_FIFO16_FLAGS : INTEGER;
C_USE_FWFT_DATA_COUNT : INTEGER;
C_VALID_LOW : INTEGER;
C_WR_ACK_LOW : INTEGER;
C_WR_DATA_COUNT_WIDTH : INTEGER;
C_WR_DEPTH : INTEGER;
C_WR_FREQ : INTEGER;
C_WR_PNTR_WIDTH : INTEGER;
C_WR_RESPONSE_LATENCY : INTEGER;
C_MSGON_VAL : INTEGER;
C_ENABLE_RST_SYNC : INTEGER;
C_EN_SAFETY_CKT : INTEGER;
C_ERROR_INJECTION_TYPE : INTEGER;
C_SYNCHRONIZER_STAGE : INTEGER;
C_INTERFACE_TYPE : INTEGER;
C_AXI_TYPE : INTEGER;
C_HAS_AXI_WR_CHANNEL : INTEGER;
C_HAS_AXI_RD_CHANNEL : INTEGER;
C_HAS_SLAVE_CE : INTEGER;
C_HAS_MASTER_CE : INTEGER;
C_ADD_NGC_CONSTRAINT : INTEGER;
C_USE_COMMON_OVERFLOW : INTEGER;
C_USE_COMMON_UNDERFLOW : INTEGER;
C_USE_DEFAULT_SETTINGS : INTEGER;
C_AXI_ID_WIDTH : INTEGER;
C_AXI_ADDR_WIDTH : INTEGER;
C_AXI_DATA_WIDTH : INTEGER;
C_AXI_LEN_WIDTH : INTEGER;
C_AXI_LOCK_WIDTH : INTEGER;
C_HAS_AXI_ID : INTEGER;
C_HAS_AXI_AWUSER : INTEGER;
C_HAS_AXI_WUSER : INTEGER;
C_HAS_AXI_BUSER : INTEGER;
C_HAS_AXI_ARUSER : INTEGER;
C_HAS_AXI_RUSER : INTEGER;
C_AXI_ARUSER_WIDTH : INTEGER;
C_AXI_AWUSER_WIDTH : INTEGER;
C_AXI_WUSER_WIDTH : INTEGER;
C_AXI_BUSER_WIDTH : INTEGER;
C_AXI_RUSER_WIDTH : INTEGER;
C_HAS_AXIS_TDATA : INTEGER;
C_HAS_AXIS_TID : INTEGER;
C_HAS_AXIS_TDEST : INTEGER;
C_HAS_AXIS_TUSER : INTEGER;
C_HAS_AXIS_TREADY : INTEGER;
C_HAS_AXIS_TLAST : INTEGER;
C_HAS_AXIS_TSTRB : INTEGER;
C_HAS_AXIS_TKEEP : INTEGER;
C_AXIS_TDATA_WIDTH : INTEGER;
C_AXIS_TID_WIDTH : INTEGER;
C_AXIS_TDEST_WIDTH : INTEGER;
C_AXIS_TUSER_WIDTH : INTEGER;
C_AXIS_TSTRB_WIDTH : INTEGER;
C_AXIS_TKEEP_WIDTH : INTEGER;
C_WACH_TYPE : INTEGER;
C_WDCH_TYPE : INTEGER;
C_WRCH_TYPE : INTEGER;
C_RACH_TYPE : INTEGER;
C_RDCH_TYPE : INTEGER;
C_AXIS_TYPE : INTEGER;
C_IMPLEMENTATION_TYPE_WACH : INTEGER;
C_IMPLEMENTATION_TYPE_WDCH : INTEGER;
C_IMPLEMENTATION_TYPE_WRCH : INTEGER;
C_IMPLEMENTATION_TYPE_RACH : INTEGER;
C_IMPLEMENTATION_TYPE_RDCH : INTEGER;
C_IMPLEMENTATION_TYPE_AXIS : INTEGER;
C_APPLICATION_TYPE_WACH : INTEGER;
C_APPLICATION_TYPE_WDCH : INTEGER;
C_APPLICATION_TYPE_WRCH : INTEGER;
C_APPLICATION_TYPE_RACH : INTEGER;
C_APPLICATION_TYPE_RDCH : INTEGER;
C_APPLICATION_TYPE_AXIS : INTEGER;
C_PRIM_FIFO_TYPE_WACH : STRING;
C_PRIM_FIFO_TYPE_WDCH : STRING;
C_PRIM_FIFO_TYPE_WRCH : STRING;
C_PRIM_FIFO_TYPE_RACH : STRING;
C_PRIM_FIFO_TYPE_RDCH : STRING;
C_PRIM_FIFO_TYPE_AXIS : STRING;
C_USE_ECC_WACH : INTEGER;
C_USE_ECC_WDCH : INTEGER;
C_USE_ECC_WRCH : INTEGER;
C_USE_ECC_RACH : INTEGER;
C_USE_ECC_RDCH : INTEGER;
C_USE_ECC_AXIS : INTEGER;
C_ERROR_INJECTION_TYPE_WACH : INTEGER;
C_ERROR_INJECTION_TYPE_WDCH : INTEGER;
C_ERROR_INJECTION_TYPE_WRCH : INTEGER;
C_ERROR_INJECTION_TYPE_RACH : INTEGER;
C_ERROR_INJECTION_TYPE_RDCH : INTEGER;
C_ERROR_INJECTION_TYPE_AXIS : INTEGER;
C_DIN_WIDTH_WACH : INTEGER;
C_DIN_WIDTH_WDCH : INTEGER;
C_DIN_WIDTH_WRCH : INTEGER;
C_DIN_WIDTH_RACH : INTEGER;
C_DIN_WIDTH_RDCH : INTEGER;
C_DIN_WIDTH_AXIS : INTEGER;
C_WR_DEPTH_WACH : INTEGER;
C_WR_DEPTH_WDCH : INTEGER;
C_WR_DEPTH_WRCH : INTEGER;
C_WR_DEPTH_RACH : INTEGER;
C_WR_DEPTH_RDCH : INTEGER;
C_WR_DEPTH_AXIS : INTEGER;
C_WR_PNTR_WIDTH_WACH : INTEGER;
C_WR_PNTR_WIDTH_WDCH : INTEGER;
C_WR_PNTR_WIDTH_WRCH : INTEGER;
C_WR_PNTR_WIDTH_RACH : INTEGER;
C_WR_PNTR_WIDTH_RDCH : INTEGER;
C_WR_PNTR_WIDTH_AXIS : INTEGER;
C_HAS_DATA_COUNTS_WACH : INTEGER;
C_HAS_DATA_COUNTS_WDCH : INTEGER;
C_HAS_DATA_COUNTS_WRCH : INTEGER;
C_HAS_DATA_COUNTS_RACH : INTEGER;
C_HAS_DATA_COUNTS_RDCH : INTEGER;
C_HAS_DATA_COUNTS_AXIS : INTEGER;
C_HAS_PROG_FLAGS_WACH : INTEGER;
C_HAS_PROG_FLAGS_WDCH : INTEGER;
C_HAS_PROG_FLAGS_WRCH : INTEGER;
C_HAS_PROG_FLAGS_RACH : INTEGER;
C_HAS_PROG_FLAGS_RDCH : INTEGER;
C_HAS_PROG_FLAGS_AXIS : INTEGER;
C_PROG_FULL_TYPE_WACH : INTEGER;
C_PROG_FULL_TYPE_WDCH : INTEGER;
C_PROG_FULL_TYPE_WRCH : INTEGER;
C_PROG_FULL_TYPE_RACH : INTEGER;
C_PROG_FULL_TYPE_RDCH : INTEGER;
C_PROG_FULL_TYPE_AXIS : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL_WACH : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL_WDCH : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL_WRCH : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL_RACH : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL_RDCH : INTEGER;
C_PROG_FULL_THRESH_ASSERT_VAL_AXIS : INTEGER;
C_PROG_EMPTY_TYPE_WACH : INTEGER;
C_PROG_EMPTY_TYPE_WDCH : INTEGER;
C_PROG_EMPTY_TYPE_WRCH : INTEGER;
C_PROG_EMPTY_TYPE_RACH : INTEGER;
C_PROG_EMPTY_TYPE_RDCH : INTEGER;
C_PROG_EMPTY_TYPE_AXIS : INTEGER;
C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH : INTEGER;
C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH : INTEGER;
C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH : INTEGER;
C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH : INTEGER;
C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH : INTEGER;
C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS : INTEGER;
C_REG_SLICE_MODE_WACH : INTEGER;
C_REG_SLICE_MODE_WDCH : INTEGER;
C_REG_SLICE_MODE_WRCH : INTEGER;
C_REG_SLICE_MODE_RACH : INTEGER;
C_REG_SLICE_MODE_RDCH : INTEGER;
C_REG_SLICE_MODE_AXIS : INTEGER
);
PORT (
backup : IN STD_LOGIC;
backup_marker : IN STD_LOGIC;
clk : IN STD_LOGIC;
rst : IN STD_LOGIC;
srst : IN STD_LOGIC;
wr_clk : IN STD_LOGIC;
wr_rst : IN STD_LOGIC;
rd_clk : IN STD_LOGIC;
rd_rst : IN STD_LOGIC;
din : IN STD_LOGIC_VECTOR(DATA_WIDTH-1 DOWNTO 0);
wr_en : IN STD_LOGIC;
rd_en : IN STD_LOGIC;
prog_empty_thresh : IN STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
prog_empty_thresh_assert : IN STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
prog_empty_thresh_negate : IN STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
prog_full_thresh : IN STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
prog_full_thresh_assert : IN STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
prog_full_thresh_negate : IN STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
int_clk : IN STD_LOGIC;
injectdbiterr : IN STD_LOGIC;
injectsbiterr : IN STD_LOGIC;
sleep : IN STD_LOGIC;
dout : OUT STD_LOGIC_VECTOR(DATA_WIDTH-1 DOWNTO 0);
full : OUT STD_LOGIC;
almost_full : OUT STD_LOGIC;
wr_ack : OUT STD_LOGIC;
overflow : OUT STD_LOGIC;
empty : OUT STD_LOGIC;
almost_empty : OUT STD_LOGIC;
valid : OUT STD_LOGIC;
underflow : OUT STD_LOGIC;
data_count : OUT STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
rd_data_count : OUT STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
wr_data_count : OUT STD_LOGIC_VECTOR(log2(DEPTH)-1 DOWNTO 0);
prog_full : OUT STD_LOGIC;
prog_empty : OUT STD_LOGIC;
sbiterr : OUT STD_LOGIC;
dbiterr : OUT STD_LOGIC;
wr_rst_busy : OUT STD_LOGIC;
rd_rst_busy : OUT STD_LOGIC;
m_aclk : IN STD_LOGIC;
s_aclk : IN STD_LOGIC;
s_aresetn : IN STD_LOGIC;
m_aclk_en : IN STD_LOGIC;
s_aclk_en : IN STD_LOGIC;
s_axi_awid : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_awaddr : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
s_axi_awlen : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
s_axi_awsize : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
s_axi_awburst : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
s_axi_awlock : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_awcache : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
s_axi_awprot : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
s_axi_awqos : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
s_axi_awregion : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
s_axi_awuser : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_awvalid : IN STD_LOGIC;
s_axi_awready : OUT STD_LOGIC;
s_axi_wid : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_wdata : IN STD_LOGIC_VECTOR(63 DOWNTO 0);
s_axi_wstrb : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
s_axi_wlast : IN STD_LOGIC;
s_axi_wuser : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_wvalid : IN STD_LOGIC;
s_axi_wready : OUT STD_LOGIC;
s_axi_bid : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_bresp : OUT STD_LOGIC_VECTOR(1 DOWNTO 0);
s_axi_buser : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_bvalid : OUT STD_LOGIC;
s_axi_bready : IN STD_LOGIC;
m_axi_awid : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_awaddr : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
m_axi_awlen : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
m_axi_awsize : OUT STD_LOGIC_VECTOR(2 DOWNTO 0);
m_axi_awburst : OUT STD_LOGIC_VECTOR(1 DOWNTO 0);
m_axi_awlock : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_awcache : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axi_awprot : OUT STD_LOGIC_VECTOR(2 DOWNTO 0);
m_axi_awqos : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axi_awregion : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axi_awuser : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_awvalid : OUT STD_LOGIC;
m_axi_awready : IN STD_LOGIC;
m_axi_wid : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_wdata : OUT STD_LOGIC_VECTOR(63 DOWNTO 0);
m_axi_wstrb : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
m_axi_wlast : OUT STD_LOGIC;
m_axi_wuser : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_wvalid : OUT STD_LOGIC;
m_axi_wready : IN STD_LOGIC;
m_axi_bid : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_bresp : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
m_axi_buser : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_bvalid : IN STD_LOGIC;
m_axi_bready : OUT STD_LOGIC;
s_axi_arid : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_araddr : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
s_axi_arlen : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
s_axi_arsize : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
s_axi_arburst : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
s_axi_arlock : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_arcache : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
s_axi_arprot : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
s_axi_arqos : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
s_axi_arregion : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
s_axi_aruser : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_arvalid : IN STD_LOGIC;
s_axi_arready : OUT STD_LOGIC;
s_axi_rid : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_rdata : OUT STD_LOGIC_VECTOR(63 DOWNTO 0);
s_axi_rresp : OUT STD_LOGIC_VECTOR(1 DOWNTO 0);
s_axi_rlast : OUT STD_LOGIC;
s_axi_ruser : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axi_rvalid : OUT STD_LOGIC;
s_axi_rready : IN STD_LOGIC;
m_axi_arid : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_araddr : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
m_axi_arlen : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
m_axi_arsize : OUT STD_LOGIC_VECTOR(2 DOWNTO 0);
m_axi_arburst : OUT STD_LOGIC_VECTOR(1 DOWNTO 0);
m_axi_arlock : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_arcache : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axi_arprot : OUT STD_LOGIC_VECTOR(2 DOWNTO 0);
m_axi_arqos : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axi_arregion : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axi_aruser : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_arvalid : OUT STD_LOGIC;
m_axi_arready : IN STD_LOGIC;
m_axi_rid : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_rdata : IN STD_LOGIC_VECTOR(63 DOWNTO 0);
m_axi_rresp : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
m_axi_rlast : IN STD_LOGIC;
m_axi_ruser : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axi_rvalid : IN STD_LOGIC;
m_axi_rready : OUT STD_LOGIC;
s_axis_tvalid : IN STD_LOGIC;
s_axis_tready : OUT STD_LOGIC;
s_axis_tdata : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
s_axis_tstrb : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axis_tkeep : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axis_tlast : IN STD_LOGIC;
s_axis_tid : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axis_tdest : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
s_axis_tuser : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
m_axis_tvalid : OUT STD_LOGIC;
m_axis_tready : IN STD_LOGIC;
m_axis_tdata : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
m_axis_tstrb : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axis_tkeep : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axis_tlast : OUT STD_LOGIC;
m_axis_tid : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axis_tdest : OUT STD_LOGIC_VECTOR(0 DOWNTO 0);
m_axis_tuser : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_aw_injectsbiterr : IN STD_LOGIC;
axi_aw_injectdbiterr : IN STD_LOGIC;
axi_aw_prog_full_thresh : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_aw_prog_empty_thresh : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_aw_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_aw_wr_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_aw_rd_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_aw_sbiterr : OUT STD_LOGIC;
axi_aw_dbiterr : OUT STD_LOGIC;
axi_aw_overflow : OUT STD_LOGIC;
axi_aw_underflow : OUT STD_LOGIC;
axi_aw_prog_full : OUT STD_LOGIC;
axi_aw_prog_empty : OUT STD_LOGIC;
axi_w_injectsbiterr : IN STD_LOGIC;
axi_w_injectdbiterr : IN STD_LOGIC;
axi_w_prog_full_thresh : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
axi_w_prog_empty_thresh : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
axi_w_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axi_w_wr_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axi_w_rd_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axi_w_sbiterr : OUT STD_LOGIC;
axi_w_dbiterr : OUT STD_LOGIC;
axi_w_overflow : OUT STD_LOGIC;
axi_w_underflow : OUT STD_LOGIC;
axi_w_prog_full : OUT STD_LOGIC;
axi_w_prog_empty : OUT STD_LOGIC;
axi_b_injectsbiterr : IN STD_LOGIC;
axi_b_injectdbiterr : IN STD_LOGIC;
axi_b_prog_full_thresh : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_b_prog_empty_thresh : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_b_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_b_wr_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_b_rd_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_b_sbiterr : OUT STD_LOGIC;
axi_b_dbiterr : OUT STD_LOGIC;
axi_b_overflow : OUT STD_LOGIC;
axi_b_underflow : OUT STD_LOGIC;
axi_b_prog_full : OUT STD_LOGIC;
axi_b_prog_empty : OUT STD_LOGIC;
axi_ar_injectsbiterr : IN STD_LOGIC;
axi_ar_injectdbiterr : IN STD_LOGIC;
axi_ar_prog_full_thresh : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_ar_prog_empty_thresh : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
axi_ar_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_ar_wr_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_ar_rd_data_count : OUT STD_LOGIC_VECTOR(4 DOWNTO 0);
axi_ar_sbiterr : OUT STD_LOGIC;
axi_ar_dbiterr : OUT STD_LOGIC;
axi_ar_overflow : OUT STD_LOGIC;
axi_ar_underflow : OUT STD_LOGIC;
axi_ar_prog_full : OUT STD_LOGIC;
axi_ar_prog_empty : OUT STD_LOGIC;
axi_r_injectsbiterr : IN STD_LOGIC;
axi_r_injectdbiterr : IN STD_LOGIC;
axi_r_prog_full_thresh : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
axi_r_prog_empty_thresh : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
axi_r_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axi_r_wr_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axi_r_rd_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axi_r_sbiterr : OUT STD_LOGIC;
axi_r_dbiterr : OUT STD_LOGIC;
axi_r_overflow : OUT STD_LOGIC;
axi_r_underflow : OUT STD_LOGIC;
axi_r_prog_full : OUT STD_LOGIC;
axi_r_prog_empty : OUT STD_LOGIC;
axis_injectsbiterr : IN STD_LOGIC;
axis_injectdbiterr : IN STD_LOGIC;
axis_prog_full_thresh : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
axis_prog_empty_thresh : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
axis_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axis_wr_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axis_rd_data_count : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
axis_sbiterr : OUT STD_LOGIC;
axis_dbiterr : OUT STD_LOGIC;
axis_overflow : OUT STD_LOGIC;
axis_underflow : OUT STD_LOGIC;
axis_prog_full : OUT STD_LOGIC;
axis_prog_empty : OUT STD_LOGIC
);
END COMPONENT fifo_generator_v13_2_7;
--}}}
ATTRIBUTE X_CORE_INFO : STRING;
ATTRIBUTE X_CORE_INFO OF xil_async_fifo_arch: ARCHITECTURE IS "fifo_generator_v13_2_7,Vivado 2018.3.1";
ATTRIBUTE CHECK_LICENSE_TYPE : STRING;
ATTRIBUTE CHECK_LICENSE_TYPE OF xil_async_fifo_arch : ARCHITECTURE IS "xil_async_fifo,fifo_generator_v13_2_7,{}";
ATTRIBUTE CORE_GENERATION_INFO : STRING;
ATTRIBUTE CORE_GENERATION_INFO OF xil_async_fifo_arch: ARCHITECTURE IS "xil_async_fifo,fifo_generator_v13_2_7,{x_ipProduct=Vivado 2018.3.1,x_ipVendor=xilinx.com,x_ipLibrary=ip,x_ipName=fifo_generator,x_ipVersion=13.2,x_ipCoreRevision=3,x_ipLanguage=VHDL,x_ipSimLanguage=MIXED,C_COMMON_CLOCK=0,C_SELECT_XPM=0,C_COUNT_TYPE=0,C_DATA_COUNT_WIDTH=4,C_DEFAULT_VALUE=BlankString,C_DIN_WIDTH=146,C_DOUT_RST_VAL=0,C_DOUT_WIDTH=146,C_ENABLE_RLOCS=0,C_FAMILY=virtexuplus,C_FULL_FLAGS_RST_VAL=1,C_HAS_ALMOST_EMPTY=0,C_HAS_ALMOST_FULL=0,C_HAS_BACKUP=0,C_HAS_DATA_COUNT=0,C_HAS_INT_C" &
"LK=0,C_HAS_MEMINIT_FILE=0,C_HAS_OVERFLOW=0,C_HAS_RD_DATA_COUNT=0,C_HAS_RD_RST=0,C_HAS_RST=1,C_HAS_SRST=0,C_HAS_UNDERFLOW=0,C_HAS_VALID=0,C_HAS_WR_ACK=0,C_HAS_WR_DATA_COUNT=0,C_HAS_WR_RST=0,C_IMPLEMENTATION_TYPE=2,C_INIT_WR_PNTR_VAL=0,C_MEMORY_TYPE=2,C_MIF_FILE_NAME=BlankString,C_OPTIMIZATION_MODE=0,C_OVERFLOW_LOW=0,C_PRELOAD_LATENCY=0,C_PRELOAD_REGS=1,C_PRIM_FIFO_TYPE=512x72,C_PROG_EMPTY_THRESH_ASSERT_VAL=4,C_PROG_EMPTY_THRESH_NEGATE_VAL=5,C_PROG_EMPTY_TYPE=0,C_PROG_FULL_THRESH_ASSERT_VAL=15,C_P" &
"ROG_FULL_THRESH_NEGATE_VAL=14,C_PROG_FULL_TYPE=0,C_RD_DATA_COUNT_WIDTH=4,C_RD_DEPTH=16,C_RD_FREQ=1,C_RD_PNTR_WIDTH=4,C_UNDERFLOW_LOW=0,C_USE_DOUT_RST=1,C_USE_ECC=0,C_USE_EMBEDDED_REG=0,C_USE_PIPELINE_REG=0,C_POWER_SAVING_MODE=0,C_USE_FIFO16_FLAGS=0,C_USE_FWFT_DATA_COUNT=0,C_VALID_LOW=0,C_WR_ACK_LOW=0,C_WR_DATA_COUNT_WIDTH=4,C_WR_DEPTH=16,C_WR_FREQ=1,C_WR_PNTR_WIDTH=4,C_WR_RESPONSE_LATENCY=1,C_MSGON_VAL=1,C_ENABLE_RST_SYNC=1,C_EN_SAFETY_CKT=0,C_ERROR_INJECTION_TYPE=0,C_SYNCHRONIZER_STAGE=2,C_INTE" &
"RFACE_TYPE=0,C_AXI_TYPE=1,C_HAS_AXI_WR_CHANNEL=1,C_HAS_AXI_RD_CHANNEL=1,C_HAS_SLAVE_CE=0,C_HAS_MASTER_CE=0,C_ADD_NGC_CONSTRAINT=0,C_USE_COMMON_OVERFLOW=0,C_USE_COMMON_UNDERFLOW=0,C_USE_DEFAULT_SETTINGS=0,C_AXI_ID_WIDTH=1,C_AXI_ADDR_WIDTH=32,C_AXI_DATA_WIDTH=64,C_AXI_LEN_WIDTH=8,C_AXI_LOCK_WIDTH=1,C_HAS_AXI_ID=0,C_HAS_AXI_AWUSER=0,C_HAS_AXI_WUSER=0,C_HAS_AXI_BUSER=0,C_HAS_AXI_ARUSER=0,C_HAS_AXI_RUSER=0,C_AXI_ARUSER_WIDTH=1,C_AXI_AWUSER_WIDTH=1,C_AXI_WUSER_WIDTH=1,C_AXI_BUSER_WIDTH=1,C_AXI_RUSER_W" &
"IDTH=1,C_HAS_AXIS_TDATA=1,C_HAS_AXIS_TID=0,C_HAS_AXIS_TDEST=0,C_HAS_AXIS_TUSER=1,C_HAS_AXIS_TREADY=1,C_HAS_AXIS_TLAST=0,C_HAS_AXIS_TSTRB=0,C_HAS_AXIS_TKEEP=0,C_AXIS_TDATA_WIDTH=8,C_AXIS_TID_WIDTH=1,C_AXIS_TDEST_WIDTH=1,C_AXIS_TUSER_WIDTH=4,C_AXIS_TSTRB_WIDTH=1,C_AXIS_TKEEP_WIDTH=1,C_WACH_TYPE=0,C_WDCH_TYPE=0,C_WRCH_TYPE=0,C_RACH_TYPE=0,C_RDCH_TYPE=0,C_AXIS_TYPE=0,C_IMPLEMENTATION_TYPE_WACH=1,C_IMPLEMENTATION_TYPE_WDCH=1,C_IMPLEMENTATION_TYPE_WRCH=1,C_IMPLEMENTATION_TYPE_RACH=1,C_IMPLEMENTATION_T" &
"YPE_RDCH=1,C_IMPLEMENTATION_TYPE_AXIS=1,C_APPLICATION_TYPE_WACH=0,C_APPLICATION_TYPE_WDCH=0,C_APPLICATION_TYPE_WRCH=0,C_APPLICATION_TYPE_RACH=0,C_APPLICATION_TYPE_RDCH=0,C_APPLICATION_TYPE_AXIS=0,C_PRIM_FIFO_TYPE_WACH=512x36,C_PRIM_FIFO_TYPE_WDCH=512x72,C_PRIM_FIFO_TYPE_WRCH=512x36,C_PRIM_FIFO_TYPE_RACH=512x36,C_PRIM_FIFO_TYPE_RDCH=512x72,C_PRIM_FIFO_TYPE_AXIS=1kx18,C_USE_ECC_WACH=0,C_USE_ECC_WDCH=0,C_USE_ECC_WRCH=0,C_USE_ECC_RACH=0,C_USE_ECC_RDCH=0,C_USE_ECC_AXIS=0,C_ERROR_INJECTION_TYPE_WACH=0" &
",C_ERROR_INJECTION_TYPE_WDCH=0,C_ERROR_INJECTION_TYPE_WRCH=0,C_ERROR_INJECTION_TYPE_RACH=0,C_ERROR_INJECTION_TYPE_RDCH=0,C_ERROR_INJECTION_TYPE_AXIS=0,C_DIN_WIDTH_WACH=1,C_DIN_WIDTH_WDCH=64,C_DIN_WIDTH_WRCH=2,C_DIN_WIDTH_RACH=32,C_DIN_WIDTH_RDCH=64,C_DIN_WIDTH_AXIS=1,C_WR_DEPTH_WACH=16,C_WR_DEPTH_WDCH=1024,C_WR_DEPTH_WRCH=16,C_WR_DEPTH_RACH=16,C_WR_DEPTH_RDCH=1024,C_WR_DEPTH_AXIS=1024,C_WR_PNTR_WIDTH_WACH=4,C_WR_PNTR_WIDTH_WDCH=10,C_WR_PNTR_WIDTH_WRCH=4,C_WR_PNTR_WIDTH_RACH=4,C_WR_PNTR_WIDTH_RDC" &
"H=10,C_WR_PNTR_WIDTH_AXIS=10,C_HAS_DATA_COUNTS_WACH=0,C_HAS_DATA_COUNTS_WDCH=0,C_HAS_DATA_COUNTS_WRCH=0,C_HAS_DATA_COUNTS_RACH=0,C_HAS_DATA_COUNTS_RDCH=0,C_HAS_DATA_COUNTS_AXIS=0,C_HAS_PROG_FLAGS_WACH=0,C_HAS_PROG_FLAGS_WDCH=0,C_HAS_PROG_FLAGS_WRCH=0,C_HAS_PROG_FLAGS_RACH=0,C_HAS_PROG_FLAGS_RDCH=0,C_HAS_PROG_FLAGS_AXIS=0,C_PROG_FULL_TYPE_WACH=0,C_PROG_FULL_TYPE_WDCH=0,C_PROG_FULL_TYPE_WRCH=0,C_PROG_FULL_TYPE_RACH=0,C_PROG_FULL_TYPE_RDCH=0,C_PROG_FULL_TYPE_AXIS=0,C_PROG_FULL_THRESH_ASSERT_VAL_WAC" &
"H=1023,C_PROG_FULL_THRESH_ASSERT_VAL_WDCH=1023,C_PROG_FULL_THRESH_ASSERT_VAL_WRCH=1023,C_PROG_FULL_THRESH_ASSERT_VAL_RACH=1023,C_PROG_FULL_THRESH_ASSERT_VAL_RDCH=1023,C_PROG_FULL_THRESH_ASSERT_VAL_AXIS=1023,C_PROG_EMPTY_TYPE_WACH=0,C_PROG_EMPTY_TYPE_WDCH=0,C_PROG_EMPTY_TYPE_WRCH=0,C_PROG_EMPTY_TYPE_RACH=0,C_PROG_EMPTY_TYPE_RDCH=0,C_PROG_EMPTY_TYPE_AXIS=0,C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH=1022,C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH=1022,C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH=1022,C_PROG_EMPTY_THRESH_" &
"ASSERT_VAL_RACH=1022,C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH=1022,C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS=1022,C_REG_SLICE_MODE_WACH=0,C_REG_SLICE_MODE_WDCH=0,C_REG_SLICE_MODE_WRCH=0,C_REG_SLICE_MODE_RACH=0,C_REG_SLICE_MODE_RDCH=0,C_REG_SLICE_MODE_AXIS=0}";
ATTRIBUTE X_INTERFACE_INFO : STRING;
ATTRIBUTE X_INTERFACE_PARAMETER : STRING;
ATTRIBUTE X_INTERFACE_INFO OF rdempty: SIGNAL IS "xilinx.com:interface:fifo_read:1.0 FIFO_READ EMPTY";
ATTRIBUTE X_INTERFACE_INFO OF wrfull: SIGNAL IS "xilinx.com:interface:fifo_write:1.0 FIFO_WRITE FULL";
ATTRIBUTE X_INTERFACE_INFO OF rddata: SIGNAL IS "xilinx.com:interface:fifo_read:1.0 FIFO_READ RD_DATA";
ATTRIBUTE X_INTERFACE_INFO OF rdreq: SIGNAL IS "xilinx.com:interface:fifo_read:1.0 FIFO_READ RD_EN";
ATTRIBUTE X_INTERFACE_INFO OF wrreq: SIGNAL IS "xilinx.com:interface:fifo_write:1.0 FIFO_WRITE WR_EN";
ATTRIBUTE X_INTERFACE_INFO OF wrdata: SIGNAL IS "xilinx.com:interface:fifo_write:1.0 FIFO_WRITE WR_DATA";
ATTRIBUTE X_INTERFACE_PARAMETER OF rdclk: SIGNAL IS "XIL_INTERFACENAME read_clk, FREQ_HZ 100000000, PHASE 0.000, INSERT_VIP 0";
ATTRIBUTE X_INTERFACE_INFO OF rdclk: SIGNAL IS "xilinx.com:signal:clock:1.0 read_clk CLK";
ATTRIBUTE X_INTERFACE_PARAMETER OF wrclk: SIGNAL IS "XIL_INTERFACENAME write_clk, FREQ_HZ 100000000, PHASE 0.000, INSERT_VIP 0";
ATTRIBUTE X_INTERFACE_INFO OF wrclk: SIGNAL IS "xilinx.com:signal:clock:1.0 write_clk CLK";
function calcFallThrough(showAhead : string) return integer is
begin
if showAhead = "ON" then
return 1;
else
return 0;
end if;
end function;
constant fallThrough : integer := calcFallThrough(SHOWAHEAD);
signal wr_rst_busy : std_logic;
BEGIN
fifo_async_inst : fifo_generator_v13_2_7
--{{{
GENERIC MAP (
C_COMMON_CLOCK => 0,
C_SELECT_XPM => 0,
C_COUNT_TYPE => 0,
C_DATA_COUNT_WIDTH => log2(DEPTH),
C_DEFAULT_VALUE => "BlankString",
C_DIN_WIDTH => DATA_WIDTH,
C_DOUT_RST_VAL => "0",
C_DOUT_WIDTH => DATA_WIDTH,
C_ENABLE_RLOCS => 0,
C_FAMILY => "virtexuplus",
C_FULL_FLAGS_RST_VAL => 1,
C_HAS_ALMOST_EMPTY => 0,
C_HAS_ALMOST_FULL => 0,
C_HAS_BACKUP => 0,
C_HAS_DATA_COUNT => 0,
C_HAS_INT_CLK => 0,
C_HAS_MEMINIT_FILE => 0,
C_HAS_OVERFLOW => 0,
C_HAS_RD_DATA_COUNT => 1,
C_HAS_RD_RST => 0,
C_HAS_RST => 1,
C_HAS_SRST => 0,
C_HAS_UNDERFLOW => 0,
C_HAS_VALID => 0,
C_HAS_WR_ACK => 0,
C_HAS_WR_DATA_COUNT => 1,
C_HAS_WR_RST => 0,
C_IMPLEMENTATION_TYPE => 2,
C_INIT_WR_PNTR_VAL => 0,
C_MEMORY_TYPE => 1,
C_MIF_FILE_NAME => "BlankString",
C_OPTIMIZATION_MODE => 0,
C_OVERFLOW_LOW => 0,
C_PRELOAD_LATENCY => 1-fallThrough,
C_PRELOAD_REGS => fallThrough,
C_PRIM_FIFO_TYPE => "1kx18",
C_PROG_EMPTY_THRESH_ASSERT_VAL => 4,
C_PROG_EMPTY_THRESH_NEGATE_VAL => 5,
C_PROG_EMPTY_TYPE => 0,
C_PROG_FULL_THRESH_ASSERT_VAL => 15,
C_PROG_FULL_THRESH_NEGATE_VAL => 14,
C_PROG_FULL_TYPE => 0,
C_RD_DATA_COUNT_WIDTH => log2(DEPTH),
C_RD_DEPTH => DEPTH,
C_RD_FREQ => 1,
C_RD_PNTR_WIDTH => log2(DEPTH),
C_UNDERFLOW_LOW => 0,
C_USE_DOUT_RST => 1,
C_USE_ECC => 0,
C_USE_EMBEDDED_REG => 0,
C_USE_PIPELINE_REG => 0,
C_POWER_SAVING_MODE => 0,
C_USE_FIFO16_FLAGS => 0,
C_USE_FWFT_DATA_COUNT => 0,
C_VALID_LOW => 0,
C_WR_ACK_LOW => 0,
C_WR_DATA_COUNT_WIDTH => log2(DEPTH),
C_WR_DEPTH => DEPTH,
C_WR_FREQ => 1,
C_WR_PNTR_WIDTH => log2(DEPTH),
C_WR_RESPONSE_LATENCY => 1,
C_MSGON_VAL => 1,
C_ENABLE_RST_SYNC => 1,
C_EN_SAFETY_CKT => 1,
C_ERROR_INJECTION_TYPE => 0,
C_SYNCHRONIZER_STAGE => 2,
C_INTERFACE_TYPE => 0,
C_AXI_TYPE => 1,
C_HAS_AXI_WR_CHANNEL => 1,
C_HAS_AXI_RD_CHANNEL => 1,
C_HAS_SLAVE_CE => 0,
C_HAS_MASTER_CE => 0,
C_ADD_NGC_CONSTRAINT => 0,
C_USE_COMMON_OVERFLOW => 0,
C_USE_COMMON_UNDERFLOW => 0,
C_USE_DEFAULT_SETTINGS => 0,
C_AXI_ID_WIDTH => 1,
C_AXI_ADDR_WIDTH => 32,
C_AXI_DATA_WIDTH => 64,
C_AXI_LEN_WIDTH => 8,
C_AXI_LOCK_WIDTH => 1,
C_HAS_AXI_ID => 0,
C_HAS_AXI_AWUSER => 0,
C_HAS_AXI_WUSER => 0,
C_HAS_AXI_BUSER => 0,
C_HAS_AXI_ARUSER => 0,
C_HAS_AXI_RUSER => 0,
C_AXI_ARUSER_WIDTH => 1,
C_AXI_AWUSER_WIDTH => 1,
C_AXI_WUSER_WIDTH => 1,
C_AXI_BUSER_WIDTH => 1,
C_AXI_RUSER_WIDTH => 1,
C_HAS_AXIS_TDATA => 1,
C_HAS_AXIS_TID => 0,
C_HAS_AXIS_TDEST => 0,
C_HAS_AXIS_TUSER => 1,
C_HAS_AXIS_TREADY => 1,
C_HAS_AXIS_TLAST => 0,
C_HAS_AXIS_TSTRB => 0,
C_HAS_AXIS_TKEEP => 0,
C_AXIS_TDATA_WIDTH => 8,
C_AXIS_TID_WIDTH => 1,
C_AXIS_TDEST_WIDTH => 1,
C_AXIS_TUSER_WIDTH => 4,
C_AXIS_TSTRB_WIDTH => 1,
C_AXIS_TKEEP_WIDTH => 1,
C_WACH_TYPE => 0,
C_WDCH_TYPE => 0,
C_WRCH_TYPE => 0,
C_RACH_TYPE => 0,
C_RDCH_TYPE => 0,
C_AXIS_TYPE => 0,
C_IMPLEMENTATION_TYPE_WACH => 1,
C_IMPLEMENTATION_TYPE_WDCH => 1,
C_IMPLEMENTATION_TYPE_WRCH => 1,
C_IMPLEMENTATION_TYPE_RACH => 1,
C_IMPLEMENTATION_TYPE_RDCH => 1,
C_IMPLEMENTATION_TYPE_AXIS => 1,
C_APPLICATION_TYPE_WACH => 0,
C_APPLICATION_TYPE_WDCH => 0,
C_APPLICATION_TYPE_WRCH => 0,
C_APPLICATION_TYPE_RACH => 0,
C_APPLICATION_TYPE_RDCH => 0,
C_APPLICATION_TYPE_AXIS => 0,
C_PRIM_FIFO_TYPE_WACH => "512x36",
C_PRIM_FIFO_TYPE_WDCH => "512x72",
C_PRIM_FIFO_TYPE_WRCH => "512x36",
C_PRIM_FIFO_TYPE_RACH => "512x36",
C_PRIM_FIFO_TYPE_RDCH => "512x72",
C_PRIM_FIFO_TYPE_AXIS => "1kx18",
C_USE_ECC_WACH => 0,
C_USE_ECC_WDCH => 0,
C_USE_ECC_WRCH => 0,
C_USE_ECC_RACH => 0,
C_USE_ECC_RDCH => 0,
C_USE_ECC_AXIS => 0,
C_ERROR_INJECTION_TYPE_WACH => 0,
C_ERROR_INJECTION_TYPE_WDCH => 0,
C_ERROR_INJECTION_TYPE_WRCH => 0,
C_ERROR_INJECTION_TYPE_RACH => 0,
C_ERROR_INJECTION_TYPE_RDCH => 0,
C_ERROR_INJECTION_TYPE_AXIS => 0,
C_DIN_WIDTH_WACH => 1,
C_DIN_WIDTH_WDCH => 64,
C_DIN_WIDTH_WRCH => 2,
C_DIN_WIDTH_RACH => 32,
C_DIN_WIDTH_RDCH => 64,
C_DIN_WIDTH_AXIS => 1,
C_WR_DEPTH_WACH => 16,
C_WR_DEPTH_WDCH => 1024,
C_WR_DEPTH_WRCH => 16,
C_WR_DEPTH_RACH => 16,
C_WR_DEPTH_RDCH => 1024,
C_WR_DEPTH_AXIS => 1024,
C_WR_PNTR_WIDTH_WACH => 4,
C_WR_PNTR_WIDTH_WDCH => 10,
C_WR_PNTR_WIDTH_WRCH => 4,
C_WR_PNTR_WIDTH_RACH => 4,
C_WR_PNTR_WIDTH_RDCH => 10,
C_WR_PNTR_WIDTH_AXIS => 10,
C_HAS_DATA_COUNTS_WACH => 0,
C_HAS_DATA_COUNTS_WDCH => 0,
C_HAS_DATA_COUNTS_WRCH => 0,
C_HAS_DATA_COUNTS_RACH => 0,
C_HAS_DATA_COUNTS_RDCH => 0,
C_HAS_DATA_COUNTS_AXIS => 0,
C_HAS_PROG_FLAGS_WACH => 0,
C_HAS_PROG_FLAGS_WDCH => 0,
C_HAS_PROG_FLAGS_WRCH => 0,
C_HAS_PROG_FLAGS_RACH => 0,
C_HAS_PROG_FLAGS_RDCH => 0,
C_HAS_PROG_FLAGS_AXIS => 0,
C_PROG_FULL_TYPE_WACH => 0,
C_PROG_FULL_TYPE_WDCH => 0,
C_PROG_FULL_TYPE_WRCH => 0,
C_PROG_FULL_TYPE_RACH => 0,
C_PROG_FULL_TYPE_RDCH => 0,
C_PROG_FULL_TYPE_AXIS => 0,
C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023,
C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023,
C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023,
C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023,
C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023,
C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023,
C_PROG_EMPTY_TYPE_WACH => 0,
C_PROG_EMPTY_TYPE_WDCH => 0,
C_PROG_EMPTY_TYPE_WRCH => 0,
C_PROG_EMPTY_TYPE_RACH => 0,
C_PROG_EMPTY_TYPE_RDCH => 0,
C_PROG_EMPTY_TYPE_AXIS => 0,
C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022,
C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022,
C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022,
C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022,
C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022,
C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022,
C_REG_SLICE_MODE_WACH => 0,
C_REG_SLICE_MODE_WDCH => 0,
C_REG_SLICE_MODE_WRCH => 0,
C_REG_SLICE_MODE_RACH => 0,
C_REG_SLICE_MODE_RDCH => 0,
C_REG_SLICE_MODE_AXIS => 0
)
--}}}
--{{{
PORT MAP (
backup => '0',
backup_marker => '0',
clk => '0',
rst => clr,
srst => '0',
wr_clk => wrclk,
wr_rst => '0',
rd_clk => rdclk,
rd_rst => '0',
din => wrdata,
wr_en => wrreq,
rd_en => rdreq,
prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, log2(DEPTH))),
prog_empty_thresh_assert => STD_LOGIC_VECTOR(TO_UNSIGNED(0, log2(DEPTH))),
prog_empty_thresh_negate => STD_LOGIC_VECTOR(TO_UNSIGNED(0, log2(DEPTH))),
prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, log2(DEPTH))),
prog_full_thresh_assert => STD_LOGIC_VECTOR(TO_UNSIGNED(0, log2(DEPTH))),
prog_full_thresh_negate => STD_LOGIC_VECTOR(TO_UNSIGNED(0, log2(DEPTH))),
int_clk => '0',
injectdbiterr => '0',
injectsbiterr => '0',
sleep => '0',
dout => rddata,
full => wrfull,
empty => rdempty,
rd_data_count => rdusedw,
wr_data_count => wrusedw,
wr_rst_busy => wr_rst_busy,
rd_rst_busy => open,
m_aclk => '0',
s_aclk => '0',
s_aresetn => '0',
m_aclk_en => '0',
s_aclk_en => '0',
s_axi_awid => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_awaddr => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 32)),
s_axi_awlen => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 8)),
s_axi_awsize => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 3)),
s_axi_awburst => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 2)),
s_axi_awlock => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_awcache => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
s_axi_awprot => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 3)),
s_axi_awqos => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
s_axi_awregion => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
s_axi_awuser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_awvalid => '0',
s_axi_wid => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_wdata => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 64)),
s_axi_wstrb => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 8)),
s_axi_wlast => '0',
s_axi_wuser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_wvalid => '0',
s_axi_bready => '0',
m_axi_awready => '0',
m_axi_wready => '0',
m_axi_bid => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
m_axi_bresp => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 2)),
m_axi_buser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
m_axi_bvalid => '0',
s_axi_arid => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_araddr => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 32)),
s_axi_arlen => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 8)),
s_axi_arsize => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 3)),
s_axi_arburst => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 2)),
s_axi_arlock => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_arcache => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
s_axi_arprot => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 3)),
s_axi_arqos => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
s_axi_arregion => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
s_axi_aruser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axi_arvalid => '0',
s_axi_rready => '0',
m_axi_arready => '0',
m_axi_rid => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
m_axi_rdata => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 64)),
m_axi_rresp => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 2)),
m_axi_rlast => '0',
m_axi_ruser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
m_axi_rvalid => '0',
s_axis_tvalid => '0',
s_axis_tdata => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 8)),
s_axis_tstrb => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axis_tkeep => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axis_tlast => '0',
s_axis_tid => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axis_tdest => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)),
s_axis_tuser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
m_axis_tready => '0',
axi_aw_injectsbiterr => '0',
axi_aw_injectdbiterr => '0',
axi_aw_prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
axi_aw_prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
axi_w_injectsbiterr => '0',
axi_w_injectdbiterr => '0',
axi_w_prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 10)),
axi_w_prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 10)),
axi_b_injectsbiterr => '0',
axi_b_injectdbiterr => '0',
axi_b_prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
axi_b_prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
axi_ar_injectsbiterr => '0',
axi_ar_injectdbiterr => '0',
axi_ar_prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
axi_ar_prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 4)),
axi_r_injectsbiterr => '0',
axi_r_injectdbiterr => '0',
axi_r_prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 10)),
axi_r_prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 10)),
axis_injectsbiterr => '0',
axis_injectdbiterr => '0',
axis_prog_full_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 10)),
axis_prog_empty_thresh => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 10))
);
--}}}
END xil_async_fifo_arch;

View file

@ -0,0 +1,508 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
Library xpm;
use xpm.vcomponents.all;
use work.common_pkg.all;
entity xil_async_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 64;
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON"; -- "OFF"
SYNC_CLR : string := "OFF" -- "ON"
);
port
(
clr : in std_logic := '0';
wrclk : in std_logic ;
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
wrfull : out std_logic ;
wrusedw : out std_logic_vector (log2(DEPTH)-1 downto 0);
rdclk : in std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
rdempty : out std_logic ;
rdusedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_async_fifo;
architecture struct of xil_async_fifo is
function calcReadMode(showAhead : string) return string is
begin
if showAhead = "ON" then
return "fwft"; -- First-Word-Fall-Through read mode
else
return "std"; -- standard read mode
end if;
end function;
constant READMODE : string := calcReadMode(SHOWAHEAD);
function calcSimCheck(checking : string) return integer is
begin
if checking = "ON" then
return 1;
else
return 0;
end if;
end function;
constant simCheck : integer := calcSimCheck(CHECKING);
signal wr_rst_busy : std_logic;
begin
-- XPM_FIFO instantiation template for Asynchronous FIFO configurations
-- Refer to the targeted device family architecture libraries guide for XPM_FIFO documentation
-- =======================================================================================================================
-- Parameter usage table, organized as follows:
-- +---------------------------------------------------------------------------------------------------------------------+
-- | Parameter name | Data type | Restrictions, if applicable |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Description |
-- +---------------------------------------------------------------------------------------------------------------------+
-- +---------------------------------------------------------------------------------------------------------------------+
-- | CASCADE_HEIGHT | Integer | Range: 0 - 64. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | 0- No Cascade Height, Allow Vivado Synthesis to choose. |
-- | 1 or more - Vivado Synthesis sets the specified value as Cascade Height. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | CDC_SYNC_STAGES | Integer | Range: 2 - 8. Default value = 2. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the number of synchronization stages on the CDC path |
-- | |
-- | Must be < 5 if FIFO_WRITE_DEPTH = 16 |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | DOUT_RESET_VALUE | String | Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Reset value of read data path. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | ECC_MODE | String | Allowed values: no_ecc, en_ecc. Default value = no_ecc. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | |
-- | "no_ecc" - Disables ECC |
-- | "en_ecc" - Enables both ECC Encoder and Decoder |
-- | |
-- | NOTE: ECC_MODE should be "no_ecc" if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FIFO_MEMORY_TYPE | String | Allowed values: auto, block, distributed. Default value = auto. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Designate the fifo memory primitive (resource type) to use. |
-- | |
-- | "auto"- Allow Vivado Synthesis to choose |
-- | "block"- Block RAM FIFO |
-- | "distributed"- Distributed RAM FIFO |
-- | |
-- | NOTE: There may be a behavior mismatch if Block RAM or Ultra RAM specific features, like ECC or Asymmetry, are selected with FIFO_MEMORY_TYPE set to "auto".|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FIFO_READ_LATENCY | Integer | Range: 0 - 10. Default value = 1. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Number of output register stages in the read data path. |
-- | |
-- | If READ_MODE = "fwft", then the only applicable value is 0. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FIFO_WRITE_DEPTH | Integer | Range: 16 - 4194304. Default value = 2048. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Defines the FIFO Write Depth, must be power of two. |
-- | |
-- | In standard READ_MODE, the effective depth = FIFO_WRITE_DEPTH-1 |
-- | In First-Word-Fall-Through READ_MODE, the effective depth = FIFO_WRITE_DEPTH+1 |
-- | |
-- | NOTE: The maximum FIFO size (width x depth) is limited to 150-Megabits. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FULL_RESET_VALUE | Integer | Range: 0 - 1. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Sets full, almost_full and prog_full to FULL_RESET_VALUE during reset |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | PROG_EMPTY_THRESH | Integer | Range: 3 - 4194301. Default value = 10. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the minimum number of read words in the FIFO at or below which prog_empty is asserted. |
-- | |
-- | Min_Value = 3 + (READ_MODE_VAL*2) |
-- | Max_Value = (FIFO_WRITE_DEPTH-3) - (READ_MODE_VAL*2) |
-- | |
-- | If READ_MODE = "std", then READ_MODE_VAL = 0; Otherwise READ_MODE_VAL = 1. |
-- | NOTE: The default threshold value is dependent on default FIFO_WRITE_DEPTH value. If FIFO_WRITE_DEPTH value is |
-- | changed, ensure the threshold value is within the valid range though the programmable flags are not used. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | PROG_FULL_THRESH | Integer | Range: 5 - 4194301. Default value = 10. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the maximum number of write words in the FIFO at or above which prog_full is asserted. |
-- | |
-- | Min_Value = 3 + (READ_MODE_VAL*2*(FIFO_WRITE_DEPTH/FIFO_READ_DEPTH))+CDC_SYNC_STAGES |
-- | Max_Value = (FIFO_WRITE_DEPTH-3) - (READ_MODE_VAL*2*(FIFO_WRITE_DEPTH/FIFO_READ_DEPTH)) |
-- | |
-- | If READ_MODE = "std", then READ_MODE_VAL = 0; Otherwise READ_MODE_VAL = 1. |
-- | NOTE: The default threshold value is dependent on default FIFO_WRITE_DEPTH value. If FIFO_WRITE_DEPTH value is |
-- | changed, ensure the threshold value is within the valid range though the programmable flags are not used. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | RD_DATA_COUNT_WIDTH | Integer | Range: 1 - 23. Default value = 1. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the width of rd_data_count. To reflect the correct value, the width should be log2(FIFO_READ_DEPTH)+1. |
-- | |
-- | FIFO_READ_DEPTH = FIFO_WRITE_DEPTH*WRITE_DATA_WIDTH/READ_DATA_WIDTH |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | READ_DATA_WIDTH | Integer | Range: 1 - 4096. Default value = 32. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Defines the width of the read data port, dout |
-- | |
-- | Write and read width aspect ratio must be 1:1, 1:2, 1:4, 1:8, 8:1, 4:1 and 2:1 |
-- | For example, if WRITE_DATA_WIDTH is 32, then the READ_DATA_WIDTH must be 32, 64,128, 256, 16, 8, 4. |
-- | |
-- | NOTE: |
-- | |
-- | READ_DATA_WIDTH should be equal to WRITE_DATA_WIDTH if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior. |
-- | The maximum FIFO size (width x depth) is limited to 150-Megabits. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | READ_MODE | String | Allowed values: std, fwft. Default value = std. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | |
-- | "std"- standard read mode |
-- | "fwft"- First-Word-Fall-Through read mode |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | RELATED_CLOCKS | Integer | Range: 0 - 1. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies if the wr_clk and rd_clk are related having the same source but different clock ratios |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | SIM_ASSERT_CHK | Integer | Range: 0 - 1. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | 0- Disable simulation message reporting. Messages related to potential misuse will not be reported. |
-- | 1- Enable simulation message reporting. Messages related to potential misuse will be reported. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | USE_ADV_FEATURES | String | Default value = 0707. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Enables data_valid, almost_empty, rd_data_count, prog_empty, underflow, wr_ack, almost_full, wr_data_count, |
-- | prog_full, overflow features. |
-- | |
-- | Setting USE_ADV_FEATURES[0] to 1 enables overflow flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[1] to 1 enables prog_full flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[2] to 1 enables wr_data_count; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[3] to 1 enables almost_full flag; Default value of this bit is 0 |
-- | Setting USE_ADV_FEATURES[4] to 1 enables wr_ack flag; Default value of this bit is 0 |
-- | Setting USE_ADV_FEATURES[8] to 1 enables underflow flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[9] to 1 enables prog_empty flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[10] to 1 enables rd_data_count; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[11] to 1 enables almost_empty flag; Default value of this bit is 0 |
-- | Setting USE_ADV_FEATURES[12] to 1 enables data_valid flag; Default value of this bit is 0 |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | WAKEUP_TIME | Integer | Range: 0 - 2. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | |
-- | 0 - Disable sleep |
-- | 2 - Use Sleep Pin |
-- | |
-- | NOTE: WAKEUP_TIME should be 0 if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | WRITE_DATA_WIDTH | Integer | Range: 1 - 4096. Default value = 32. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Defines the width of the write data port, din |
-- | |
-- | Write and read width aspect ratio must be 1:1, 1:2, 1:4, 1:8, 8:1, 4:1 and 2:1 |
-- | For example, if WRITE_DATA_WIDTH is 32, then the READ_DATA_WIDTH must be 32, 64,128, 256, 16, 8, 4. |
-- | |
-- | NOTE: |
-- | |
-- | WRITE_DATA_WIDTH should be equal to READ_DATA_WIDTH if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior. |
-- | The maximum FIFO size (width x depth) is limited to 150-Megabits. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | WR_DATA_COUNT_WIDTH | Integer | Range: 1 - 23. Default value = 1. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the width of wr_data_count. To reflect the correct value, the width should be log2(FIFO_WRITE_DEPTH)+1. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- Port usage table, organized as follows:
-- +---------------------------------------------------------------------------------------------------------------------+
-- | Port name | Direction | Size, in bits | Domain | Sense | Handling if unused |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Description |
-- +---------------------------------------------------------------------------------------------------------------------+
-- +---------------------------------------------------------------------------------------------------------------------+
-- | almost_empty | Output | 1 | rd_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Almost Empty : When asserted, this signal indicates that only one more read can be performed before the FIFO goes to|
-- | empty. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | almost_full | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Almost Full: When asserted, this signal indicates that only one more write can be performed before the FIFO is full.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | data_valid | Output | 1 | rd_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Data Valid: When asserted, this signal indicates that valid data is available on the output bus (dout). |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | dbiterr | Output | 1 | rd_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Double Bit Error: Indicates that the ECC decoder detected a double-bit error and data in the FIFO core is corrupted.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | din | Input | WRITE_DATA_WIDTH | wr_clk | NA | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Data: The input data bus used when writing the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | dout | Output | READ_DATA_WIDTH | rd_clk | NA | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Data: The output data bus is driven when reading the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | empty | Output | 1 | rd_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Empty Flag: When asserted, this signal indicates that the FIFO is empty. |
-- | Read requests are ignored when the FIFO is empty, initiating a read while empty is not destructive to the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | full | Output | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Full Flag: When asserted, this signal indicates that the FIFO is full. |
-- | Write requests are ignored when the FIFO is full, initiating a write when the FIFO is full is not destructive |
-- | to the contents of the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | injectdbiterr | Input | 1 | wr_clk | Active-high | Tie to 1'b0 |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Double Bit Error Injection: Injects a double bit error if the ECC feature is used on block RAMs or |
-- | UltraRAM macros. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | injectsbiterr | Input | 1 | wr_clk | Active-high | Tie to 1'b0 |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Single Bit Error Injection: Injects a single bit error if the ECC feature is used on block RAMs or |
-- | UltraRAM macros. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | overflow | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Overflow: This signal indicates that a write request (wren) during the prior clock cycle was rejected, |
-- | because the FIFO is full. Overflowing the FIFO is not destructive to the contents of the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | prog_empty | Output | 1 | rd_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Programmable Empty: This signal is asserted when the number of words in the FIFO is less than or equal |
-- | to the programmable empty threshold value. |
-- | It is de-asserted when the number of words in the FIFO exceeds the programmable empty threshold value. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | prog_full | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Programmable Full: This signal is asserted when the number of words in the FIFO is greater than or equal |
-- | to the programmable full threshold value. |
-- | It is de-asserted when the number of words in the FIFO is less than the programmable full threshold value. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_clk | Input | 1 | NA | Rising edge | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read clock: Used for read operation. rd_clk must be a free running clock. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_data_count | Output | RD_DATA_COUNT_WIDTH | rd_clk | NA | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Data Count: This bus indicates the number of words read from the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_en | Input | 1 | rd_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Enable: If the FIFO is not empty, asserting this signal causes data (on dout) to be read from the FIFO. |
-- | |
-- | Must be held active-low when rd_rst_busy is active high. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_rst_busy | Output | 1 | rd_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Reset Busy: Active-High indicator that the FIFO read domain is currently in a reset state. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rst | Input | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Reset: Must be synchronous to wr_clk. The clock(s) can be unstable at the time of applying reset, but reset must be released only after the clock(s) is/are stable.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | sbiterr | Output | 1 | rd_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Single Bit Error: Indicates that the ECC decoder detected and fixed a single-bit error. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | sleep | Input | 1 | NA | Active-high | Tie to 1'b0 |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Dynamic power saving: If sleep is High, the memory/fifo block is in power saving mode. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | underflow | Output | 1 | rd_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Underflow: Indicates that the read request (rd_en) during the previous clock cycle was rejected |
-- | because the FIFO is empty. Under flowing the FIFO is not destructive to the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_ack | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Acknowledge: This signal indicates that a write request (wr_en) during the prior clock cycle is succeeded. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_clk | Input | 1 | NA | Rising edge | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write clock: Used for write operation. wr_clk must be a free running clock. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_data_count | Output | WR_DATA_COUNT_WIDTH | wr_clk | NA | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Data Count: This bus indicates the number of words written into the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_en | Input | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Enable: If the FIFO is not full, asserting this signal causes data (on din) to be written to the FIFO. |
-- | |
-- | Must be held active-low when rst or wr_rst_busy is active high. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_rst_busy | Output | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Reset Busy: Active-High indicator that the FIFO write domain is currently in a reset state. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- xpm_fifo_async : In order to incorporate this function into the design,
-- VHDL : the following instance declaration needs to be placed
-- instance : in the body of the design code. The instance name
-- declaration : (xpm_fifo_async_inst) and/or the port declarations after the
-- code : "=>" declaration maybe changed to properly reference and
-- : connect this function to the design. All inputs and outputs
-- : must be connected.
-- Library : In addition to adding the instance declaration, a use
-- declaration : statement for the UNISIM.vcomponents library needs to be
-- for : added before the entity declaration. This library
-- Xilinx : contains the component declarations for all Xilinx
-- primitives : primitives and points to the models that will be used
-- : for simulation.
-- Please reference the appropriate libraries guide for additional information on the XPM modules.
-- Copy the following two statements and paste them before the
-- Entity declaration, unless they already exist.
-- <-----Cut code below this line and paste into the architecture body---->
-- xpm_fifo_async: Asynchronous FIFO
-- Xilinx Parameterized Macro, version 2022.1
fifo_async_inst : xpm_fifo_async
generic map (
CASCADE_HEIGHT => 0, -- DECIMAL
CDC_SYNC_STAGES => 2, -- DECIMAL
DOUT_RESET_VALUE => "0", -- String
ECC_MODE => "no_ecc", -- String
FIFO_MEMORY_TYPE => "block", -- String
FIFO_READ_LATENCY => 1, -- DECIMAL
FIFO_WRITE_DEPTH => DEPTH, -- DECIMAL
FULL_RESET_VALUE => 0, -- DECIMAL
PROG_EMPTY_THRESH => 10, -- DECIMAL
PROG_FULL_THRESH => 10, -- DECIMAL
RD_DATA_COUNT_WIDTH => log2(DEPTH), -- DECIMAL
READ_DATA_WIDTH => DATA_WIDTH, -- DECIMAL
READ_MODE => READMODE, -- String
RELATED_CLOCKS => 0, -- DECIMAL
SIM_ASSERT_CHK => simCheck, -- DECIMAL; 0=disable simulation messages, 1=enable simulation messages
USE_ADV_FEATURES => "0707", -- String
WAKEUP_TIME => 0, -- DECIMAL
WRITE_DATA_WIDTH => DATA_WIDTH, -- DECIMAL
WR_DATA_COUNT_WIDTH => log2(DEPTH) -- DECIMAL
)
port map (
almost_empty => open, -- 1-bit output: Almost Empty : When asserted, this signal indicates that
-- only one more read can be performed before the FIFO goes to empty.
almost_full => open, -- 1-bit output: Almost Full: When asserted, this signal indicates that
-- only one more write can be performed before the FIFO is full.
data_valid => open, -- 1-bit output: Read Data Valid: When asserted, this signal indicates
-- that valid data is available on the output bus (dout).
dbiterr => open, -- 1-bit output: Double Bit Error: Indicates that the ECC decoder
-- detected a double-bit error and data in the FIFO core is corrupted.
dout => rddata, -- READ_DATA_WIDTH-bit output: Read Data: The output data bus is driven
-- when reading the FIFO.
empty => rdempty, -- 1-bit output: Empty Flag: When asserted, this signal indicates that
-- the FIFO is empty. Read requests are ignored when the FIFO is empty,
-- initiating a read while empty is not destructive to the FIFO.
full => wrfull, -- 1-bit output: Full Flag: When asserted, this signal indicates that the
-- FIFO is full. Write requests are ignored when the FIFO is full,
-- initiating a write when the FIFO is full is not destructive to the
-- contents of the FIFO.
overflow => open, -- 1-bit output: Overflow: This signal indicates that a write request
-- (wren) during the prior clock cycle was rejected, because the FIFO is
-- full. Overflowing the FIFO is not destructive to the contents of the
-- FIFO.
prog_empty => open, -- 1-bit output: Programmable Empty: This signal is asserted when the
-- number of words in the FIFO is less than or equal to the programmable
-- empty threshold value. It is de-asserted when the number of words in
-- the FIFO exceeds the programmable empty threshold value.
prog_full => open, -- 1-bit output: Programmable Full: This signal is asserted when the
-- number of words in the FIFO is greater than or equal to the
-- programmable full threshold value. It is de-asserted when the number
-- of words in the FIFO is less than the programmable full threshold
-- value.
rd_data_count => rdusedw, -- RD_DATA_COUNT_WIDTH-bit output: Read Data Count: This bus indicates
-- the number of words read from the FIFO.
rd_rst_busy => open, -- 1-bit output: Read Reset Busy: Active-High indicator that the FIFO
-- read domain is currently in a reset state.
sbiterr => open, -- 1-bit output: Single Bit Error: Indicates that the ECC decoder
-- detected and fixed a single-bit error.
underflow => open, -- 1-bit output: Underflow: Indicates that the read request (rd_en)
-- during the previous clock cycle was rejected because the FIFO is
-- empty. Under flowing the FIFO is not destructive to the FIFO.
wr_ack => open, -- 1-bit output: Write Acknowledge: This signal indicates that a write
-- request (wr_en) during the prior clock cycle is succeeded.
wr_data_count => wrusedw, -- WR_DATA_COUNT_WIDTH-bit output: Write Data Count: This bus indicates
-- the number of words written into the FIFO.
wr_rst_busy => wr_rst_busy, -- 1-bit output: Write Reset Busy: Active-High indicator that the FIFO
-- write domain is currently in a reset state.
din => wrdata, -- WRITE_DATA_WIDTH-bit input: Write Data: The input data bus used when
-- writing the FIFO.
injectdbiterr => '0', -- 1-bit input: Double Bit Error Injection: Injects a double bit error if
-- the ECC feature is used on block RAMs or UltraRAM macros.
injectsbiterr => '0', -- 1-bit input: Single Bit Error Injection: Injects a single bit error if
-- the ECC feature is used on block RAMs or UltraRAM macros.
rd_clk => rdclk, -- 1-bit input: Read clock: Used for read operation. rd_clk must be a
-- free running clock.
rd_en => rdreq, -- 1-bit input: Read Enable: If the FIFO is not empty, asserting this
-- signal causes data (on dout) to be read from the FIFO. Must be held
-- active-low when rd_rst_busy is active high.
rst => clr, -- 1-bit input: Reset: Must be synchronous to wr_clk. The clock(s) can be
-- unstable at the time of applying reset, but reset must be released
-- only after the clock(s) is/are stable.
sleep => '0', -- 1-bit input: Dynamic power saving: If sleep is High, the memory/fifo
-- block is in power saving mode.
wr_clk => wrclk, -- 1-bit input: Write clock: Used for write operation. wr_clk must be a
-- free running clock.
wr_en => wrreq -- 1-bit input: Write Enable: If the FIFO is not full, asserting this
-- signal causes data (on din) to be written to the FIFO. Must be held
-- active-low when rst or wr_rst_busy is active high.
);
-- End of xpm_fifo_async_inst instantiation
end struct;

View file

@ -0,0 +1,138 @@
-------------------------------------------------------------------------------
-- Title : dpram_sclk
-- Project : Dual-Port, single clock RAM
-------------------------------------------------------------------------------
-- File : xil_dpram.vhd
-- Author : DCS
-- Company : Global Inkjet Systems
-- Created : 2022-07-20
-- Last update:
-- SVN ID : Git
-- Standard : VHDL'2008
-------------------------------------------------------------------------------
-- Description:
-- True Dual-Port, single clock RAM
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
entity xil_dpram is
generic(
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 2 to 131072 := 128;
REGISTER_ADDRA : string := "UNREGISTERED"; -- "CLOCK0"
REGISTER_ADDRB : string := "UNREGISTERED"; -- "CLOCK0"
REGISTER_OUTPUTA : string := "UNREGISTERED"; -- "CLOCK0"
REGISTER_OUTPUTB : string := "UNREGISTERED"; -- "CLOCK0"
READ_WRITE_MODE : string := "OLD_DATA"; -- "DONT_CARE"
DEVICE_FAMILY : string := "Ultrascale+"
);
port(
clk : in std_logic;
-- Port-A
addr_a : in std_logic_vector(log2(DEPTH)-1 downto 0);
we_a : in std_logic := '0';
data_a : in std_logic_vector(DATA_WIDTH-1 downto 0) := (others => '0');
q_a : out std_logic_vector(DATA_WIDTH-1 downto 0);
-- Port-B
addr_b : in std_logic_vector(log2(DEPTH)-1 downto 0);
we_b : in std_logic := '0';
data_b : in std_logic_vector(DATA_WIDTH-1 downto 0) := (others => '0');
q_b : out std_logic_vector(DATA_WIDTH-1 downto 0));
end xil_dpram;
architecture rtl of xil_dpram is
-- Build a 2-D array type for the RAM
subtype word_t is std_logic_vector(DATA_WIDTH-1 downto 0);
type memory_t is array(DEPTH-1 downto 0) of word_t;
-- Declare the RAM
shared variable ram : memory_t := (others => (others => '0')); -- Must Init to zero or avs_seq_reads don't work.
signal addr_a_reg : std_logic_vector(log2(DEPTH)-1 downto 0);
signal addr_a_sel : std_logic_vector(log2(DEPTH)-1 downto 0);
signal data_a_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
signal data_a_sel : std_logic_vector(DATA_WIDTH-1 downto 0);
signal we_a_reg : std_logic;
signal we_a_sel : std_logic;
signal read_a : std_logic_vector(DATA_WIDTH-1 downto 0);
signal read_a_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
signal addr_b_reg : std_logic_vector(log2(DEPTH)-1 downto 0);
signal addr_b_sel : std_logic_vector(log2(DEPTH)-1 downto 0);
signal data_b_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
signal data_b_sel : std_logic_vector(DATA_WIDTH-1 downto 0);
signal we_b_reg : std_logic;
signal we_b_sel : std_logic;
signal read_b : std_logic_vector(DATA_WIDTH-1 downto 0);
signal read_b_reg : std_logic_vector(DATA_WIDTH-1 downto 0);
begin
-- Port A
pPORT_A_wr : process(clk)
begin
if(clk = '1' and clk'event) then
if(we_a_sel = '1') then
ram(to_integer(unsigned(addr_a_sel))) := data_a_sel;
end if;
addr_a_reg <= addr_a;
data_a_reg <= data_a;
we_a_reg <= we_a;
end if;
end process;
addr_a_sel <= addr_a_reg when ((REGISTER_ADDRA = "CLOCK0") or (REGISTER_ADDRA = "CLOCK1")) else addr_a;
data_a_sel <= data_a_reg when ((REGISTER_ADDRA = "CLOCK0") or (REGISTER_ADDRA = "CLOCK1")) else data_a;
we_a_sel <= we_a_reg when ((REGISTER_ADDRA = "CLOCK0") or (REGISTER_ADDRA = "CLOCK1")) else we_a;
q_a <= read_a_reg when ((REGISTER_OUTPUTA = "CLOCK0") or (REGISTER_OUTPUTA = "CLOCK1")) else read_a;
pPORT_A_rd : process(clk)
begin
if(clk = '1' and clk'event) then
if (we_a_sel = '1') and READ_WRITE_MODE = "OLD_DATA" then
-- hold old data
else
read_a <= ram(to_integer(unsigned(addr_a_sel)));
end if;
read_a_reg <= read_a;
end if;
end process;
-- Port B
pPORT_B_wr : process(clk)
begin
if(clk = '1' and clk'event) then
if(we_b_sel = '1') then
ram(to_integer(unsigned(addr_b_sel))) := data_b_sel;
end if;
addr_b_reg <= addr_b;
data_b_reg <= data_b;
we_b_reg <= we_b;
end if;
end process;
addr_b_sel <= addr_b_reg when ((REGISTER_ADDRB = "CLOCK0") or (REGISTER_ADDRB = "CLOCK1")) else addr_b;
data_b_sel <= data_b_reg when ((REGISTER_ADDRB = "CLOCK0") or (REGISTER_ADDRB = "CLOCK1")) else data_b;
we_b_sel <= we_b_reg when ((REGISTER_ADDRB = "CLOCK0") or (REGISTER_ADDRB = "CLOCK1")) else we_b;
q_b <= read_b_reg when ((REGISTER_OUTPUTB = "CLOCK0") or (REGISTER_OUTPUTB = "CLOCK1")) else read_b;
pPORT_B_rd : process(clk)
begin
if(clk = '1' and clk'event) then
if (we_b_sel = '1') and READ_WRITE_MODE = "OLD_DATA" then
-- hold old data
else
read_b <= ram(to_integer(unsigned(addr_b_sel)));
end if;
read_b_reg <= read_b;
end if;
end process;
end rtl;

View file

@ -0,0 +1,203 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Inferred RAM Sync FIFO
library ieee;
use ieee.std_logic_1164.all;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
-- ****** REGISTER_OUTPUT : string := "ON"; -- "OFF"
-- never used in all current instances. Doesn't seem to make any difference to Altera sim dcs
-- Note usedw goes to 0 when fifo is full. This is the same as Altera
entity xil_sync_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_sync_fifo;
architecture rtl OF xil_sync_fifo is
type memory_t is array (DEPTH-1 downto 0) of std_logic_vector (DATA_WIDTH-1 downto 0) ;
signal ram : memory_t := (others => (others => '0')); -- make simulation same as Altera
signal wr_addr : integer range 0 to DEPTH-1;
signal rd_addr : integer range 0 to DEPTH-1;
signal rd_addr_reg : integer range 0 to DEPTH-1;
signal count : integer range 0 to DEPTH;
signal empty_int : std_logic;
signal empty_d : std_logic;
begin
usedw <= std_logic_vector(to_unsigned(count, usedw'high+1));
PROC_WRITE : process(rst_n, clk)
begin
if rst_n = '0' then
elsif(clk'event and clk = '1') then
if(wrreq = '1') and full = '0' and sclr = '0' then
ram(wr_addr) <= wrdata;
end if;
end if;
end process;
PROC_READ : process(rst_n, clk)
begin
if rst_n = '0' then
rddata <= (others => '0');
elsif(clk'event and clk = '1') then
if sclr = '1' then
rddata <= (others => '0');
elsif SHOWAHEAD = "ON" then
rddata <= ram(rd_addr);
elsif rdreq = '1' then
rddata <= ram(rd_addr_reg);
end if;
end if;
end process;
PROC_WR_ADDR : process(rst_n, clk)
begin
if rst_n = '0' then
wr_addr <= 0;
elsif(clk'event and clk = '1') then
if sclr = '1' then
wr_addr <= 0;
elsif wrreq = '1' then -- write
if full = '0' then
if wr_addr = DEPTH-1 then
wr_addr <= 0;
else
wr_addr <= wr_addr + 1;
end if;
end if;
end if;
end if;
end process;
PROC_RD_ADDR : process(all)
begin
if rst_n = '0' then
rd_addr <= 0;
elsif sclr = '1' then
rd_addr <= 0;
elsif rdreq = '1' then -- read
if empty = '0' then
if rd_addr_reg = DEPTH-1 then
rd_addr <= 0;
else
rd_addr <= rd_addr_reg + 1;
end if;
else
rd_addr <= rd_addr_reg;
end if;
else
rd_addr <= rd_addr_reg;
end if;
end process;
PROC_ADDR_REG : process(rst_n, clk)
begin
if rst_n = '0' then
rd_addr_reg <= 0;
elsif(clk'event and clk = '1') then
rd_addr_reg <= rd_addr;
end if;
end process;
PROC_FLAGS : process(rst_n, clk)
begin
if rst_n = '0' then
count <= 0;
full <= '0';
empty_int <= '1';
empty_d <= '1';
almost_full <= '0';
almost_empty <= '1';
elsif(clk'event and clk = '1') then
empty_d <= empty_int;
if sclr = '1' then
count <= 0;
full <= '0';
empty_int <= '1';
almost_full <= '0';
almost_empty <= '1';
elsif wrreq = '1' and rdreq = '0' then -- Count goes up by 1
if full = '0' then
count <= count + 1;
if count = DEPTH-1 then
full <= '1';
end if;
if (NEARLY_FULL-1) = count then
almost_full <= '1';
end if;
end if;
if (NEARLY_EMPTY-1) = count then
almost_empty <= '0';
end if;
empty_int <= '0';
elsif wrreq = '0' and rdreq = '1' then
if empty_int = '0' then
count <= count - 1;
if count = 1 then
empty_int <= '1';
end if;
end if;
if NEARLY_EMPTY = count then
almost_empty <= '1';
end if;
if NEARLY_FULL = count then
almost_full <= '0';
end if;
full <= '0';
end if;
end if;
end process;
ASSERT_PROC : process(clk)
begin
assert DEPTH > 1
report "**** Config error Fifo Depth must be grester than 1!"
severity error;
end process;
empty <= empty_int or empty_d when SHOWAHEAD = "ON" else empty_int; -- delay going not empty to match Altera when SHOWAHEAD
end rtl;

View file

@ -0,0 +1,112 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity fifo is
generic
(
DATA_WIDTH : integer := 20
);
port
(
i_clk : in std_logic;
i_write_rst : in std_logic;
i_write_data : in std_logic_vector(DATA_WIDTH-1 downto 0);
i_write_data_we : in std_logic;
i_read_rst : in std_logic;
i_read_data_re : in std_logic;
o_read_data : out std_logic_vector(DATA_WIDTH-1 downto 0)
);
end fifo;
architecture rtl of fifo is
------------------------------------------------------------------------------------------
-- configuration
------------------------------------------------------------------------------------------
constant FIFO_DEPTH : integer := 4096;
------------------------------------------------------------------------------------------
-- signal declaration
------------------------------------------------------------------------------------------
signal write_ptr : integer range 0 to (FIFO_DEPTH-1) := 0;
signal read_ptr : integer range 0 to (FIFO_DEPTH-1) := 0;
type FIFO_TYPE is array (0 to (FIFO_DEPTH-1)) of std_logic_vector(DATA_WIDTH-1 downto 0);
signal fifo : FIFO_TYPE;
signal read_data : std_logic_vector(DATA_WIDTH-1 downto 0);
begin
------------------------------------------------------------------------------------------
-- direct connection
------------------------------------------------------------------------------------------
o_read_data <= read_data;
------------------------------------------------------------------------------------------
-- write pointer
------------------------------------------------------------------------------------------
process(i_clk)
begin
if(rising_edge(i_clk)) then
if(i_write_rst = '1') then
write_ptr <= 0;
elsif(i_write_data_we = '1') then
if(write_ptr = (FIFO_DEPTH-1)) then
write_ptr <= 0;
else
write_ptr <= write_ptr + 1;
end if;
else
write_ptr <= write_ptr;
end if;
end if;
end process;
------------------------------------------------------------------------------------------
-- read pointer
------------------------------------------------------------------------------------------
process(i_clk)
begin
if(rising_edge(i_clk)) then
if(i_read_rst = '1') then
read_ptr <= 0;
elsif(i_read_data_re = '1') then
if(read_ptr = (FIFO_DEPTH-1)) then
read_ptr <= 0;
else
read_ptr <= read_ptr + 1;
end if;
else
read_ptr <= read_ptr;
end if;
end if;
end process;
------------------------------------------------------------------------------------------
-- fifo
------------------------------------------------------------------------------------------
process(i_clk)
begin
if(rising_edge(i_clk)) then
if(i_write_data_we = '1') then
fifo(write_ptr) <= i_write_data;
else
fifo <= fifo;
end if;
end if;
end process;
process(i_clk)
begin
if(rising_edge(i_clk)) then
if (i_read_data_re = '1') then
read_data <= fifo(read_ptr);
else
read_data <= read_data;
end if;
end if;
end process;
end rtl;

View file

@ -0,0 +1,192 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
-- Inferred RAM Sync FIFO
library ieee;
use ieee.std_logic_1164.all;
USE ieee.numeric_std.ALL;
use work.common_pkg.all;
-- ****** REGISTER_OUTPUT : string := "ON"; -- "OFF"
entity xil_sync_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_sync_fifo;
architecture rtl OF xil_sync_fifo is
type memory_t is array (DEPTH-1 downto 0) of std_logic_vector (DATA_WIDTH-1 downto 0) ;
signal ram : memory_t := (others => (others => '0')); -- make simulation same as Altera
signal wr_addr : integer range 0 to DEPTH-1;
signal rd_addr : integer range 0 to DEPTH-1;
signal rd_addr_reg : integer range 0 to DEPTH-1;
signal count : integer range 0 to DEPTH;
signal empty_int : std_logic;
signal empty_d : std_logic;
begin
usedw <= std_logic_vector(to_unsigned(count, usedw'high+1));
PROC_WRITE : process(rst_n, clk)
begin
if rst_n = '0' then
elsif(clk'event and clk = '1') then
if(wrreq = '1') and full = '0' and sclr = '0' then
ram(wr_addr) <= wrdata;
end if;
end if;
end process;
PROC_READ : process(rst_n, clk)
begin
if rst_n = '0' then
rddata <= (others => '0');
elsif(clk'event and clk = '1') then
if sclr = '1' then
rddata <= (others => '0');
elsif SHOWAHEAD = "ON" then
rddata <= ram(rd_addr);
elsif rdreq = '1' then
rddata <= ram(rd_addr_reg);
end if;
end if;
end process;
PROC_WR_ADDR : process(rst_n, clk)
begin
if rst_n = '0' then
wr_addr <= 0;
elsif(clk'event and clk = '1') then
if sclr = '1' then
wr_addr <= 0;
elsif wrreq = '1' then -- write
if full = '0' then
if wr_addr = DEPTH-1 then
wr_addr <= 0;
else
wr_addr <= wr_addr + 1;
end if;
end if;
end if;
end if;
end process;
PROC_RD_ADDR : process(all)
begin
if rst_n = '0' then
rd_addr <= 0;
elsif sclr = '1' then
rd_addr <= 0;
elsif rdreq = '1' then -- read
if empty = '0' then
if rd_addr_reg = DEPTH-1 then
rd_addr <= 0;
else
rd_addr <= rd_addr_reg + 1;
end if;
else
rd_addr <= rd_addr_reg;
end if;
else
rd_addr <= rd_addr_reg;
end if;
end process;
PROC_ADDR_REG : process(rst_n, clk)
begin
if rst_n = '0' then
rd_addr_reg <= 0;
elsif(clk'event and clk = '1') then
rd_addr_reg <= rd_addr;
end if;
end process;
PROC_FLAGS : process(rst_n, clk) -- Strange -1 to make flags exactly same as altera
begin
if rst_n = '0' then
count <= 0;
full <= '0';
empty_int <= '1';
empty_d <= '1';
almost_full <= '0';
almost_empty <= '1';
elsif(clk'event and clk = '1') then
empty_d <= empty_int;
if sclr = '1' then
count <= 0;
full <= '0';
empty_int <= '1';
almost_full <= '0';
almost_empty <= '1';
elsif wrreq = '1' and rdreq = '0' then -- Count goes up by 1
if full = '0' then
count <= count + 1;
if count = DEPTH-1 then
full <= '1';
end if;
if (NEARLY_FULL-1) = count then
almost_full <= '1';
end if;
end if;
if (NEARLY_EMPTY-1) = count then
almost_empty <= '0';
end if;
empty_int <= '0';
elsif wrreq = '0' and rdreq = '1' then
if empty_int = '0' then
count <= count - 1;
if count = 1 then
empty_int <= '1';
end if;
end if;
if NEARLY_EMPTY = count then
almost_empty <= '1';
end if;
if NEARLY_FULL = count then
almost_full <= '0';
end if;
full <= '0';
end if;
end if;
end process;
empty <= empty_int or empty_d when SHOWAHEAD = "ON" else empty_int; -- delay going not empty to match Altera when SHOWAHEAD
end rtl;

View file

@ -0,0 +1,489 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2022 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
Library xpm;
use xpm.vcomponents.all;
use work.common_pkg.all;
-- ****** REGISTER_OUTPUT : string := "ON"; -- "OFF"
entity xil_sync_fifo is
generic (
DATA_WIDTH : natural range 1 to 256 := 32;
DEPTH : natural range 1 to 131072 := 64;
REGISTER_OUTPUT : string := "ON"; -- "OFF"
NEARLY_FULL : natural range 1 to 131072 := 62;
NEARLY_EMPTY : natural range 1 to 131072 := 2;
DEVICE_FAMILY : string := "Cyclone V" ; -- "Cyclone 10 LP"
SHOWAHEAD : string := "ON"; -- "OFF"
CHECKING : string := "ON" -- "OFF"
);
port
(
clk : in std_logic ;
rst_n : in std_logic := '1';
sclr : in std_logic := '0';
wrreq : in std_logic ;
wrdata : in std_logic_vector (DATA_WIDTH-1 downto 0);
almost_full : out std_logic ;
full : out std_logic ;
rdreq : in std_logic ;
rddata : out std_logic_vector (DATA_WIDTH-1 downto 0);
almost_empty : out std_logic ;
empty : out std_logic ;
usedw : out std_logic_vector (log2(DEPTH)-1 downto 0)
);
end xil_sync_fifo;
architecture struct of xil_sync_fifo is
function calcReadMode(showAhead : string) return string is
begin
if showAhead = "ON" then
return "fwft"; -- First-Word-Fall-Through read mode
else
return "std"; -- standard read mode
end if;
end function;
constant READMODE : string := calcReadMode(SHOWAHEAD);
function calcSimCheck(checking : string) return integer is
begin
if checking = "ON" then
return 1;
else
return 0;
end if;
end function;
constant simCheck : integer := calcSimCheck(CHECKING);
begin
-- XPM_FIFO instantiation template for Synchronous FIFO configurations
-- Refer to the targeted device family architecture libraries guide for XPM_FIFO documentation
-- =======================================================================================================================
-- Parameter usage table, organized as follows:
-- +---------------------------------------------------------------------------------------------------------------------+
-- | Parameter name | Data type | Restrictions, if applicable |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Description |
-- +---------------------------------------------------------------------------------------------------------------------+
-- +---------------------------------------------------------------------------------------------------------------------+
-- | CASCADE_HEIGHT | Integer | Range: 0 - 64. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | 0- No Cascade Height, Allow Vivado Synthesis to choose. |
-- | 1 or more - Vivado Synthesis sets the specified value as Cascade Height. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | DOUT_RESET_VALUE | String | Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Reset value of read data path. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | ECC_MODE | String | Allowed values: no_ecc, en_ecc. Default value = no_ecc. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | |
-- | "no_ecc" - Disables ECC |
-- | "en_ecc" - Enables both ECC Encoder and Decoder |
-- | |
-- | NOTE: ECC_MODE should be "no_ecc" if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FIFO_MEMORY_TYPE | String | Allowed values: auto, block, distributed, ultra. Default value = auto. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Designate the fifo memory primitive (resource type) to use- |
-- | |
-- | "auto"- Allow Vivado Synthesis to choose |
-- | "block"- Block RAM FIFO |
-- | "distributed"- Distributed RAM FIFO |
-- | "ultra"- URAM FIFO |
-- | |
-- | NOTE: There may be a behavior mismatch if Block RAM or Ultra RAM specific features, like ECC or Asymmetry, are selected with FIFO_MEMORY_TYPE set to "auto".|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FIFO_READ_LATENCY | Integer | Range: 0 - 100. Default value = 1. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Number of output register stages in the read data path |
-- | |
-- | If READ_MODE = "fwft", then the only applicable value is 0 |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FIFO_WRITE_DEPTH | Integer | Range: 16 - 4194304. Default value = 2048. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Defines the FIFO Write Depth, must be power of two |
-- | |
-- | In standard READ_MODE, the effective depth = FIFO_WRITE_DEPTH |
-- | In First-Word-Fall-Through READ_MODE, the effective depth = FIFO_WRITE_DEPTH+2 |
-- | |
-- | NOTE: The maximum FIFO size (width x depth) is limited to 150-Megabits. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | FULL_RESET_VALUE | Integer | Range: 0 - 1. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Sets full, almost_full and prog_full to FULL_RESET_VALUE during reset |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | PROG_EMPTY_THRESH | Integer | Range: 3 - 4194304. Default value = 10. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the minimum number of read words in the FIFO at or below which prog_empty is asserted. |
-- | |
-- | Min_Value = 3 + (READ_MODE_VAL*2) |
-- | Max_Value = (FIFO_WRITE_DEPTH-3) - (READ_MODE_VAL*2) |
-- | |
-- | If READ_MODE = "std", then READ_MODE_VAL = 0; Otherwise READ_MODE_VAL = 1. |
-- | NOTE: The default threshold value is dependent on default FIFO_WRITE_DEPTH value. If FIFO_WRITE_DEPTH value is |
-- | changed, ensure the threshold value is within the valid range though the programmable flags are not used. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | PROG_FULL_THRESH | Integer | Range: 3 - 4194301. Default value = 10. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the maximum number of write words in the FIFO at or above which prog_full is asserted. |
-- | |
-- | Min_Value = 3 + (READ_MODE_VAL*2*(FIFO_WRITE_DEPTH/FIFO_READ_DEPTH)) |
-- | Max_Value = (FIFO_WRITE_DEPTH-3) - (READ_MODE_VAL*2*(FIFO_WRITE_DEPTH/FIFO_READ_DEPTH)) |
-- | |
-- | If READ_MODE = "std", then READ_MODE_VAL = 0; Otherwise READ_MODE_VAL = 1. |
-- | NOTE: The default threshold value is dependent on default FIFO_WRITE_DEPTH value. If FIFO_WRITE_DEPTH value is |
-- | changed, ensure the threshold value is within the valid range though the programmable flags are not used. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | RD_DATA_COUNT_WIDTH | Integer | Range: 1 - 23. Default value = 1. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the width of rd_data_count. To reflect the correct value, the width should be log2(FIFO_READ_DEPTH)+1. |
-- | |
-- | FIFO_READ_DEPTH = FIFO_WRITE_DEPTH*WRITE_DATA_WIDTH/READ_DATA_WIDTH |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | READ_DATA_WIDTH | Integer | Range: 1 - 4096. Default value = 32. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Defines the width of the read data port, dout |
-- | |
-- | Write and read width aspect ratio must be 1:1, 1:2, 1:4, 1:8, 8:1, 4:1 and 2:1 |
-- | For example, if WRITE_DATA_WIDTH is 32, then the READ_DATA_WIDTH must be 32, 64,128, 256, 16, 8, 4. |
-- | |
-- | NOTE: |
-- | |
-- | READ_DATA_WIDTH should be equal to WRITE_DATA_WIDTH if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior. |
-- | The maximum FIFO size (width x depth) is limited to 150-Megabits. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | READ_MODE | String | Allowed values: std, fwft. Default value = std. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | |
-- | "std"- standard read mode |
-- | "fwft"- First-Word-Fall-Through read mode |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | SIM_ASSERT_CHK | Integer | Range: 0 - 1. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | 0- Disable simulation message reporting. Messages related to potential misuse will not be reported. |
-- | 1- Enable simulation message reporting. Messages related to potential misuse will be reported. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | USE_ADV_FEATURES | String | Default value = 0707. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Enables data_valid, almost_empty, rd_data_count, prog_empty, underflow, wr_ack, almost_full, wr_data_count, |
-- | prog_full, overflow features. |
-- | |
-- | Setting USE_ADV_FEATURES[0] to 1 enables overflow flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[1] to 1 enables prog_full flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[2] to 1 enables wr_data_count; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[3] to 1 enables almost_full flag; Default value of this bit is 0 |
-- | Setting USE_ADV_FEATURES[4] to 1 enables wr_ack flag; Default value of this bit is 0 |
-- | Setting USE_ADV_FEATURES[8] to 1 enables underflow flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[9] to 1 enables prog_empty flag; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[10] to 1 enables rd_data_count; Default value of this bit is 1 |
-- | Setting USE_ADV_FEATURES[11] to 1 enables almost_empty flag; Default value of this bit is 0 |
-- | Setting USE_ADV_FEATURES[12] to 1 enables data_valid flag; Default value of this bit is 0 |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | WAKEUP_TIME | Integer | Range: 0 - 2. Default value = 0. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | |
-- | 0 - Disable sleep |
-- | 2 - Use Sleep Pin |
-- | |
-- | NOTE: WAKEUP_TIME should be 0 if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | WRITE_DATA_WIDTH | Integer | Range: 1 - 4096. Default value = 32. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Defines the width of the write data port, din |
-- | |
-- | Write and read width aspect ratio must be 1:1, 1:2, 1:4, 1:8, 8:1, 4:1 and 2:1 |
-- | For example, if WRITE_DATA_WIDTH is 32, then the READ_DATA_WIDTH must be 32, 64,128, 256, 16, 8, 4. |
-- | |
-- | NOTE: |
-- | |
-- | WRITE_DATA_WIDTH should be equal to READ_DATA_WIDTH if FIFO_MEMORY_TYPE is set to "auto". Violating this may result incorrect behavior.|
-- | The maximum FIFO size (width x depth) is limited to 150-Megabits. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | WR_DATA_COUNT_WIDTH | Integer | Range: 1 - 23. Default value = 1. |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Specifies the width of wr_data_count. To reflect the correct value, the width should be log2(FIFO_WRITE_DEPTH)+1. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- Port usage table, organized as follows:
-- +---------------------------------------------------------------------------------------------------------------------+
-- | Port name | Direction | Size, in bits | Domain | Sense | Handling if unused |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Description |
-- +---------------------------------------------------------------------------------------------------------------------+
-- +---------------------------------------------------------------------------------------------------------------------+
-- | almost_empty | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Almost Empty : When asserted, this signal indicates that only one more read can be performed before the FIFO goes to|
-- | empty. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | almost_full | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Almost Full: When asserted, this signal indicates that only one more write can be performed before the FIFO is full.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | data_valid | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Data Valid: When asserted, this signal indicates that valid data is available on the output bus (dout). |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | dbiterr | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Double Bit Error: Indicates that the ECC decoder detected a double-bit error and data in the FIFO core is corrupted.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | din | Input | WRITE_DATA_WIDTH | wr_clk | NA | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Data: The input data bus used when writing the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | dout | Output | READ_DATA_WIDTH | wr_clk | NA | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Data: The output data bus is driven when reading the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | empty | Output | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Empty Flag: When asserted, this signal indicates that the FIFO is empty. |
-- | Read requests are ignored when the FIFO is empty, initiating a read while empty is not destructive to the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | full | Output | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Full Flag: When asserted, this signal indicates that the FIFO is full. |
-- | Write requests are ignored when the FIFO is full, initiating a write when the FIFO is full is not destructive |
-- | to the contents of the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | injectdbiterr | Input | 1 | wr_clk | Active-high | Tie to 1'b0 |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Double Bit Error Injection: Injects a double bit error if the ECC feature is used on block RAMs or |
-- | UltraRAM macros. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | injectsbiterr | Input | 1 | wr_clk | Active-high | Tie to 1'b0 |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Single Bit Error Injection: Injects a single bit error if the ECC feature is used on block RAMs or |
-- | UltraRAM macros. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | overflow | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Overflow: This signal indicates that a write request (wren) during the prior clock cycle was rejected, |
-- | because the FIFO is full. Overflowing the FIFO is not destructive to the contents of the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | prog_empty | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Programmable Empty: This signal is asserted when the number of words in the FIFO is less than or equal |
-- | to the programmable empty threshold value. |
-- | It is de-asserted when the number of words in the FIFO exceeds the programmable empty threshold value. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | prog_full | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Programmable Full: This signal is asserted when the number of words in the FIFO is greater than or equal |
-- | to the programmable full threshold value. |
-- | It is de-asserted when the number of words in the FIFO is less than the programmable full threshold value. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_data_count | Output | RD_DATA_COUNT_WIDTH | wr_clk | NA | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Data Count: This bus indicates the number of words read from the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_en | Input | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Enable: If the FIFO is not empty, asserting this signal causes data (on dout) to be read from the FIFO. |
-- | |
-- | Must be held active-low when rd_rst_busy is active high. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rd_rst_busy | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Read Reset Busy: Active-High indicator that the FIFO read domain is currently in a reset state. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | rst | Input | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Reset: Must be synchronous to wr_clk. The clock(s) can be unstable at the time of applying reset, but reset must be released only after the clock(s) is/are stable.|
-- +---------------------------------------------------------------------------------------------------------------------+
-- | sbiterr | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Single Bit Error: Indicates that the ECC decoder detected and fixed a single-bit error. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | sleep | Input | 1 | NA | Active-high | Tie to 1'b0 |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Dynamic power saving- If sleep is High, the memory/fifo block is in power saving mode. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | underflow | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Underflow: Indicates that the read request (rd_en) during the previous clock cycle was rejected |
-- | because the FIFO is empty. Under flowing the FIFO is not destructive to the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_ack | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Acknowledge: This signal indicates that a write request (wr_en) during the prior clock cycle is succeeded. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_clk | Input | 1 | NA | Rising edge | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write clock: Used for write operation. wr_clk must be a free running clock. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_data_count | Output | WR_DATA_COUNT_WIDTH | wr_clk | NA | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Data Count: This bus indicates the number of words written into the FIFO. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_en | Input | 1 | wr_clk | Active-high | Required |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Enable: If the FIFO is not full, asserting this signal causes data (on din) to be written to the FIFO |
-- | |
-- | Must be held active-low when rst or wr_rst_busy or rd_rst_busy is active high |
-- +---------------------------------------------------------------------------------------------------------------------+
-- | wr_rst_busy | Output | 1 | wr_clk | Active-high | DoNotCare |
-- |---------------------------------------------------------------------------------------------------------------------|
-- | Write Reset Busy: Active-High indicator that the FIFO write domain is currently in a reset state. |
-- +---------------------------------------------------------------------------------------------------------------------+
-- xpm_fifo_sync : In order to incorporate this function into the design,
-- VHDL : the following instance declaration needs to be placed
-- instance : in the body of the design code. The instance name
-- declaration : (xpm_fifo_sync_inst) and/or the port declarations after the
-- code : "=>" declaration maybe changed to properly reference and
-- : connect this function to the design. All inputs and outputs
-- : must be connected.
-- Library : In addition to adding the instance declaration, a use
-- declaration : statement for the UNISIM.vcomponents library needs to be
-- for : added before the entity declaration. This library
-- Xilinx : contains the component declarations for all Xilinx
-- primitives : primitives and points to the models that will be used
-- : for simulation.
-- Please reference the appropriate libraries guide for additional information on the XPM modules.
-- xpm_fifo_sync: Synchronous FIFO
-- Xilinx Parameterized Macro, version 2022.1
xpm_fifo_sync_inst : xpm_fifo_sync
generic map (
CASCADE_HEIGHT => 0, -- DECIMAL
DOUT_RESET_VALUE => "0", -- String
ECC_MODE => "no_ecc", -- String
FIFO_MEMORY_TYPE => "auto", -- String
FIFO_READ_LATENCY => 1, -- DECIMAL
FIFO_WRITE_DEPTH => DEPTH, -- DECIMAL
FULL_RESET_VALUE => 0, -- DECIMAL
PROG_EMPTY_THRESH => NEARLY_EMPTY, -- DECIMAL
PROG_FULL_THRESH => NEARLY_FULL, -- DECIMAL
RD_DATA_COUNT_WIDTH => log2(DEPTH), -- DECIMAL
READ_DATA_WIDTH => DATA_WIDTH, -- DECIMAL
READ_MODE => READMODE, -- String
SIM_ASSERT_CHK => simCheck, -- DECIMAL; 0=disable simulation messages, 1=enable simulation messages
USE_ADV_FEATURES => "0707", -- String
WAKEUP_TIME => 0, -- DECIMAL
WRITE_DATA_WIDTH => DATA_WIDTH, -- DECIMAL
WR_DATA_COUNT_WIDTH => log2(DEPTH) -- DECIMAL
)
port map (
almost_empty => open, -- 1-bit output: Almost Empty : When asserted, this signal indicates that
-- only one more read can be performed before the FIFO goes to empty.
almost_full => open, -- 1-bit output: Almost Full: When asserted, this signal indicates that
-- only one more write can be performed before the FIFO is full.
data_valid => open, -- 1-bit output: Read Data Valid: When asserted, this signal indicates
-- that valid data is available on the output bus (dout).
dbiterr => open, -- 1-bit output: Double Bit Error: Indicates that the ECC decoder
-- detected a double-bit error and data in the FIFO core is corrupted.
dout => rddata, -- READ_DATA_WIDTH-bit output: Read Data: The output data bus is driven
-- when reading the FIFO.
empty => empty, -- 1-bit output: Empty Flag: When asserted, this signal indicates that
-- the FIFO is empty. Read requests are ignored when the FIFO is empty,
-- initiating a read while empty is not destructive to the FIFO.
full => full, -- 1-bit output: Full Flag: When asserted, this signal indicates that the
-- FIFO is full. Write requests are ignored when the FIFO is full,
-- initiating a write when the FIFO is full is not destructive to the
-- contents of the FIFO.
overflow => open, -- 1-bit output: Overflow: This signal indicates that a write request
-- (wren) during the prior clock cycle was rejected, because the FIFO is
-- full. Overflowing the FIFO is not destructive to the contents of the
-- FIFO.
prog_empty => almost_empty, -- 1-bit output: Programmable Empty: This signal is asserted when the
-- number of words in the FIFO is less than or equal to the programmable
-- empty threshold value. It is de-asserted when the number of words in
-- the FIFO exceeds the programmable empty threshold value.
prog_full => almost_full, -- 1-bit output: Programmable Full: This signal is asserted when the
-- number of words in the FIFO is greater than or equal to the
-- programmable full threshold value. It is de-asserted when the number
-- of words in the FIFO is less than the programmable full threshold
-- value.
rd_data_count => open, -- RD_DATA_COUNT_WIDTH-bit output: Read Data Count: This bus indicates
-- the number of words read from the FIFO.
rd_rst_busy => open, -- 1-bit output: Read Reset Busy: Active-High indicator that the FIFO
-- read domain is currently in a reset state.
sbiterr => open, -- 1-bit output: Single Bit Error: Indicates that the ECC decoder
-- detected and fixed a single-bit error.
underflow => open, -- 1-bit output: Underflow: Indicates that the read request (rd_en)
-- during the previous clock cycle was rejected because the FIFO is
-- empty. Under flowing the FIFO is not destructive to the FIFO.
wr_ack => open, -- 1-bit output: Write Acknowledge: This signal indicates that a write
-- request (wr_en) during the prior clock cycle is succeeded.
wr_data_count => usedw, -- WR_DATA_COUNT_WIDTH-bit output: Write Data Count: This bus indicates
-- the number of words written into the FIFO.
wr_rst_busy => open, -- 1-bit output: Write Reset Busy: Active-High indicator that the FIFO
-- write domain is currently in a reset state.
din => wrdata, -- WRITE_DATA_WIDTH-bit input: Write Data: The input data bus used when
-- writing the FIFO.
injectdbiterr => '0', -- 1-bit input: Double Bit Error Injection: Injects a double bit error if
-- the ECC feature is used on block RAMs or UltraRAM macros.
injectsbiterr => '0', -- 1-bit input: Single Bit Error Injection: Injects a single bit error if
-- the ECC feature is used on block RAMs or UltraRAM macros.
rd_en => rdreq, -- 1-bit input: Read Enable: If the FIFO is not empty, asserting this
-- signal causes data (on dout) to be read from the FIFO. Must be held
-- active-low when rd_rst_busy is active high.
rst => sclr or not rst_n, -- 1-bit input: Reset: Must be synchronous to wr_clk. The clock(s) can be
-- unstable at the time of applying reset, but reset must be released
-- only after the clock(s) is/are stable.
sleep => '0', -- 1-bit input: Dynamic power saving- If sleep is High, the memory/fifo
-- block is in power saving mode.
wr_clk => clk, -- 1-bit input: Write clock: Used for write operation. wr_clk must be a
-- free running clock.
wr_en => wrreq -- 1-bit input: Write Enable: If the FIFO is not full, asserting this
-- signal causes data (on din) to be written to the FIFO Must be held
-- active-low when rst or wr_rst_busy or rd_rst_busy is active high
);
-- End of xpm_fifo_sync_inst instantiation
end struct;