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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [techmap/] [virage/] [memory_virage.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
------------------------------------------------------------------------------
2
--  This file is a part of the GRLIB VHDL IP LIBRARY
3
--  Copyright (C) 2003, Gaisler Research
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
--
15
--  You should have received a copy of the GNU General Public License
16
--  along with this program; if not, write to the Free Software
17
--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
18
-----------------------------------------------------------------------------
19
-- Entity:      various
20
-- File:        mem_virage_gen.vhd
21
-- Author:      Jiri Gaisler Gaisler Research
22
-- Description: Memory generators for Virage rams
23
------------------------------------------------------------------------------
24
 
25
library ieee;
26
use ieee.std_logic_1164.all;
27
-- pragma translate_off
28
library virage;
29
use virage.hdss1_128x32cm4sw0ab;
30
use virage.hdss1_256x32cm4sw0ab;
31
use virage.hdss1_512x32cm4sw0ab;
32
use virage.hdss1_512x38cm4sw0ab;
33
use virage.hdss1_1024x32cm4sw0ab;
34
use virage.hdss1_2048x32cm8sw0ab;
35
use virage.hdss1_4096x36cm8sw0ab;
36
use virage.hdss1_16384x8cm16sw0;
37
-- pragma translate_on
38
 
39
entity virage_syncram is
40
  generic ( abits : integer := 10; dbits : integer := 8 );
41
  port (
42
    clk      : in std_ulogic;
43
    address  : in std_logic_vector(abits -1 downto 0);
44
    datain   : in std_logic_vector(dbits -1 downto 0);
45
    dataout  : out std_logic_vector(dbits -1 downto 0);
46
    enable   : in std_ulogic;
47
    write    : in std_ulogic
48
  );
49
end;
50
 
51
architecture rtl of virage_syncram is
52
 
53
  component hdss1_128x32cm4sw0ab
54
  port (
55
    addr, taddr : in std_logic_vector(6 downto 0);
56
    clk         : in std_logic;
57
    di, tdi     : in std_logic_vector(31 downto 0);
58
    do          : out std_logic_vector(31 downto 0);
59
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
60
  );
61
  end component;
62
 
63
  component hdss1_256x32cm4sw0ab
64
  port (
65
    addr, taddr : in std_logic_vector(7 downto 0);
66
    clk         : in std_logic;
67
    di, tdi     : in std_logic_vector(31 downto 0);
68
    do          : out std_logic_vector(31 downto 0);
69
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
70
  );
71
  end component;
72
 
73
  component hdss1_512x32cm4sw0ab
74
  port (
75
    addr, taddr : in std_logic_vector(8 downto 0);
76
    clk         : in std_logic;
77
    di, tdi     : in std_logic_vector(31 downto 0);
78
    do          : out std_logic_vector(31 downto 0);
79
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
80
  );
81
  end component;
82
 
83
  component hdss1_512x38cm4sw0ab
84
  port (
85
    addr, taddr : in std_logic_vector(8 downto 0);
86
    clk         : in std_logic;
87
    di, tdi     : in std_logic_vector(37 downto 0);
88
    do          : out std_logic_vector(37 downto 0);
89
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
90
  );
91
  end component;
92
 
93
  component hdss1_1024x32cm4sw0ab
94
  port (
95
    addr, taddr : in std_logic_vector(9 downto 0);
96
    clk         : in std_logic;
97
    di, tdi     : in std_logic_vector(31 downto 0);
98
    do          : out std_logic_vector(31 downto 0);
99
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
100
  );
101
  end component;
102
 
103
  component hdss1_2048x32cm8sw0ab
104
  port (
105
    addr, taddr : in std_logic_vector(10 downto 0);
106
    clk         : in std_logic;
107
    di, tdi     : in std_logic_vector(31 downto 0);
108
    do          : out std_logic_vector(31 downto 0);
109
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
110
  );
111
  end component;
112
 
113
  component hdss1_4096x36cm8sw0ab is
114
  port (
115
    addr, taddr : in std_logic_vector(11 downto 0);
116
    clk         : in std_logic;
117
    di, tdi     : in std_logic_vector(35 downto 0);
118
    do          : out std_logic_vector(35 downto 0);
119
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
120
  );
121
  end component;
122
 
123
  component hdss1_16384x8cm16sw0 is
124
  port (
125
    addr        : in std_logic_vector(13 downto 0);
126
    clk         : in std_logic;
127
    di          : in std_logic_vector(7 downto 0);
128
    do          : out std_logic_vector(7 downto 0);
129
    me, oe, we  : in std_logic
130
  );
131
  end component;
132
 
133
  signal d, q, gnd : std_logic_vector(40 downto 0);
134
  signal a : std_logic_vector(17 downto 0);
135
  signal vcc : std_ulogic;
136
  constant synopsys_bug : std_logic_vector(40 downto 0) := (others => '0');
137
begin
138
 
139
  gnd <= (others => '0'); vcc <= '1';
140
  a(abits -1 downto 0) <= address;
141
  d(dbits -1 downto 0) <= datain(dbits -1 downto 0);
142
  a(17 downto abits) <= synopsys_bug(17 downto abits);
143
  d(40 downto dbits) <= synopsys_bug(40 downto dbits);
144
  dataout <= q(dbits -1 downto 0);
145
 
146
  a7d32 : if (abits <= 7) and (dbits <= 32) generate
147
    id0 : hdss1_128x32cm4sw0ab
148
      port map (a(6 downto 0), gnd(6 downto 0),clk,
149
        d(31 downto 0), gnd(31 downto 0), q(31 downto 0),
150
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
151
  end generate;
152
 
153
  a8d32 : if (abits = 8) and (dbits <= 32) generate
154
    id0 : hdss1_256x32cm4sw0ab
155
      port map (a(7 downto 0), gnd(7 downto 0),clk,
156
        d(31 downto 0), gnd(31 downto 0), q(31 downto 0),
157
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
158
  end generate;
159
 
160
  a9d32 : if (abits = 9) and (dbits <= 32) generate
161
    id0 : hdss1_512x32cm4sw0ab
162
      port map (address(8 downto 0), gnd(8 downto 0),clk,
163
        d(31 downto 0), gnd(31 downto 0), q(31 downto 0),
164
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
165
  end generate;
166
 
167
  a9d38 : if (abits = 9) and (dbits > 32) and (dbits <= 38) generate
168
    id0 : hdss1_512x38cm4sw0ab
169
      port map (address(8 downto 0), gnd(8 downto 0),clk,
170
        d(37 downto 0), gnd(37 downto 0), q(37 downto 0),
171
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
172
  end generate;
173
 
174
  a10d32 : if (abits = 10) and (dbits <= 32) generate
175
    id0 : hdss1_1024x32cm4sw0ab
176
      port map (address(9 downto 0), gnd(9 downto 0), clk,
177
        d(31 downto 0), gnd(31 downto 0), q(31 downto 0),
178
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
179
  end generate;
180
 
181
  a11d32 : if (abits = 11) and (dbits <= 32) generate
182
    id0 : hdss1_2048x32cm8sw0ab
183
      port map (address(10 downto 0), gnd(10 downto 0), clk,
184
        d(31 downto 0), gnd(31 downto 0), q(31 downto 0),
185
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
186
  end generate;
187
 
188
  a12d36 : if (abits = 12) and (dbits <= 36) generate
189
    id0 : hdss1_4096x36cm8sw0ab
190
      port map (address(11 downto 0), gnd(11 downto 0), clk,
191
        d(35 downto 0), gnd(35 downto 0), q(35 downto 0),
192
        enable, vcc, write, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
193
  end generate;
194
 
195
  a14d8 : if (abits = 14) and (dbits <= 8) generate
196
    id0 : hdss1_16384x8cm16sw0
197
      port map (address(13 downto 0), clk,
198
        d(7 downto 0), q(7 downto 0),
199
        enable, vcc, Write);
200
  end generate;
201
 
202
end rtl;
203
 
204
library ieee;
205
use ieee.std_logic_1164.all;
206
-- pragma translate_off
207
library virage;
208
use virage.hdss2_64x32cm4sw0ab;
209
use virage.hdss2_128x32cm4sw0ab;
210
use virage.hdss2_256x32cm4sw0ab;
211
use virage.hdss2_512x32cm4sw0ab;
212
use virage.hdss2_512x38cm4sw0ab;
213
use virage.hdss2_8192x8cm16sw0ab;
214
-- pragma translate_on
215
 
216
entity virage_syncram_dp is
217
  generic ( abits : integer := 10; dbits : integer := 8);
218
  port (
219
    clk1     : in std_ulogic;
220
    address1 : in std_logic_vector((abits -1) downto 0);
221
    datain1  : in std_logic_vector((dbits -1) downto 0);
222
    dataout1 : out std_logic_vector((dbits -1) downto 0);
223
    enable1  : in std_ulogic;
224
    write1   : in std_ulogic;
225
    clk2     : in std_ulogic;
226
    address2 : in std_logic_vector((abits -1) downto 0);
227
    datain2  : in std_logic_vector((dbits -1) downto 0);
228
    dataout2 : out std_logic_vector((dbits -1) downto 0);
229
    enable2  : in std_ulogic;
230
    write2   : in std_ulogic
231
   );
232
end;
233
architecture rtl of virage_syncram_dp is
234
 
235
  component hdss2_64x32cm4sw0ab
236
  port (
237
    addra, taddra : in std_logic_vector(5 downto 0);
238
    addrb, taddrb : in std_logic_vector(5 downto 0);
239
    clka, clkb    : in std_logic;
240
    dia, tdia     : in std_logic_vector(31 downto 0);
241
    dib, tdib     : in std_logic_vector(31 downto 0);
242
    doa, dob      : out std_logic_vector(31 downto 0);
243
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
244
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
245
  );
246
  end component;
247
 
248
  component hdss2_128x32cm4sw0ab
249
  port (
250
    addra, taddra : in std_logic_vector(6 downto 0);
251
    addrb, taddrb : in std_logic_vector(6 downto 0);
252
    clka, clkb    : in std_logic;
253
    dia, tdia     : in std_logic_vector(31 downto 0);
254
    dib, tdib     : in std_logic_vector(31 downto 0);
255
    doa, dob      : out std_logic_vector(31 downto 0);
256
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
257
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
258
  );
259
  end component;
260
 
261
  component hdss2_256x32cm4sw0ab
262
  port (
263
    addra, taddra : in std_logic_vector(7 downto 0);
264
    addrb, taddrb : in std_logic_vector(7 downto 0);
265
    clka, clkb    : in std_logic;
266
    dia, tdia     : in std_logic_vector(31 downto 0);
267
    dib, tdib     : in std_logic_vector(31 downto 0);
268
    doa, dob      : out std_logic_vector(31 downto 0);
269
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
270
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
271
  );
272
  end component;
273
 
274
  component hdss2_512x32cm4sw0ab
275
  port (
276
    addra, taddra : in std_logic_vector(8 downto 0);
277
    addrb, taddrb : in std_logic_vector(8 downto 0);
278
    clka, clkb    : in std_logic;
279
    dia, tdia     : in std_logic_vector(31 downto 0);
280
    dib, tdib     : in std_logic_vector(31 downto 0);
281
    doa, dob      : out std_logic_vector(31 downto 0);
282
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
283
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
284
  );
285
  end component;
286
 
287
  component hdss2_512x38cm4sw0ab
288
  port (
289
    addra, taddra : in std_logic_vector(8 downto 0);
290
    addrb, taddrb : in std_logic_vector(8 downto 0);
291
    clka, clkb    : in std_logic;
292
    dia, tdia     : in std_logic_vector(37 downto 0);
293
    dib, tdib     : in std_logic_vector(37 downto 0);
294
    doa, dob      : out std_logic_vector(37 downto 0);
295
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
296
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
297
  );
298
  end component;
299
 
300
  component hdss2_8192x8cm16sw0ab
301
  port (
302
    addra, taddra : in std_logic_vector(12 downto 0);
303
    addrb, taddrb : in std_logic_vector(12 downto 0);
304
    clka, clkb    : in std_logic;
305
    dia, tdia     : in std_logic_vector(7 downto 0);
306
    dib, tdib     : in std_logic_vector(7 downto 0);
307
    doa, dob      : out std_logic_vector(7 downto 0);
308
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
309
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
310
  );
311
  end component;
312
 
313
  signal vcc : std_ulogic;
314
  signal d1, d2, a1, a2, q1, q2, gnd : std_logic_vector(40 downto 0);
315
begin
316
 
317
  vcc <= '1'; gnd <=  (others => '0');
318
  d1(dbits-1 downto 0) <= datain1; d1(40 downto dbits) <= (others => '0');
319
  d2(dbits-1 downto 0) <= datain2; d2(40 downto dbits) <= (others => '0');
320
  a1(abits-1 downto 0) <= address1; a1(40 downto abits) <= (others => '0');
321
  a2(abits-1 downto 0) <= address2; a2(40 downto abits) <= (others => '0');
322
  dataout1 <= q1(dbits-1 downto 0); dataout2 <= q2(dbits-1 downto 0);
323
 
324
  a6d32 : if (abits <= 6) and (dbits <= 32) generate
325
    id0 : hdss2_64x32cm4sw0ab
326
      port map (a1(5 downto 0), gnd(5 downto 0), a2(5 downto 0),
327
        gnd(5 downto 0), clk1, clk2,
328
        d1(31 downto 0), gnd(31 downto 0), d2(31 downto 0), gnd(31 downto 0),
329
        q1(31 downto 0), q2(31 downto 0),
330
        enable1, vcc, write1, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0),
331
        enable2, vcc, write2, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
332
  end generate;
333
 
334
  a7d32 : if (abits = 7) and (dbits <= 32) generate
335
    id0 : hdss2_128x32cm4sw0ab
336
      port map (a1(6 downto 0), gnd(6 downto 0), a2(6 downto 0),
337
        gnd(6 downto 0), clk1, clk2,
338
        d1(31 downto 0), gnd(31 downto 0), d2(31 downto 0), gnd(31 downto 0),
339
        q1(31 downto 0), q2(31 downto 0),
340
        enable1, vcc, write1, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0),
341
        enable2, vcc, write2, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
342
  end generate;
343
 
344
  a8d32 : if (abits = 8) and (dbits <= 32) generate
345
    id0 : hdss2_256x32cm4sw0ab
346
      port map (a1(7 downto 0), gnd(7 downto 0), a2(7 downto 0),
347
        gnd(7 downto 0), clk1, clk2,
348
        d1(31 downto 0), gnd(31 downto 0), d2(31 downto 0), gnd(31 downto 0),
349
        q1(31 downto 0), q2(31 downto 0),
350
        enable1, vcc, write1, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0),
351
        enable2, vcc, write2, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
352
  end generate;
353
 
354
  a9d32 : if (abits = 9) and (dbits <= 32) generate
355
    id0 : hdss2_512x32cm4sw0ab
356
      port map (a1(8 downto 0), gnd(8 downto 0), a2(8 downto 0),
357
        gnd(8 downto 0), clk1, clk2,
358
        d1(31 downto 0), gnd(31 downto 0), d2(31 downto 0), gnd(31 downto 0),
359
        q1(31 downto 0), q2(31 downto 0),
360
        enable1, vcc, write1, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0),
361
        enable2, vcc, write2, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
362
  end generate;
363
 
364
  a9d38 : if (abits = 9) and (dbits > 32) and (dbits <= 38) generate
365
    id0 : hdss2_512x38cm4sw0ab
366
      port map (a1(8 downto 0), gnd(8 downto 0), a2(8 downto 0),
367
        gnd(8 downto 0), clk1, clk2,
368
        d1(37 downto 0), gnd(37 downto 0), d2(37 downto 0), gnd(37 downto 0),
369
        q1(37 downto 0), q2(37 downto 0),
370
        enable1, vcc, write1, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0),
371
        enable2, vcc, write2, gnd(0), gnd(0), gnd(0), gnd(0), gnd(0));
372
  end generate;
373
 
374
end;
375
 
376
 
377
 
378
library ieee;
379
use ieee.std_logic_1164.all;
380
-- pragma translate_off
381
library virage;
382
use virage.rfss2_136x32cm2sw0ab;
383
use virage.rfss2_136x40cm2sw0ab;
384
use virage.rfss2_168x32cm2sw0ab;
385
use virage.hdss2_64x32cm4sw0ab;
386
use virage.hdss2_128x32cm4sw0ab;
387
use virage.hdss2_256x32cm4sw0ab;
388
use virage.hdss2_512x32cm4sw0ab;
389
use virage.hdss2_8192x8cm16sw0ab;
390
-- pragma translate_on
391
 
392
entity virage_syncram_2p is
393
  generic ( abits : integer := 6; dbits : integer := 8;
394
        sepclk : integer := 0; wrfst : integer := 0);
395
  port (
396
    rclk     : in std_ulogic;
397
    renable  : in std_ulogic;
398
    raddress : in std_logic_vector((abits -1) downto 0);
399
    dataout  : out std_logic_vector((dbits -1) downto 0);
400
    wclk     : in std_ulogic;
401
    write    : in std_ulogic;
402
    waddress : in std_logic_vector((abits -1) downto 0);
403
    datain   : in std_logic_vector((dbits -1) downto 0));
404
end;
405
 
406
architecture rtl of virage_syncram_2p is
407
 
408
  component rfss2_136x32cm2sw0ab
409
  port (
410
    addra, taddra : in std_logic_vector(7 downto 0);
411
    addrb, taddrb : in std_logic_vector(7 downto 0);
412
    clka, clkb    : in std_logic;
413
    dia, tdia     : in std_logic_vector(31 downto 0);
414
    dob      : out std_logic_vector(31 downto 0);
415
    mea, wea, tmea, twea, bistea : in std_logic;
416
    meb, oeb, tmeb,  awtb, bisteb, toeb : in std_logic
417
  );
418
  end component;
419
 
420
  component rfss2_136x40cm2sw0ab
421
  port (
422
    addra, taddra : in std_logic_vector(7 downto 0);
423
    addrb, taddrb : in std_logic_vector(7 downto 0);
424
    clka, clkb    : in std_logic;
425
    dia, tdia     : in std_logic_vector(39 downto 0);
426
    dob      : out std_logic_vector(39 downto 0);
427
    mea, wea, tmea, twea, bistea : in std_logic;
428
    meb, oeb, tmeb,  awtb, bisteb, toeb : in std_logic
429
  );
430
  end component;
431
 
432
  signal vcc : std_ulogic;
433
  signal d1, a1, a2, q1, gnd : std_logic_vector(40 downto 0);
434
begin
435
 
436
  vcc <= '1'; gnd <=  (others => '0');
437
  d1(dbits-1 downto 0) <= datain; d1(40 downto dbits) <= (others => '0');
438
  a1(abits-1 downto 0) <= waddress; a1(40 downto abits) <= (others => '0');
439
  a2(abits-1 downto 0) <= raddress; a2(40 downto abits) <= (others => '0');
440
  dataout <= q1(dbits-1 downto 0);
441
 
442
    id0 : rfss2_136x40cm2sw0ab
443
      port map (
444
        a1(7 downto 0), gnd(7 downto 0), a2(7 downto 0), gnd(7 downto 0),
445
        wclk, rclk, d1(39 downto 0), gnd(39 downto 0),
446
        q1(39 downto 0),
447
        vcc, write, gnd(0), gnd(0), gnd(0),
448
        renable, vcc, gnd(0), gnd(0), gnd(0), gnd(0));
449
 
450
end;
451
 

powered by: WebSVN 2.1.0

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