1 ----------------------------------------------------------------------------------
5 -- Create Date: 10:
01:
22 10/08/2013
7 -- Module Name: FIFO72x8192 - Behavioral
16 -- Revision 0.
01 -
File Created
17 -- Additional Comments:
19 ----------------------------------------------------------------------------------
21 use IEEE.STD_LOGIC_1164.
ALL;
23 -- Uncomment the following library declaration if using
24 -- arithmetic functions with or values
25 --use IEEE.NUMERIC_STD.ALL;
27 -- Uncomment the following library declaration if instantiating
28 -- any Xilinx primitives in this code.
30 use UNISIM.VComponents.
all;
32 use UNIMACRO.vcomponents.
all;
35 generic(ALMOSTFULL_OFFSET : (15 downto 0) := x"0080";
ALMOSTEMPTY_OFFSET : (15 downto 0) := x"0080");
40 di : in (65 downto 0);
43 do : out (65 downto 0);
50 signal fifo_re : := '0';
51 signal fifo_we : := '0';
52 signal wait_time : (3 downto 0) := (others => '0');
53 signal dip : (71 downto 0) := (others => '0');
54 signal dop : (71 downto 0) := (others => '0');
55 signal fifo_empty : (7 downto 0) := (others => '0');
56 signal fifo_Almostempty : (7 downto 0) := (others => '0');
57 signal fifo_full : (7 downto 0) := (others => '0');
58 type array8X12 is array (0 to 7) of (11 downto 0);
59 signal rdcount : array8X12 := (others => (others => '0'));
60 signal wrcount : array8X12 := (others => (others => '0'));
63 dip(65 downto 0) <= di;
64 do <= dop(65 downto 0);
65 g_FIFO: for i in 0 to 7 generate
66 i_FIFO : FIFO_DUALCLOCK_MACRO
68 DEVICE =>
"7SERIES",
-- Target Device: "VIRTEX5",
"VIRTEX6",
"7SERIES"
69 ALMOST_FULL_OFFSET => ALMOSTFULL_OFFSET ,
-- Sets almost full threshold
70 ALMOST_EMPTY_OFFSET => ALMOSTEMPTY_OFFSET,
-- Sets the almost empty threshold
71 DATA_WIDTH =>
9,
-- Valid values are 1-72 (37-72 only valid when FIFO_SIZE="36Kb")
72 FIFO_SIZE =>
"36Kb",
-- Target BRAM, "18Kb" or "36Kb"
73 FIRST_WORD_FALL_THROUGH => TRUE
) -- Sets the FIFO FWFT to TRUE or FALSE
75 ALMOSTEMPTY => fifo_Almostempty
(i
),
-- 1-bit output almost empty
76 ALMOSTFULL => FIFO_full
(i
),
-- 1-bit output almost full
77 DO => dop
(i*9+8
downto i*9
),
-- Output data, width defined by DATA_WIDTH parameter
78 EMPTY => fifo_empty
(i
),
-- 1-bit output empty
79 FULL =>
open,
-- 1-bit output full
80 RDCOUNT => rdcount
(i
),
-- Output read count, width determined by FIFO depth
81 RDERR =>
open,
-- 1-bit output read error
82 WRCOUNT => wrcount
(i
),
-- Output write count, width determined by FIFO depth
83 WRERR =>
open,
-- 1-bit output write error
84 DI => dip
(i*9+8
downto i*9
),
-- Input data, width defined by DATA_WIDTH parameter
85 RDCLK => rclk,
-- 1-bit input read clock
86 RDEN => FIFO_re,
-- 1-bit input read enable
87 RST => fifo_rst,
-- 1-bit input reset
88 WRCLK => wclk,
-- 1-bit input write clock
89 WREN => FIFO_we
-- 1-bit input write enable
92 FIFO_we <= FIFO_en and we;
93 FIFO_re <= FIFO_en and re;
95 empty <= '0' when FIFO_empty = x"00" else '1';
96 data_avl <= not fifo_Almostempty(0);
99 -- if(rclk'event and rclk = '1')then
100 -- if(FIFO_empty(0) = '1'
or wait_time(
3) = '1')
then
105 -- if(fifo_Almostempty(0) = '1'
and wait_time(
3) = '0')
then
106 -- wait_time <= "1111";
108 -- wait_time <= wait_time(2 downto 0) & '0';
112 --data_avl <= not FIFO_empty(0);