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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable/] [mp3/] [lib/] [xilinx/] [unisims/] [RAM32X2S.v] - Blame information for rev 392

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 266 lampret
// $Header: /home/marcus/revision_ctrl_test/oc_cvs/cvs/or1k/mp3/lib/xilinx/unisims/RAM32X2S.v,v 1.1.1.1 2001-11-04 18:59:50 lampret Exp $
2
 
3
/*
4
 
5
FUNCTION        : 32x2 Static RAM with synchronous write capability
6
 
7
*/
8
 
9
`timescale  100 ps / 10 ps
10
 
11
`celldefine
12
 
13
module RAM32X2S (O0, O1, A0, A1, A2, A3, A4, D0, D1, WCLK, WE);
14
 
15
    parameter cds_action = "ignore";
16
 
17
    parameter INIT_00 = 32'h00000000;
18
    parameter INIT_01 = 32'h00000000;
19
 
20
    output O0, O1;
21
 
22
    input  A0, A1, A2, A3, A4, D0, D1, WCLK, WE;
23
 
24
    reg  mem [64:0];
25
    reg  [8:0] count;
26
    wire [4:0] adr;
27
    wire [1:0] d_in, o_out;
28
    wire wclk_in, we_in;
29
 
30
    buf b_d0   (d_in[0], D0);
31
    buf b_d1   (d_in[1], D1);
32
    buf b_wclk (wclk_in, WCLK);
33
    buf b_we   (we_in, WE);
34
 
35
    buf b_a4 (adr[4], A4);
36
    buf b_a3 (adr[3], A3);
37
    buf b_a2 (adr[2], A2);
38
    buf b_a1 (adr[1], A1);
39
    buf b_a0 (adr[0], A0);
40
 
41
    buf b_o0 (O0, o_out[0]);
42
    buf b_o1 (O1, o_out[1]);
43
 
44
    buf b_o_out0 (o_out[0], mem[adr + 32 * 0]);
45
    buf b_o_out1 (o_out[1], mem[adr + 32 * 1]);
46
 
47
    initial begin
48
        for (count = 0; count < 32; count = count + 1) begin
49
            mem[count + 32 * 0] <= INIT_00[count];
50
            mem[count + 32 * 1] <= INIT_01[count];
51
        end
52
    end
53
 
54
    always @(posedge wclk_in) begin
55
        if (we_in == 1'b1) begin
56
            mem[adr + 32 * 0] <= d_in[0];
57
            mem[adr + 32 * 1] <= d_in[1];
58
        end
59
    end
60
 
61
    specify
62
        if (WE)
63
            (WCLK => O0) = (1, 1);
64
        if (WE)
65
            (WCLK => O1) = (1, 1);
66
 
67
        (A4 => O0) = (1, 1);
68
        (A3 => O0) = (1, 1);
69
        (A2 => O0) = (1, 1);
70
        (A1 => O0) = (1, 1);
71
        (A0 => O0) = (1, 1);
72
        (A4 => O1) = (1, 1);
73
        (A3 => O1) = (1, 1);
74
        (A2 => O1) = (1, 1);
75
        (A1 => O1) = (1, 1);
76
        (A0 => O1) = (1, 1);
77
    endspecify
78
 
79
endmodule
80
 
81
`endcelldefine

powered by: WebSVN 2.1.0

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