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/] [ram4kx8/] [simulation/] [ram4kx8_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: ram4kx8_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 ram4kx8_synth IS
95
PORT(
96
        CLK_IN     : IN  STD_LOGIC;
97
    RESET_IN   : IN  STD_LOGIC;
98
    STATUS     : OUT STD_LOGIC_VECTOR(8 DOWNTO 0) := (OTHERS => '0')   --ERROR STATUS OUT OF FPGA
99
    );
100
END ENTITY;
101
 
102
ARCHITECTURE ram4kx8_synth_ARCH OF ram4kx8_synth IS
103
 
104
 
105
COMPONENT ram4kx8_exdes
106
  PORT (
107
      --Inputs - Port A
108
    ENA            : IN STD_LOGIC;  --opt port
109
    WEA            : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
110
    ADDRA          : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
111
    DINA           : IN STD_LOGIC_VECTOR(7 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 ENA: STD_LOGIC := '0';
124
  SIGNAL ENA_R: STD_LOGIC := '0';
125
  SIGNAL WEA: STD_LOGIC_VECTOR(0 DOWNTO 0) := (OTHERS => '0');
126
  SIGNAL WEA_R: STD_LOGIC_VECTOR(0 DOWNTO 0) := (OTHERS => '0');
127
  SIGNAL ADDRA: STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
128
  SIGNAL ADDRA_R: STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
129
  SIGNAL DINA: STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
130
  SIGNAL DINA_R: STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
131
  SIGNAL DOUTA: STD_LOGIC_VECTOR(7 DOWNTO 0);
132
  SIGNAL CHECKER_EN : STD_LOGIC:='0';
133
  SIGNAL CHECKER_EN_R : STD_LOGIC:='0';
134
  SIGNAL STIMULUS_FLOW : STD_LOGIC_VECTOR(22 DOWNTO 0) := (OTHERS =>'0');
135
  SIGNAL clk_in_i: STD_LOGIC;
136
 
137
  SIGNAL RESET_SYNC_R1 : STD_LOGIC:='1';
138
  SIGNAL RESET_SYNC_R2 : STD_LOGIC:='1';
139
  SIGNAL RESET_SYNC_R3 : STD_LOGIC:='1';
140
 
141
  SIGNAL ITER_R0 : STD_LOGIC := '0';
142
  SIGNAL ITER_R1 : STD_LOGIC := '0';
143
  SIGNAL ITER_R2 : STD_LOGIC := '0';
144
 
145
  SIGNAL ISSUE_FLAG : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
146
  SIGNAL ISSUE_FLAG_STATUS : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
147
 
148
  BEGIN
149
 
150
--  clk_buf: bufg
151
--    PORT map(
152
--      i => CLK_IN,
153
--      o => clk_in_i
154
--    );
155
   clk_in_i <= CLK_IN;
156
   CLKA <= clk_in_i;
157
 
158
   RSTA <= RESET_SYNC_R3 AFTER 50 ns;
159
 
160
 
161
   PROCESS(clk_in_i)
162
   BEGIN
163
      IF(RISING_EDGE(clk_in_i)) THEN
164
                 RESET_SYNC_R1 <= RESET_IN;
165
                 RESET_SYNC_R2 <= RESET_SYNC_R1;
166
                 RESET_SYNC_R3 <= RESET_SYNC_R2;
167
          END IF;
168
   END PROCESS;
169
 
170
 
171
PROCESS(CLKA)
172
BEGIN
173
  IF(RISING_EDGE(CLKA)) THEN
174
    IF(RESET_SYNC_R3='1') THEN
175
        ISSUE_FLAG_STATUS<= (OTHERS => '0');
176
          ELSE
177
        ISSUE_FLAG_STATUS <= ISSUE_FLAG_STATUS OR ISSUE_FLAG;
178
   END IF;
179
  END IF;
180
END PROCESS;
181
 
182
STATUS(7 DOWNTO 0) <= ISSUE_FLAG_STATUS;
183
 
184
 
185
 
186
   BMG_DATA_CHECKER_INST: ENTITY work.CHECKER
187
      GENERIC MAP (
188
         WRITE_WIDTH => 8,
189
                 READ_WIDTH  => 8      )
190
      PORT MAP (
191
         CLK     => CLKA,
192
         RST     => RSTA,
193
         EN      => CHECKER_EN_R,
194
         DATA_IN => DOUTA,
195
         STATUS  => ISSUE_FLAG(0)
196
           );
197
 
198
   PROCESS(CLKA)
199
   BEGIN
200
      IF(RISING_EDGE(CLKA)) THEN
201
         IF(RSTA='1') THEN
202
                    CHECKER_EN_R <= '0';
203
             ELSE
204
                    CHECKER_EN_R <= CHECKER_EN AFTER 50 ns;
205
         END IF;
206
      END IF;
207
   END PROCESS;
208
 
209
 
210
    BMG_STIM_GEN_INST:ENTITY work.BMG_STIM_GEN
211
     PORT MAP(
212
                CLK => clk_in_i,
213
                RST => RSTA,
214
                ADDRA  => ADDRA,
215
                DINA => DINA,
216
 
217
                ENA => ENA,
218
                WEA => WEA,
219
                    CHECK_DATA => CHECKER_EN
220
             );
221
 
222
      PROCESS(CLKA)
223
      BEGIN
224
        IF(RISING_EDGE(CLKA)) THEN
225
                  IF(RESET_SYNC_R3='1') THEN
226
                        STATUS(8) <= '0';
227
                        iter_r2 <= '0';
228
                        iter_r1 <= '0';
229
                        iter_r0 <= '0';
230
                  ELSE
231
                        STATUS(8) <= iter_r2;
232
                        iter_r2 <= iter_r1;
233
                        iter_r1 <= iter_r0;
234
                        iter_r0 <= STIMULUS_FLOW(8);
235
              END IF;
236
            END IF;
237
      END PROCESS;
238
 
239
 
240
      PROCESS(CLKA)
241
      BEGIN
242
        IF(RISING_EDGE(CLKA)) THEN
243
                  IF(RESET_SYNC_R3='1') THEN
244
                      STIMULUS_FLOW <= (OTHERS => '0');
245
           ELSIF(WEA(0)='1') THEN
246
                      STIMULUS_FLOW <= STIMULUS_FLOW+1;
247
         END IF;
248
            END IF;
249
      END PROCESS;
250
 
251
 
252
 
253
 
254
      PROCESS(CLKA)
255
      BEGIN
256
        IF(RISING_EDGE(CLKA)) THEN
257
                  IF(RESET_SYNC_R3='1') THEN
258
            ENA_R <= '0' AFTER 50 ns;
259
            WEA_R  <= (OTHERS=>'0') AFTER 50 ns;
260
            DINA_R <= (OTHERS=>'0') AFTER 50 ns;
261
 
262
 
263
           ELSE
264
          ENA_R <= ENA AFTER 50 ns;
265
            WEA_R  <= WEA AFTER 50 ns;
266
            DINA_R <= DINA AFTER 50 ns;
267
 
268
         END IF;
269
            END IF;
270
      END PROCESS;
271
 
272
 
273
      PROCESS(CLKA)
274
      BEGIN
275
        IF(RISING_EDGE(CLKA)) THEN
276
                  IF(RESET_SYNC_R3='1') THEN
277
            ADDRA_R <= (OTHERS=> '0') AFTER 50 ns;
278
          ELSE
279
            ADDRA_R <= ADDRA AFTER 50 ns;
280
          END IF;
281
            END IF;
282
      END PROCESS;
283
 
284
 
285
    BMG_PORT: ram4kx8_exdes PORT MAP (
286
      --Port A
287
      ENA        => ENA_R,
288
      WEA        => WEA_R,
289
      ADDRA      => ADDRA_R,
290
      DINA       => DINA_R,
291
      DOUTA      => DOUTA,
292
      CLKA       => CLKA
293
 
294
    );
295
END ARCHITECTURE;

powered by: WebSVN 2.1.0

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