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/] [bmg_stim_gen.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
-- BLK MEM GEN v7_3 Core - Stimulus Generator For Single Port Ram
7
--
8
--------------------------------------------------------------------------------
9
--
10
-- (c) Copyright 2006_3010 Xilinx, Inc. All rights reserved.
11
--
12
-- This file contains confidential and proprietary information
13
-- of Xilinx, Inc. and is protected under U.S. and
14
-- international copyright and other intellectual property
15
-- laws.
16
--
17
-- DISCLAIMER
18
-- This disclaimer is not a license and does not grant any
19
-- rights to the materials distributed herewith. Except as
20
-- otherwise provided in a valid license issued to you by
21
-- Xilinx, and to the maximum extent permitted by applicable
22
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
23
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
24
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
25
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
26
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
27
-- (2) Xilinx shall not be liable (whether in contract or tort,
28
-- including negligence, or under any other theory of
29
-- liability) for any loss or damage of any kind or nature
30
-- related to, arising under or in connection with these
31
-- materials, including for any direct, or any indirect,
32
-- special, incidental, or consequential loss or damage
33
-- (including loss of data, profits, goodwill, or any type of
34
-- loss or damage suffered as a result of any action brought
35
-- by a third party) even if such damage or loss was
36
-- reasonably foreseeable or Xilinx had been advised of the
37
-- possibility of the same.
38
--
39
-- CRITICAL APPLICATIONS
40
-- Xilinx products are not designed or intended to be fail-
41
-- safe, or for use in any application requiring fail-safe
42
-- performance, such as life-support or safety devices or
43
-- systems, Class III medical devices, nuclear facilities,
44
-- applications related to the deployment of airbags, or any
45
-- other applications that could lead to death, personal
46
-- injury, or severe property or environmental damage
47
-- (individually and collectively, "Critical
48
-- Applications"). Customer assumes the sole risk and
49
-- liability of any use of Xilinx products in Critical
50
-- Applications, subject only to applicable laws and
51
-- regulations governing limitations on product liability.
52
--
53
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
54
-- PART OF THIS FILE AT ALL TIMES.
55
 
56
--------------------------------------------------------------------------------
57
--
58
-- Filename: bmg_stim_gen.vhd
59
--
60
-- Description:
61
--  Stimulus Generation For SRAM
62
--  100 Writes and 100 Reads will be performed in a repeatitive loop till the 
63
--  simulation ends
64
--
65
--------------------------------------------------------------------------------
66
-- Author: IP Solutions Division
67
--
68
-- History: Sep 12, 2011 - First Release
69
--------------------------------------------------------------------------------
70
--
71
--------------------------------------------------------------------------------
72
-- Library Declarations
73
--------------------------------------------------------------------------------
74
LIBRARY IEEE;
75
USE IEEE.STD_LOGIC_1164.ALL;
76
USE IEEE.STD_LOGIC_ARITH.ALL;
77
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
78
USE IEEE.STD_LOGIC_MISC.ALL;
79
 
80
LIBRARY work;
81
USE work.ALL;
82
 
83
USE work.BMG_TB_PKG.ALL;
84
 
85
 
86
ENTITY REGISTER_LOGIC_SRAM IS
87
  PORT(
88
       Q   : OUT STD_LOGIC;
89
       CLK : IN STD_LOGIC;
90
       RST : IN STD_LOGIC;
91
       D   : IN STD_LOGIC
92
  );
93
END REGISTER_LOGIC_SRAM;
94
 
95
ARCHITECTURE REGISTER_ARCH OF REGISTER_LOGIC_SRAM IS
96
   SIGNAL Q_O : STD_LOGIC :='0';
97
BEGIN
98
  Q <= Q_O;
99
  FF_BEH: PROCESS(CLK)
100
  BEGIN
101
    IF(RISING_EDGE(CLK)) THEN
102
      IF(RST ='1') THEN
103
        Q_O <= '0';
104
      ELSE
105
        Q_O <= D;
106
      END IF;
107
    END IF;
108
  END PROCESS;
109
END REGISTER_ARCH;
110
 
111
LIBRARY IEEE;
112
USE IEEE.STD_LOGIC_1164.ALL;
113
USE IEEE.STD_LOGIC_ARITH.ALL;
114
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
115
USE IEEE.STD_LOGIC_MISC.ALL;
116
 
117
LIBRARY work;
118
USE work.ALL;
119
USE work.BMG_TB_PKG.ALL;
120
 
121
 
122
ENTITY BMG_STIM_GEN IS
123
  PORT (
124
        CLK       : IN   STD_LOGIC;
125
        RST       : IN   STD_LOGIC;
126
        ADDRA     : OUT  STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
127
        DINA      : OUT  STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
128
 
129
        ENA       : OUT  STD_LOGIC :='0';
130
        WEA       : OUT  STD_LOGIC_VECTOR (0 DOWNTO 0) := (OTHERS => '0');
131
        CHECK_DATA: OUT  STD_LOGIC:='0'
132
  );
133
END BMG_STIM_GEN;
134
 
135
 
136
ARCHITECTURE BEHAVIORAL OF BMG_STIM_GEN IS
137
 
138
   CONSTANT ZERO           : STD_LOGIC_VECTOR(31 DOWNTO 0)                := (OTHERS => '0');
139
   CONSTANT DATA_PART_CNT_A: INTEGER:= DIVROUNDUP(8,8);
140
   SIGNAL   WRITE_ADDR     : STD_LOGIC_VECTOR(31 DOWNTO 0)                := (OTHERS => '0');
141
   SIGNAL   WRITE_ADDR_INT : STD_LOGIC_VECTOR(7 DOWNTO 0)   := (OTHERS => '0');
142
   SIGNAL   READ_ADDR_INT  : STD_LOGIC_VECTOR(7 DOWNTO 0)   := (OTHERS => '0');
143
   SIGNAL   READ_ADDR      : STD_LOGIC_VECTOR(31 DOWNTO 0)                := (OTHERS => '0');
144
   SIGNAL   DINA_INT       : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
145
   SIGNAL   DO_WRITE       : STD_LOGIC                                    := '0';
146
   SIGNAL   DO_READ        : STD_LOGIC                                    := '0';
147
   SIGNAL   COUNT_NO       : INTEGER                                      :=0;
148
   SIGNAL   DO_READ_REG    : STD_LOGIC_VECTOR(4 DOWNTO 0)                 :=(OTHERS => '0');
149
BEGIN
150
   WRITE_ADDR_INT(7 DOWNTO 0) <= WRITE_ADDR(7 DOWNTO 0);
151
   READ_ADDR_INT(7 DOWNTO 0)  <= READ_ADDR(7 DOWNTO 0);
152
   ADDRA <= IF_THEN_ELSE(DO_WRITE='1',WRITE_ADDR_INT,READ_ADDR_INT) ;
153
    DINA  <= DINA_INT ;
154
 
155
   CHECK_DATA <= DO_READ;
156
 
157
RD_ADDR_GEN_INST:ENTITY work.ADDR_GEN
158
  GENERIC MAP(
159
    C_MAX_DEPTH => 256
160
  )
161
  PORT MAP(
162
    CLK        => CLK,
163
    RST        => RST,
164
    EN         => DO_READ,
165
    LOAD       => '0',
166
    LOAD_VALUE => ZERO,
167
    ADDR_OUT   => READ_ADDR
168
  );
169
 
170
WR_ADDR_GEN_INST:ENTITY work.ADDR_GEN
171
  GENERIC MAP(
172
    C_MAX_DEPTH => 256  )
173
  PORT MAP(
174
     CLK        => CLK,
175
         RST        => RST,
176
         EN         => DO_WRITE,
177
     LOAD       => '0',
178
         LOAD_VALUE => ZERO,
179
         ADDR_OUT   => WRITE_ADDR
180
  );
181
 
182
WR_DATA_GEN_INST:ENTITY work.DATA_GEN
183
   GENERIC MAP (
184
     DATA_GEN_WIDTH => 8,
185
     DOUT_WIDTH     => 8,
186
     DATA_PART_CNT  => DATA_PART_CNT_A,
187
     SEED           => 2
188
   )
189
   PORT MAP (
190
     CLK      => CLK,
191
         RST      => RST,
192
     EN       => DO_WRITE,
193
     DATA_OUT => DINA_INT
194
   );
195
 
196
WR_RD_PROCESS: PROCESS (CLK)
197
BEGIN
198
  IF(RISING_EDGE(CLK)) THEN
199
     IF(RST='1') THEN
200
            DO_WRITE <= '0';
201
        DO_READ  <= '0';
202
        COUNT_NO <=  0 ;
203
     ELSIF(COUNT_NO < 4) THEN
204
            DO_WRITE <= '1';
205
        DO_READ  <= '0';
206
        COUNT_NO <= COUNT_NO + 1;
207
     ELSIF(COUNT_NO< 8) THEN
208
            DO_WRITE <= '0';
209
        DO_READ  <= '1';
210
        COUNT_NO <= COUNT_NO + 1;
211
     ELSIF(COUNT_NO=8) THEN
212
        DO_WRITE <= '0';
213
        DO_READ  <= '0';
214
        COUNT_NO <=  0 ;
215
     END IF;
216
  END IF;
217
END PROCESS;
218
 
219
BEGIN_SHIFT_REG: FOR I IN 0 TO 4 GENERATE
220
BEGIN
221
  DFF_RIGHT: IF I=0 GENERATE
222
  BEGIN
223
    SHIFT_INST_0: ENTITY work.REGISTER_LOGIC_SRAM
224
      PORT MAP(
225
        Q   => DO_READ_REG(0),
226
        CLK => CLK,
227
        RST => RST,
228
        D   => DO_READ
229
      );
230
  END GENERATE DFF_RIGHT;
231
  DFF_OTHERS: IF ((I>0) AND (I<=4)) GENERATE
232
  BEGIN
233
     SHIFT_INST: ENTITY work.REGISTER_LOGIC_SRAM
234
       PORT MAP(
235
          Q   => DO_READ_REG(I),
236
          CLK => CLK,
237
          RST => RST,
238
          D   => DO_READ_REG(I-1)
239
       );
240
  END GENERATE DFF_OTHERS;
241
END GENERATE BEGIN_SHIFT_REG;
242
 
243
   ENA <= DO_READ OR DO_WRITE ;
244
   WEA(0) <= IF_THEN_ELSE(DO_WRITE='1','1','0') ;
245
 
246
END ARCHITECTURE;

powered by: WebSVN 2.1.0

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