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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [xilinx_avnet_lx9microbard/] [rtl/] [verilog/] [coregen/] [ram_16x1k_sp/] [simulation/] [bmg_stim_gen.vhd] - Blame information for rev 167

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 167 olivier.gi
 
2
 
3
 
4
--------------------------------------------------------------------------------
5
--
6
-- BLK MEM GEN v7_2 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(9 DOWNTO 0) := (OTHERS => '0');
127
        DINA      : OUT  STD_LOGIC_VECTOR(15 DOWNTO 0) := (OTHERS => '0');
128
 
129
        ENA       : OUT  STD_LOGIC :='0';
130
        WEA       : OUT  STD_LOGIC_VECTOR (1 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(16,16);
140
   SIGNAL   WRITE_ADDR     : STD_LOGIC_VECTOR(31 DOWNTO 0)                := (OTHERS => '0');
141
   SIGNAL   WRITE_ADDR_INT : STD_LOGIC_VECTOR(9 DOWNTO 0)   := (OTHERS => '0');
142
   SIGNAL   READ_ADDR_INT  : STD_LOGIC_VECTOR(9 DOWNTO 0)   := (OTHERS => '0');
143
   SIGNAL   READ_ADDR      : STD_LOGIC_VECTOR(31 DOWNTO 0)                := (OTHERS => '0');
144
   SIGNAL   DINA_INT       : STD_LOGIC_VECTOR(15 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
   SIGNAL   WEA_VCC        : STD_LOGIC_VECTOR(1 DOWNTO 0)     :=(OTHERS => '1');
150
   SIGNAL   WEA_GND        : STD_LOGIC_VECTOR(1 DOWNTO 0)     :=(OTHERS => '0');
151
BEGIN
152
   WRITE_ADDR_INT(9 DOWNTO 0) <= WRITE_ADDR(9 DOWNTO 0);
153
   READ_ADDR_INT(9 DOWNTO 0)  <= READ_ADDR(9 DOWNTO 0);
154
   ADDRA <= IF_THEN_ELSE(DO_WRITE='1',WRITE_ADDR_INT,READ_ADDR_INT) ;
155
    DINA  <= DINA_INT ;
156
 
157
   CHECK_DATA <= DO_READ;
158
 
159
RD_ADDR_GEN_INST:ENTITY work.ADDR_GEN
160
  GENERIC MAP(
161
    C_MAX_DEPTH => 1024
162
  )
163
  PORT MAP(
164
    CLK        => CLK,
165
    RST        => RST,
166
    EN         => DO_READ,
167
    LOAD       => '0',
168
    LOAD_VALUE => ZERO,
169
    ADDR_OUT   => READ_ADDR
170
  );
171
 
172
WR_ADDR_GEN_INST:ENTITY work.ADDR_GEN
173
  GENERIC MAP(
174
    C_MAX_DEPTH => 1024  )
175
  PORT MAP(
176
     CLK        => CLK,
177
         RST        => RST,
178
         EN         => DO_WRITE,
179
     LOAD       => '0',
180
         LOAD_VALUE => ZERO,
181
         ADDR_OUT   => WRITE_ADDR
182
  );
183
 
184
WR_DATA_GEN_INST:ENTITY work.DATA_GEN
185
   GENERIC MAP (
186
     DATA_GEN_WIDTH => 16,
187
     DOUT_WIDTH     => 16,
188
     DATA_PART_CNT  => DATA_PART_CNT_A,
189
     SEED           => 2
190
   )
191
   PORT MAP (
192
     CLK      => CLK,
193
         RST      => RST,
194
     EN       => DO_WRITE,
195
     DATA_OUT => DINA_INT
196
   );
197
 
198
WR_RD_PROCESS: PROCESS (CLK)
199
BEGIN
200
  IF(RISING_EDGE(CLK)) THEN
201
     IF(RST='1') THEN
202
            DO_WRITE <= '0';
203
        DO_READ  <= '0';
204
        COUNT_NO <=  0 ;
205
     ELSIF(COUNT_NO < 4) THEN
206
            DO_WRITE <= '1';
207
        DO_READ  <= '0';
208
        COUNT_NO <= COUNT_NO + 1;
209
     ELSIF(COUNT_NO< 8) THEN
210
            DO_WRITE <= '0';
211
        DO_READ  <= '1';
212
        COUNT_NO <= COUNT_NO + 1;
213
     ELSIF(COUNT_NO=8) THEN
214
        DO_WRITE <= '0';
215
        DO_READ  <= '0';
216
        COUNT_NO <=  0 ;
217
     END IF;
218
  END IF;
219
END PROCESS;
220
 
221
BEGIN_SHIFT_REG: FOR I IN 0 TO 4 GENERATE
222
BEGIN
223
  DFF_RIGHT: IF I=0 GENERATE
224
  BEGIN
225
    SHIFT_INST_0: ENTITY work.REGISTER_LOGIC_SRAM
226
      PORT MAP(
227
        Q   => DO_READ_REG(0),
228
        CLK => CLK,
229
        RST => RST,
230
        D   => DO_READ
231
      );
232
  END GENERATE DFF_RIGHT;
233
  DFF_OTHERS: IF ((I>0) AND (I<=4)) GENERATE
234
  BEGIN
235
     SHIFT_INST: ENTITY work.REGISTER_LOGIC_SRAM
236
       PORT MAP(
237
          Q   => DO_READ_REG(I),
238
          CLK => CLK,
239
          RST => RST,
240
          D   => DO_READ_REG(I-1)
241
       );
242
  END GENERATE DFF_OTHERS;
243
END GENERATE BEGIN_SHIFT_REG;
244
 
245
   ENA <= DO_READ OR DO_WRITE ;
246
   WEA <= IF_THEN_ELSE(DO_WRITE='1', WEA_VCC,WEA_GND) ;
247
 
248
END ARCHITECTURE;

powered by: WebSVN 2.1.0

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