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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [ipcore_dir/] [fifo_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3/] [simulation/] [fifo_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3_dverif.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_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3_dverif.vhd
55
--
56
-- Description:
57
--   Used for FIFO read interface stimulus generation and data checking
58
--
59
--------------------------------------------------------------------------------
60
-- Library Declarations
61
--------------------------------------------------------------------------------
62
LIBRARY ieee;
63
USE ieee.std_logic_1164.ALL;
64
USE ieee.std_logic_unsigned.all;
65
USE IEEE.std_logic_arith.all;
66
USE IEEE.std_logic_misc.all;
67
 
68
LIBRARY work;
69
USE work.fifo_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3_pkg.ALL;
70
 
71
ENTITY fifo_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3_dverif IS
72
  GENERIC(
73
   C_DIN_WIDTH        : INTEGER := 0;
74
   C_DOUT_WIDTH       : INTEGER := 0;
75
   C_USE_EMBEDDED_REG : INTEGER := 0;
76
   C_CH_TYPE          : INTEGER := 0;
77
   TB_SEED            : INTEGER := 2
78
  );
79
  PORT(
80
       RESET          : IN STD_LOGIC;
81
       RD_CLK         : IN STD_LOGIC;
82
       PRC_RD_EN      : IN STD_LOGIC;
83
       EMPTY          : IN STD_LOGIC;
84
       DATA_OUT       : IN STD_LOGIC_VECTOR(C_DOUT_WIDTH-1 DOWNTO 0);
85
       RD_EN          : OUT STD_LOGIC;
86
       DOUT_CHK       : OUT STD_LOGIC
87
      );
88
END ENTITY;
89
 
90
 
91
ARCHITECTURE fg_dv_arch OF fifo_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3_dverif IS
92
 
93
 CONSTANT C_DATA_WIDTH    : INTEGER := if_then_else(C_DIN_WIDTH > C_DOUT_WIDTH,C_DIN_WIDTH,C_DOUT_WIDTH);
94
 CONSTANT EXTRA_WIDTH     : INTEGER := if_then_else(C_CH_TYPE = 2,1,0);
95
 CONSTANT LOOP_COUNT      : INTEGER := divroundup(C_DATA_WIDTH+EXTRA_WIDTH,8);
96
 
97
 SIGNAL expected_dout     : STD_LOGIC_VECTOR(C_DOUT_WIDTH-1 DOWNTO 0) := (OTHERS => '0');
98
 SIGNAL expected_dout_reg : STD_LOGIC_VECTOR(C_DOUT_WIDTH-1 DOWNTO 0) := (OTHERS => '0');
99
 SIGNAL data_chk          : STD_LOGIC := '1';
100
 SIGNAL rand_num          : STD_LOGIC_VECTOR(8*LOOP_COUNT-1 downto 0);
101
 SIGNAL rd_en_i           : STD_LOGIC := '0';
102
 SIGNAL pr_r_en           : STD_LOGIC := '0';
103
 SIGNAL rd_en_d1          : STD_LOGIC := '0';
104
 SIGNAL rd_en_emb         : STD_LOGIC := '0';
105
BEGIN
106
 
107
 
108
  DOUT_CHK <= data_chk;
109
  RD_EN    <= rd_en_i;
110
  rd_en_i  <= PRC_RD_EN;
111
 
112
 
113
  data_fifo_chk:IF(C_CH_TYPE /=2) GENERATE
114
  -------------------------------------------------------
115
  -- Expected data generation and checking for data_fifo
116
  -------------------------------------------------------
117
      PROCESS (RD_CLK,RESET)
118
      BEGIN
119
        IF (RESET = '1') THEN
120
          rd_en_d1 <= '0';
121
        ELSIF (RD_CLK'event AND RD_CLK='1') THEN
122
          IF(EMPTY = '0' AND rd_en_i='1' AND rd_en_d1 = '0') THEN
123
            rd_en_d1 <= '1';
124
          END IF;
125
        END IF;
126
      END PROCESS;
127
 
128
      pr_r_en       <= rd_en_i AND NOT EMPTY AND rd_en_d1;
129
      expected_dout <= rand_num(C_DOUT_WIDTH-1 DOWNTO 0);
130
 
131
    gen_num:FOR N IN LOOP_COUNT-1 DOWNTO 0 GENERATE
132
      rd_gen_inst2:fifo_2048x8wr_256x64rd_prog_full_fifo_gen_v9_3_rng
133
      GENERIC MAP(
134
                WIDTH => 8,
135
                SEED  => TB_SEED+N
136
                 )
137
      PORT MAP(
138
                CLK        => RD_CLK,
139
                RESET      => RESET,
140
                RANDOM_NUM => rand_num(8*(N+1)-1 downto 8*N),
141
                ENABLE     => pr_r_en
142
              );
143
    END GENERATE;
144
 
145
 
146
      PROCESS (RD_CLK,RESET)
147
      BEGIN
148
        IF(RESET = '1') THEN
149
          rd_en_emb <= '0';
150
          expected_dout_reg <= hexstr_to_std_logic_vec("0",64);
151
        ELSIF (RD_CLK'event AND RD_CLK='1') THEN
152
          rd_en_emb <= rd_en_i AND NOT EMPTY;
153
          IF(rd_en_emb = '1') THEN
154
            expected_dout_reg <= expected_dout;
155
          END IF;
156
        END IF;
157
      END PROCESS;
158
 
159
      PROCESS (RD_CLK,RESET)
160
      BEGIN
161
        IF(RESET = '1') THEN
162
          data_chk <= '0';
163
        ELSIF (RD_CLK'event AND RD_CLK='1') THEN
164
          IF((EMPTY = '0') AND ((rd_en_emb = '1' OR rd_en_i = '1') AND rd_en_d1 = '1')) THEN
165
            IF (DATA_OUT = expected_dout_reg) THEN
166
              data_chk <= '0';
167
            ELSE
168
              data_chk <= '1';
169
            END IF;
170
          END IF;
171
        END IF;
172
      END PROCESS;
173
  END GENERATE data_fifo_chk;
174
 
175
END ARCHITECTURE;

powered by: WebSVN 2.1.0

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