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/] [tech/] [virage/] [simprims/] [virage_simprims.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
-- Package:     virage_simprims
20
-- File:        virage_simprims.vhd
21
-- Author:      Jiri Gaisler, Gaisler Research
22
-- Description: Simple simulation models for VIRAGE RAMs
23
-----------------------------------------------------------------------------
24
 
25
-- pragma translate_off
26
 
27
library ieee;
28
use ieee.std_logic_1164.all;
29
 
30
package virage_simprims is
31
 
32
component virage_syncram_sim
33
  generic ( abits : integer := 10; dbits : integer := 8 );
34
  port (
35
    addr  : in std_logic_vector((abits -1) downto 0);
36
    clk   : in std_logic;
37
    di    : in std_logic_vector((dbits -1) downto 0);
38
    do    : out std_logic_vector((dbits -1) downto 0);
39
    me    : in std_logic;
40
    oe    : in std_logic;
41
    we    : in std_logic
42
   );
43
end component;
44
 
45
--  synchronous 2-port ram
46
component virage_2pram_sim
47
  generic (
48
    abits : integer := 8;
49
    dbits : integer := 32;
50
    words : integer := 256
51
  );
52
  port (
53
    addra, addrb  : in std_logic_vector((abits -1) downto 0);
54
    clka, clkb   : in std_logic;
55
    dia    : in std_logic_vector((dbits -1) downto 0);
56
    dob    : out std_logic_vector((dbits -1) downto 0);
57
    mea, wea, meb, oeb    : in std_logic
58
  );
59
end component;
60
 
61
component virage_dpram_sim
62
  generic (
63
    abits : integer := 8;
64
    dbits : integer := 32
65
  );
66
  port (
67
    addra  : in std_logic_vector((abits -1) downto 0);
68
    clka   : in std_logic;
69
    dia    : in std_logic_vector((dbits -1) downto 0);
70
    doa    : out std_logic_vector((dbits -1) downto 0);
71
    mea, oea, wea : in std_logic;
72
    addrb  : in std_logic_vector((abits -1) downto 0);
73
    clkb   : in std_logic;
74
    dib    : in std_logic_vector((dbits -1) downto 0);
75
    dob    : out std_logic_vector((dbits -1) downto 0);
76
    meb, oeb, web : in std_logic
77
  );
78
end component;
79
 
80
end;
81
 
82
-- 1-port syncronous ram
83
 
84
library ieee;
85
use ieee.std_logic_1164.all;
86
use ieee.numeric_std.all;
87
 
88
entity virage_syncram_sim is
89
  generic (
90
    abits : integer := 10;
91
    dbits : integer := 8
92
  );
93
  port (
94
    addr  : in std_logic_vector((abits -1) downto 0);
95
    clk   : in std_logic;
96
    di    : in std_logic_vector((dbits -1) downto 0);
97
    do    : out std_logic_vector((dbits -1) downto 0);
98
    me    : in std_logic;
99
    oe    : in std_logic;
100
    we    : in std_logic
101
  );
102
end;
103
 
104
architecture behavioral of virage_syncram_sim is
105
  subtype word is std_logic_vector((dbits -1) downto 0);
106
  type mem is array(0 to (2**abits -1)) of word;
107
begin
108
  main : process(clk, oe, me)
109
  variable memarr : mem;-- := (others => (others => '0'));
110
  variable doint  : std_logic_vector((dbits -1) downto 0);
111
  begin
112
    if rising_edge(clk) and (me = '1') and not is_x(addr) then
113
      if (we = '1') then memarr(to_integer(unsigned(addr))) := di; end if;
114
      doint := memarr(to_integer(unsigned(addr)));
115
    end if;
116
--    if (me and oe) = '1' then do <= doint;
117
    if oe = '1' then do <= doint;
118
    else do <= (others => 'Z'); end if;
119
  end process;
120
end behavioral;
121
 
122
--  synchronous 2-port ram
123
 
124
library ieee;
125
use ieee.std_logic_1164.all;
126
use ieee.numeric_std.all;
127
 
128
entity virage_2pram_sim is
129
  generic (
130
    abits : integer := 10;
131
    dbits : integer := 8;
132
    words : integer := 1024
133
  );
134
  port (
135
    addra, addrb  : in std_logic_vector((abits -1) downto 0);
136
    clka, clkb   : in std_logic;
137
    dia    : in std_logic_vector((dbits -1) downto 0);
138
    dob    : out std_logic_vector((dbits -1) downto 0);
139
    mea, wea, meb, oeb    : in std_logic
140
  );
141
end;
142
 
143
architecture behavioral of virage_2pram_sim is
144
  subtype word is std_logic_vector((dbits -1) downto 0);
145
  type mem is array(0 to (words-1)) of word;
146
begin
147
  main : process(clka, clkb, oeb, mea, meb, wea)
148
  variable memarr : mem;
149
  variable doint  : std_logic_vector((dbits -1) downto 0);
150
  begin
151
    if rising_edge(clka) and (mea = '1') and not is_x(addra) then
152
      if (wea = '1') then memarr(to_integer(unsigned(addra)) mod words) := dia; end if;
153
    end if;
154
    if rising_edge(clkb) and (meb = '1') and not is_x(addrb) then
155
      doint := memarr(to_integer(unsigned(addrb)) mod words);
156
    end if;
157
    if oeb = '1' then dob <= doint;
158
    else dob <= (others => 'Z'); end if;
159
  end process;
160
end behavioral;
161
 
162
 
163
--  synchronous dual-port ram
164
 
165
library ieee;
166
use ieee.std_logic_1164.all;
167
use ieee.numeric_std.all;
168
 
169
entity virage_dpram_sim is
170
  generic (
171
    abits : integer := 10;
172
    dbits : integer := 8
173
  );
174
  port (
175
    addra  : in std_logic_vector((abits -1) downto 0);
176
    clka   : in std_logic;
177
    dia    : in std_logic_vector((dbits -1) downto 0);
178
    doa    : out std_logic_vector((dbits -1) downto 0);
179
    mea, oea, wea : in std_logic;
180
    addrb  : in std_logic_vector((abits -1) downto 0);
181
    clkb   : in std_logic;
182
    dib    : in std_logic_vector((dbits -1) downto 0);
183
    dob    : out std_logic_vector((dbits -1) downto 0);
184
    meb, oeb, web : in std_logic
185
  );
186
end;
187
 
188
architecture behavioral of virage_dpram_sim is
189
  subtype word is std_logic_vector((dbits -1) downto 0);
190
  type mem is array(0 to (2**abits -1)) of word;
191
begin
192
  main : process(clka, oea, mea, clkb, oeb, meb)
193
  variable memarr : mem;
194
  variable dointa, dointb  : std_logic_vector((dbits -1) downto 0);
195
  begin
196
    if rising_edge(clka) and (mea = '1') and not is_x(addra) then
197
      if (wea = '1') then memarr(to_integer(unsigned(addra))) := dia; end if;
198
      dointa := memarr(to_integer(unsigned(addra)));
199
    end if;
200
    if oea = '1' then doa <= dointa;
201
    else doa <= (others => 'Z'); end if;
202
    if rising_edge(clkb) and (meb = '1') and not is_x(addrb) then
203
      if (web = '1') then memarr(to_integer(unsigned(addrb))) := dib; end if;
204
      dointb := memarr(to_integer(unsigned(addrb)));
205
    end if;
206
    if oeb = '1' then dob <= dointb;
207
    else dob <= (others => 'Z'); end if;
208
  end process;
209
end behavioral;
210
 
211
library ieee;
212
use ieee.std_logic_1164.all;
213
library virage;
214
use virage.virage_simprims.all;
215
entity hdss1_128x32cm4sw0ab is
216
  port (
217
    addr, taddr : in std_logic_vector(6 downto 0);
218
    clk         : in std_logic;
219
    di, tdi     : in std_logic_vector(31 downto 0);
220
    do          : out std_logic_vector(31 downto 0);
221
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
222
  );
223
end;
224
architecture behavioral of hdss1_128x32cm4sw0ab is
225
begin
226
  syncram0 : virage_syncram_sim
227
    generic map ( abits => 7, dbits => 32)
228
    port map ( addr, clk, di, do, me, oe, we);
229
end behavioral;
230
 
231
library ieee;
232
use ieee.std_logic_1164.all;
233
library virage;
234
use virage.virage_simprims.all;
235
entity hdss1_256x32cm4sw0ab is
236
  port (
237
    addr, taddr : in std_logic_vector(7 downto 0);
238
    clk         : in std_logic;
239
    di, tdi     : in std_logic_vector(31 downto 0);
240
    do          : out std_logic_vector(31 downto 0);
241
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
242
  );
243
end;
244
architecture behavioral of hdss1_256x32cm4sw0ab is
245
begin
246
  syncram0 : virage_syncram_sim
247
    generic map ( abits => 8, dbits => 32)
248
    port map ( addr, clk, di, do, me, oe, we);
249
end behavioral;
250
 
251
library ieee;
252
use ieee.std_logic_1164.all;
253
library virage;
254
use virage.virage_simprims.all;
255
entity hdss1_512x32cm4sw0ab is
256
  port (
257
    addr, taddr : in std_logic_vector(8 downto 0);
258
    clk         : in std_logic;
259
    di, tdi     : in std_logic_vector(31 downto 0);
260
    do          : out std_logic_vector(31 downto 0);
261
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
262
  );
263
end;
264
architecture behavioral of hdss1_512x32cm4sw0ab is
265
begin
266
  syncram0 : virage_syncram_sim
267
    generic map ( abits => 9, dbits => 32)
268
    port map ( addr, clk, di, do, me, oe, we);
269
end behavioral;
270
 
271
library ieee;
272
use ieee.std_logic_1164.all;
273
library virage;
274
use virage.virage_simprims.all;
275
entity hdss1_512x38cm4sw0ab is
276
  port (
277
    addr, taddr : in std_logic_vector(8 downto 0);
278
    clk         : in std_logic;
279
    di, tdi     : in std_logic_vector(37 downto 0);
280
    do          : out std_logic_vector(37 downto 0);
281
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
282
  );
283
end;
284
architecture behavioral of hdss1_512x38cm4sw0ab is
285
begin
286
  syncram0 : virage_syncram_sim
287
    generic map ( abits => 9, dbits => 38)
288
    port map ( addr, clk, di, do, me, oe, we);
289
end behavioral;
290
 
291
library ieee;
292
use ieee.std_logic_1164.all;
293
library virage;
294
use virage.virage_simprims.all;
295
entity hdss1_1024x32cm4sw0ab is
296
  port (
297
    addr, taddr : in std_logic_vector(9 downto 0);
298
    clk         : in std_logic;
299
    di, tdi     : in std_logic_vector(31 downto 0);
300
    do          : out std_logic_vector(31 downto 0);
301
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
302
  );
303
end;
304
architecture behavioral of hdss1_1024x32cm4sw0ab is
305
begin
306
  syncram0 : virage_syncram_sim
307
    generic map ( abits => 10, dbits => 32)
308
    port map ( addr, clk, di, do, me, oe, we);
309
end behavioral;
310
 
311
library ieee;
312
use ieee.std_logic_1164.all;
313
library virage;
314
use virage.virage_simprims.all;
315
entity hdss1_2048x32cm8sw0ab is
316
  port (
317
    addr, taddr : in std_logic_vector(10 downto 0);
318
    clk         : in std_logic;
319
    di, tdi     : in std_logic_vector(31 downto 0);
320
    do          : out std_logic_vector(31 downto 0);
321
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
322
  );
323
end;
324
architecture behavioral of hdss1_2048x32cm8sw0ab is
325
begin
326
  syncram0 : virage_syncram_sim
327
    generic map ( abits => 11, dbits => 32)
328
    port map ( addr, clk, di, do, me, oe, we);
329
end behavioral;
330
 
331
library ieee;
332
use ieee.std_logic_1164.all;
333
library virage;
334
use virage.virage_simprims.all;
335
entity hdss1_4096x36cm8sw0ab is
336
  port (
337
    addr, taddr : in std_logic_vector(11 downto 0);
338
    clk         : in std_logic;
339
    di, tdi     : in std_logic_vector(35 downto 0);
340
    do          : out std_logic_vector(35 downto 0);
341
    me, oe, we, tme, twe, awt, biste, toe : in std_logic
342
  );
343
end;
344
architecture behavioral of hdss1_4096x36cm8sw0ab is
345
begin
346
  syncram0 : virage_syncram_sim
347
    generic map ( abits => 12, dbits => 36)
348
    port map ( addr, clk, di, do, me, oe, we);
349
end behavioral;
350
 
351
library ieee;
352
use ieee.std_logic_1164.all;
353
library virage;
354
use virage.virage_simprims.all;
355
entity hdss1_16384x8cm16sw0 is
356
  port (
357
    addr        : in std_logic_vector(13 downto 0);
358
    clk         : in std_logic;
359
    di          : in std_logic_vector(7 downto 0);
360
    do          : out std_logic_vector(7 downto 0);
361
    me, oe, we  : in std_logic
362
  );
363
end;
364
architecture behavioral of hdss1_16384x8cm16sw0 is
365
begin
366
  syncram0 : virage_syncram_sim
367
    generic map ( abits => 14, dbits => 8)
368
    port map ( addr, clk, di, do, me, oe, we);
369
end behavioral;
370
 
371
-- 2-port syncronous ram
372
 
373
library ieee;
374
use ieee.std_logic_1164.all;
375
library virage;
376
use virage.virage_simprims.all;
377
entity rfss2_136x32cm2sw0ab is
378
  port (
379
    addra, taddra : in std_logic_vector(7 downto 0);
380
    addrb, taddrb : in std_logic_vector(7 downto 0);
381
    clka, clkb    : in std_logic;
382
    dia, tdia     : in std_logic_vector(31 downto 0);
383
    dob           : out std_logic_vector(31 downto 0);
384
    mea, wea, tmea, twea, bistea : in std_logic;
385
    meb, oeb, tmeb,  awtb, bisteb, toeb : in std_logic
386
  );
387
end;
388
architecture behavioral of rfss2_136x32cm2sw0ab is
389
begin
390
  syncram0 : virage_2pram_sim
391
    generic map ( abits => 8, dbits => 32, words => 136)
392
    port map ( addra, addrb, clka, clkb, dia, dob, mea, wea, meb, oeb);
393
end behavioral;
394
 
395
library ieee;
396
use ieee.std_logic_1164.all;
397
library virage;
398
use virage.virage_simprims.all;
399
entity rfss2_136x40cm2sw0ab is
400
  port (
401
    addra, taddra : in std_logic_vector(7 downto 0);
402
    addrb, taddrb : in std_logic_vector(7 downto 0);
403
    clka, clkb    : in std_logic;
404
    dia, tdia     : in std_logic_vector(39 downto 0);
405
    dob           : out std_logic_vector(39 downto 0);
406
    mea, wea, tmea, twea, bistea : in std_logic;
407
    meb, oeb, tmeb,  awtb, bisteb, toeb : in std_logic
408
  );
409
end;
410
architecture behavioral of rfss2_136x40cm2sw0ab is
411
begin
412
  syncram0 : virage_2pram_sim
413
    generic map ( abits => 8, dbits => 40, words => 136)
414
    port map ( addra, addrb, clka, clkb, dia, dob, mea, wea, meb, oeb);
415
end behavioral;
416
 
417
library ieee;
418
use ieee.std_logic_1164.all;
419
library virage;
420
use virage.virage_simprims.all;
421
entity rfss2_168x32cm2sw0ab is
422
  port (
423
    addra, taddra : in std_logic_vector(7 downto 0);
424
    addrb, taddrb : in std_logic_vector(7 downto 0);
425
    clka, clkb    : in std_logic;
426
    dia, tdia     : in std_logic_vector(31 downto 0);
427
    dob           : out std_logic_vector(31 downto 0);
428
    mea, wea, tmea, twea, bistea : in std_logic;
429
    meb, oeb, tmeb,  awtb, bisteb, toeb : in std_logic
430
  );
431
end;
432
architecture behavioral of rfss2_168x32cm2sw0ab is
433
begin
434
  syncram0 : virage_2pram_sim
435
    generic map ( abits => 8, dbits => 32, words => 168)
436
    port map ( addra, addrb, clka, clkb, dia, dob, mea, wea, meb, oeb);
437
end behavioral;
438
 
439
-- dual-port syncronous ram
440
 
441
library ieee;
442
use ieee.std_logic_1164.all;
443
library virage;
444
use virage.virage_simprims.all;
445
 
446
entity hdss2_64x32cm4sw0ab is
447
  port (
448
    addra, taddra : in std_logic_vector(5 downto 0);
449
    addrb, taddrb : in std_logic_vector(5 downto 0);
450
    clka, clkb    : in std_logic;
451
    dia, tdia     : in std_logic_vector(31 downto 0);
452
    dib, tdib     : in std_logic_vector(31 downto 0);
453
    doa, dob      : out std_logic_vector(31 downto 0);
454
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
455
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
456
  );
457
end;
458
architecture behavioral of hdss2_64x32cm4sw0ab is
459
begin
460
  syncram0 : virage_dpram_sim
461
    generic map ( abits => 6, dbits => 32)
462
    port map ( addra, clka, dia, doa, mea, oea, wea,
463
               addrb, clkb, dib, dob, meb, oeb, web);
464
end behavioral;
465
 
466
library ieee;
467
use ieee.std_logic_1164.all;
468
library virage;
469
use virage.virage_simprims.all;
470
entity hdss2_128x32cm4sw0ab is
471
  port (
472
    addra, taddra : in std_logic_vector(6 downto 0);
473
    addrb, taddrb : in std_logic_vector(6 downto 0);
474
    clka, clkb    : in std_logic;
475
    dia, tdia     : in std_logic_vector(31 downto 0);
476
    dib, tdib     : in std_logic_vector(31 downto 0);
477
    doa, dob      : out std_logic_vector(31 downto 0);
478
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
479
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
480
  );
481
end;
482
architecture behavioral of hdss2_128x32cm4sw0ab is
483
begin
484
  syncram0 : virage_dpram_sim
485
    generic map ( abits => 7, dbits => 32)
486
    port map ( addra, clka, dia, doa, mea, oea, wea,
487
               addrb, clkb, dib, dob, meb, oeb, web);
488
end behavioral;
489
 
490
library ieee;
491
use ieee.std_logic_1164.all;
492
library virage;
493
use virage.virage_simprims.all;
494
entity hdss2_256x32cm4sw0ab is
495
  port (
496
    addra, taddra : in std_logic_vector(7 downto 0);
497
    addrb, taddrb : in std_logic_vector(7 downto 0);
498
    clka, clkb    : in std_logic;
499
    dia, tdia     : in std_logic_vector(31 downto 0);
500
    dib, tdib     : in std_logic_vector(31 downto 0);
501
    doa, dob      : out std_logic_vector(31 downto 0);
502
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
503
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
504
  );
505
end;
506
architecture behavioral of hdss2_256x32cm4sw0ab is
507
begin
508
  syncram0 : virage_dpram_sim
509
    generic map ( abits => 8, dbits => 32)
510
    port map ( addra, clka, dia, doa, mea, oea, wea,
511
               addrb, clkb, dib, dob, meb, oeb, web);
512
end behavioral;
513
 
514
library ieee;
515
use ieee.std_logic_1164.all;
516
library virage;
517
use virage.virage_simprims.all;
518
entity hdss2_512x32cm4sw0ab is
519
  port (
520
    addra, taddra : in std_logic_vector(8 downto 0);
521
    addrb, taddrb : in std_logic_vector(8 downto 0);
522
    clka, clkb    : in std_logic;
523
    dia, tdia     : in std_logic_vector(31 downto 0);
524
    dib, tdib     : in std_logic_vector(31 downto 0);
525
    doa, dob      : out std_logic_vector(31 downto 0);
526
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
527
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
528
  );
529
end;
530
architecture behavioral of hdss2_512x32cm4sw0ab is
531
begin
532
  syncram0 : virage_dpram_sim
533
    generic map ( abits => 9, dbits => 32)
534
    port map ( addra, clka, dia, doa, mea, oea, wea,
535
               addrb, clkb, dib, dob, meb, oeb, web);
536
end behavioral;
537
 
538
library ieee;
539
use ieee.std_logic_1164.all;
540
library virage;
541
use virage.virage_simprims.all;
542
entity hdss2_512x38cm4sw0ab is
543
  port (
544
    addra, taddra : in std_logic_vector(8 downto 0);
545
    addrb, taddrb : in std_logic_vector(8 downto 0);
546
    clka, clkb    : in std_logic;
547
    dia, tdia     : in std_logic_vector(37 downto 0);
548
    dib, tdib     : in std_logic_vector(37 downto 0);
549
    doa, dob      : out std_logic_vector(37 downto 0);
550
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
551
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
552
  );
553
end;
554
architecture behavioral of hdss2_512x38cm4sw0ab is
555
begin
556
  syncram0 : virage_dpram_sim
557
    generic map ( abits => 9, dbits => 38)
558
    port map ( addra, clka, dia, doa, mea, oea, wea,
559
               addrb, clkb, dib, dob, meb, oeb, web);
560
end behavioral;
561
 
562
library ieee;
563
use ieee.std_logic_1164.all;
564
library virage;
565
use virage.virage_simprims.all;
566
entity hdss2_8192x8cm16sw0ab is
567
  port (
568
    addra, taddra : in std_logic_vector(12 downto 0);
569
    addrb, taddrb : in std_logic_vector(12 downto 0);
570
    clka, clkb    : in std_logic;
571
    dia, tdia     : in std_logic_vector(7 downto 0);
572
    dib, tdib     : in std_logic_vector(7 downto 0);
573
    doa, dob      : out std_logic_vector(7 downto 0);
574
    mea, oea, wea, tmea, twea, awta, bistea, toea : in std_logic;
575
    meb, oeb, web, tmeb, tweb, awtb, bisteb, toeb : in std_logic
576
  );
577
end;
578
architecture behavioral of hdss2_8192x8cm16sw0ab is
579
begin
580
  syncram0 : virage_dpram_sim
581
    generic map ( abits => 13, dbits => 8)
582
    port map ( addra, clka, dia, doa, mea, oea, wea,
583
               addrb, clkb, dib, dob, meb, oeb, web);
584
end behavioral;
585
 
586
-- pragma translate_on

powered by: WebSVN 2.1.0

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