OpenCores
URL https://opencores.org/ocsvn/am9080_cpu_based_on_microcoded_am29xx_bit-slices/am9080_cpu_based_on_microcoded_am29xx_bit-slices/trunk

Subversion Repositories am9080_cpu_based_on_microcoded_am29xx_bit-slices

[/] [am9080_cpu_based_on_microcoded_am29xx_bit-slices/] [trunk/] [ipcore_dir/] [rom4kx8/] [simulation/] [rom4kx8_synth.vhd] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 zpekic
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
--------------------------------------------------------------------------------
10
--
11
-- BLK MEM GEN v7_3 Core - Synthesizable Testbench
12
--
13
--------------------------------------------------------------------------------
14
--
15
-- (c) Copyright 2006_3010 Xilinx, Inc. All rights reserved.
16
--
17
-- This file contains confidential and proprietary information
18
-- of Xilinx, Inc. and is protected under U.S. and
19
-- international copyright and other intellectual property
20
-- laws.
21
--
22
-- DISCLAIMER
23
-- This disclaimer is not a license and does not grant any
24
-- rights to the materials distributed herewith. Except as
25
-- otherwise provided in a valid license issued to you by
26
-- Xilinx, and to the maximum extent permitted by applicable
27
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
28
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
29
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
30
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
31
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
32
-- (2) Xilinx shall not be liable (whether in contract or tort,
33
-- including negligence, or under any other theory of
34
-- liability) for any loss or damage of any kind or nature
35
-- related to, arising under or in connection with these
36
-- materials, including for any direct, or any indirect,
37
-- special, incidental, or consequential loss or damage
38
-- (including loss of data, profits, goodwill, or any type of
39
-- loss or damage suffered as a result of any action brought
40
-- by a third party) even if such damage or loss was
41
-- reasonably foreseeable or Xilinx had been advised of the
42
-- possibility of the same.
43
--
44
-- CRITICAL APPLICATIONS
45
-- Xilinx products are not designed or intended to be fail-
46
-- safe, or for use in any application requiring fail-safe
47
-- performance, such as life-support or safety devices or
48
-- systems, Class III medical devices, nuclear facilities,
49
-- applications related to the deployment of airbags, or any
50
-- other applications that could lead to death, personal
51
-- injury, or severe property or environmental damage
52
-- (individually and collectively, "Critical
53
-- Applications"). Customer assumes the sole risk and
54
-- liability of any use of Xilinx products in Critical
55
-- Applications, subject only to applicable laws and
56
-- regulations governing limitations on product liability.
57
--
58
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
59
-- PART OF THIS FILE AT ALL TIMES.
60
 
61
--------------------------------------------------------------------------------
62
--
63
-- Filename: rom4kx8_synth.vhd
64
--
65
-- Description:
66
--  Synthesizable Testbench
67
--------------------------------------------------------------------------------
68
-- Author: IP Solutions Division
69
--
70
-- History: Sep 12, 2011 - First Release
71
--------------------------------------------------------------------------------
72
--
73
--------------------------------------------------------------------------------
74
-- Library Declarations
75
--------------------------------------------------------------------------------
76
 
77
LIBRARY IEEE;
78
USE IEEE.STD_LOGIC_1164.ALL;
79
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
80
USE IEEE.STD_LOGIC_ARITH.ALL;
81
USE IEEE.NUMERIC_STD.ALL;
82
USE IEEE.STD_LOGIC_MISC.ALL;
83
 
84
LIBRARY STD;
85
USE STD.TEXTIO.ALL;
86
 
87
--LIBRARY unisim;
88
--USE unisim.vcomponents.ALL;
89
 
90
LIBRARY work;
91
USE work.ALL;
92
USE work.BMG_TB_PKG.ALL;
93
 
94
ENTITY rom4kx8_synth IS
95
GENERIC (
96
   C_ROM_SYNTH : INTEGER := 1
97
   );
98
PORT(
99
        CLK_IN     : IN  STD_LOGIC;
100
    RESET_IN   : IN  STD_LOGIC;
101
    STATUS     : OUT STD_LOGIC_VECTOR(8 DOWNTO 0) := (OTHERS => '0')   --ERROR STATUS OUT OF FPGA
102
    );
103
END ENTITY;
104
 
105
ARCHITECTURE rom4kx8_synth_ARCH OF rom4kx8_synth IS
106
 
107
 
108
COMPONENT rom4kx8_exdes
109
  PORT (
110
      --Inputs - Port A
111
    ADDRA          : IN STD_LOGIC_VECTOR(11 DOWNTO 0);
112
    DOUTA          : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
113
    CLKA       : IN STD_LOGIC
114
 
115
 
116
  );
117
 
118
END COMPONENT;
119
 
120
 
121
  SIGNAL CLKA: STD_LOGIC := '0';
122
  SIGNAL RSTA: STD_LOGIC := '0';
123
  SIGNAL ADDRA: STD_LOGIC_VECTOR(11 DOWNTO 0) := (OTHERS => '0');
124
  SIGNAL ADDRA_R: STD_LOGIC_VECTOR(11 DOWNTO 0) := (OTHERS => '0');
125
  SIGNAL DOUTA: STD_LOGIC_VECTOR(7 DOWNTO 0);
126
  SIGNAL CHECKER_EN : STD_LOGIC:='0';
127
  SIGNAL CHECKER_EN_R : STD_LOGIC:='0';
128
  SIGNAL STIMULUS_FLOW : STD_LOGIC_VECTOR(22 DOWNTO 0) := (OTHERS =>'0');
129
  SIGNAL clk_in_i: STD_LOGIC;
130
 
131
  SIGNAL RESET_SYNC_R1 : STD_LOGIC:='1';
132
  SIGNAL RESET_SYNC_R2 : STD_LOGIC:='1';
133
  SIGNAL RESET_SYNC_R3 : STD_LOGIC:='1';
134
 
135
  SIGNAL ITER_R0 : STD_LOGIC := '0';
136
  SIGNAL ITER_R1 : STD_LOGIC := '0';
137
  SIGNAL ITER_R2 : STD_LOGIC := '0';
138
 
139
  SIGNAL ISSUE_FLAG : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
140
  SIGNAL ISSUE_FLAG_STATUS : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
141
 
142
  BEGIN
143
 
144
--  clk_buf: bufg
145
--    PORT map(
146
--      i => CLK_IN,
147
--      o => clk_in_i
148
--    );
149
   clk_in_i <= CLK_IN;
150
   CLKA <= clk_in_i;
151
 
152
   RSTA <= RESET_SYNC_R3 AFTER 50 ns;
153
 
154
 
155
   PROCESS(clk_in_i)
156
   BEGIN
157
      IF(RISING_EDGE(clk_in_i)) THEN
158
                 RESET_SYNC_R1 <= RESET_IN;
159
                 RESET_SYNC_R2 <= RESET_SYNC_R1;
160
                 RESET_SYNC_R3 <= RESET_SYNC_R2;
161
          END IF;
162
   END PROCESS;
163
 
164
 
165
PROCESS(CLKA)
166
BEGIN
167
  IF(RISING_EDGE(CLKA)) THEN
168
    IF(RESET_SYNC_R3='1') THEN
169
        ISSUE_FLAG_STATUS<= (OTHERS => '0');
170
          ELSE
171
        ISSUE_FLAG_STATUS <= ISSUE_FLAG_STATUS OR ISSUE_FLAG;
172
   END IF;
173
  END IF;
174
END PROCESS;
175
 
176
STATUS(7 DOWNTO 0) <= ISSUE_FLAG_STATUS;
177
 
178
 
179
 
180
 
181
 
182
 BMG_STIM_GEN_INST:ENTITY work.BMG_STIM_GEN
183
    GENERIC MAP(  C_ROM_SYNTH => C_ROM_SYNTH
184
              )
185
 
186
     PORT MAP(
187
                CLK => clk_in_i,
188
                RST => RSTA,
189
                ADDRA  => ADDRA,
190
                                DATA_IN => DOUTA,
191
                                STATUS => ISSUE_FLAG(0)
192
             );
193
 
194
      PROCESS(CLKA)
195
      BEGIN
196
        IF(RISING_EDGE(CLKA)) THEN
197
                  IF(RESET_SYNC_R3='1') THEN
198
                        STATUS(8) <= '0';
199
                        iter_r2 <= '0';
200
                        iter_r1 <= '0';
201
                        iter_r0 <= '0';
202
                  ELSE
203
                        STATUS(8) <= iter_r2;
204
                        iter_r2 <= iter_r1;
205
                        iter_r1 <= iter_r0;
206
                        iter_r0 <= STIMULUS_FLOW(8);
207
              END IF;
208
            END IF;
209
      END PROCESS;
210
 
211
      PROCESS(CLKA)
212
      BEGIN
213
        IF(RISING_EDGE(CLKA)) THEN
214
                  IF(RESET_SYNC_R3='1') THEN
215
                      STIMULUS_FLOW <= (OTHERS => '0');
216
           ELSIF(ADDRA(0)='1') THEN
217
                      STIMULUS_FLOW <= STIMULUS_FLOW+1;
218
         END IF;
219
            END IF;
220
      END PROCESS;
221
 
222
 
223
      PROCESS(CLKA)
224
      BEGIN
225
        IF(RISING_EDGE(CLKA)) THEN
226
                  IF(RESET_SYNC_R3='1') THEN
227
 
228
 
229
           ELSE
230
 
231
         END IF;
232
            END IF;
233
      END PROCESS;
234
 
235
 
236
      PROCESS(CLKA)
237
      BEGIN
238
        IF(RISING_EDGE(CLKA)) THEN
239
                  IF(RESET_SYNC_R3='1') THEN
240
            ADDRA_R <= (OTHERS=> '0') AFTER 50 ns;
241
          ELSE
242
            ADDRA_R <= ADDRA AFTER 50 ns;
243
          END IF;
244
            END IF;
245
      END PROCESS;
246
 
247
 
248
    BMG_PORT: rom4kx8_exdes PORT MAP (
249
      --Port A
250
      ADDRA      => ADDRA_R,
251
      DOUTA      => DOUTA,
252
      CLKA       => CLKA
253
 
254
    );
255
END ARCHITECTURE;

powered by: WebSVN 2.1.0

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