OpenCores
URL https://opencores.org/ocsvn/xmatchpro/xmatchpro/trunk

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [ipcore_dir/] [fifo_generator_v9_3/] [simulation/] [fifo_generator_v9_3_synth.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 eejlny
--------------------------------------------------------------------------------
2
--
3
-- FIFO Generator Core Demo Testbench 
4
--
5
--------------------------------------------------------------------------------
6
--
7
-- (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved.
8
-- 
9
-- This file contains confidential and proprietary information
10
-- of Xilinx, Inc. and is protected under U.S. and
11
-- international copyright and other intellectual property
12
-- laws.
13
-- 
14
-- DISCLAIMER
15
-- This disclaimer is not a license and does not grant any
16
-- rights to the materials distributed herewith. Except as
17
-- otherwise provided in a valid license issued to you by
18
-- Xilinx, and to the maximum extent permitted by applicable
19
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
20
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
21
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
22
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
23
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
24
-- (2) Xilinx shall not be liable (whether in contract or tort,
25
-- including negligence, or under any other theory of
26
-- liability) for any loss or damage of any kind or nature
27
-- related to, arising under or in connection with these
28
-- materials, including for any direct, or any indirect,
29
-- special, incidental, or consequential loss or damage
30
-- (including loss of data, profits, goodwill, or any type of
31
-- loss or damage suffered as a result of any action brought
32
-- by a third party) even if such damage or loss was
33
-- reasonably foreseeable or Xilinx had been advised of the
34
-- possibility of the same.
35
-- 
36
-- CRITICAL APPLICATIONS
37
-- Xilinx products are not designed or intended to be fail-
38
-- safe, or for use in any application requiring fail-safe
39
-- performance, such as life-support or safety devices or
40
-- systems, Class III medical devices, nuclear facilities,
41
-- applications related to the deployment of airbags, or any
42
-- other applications that could lead to death, personal
43
-- injury, or severe property or environmental damage
44
-- (individually and collectively, "Critical
45
-- Applications"). Customer assumes the sole risk and
46
-- liability of any use of Xilinx products in Critical
47
-- Applications, subject only to applicable laws and
48
-- regulations governing limitations on product liability.
49
-- 
50
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
51
-- PART OF THIS FILE AT ALL TIMES.
52
--------------------------------------------------------------------------------
53
--
54
-- Filename: fifo_generator_v9_3_synth.vhd
55
--
56
-- Description:
57
--   This is the demo testbench for fifo_generator core.
58
--
59
--------------------------------------------------------------------------------
60
-- Library Declarations
61
--------------------------------------------------------------------------------
62
 
63
 
64
LIBRARY ieee;
65
USE ieee.STD_LOGIC_1164.ALL;
66
USE ieee.STD_LOGIC_unsigned.ALL;
67
USE IEEE.STD_LOGIC_arith.ALL;
68
USE ieee.numeric_std.ALL;
69
USE ieee.STD_LOGIC_misc.ALL;
70
 
71
LIBRARY std;
72
USE std.textio.ALL;
73
 
74
LIBRARY work;
75
USE work.fifo_generator_v9_3_pkg.ALL;
76
 
77
--------------------------------------------------------------------------------
78
-- Entity Declaration
79
--------------------------------------------------------------------------------
80
ENTITY fifo_generator_v9_3_synth IS
81
  GENERIC(
82
           FREEZEON_ERROR : INTEGER := 0;
83
           TB_STOP_CNT    : INTEGER := 0;
84
           TB_SEED        : INTEGER := 1
85
         );
86
  PORT(
87
        CLK        :  IN  STD_LOGIC;
88
        RESET      :  IN  STD_LOGIC;
89
        SIM_DONE   :  OUT STD_LOGIC;
90
        STATUS     :  OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
91
      );
92
END ENTITY;
93
 
94
ARCHITECTURE simulation_arch OF fifo_generator_v9_3_synth IS
95
 
96
    -- FIFO interface signal declarations
97
    SIGNAL clk_i                          :   STD_LOGIC;
98
    SIGNAL rst                            :   STD_LOGIC;
99
    SIGNAL wr_en                          :   STD_LOGIC;
100
    SIGNAL rd_en                          :   STD_LOGIC;
101
    SIGNAL din                            :   STD_LOGIC_VECTOR(32-1 DOWNTO 0);
102
    SIGNAL dout                           :   STD_LOGIC_VECTOR(32-1 DOWNTO 0);
103
    SIGNAL full                           :   STD_LOGIC;
104
    SIGNAL empty                          :   STD_LOGIC;
105
   -- TB Signals
106
    SIGNAL wr_data                        :   STD_LOGIC_VECTOR(32-1 DOWNTO 0);
107
    SIGNAL dout_i                         :   STD_LOGIC_VECTOR(32-1 DOWNTO 0);
108
    SIGNAL wr_en_i                        :   STD_LOGIC := '0';
109
    SIGNAL rd_en_i                        :   STD_LOGIC := '0';
110
    SIGNAL full_i                         :   STD_LOGIC := '0';
111
    SIGNAL empty_i                        :   STD_LOGIC := '0';
112
    SIGNAL almost_full_i                  :   STD_LOGIC := '0';
113
    SIGNAL almost_empty_i                 :   STD_LOGIC := '0';
114
    SIGNAL prc_we_i                       :   STD_LOGIC := '0';
115
    SIGNAL prc_re_i                       :   STD_LOGIC := '0';
116
    SIGNAL dout_chk_i                     :   STD_LOGIC := '0';
117
    SIGNAL rst_int_rd                     :   STD_LOGIC := '0';
118
    SIGNAL rst_int_wr                     :   STD_LOGIC := '0';
119
    SIGNAL rst_gen_rd                     :   STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
120
    SIGNAL rst_s_wr3                      :   STD_LOGIC := '0';
121
    SIGNAL rst_s_rd                       :   STD_LOGIC := '0';
122
    SIGNAL reset_en                       :   STD_LOGIC := '0';
123
    SIGNAL rst_async_rd1                  :   STD_LOGIC := '0';
124
    SIGNAL rst_async_rd2                  :   STD_LOGIC := '0';
125
    SIGNAL rst_async_rd3                  :   STD_LOGIC := '0';
126
 
127
 
128
 BEGIN
129
 
130
   ---- Reset generation logic -----
131
   rst_int_wr          <= rst_async_rd3 OR rst_s_rd;
132
   rst_int_rd          <= rst_async_rd3 OR rst_s_rd;
133
 
134
   --Testbench reset synchronization
135
   PROCESS(clk_i,RESET)
136
   BEGIN
137
     IF(RESET = '1') THEN
138
       rst_async_rd1    <= '1';
139
       rst_async_rd2    <= '1';
140
       rst_async_rd3    <= '1';
141
     ELSIF(clk_i'event AND clk_i='1') THEN
142
       rst_async_rd1    <= RESET;
143
       rst_async_rd2    <= rst_async_rd1;
144
       rst_async_rd3    <= rst_async_rd2;
145
     END IF;
146
   END PROCESS;
147
 
148
   --Soft reset for core and testbench
149
   PROCESS(clk_i)
150
   BEGIN
151
     IF(clk_i'event AND clk_i='1') THEN
152
       rst_gen_rd      <= rst_gen_rd + "1";
153
       IF(reset_en = '1' AND AND_REDUCE(rst_gen_rd) = '1') THEN
154
         rst_s_rd      <= '1';
155
         assert false
156
         report "Reset applied..Memory Collision checks are not valid"
157
         severity note;
158
       ELSE
159
         IF(AND_REDUCE(rst_gen_rd)  = '1' AND rst_s_rd = '1') THEN
160
           rst_s_rd    <= '0';
161
           assert false
162
           report "Reset removed..Memory Collision checks are valid"
163
           severity note;
164
         END IF;
165
       END IF;
166
     END IF;
167
   END PROCESS;
168
   ------------------
169
 
170
   ---- Clock buffers for testbench ----
171
  clk_i <= CLK;
172
   ------------------
173
 
174
    rst                       <=   RESET OR rst_s_rd AFTER 12 ns;
175
    din                       <=   wr_data;
176
    dout_i                    <=   dout;
177
    wr_en                     <=   wr_en_i;
178
    rd_en                     <=   rd_en_i;
179
    full_i                    <=   full;
180
    empty_i                   <=   empty;
181
 
182
    fg_dg_nv: fifo_generator_v9_3_dgen
183
      GENERIC MAP (
184
                C_DIN_WIDTH       => 32,
185
                C_DOUT_WIDTH      => 32,
186
                TB_SEED           => TB_SEED,
187
                C_CH_TYPE         => 0
188
                 )
189
      PORT MAP (  -- Write Port
190
                RESET             => rst_int_wr,
191
                WR_CLK            => clk_i,
192
                PRC_WR_EN         => prc_we_i,
193
                FULL              => full_i,
194
                WR_EN             => wr_en_i,
195
                WR_DATA           => wr_data
196
               );
197
 
198
   fg_dv_nv: fifo_generator_v9_3_dverif
199
    GENERIC MAP (
200
               C_DOUT_WIDTH       => 32,
201
               C_DIN_WIDTH        => 32,
202
               C_USE_EMBEDDED_REG => 0,
203
               TB_SEED            => TB_SEED,
204
               C_CH_TYPE          => 0
205
                )
206
     PORT MAP(
207
              RESET               => rst_int_rd,
208
              RD_CLK              => clk_i,
209
              PRC_RD_EN           => prc_re_i,
210
              RD_EN               => rd_en_i,
211
              EMPTY               => empty_i,
212
              DATA_OUT            => dout_i,
213
              DOUT_CHK            => dout_chk_i
214
            );
215
 
216
    fg_pc_nv: fifo_generator_v9_3_pctrl
217
    GENERIC MAP (
218
              AXI_CHANNEL         => "Native",
219
              C_APPLICATION_TYPE  => 0,
220
              C_DOUT_WIDTH        => 32,
221
              C_DIN_WIDTH         => 32,
222
              C_WR_PNTR_WIDTH     => 9,
223
              C_RD_PNTR_WIDTH     => 9,
224
              C_CH_TYPE           => 0,
225
              FREEZEON_ERROR      => FREEZEON_ERROR,
226
              TB_SEED             => TB_SEED,
227
              TB_STOP_CNT         => TB_STOP_CNT
228
                )
229
     PORT MAP(
230
              RESET_WR            => rst_int_wr,
231
              RESET_RD            => rst_int_rd,
232
              RESET_EN            => reset_en,
233
              WR_CLK              => clk_i,
234
              RD_CLK              => clk_i,
235
              PRC_WR_EN           => prc_we_i,
236
              PRC_RD_EN           => prc_re_i,
237
              FULL                => full_i,
238
              ALMOST_FULL         => almost_full_i,
239
              ALMOST_EMPTY        => almost_empty_i,
240
              DOUT_CHK            => dout_chk_i,
241
              EMPTY               => empty_i,
242
              DATA_IN             => wr_data,
243
              DATA_OUT            => dout,
244
              SIM_DONE            => SIM_DONE,
245
              STATUS              => STATUS
246
            );
247
 
248
 
249
 
250
 
251
 
252
  fifo_generator_v9_3_inst : fifo_generator_v9_3_exdes
253
    PORT MAP (
254
           CLK                       => clk_i,
255
           RST                       => rst,
256
           WR_EN                     => wr_en,
257
           RD_EN                     => rd_en,
258
           DIN                       => din,
259
           DOUT                      => dout,
260
           FULL                      => full,
261
           EMPTY                     => empty);
262
 
263
END ARCHITECTURE;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.