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

Subversion Repositories or1k

[/] [or1k/] [branches/] [mp3_stable/] [mp3/] [lib/] [xilinx/] [unisims/] [RAM32X8S.v] - Blame information for rev 1765

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/RAM32X8S.v,v 1.1.1.1 2001-11-04 18:59:50 lampret Exp $
2
 
3
/*
4
 
5
FUNCTION        : 32x8 Static RAM with synchronous write capability
6
 
7
*/
8
 
9
`timescale  100 ps / 10 ps
10
 
11
`celldefine
12
 
13
module RAM32X8S (O, A0, A1, A2, A3, A4, D, WCLK, WE);
14
 
15
    parameter cds_action = "ignore";
16
 
17
    parameter INIT_00 = 32'h00000000;
18
    parameter INIT_01 = 32'h00000000;
19
    parameter INIT_02 = 32'h00000000;
20
    parameter INIT_03 = 32'h00000000;
21
    parameter INIT_04 = 32'h00000000;
22
    parameter INIT_05 = 32'h00000000;
23
    parameter INIT_06 = 32'h00000000;
24
    parameter INIT_07 = 32'h00000000;
25
 
26
    output [7:0] O;
27
 
28
    input  A0, A1, A2, A3, A4, WCLK, WE;
29
    input [7:0] D;
30
 
31
    reg  mem [256:0];
32
    reg  [8:0] count;
33
    wire [4:0] adr;
34
    wire [7:0] d_in, o_out;
35
    wire wclk_in, we_in;
36
 
37
    buf b_d0   (d_in[0], D[0]);
38
    buf b_d1   (d_in[1], D[1]);
39
    buf b_d2   (d_in[2], D[2]);
40
    buf b_d3   (d_in[3], D[3]);
41
    buf b_d4   (d_in[4], D[4]);
42
    buf b_d5   (d_in[5], D[5]);
43
    buf b_d6   (d_in[6], D[6]);
44
    buf b_d7   (d_in[7], D[7]);
45
    buf b_wclk (wclk_in, WCLK);
46
    buf b_we   (we_in, WE);
47
 
48
    buf b_a4 (adr[4], A4);
49
    buf b_a3 (adr[3], A3);
50
    buf b_a2 (adr[2], A2);
51
    buf b_a1 (adr[1], A1);
52
    buf b_a0 (adr[0], A0);
53
 
54
    buf b_o0 (O[0], o_out[0]);
55
    buf b_o1 (O[1], o_out[1]);
56
    buf b_o2 (O[2], o_out[2]);
57
    buf b_o3 (O[3], o_out[3]);
58
    buf b_o4 (O[4], o_out[4]);
59
    buf b_o5 (O[5], o_out[5]);
60
    buf b_o6 (O[6], o_out[6]);
61
    buf b_o7 (O[7], o_out[7]);
62
 
63
    buf b_o_out0 (o_out[0], mem[adr + 32 * 0]);
64
    buf b_o_out1 (o_out[1], mem[adr + 32 * 1]);
65
    buf b_o_out2 (o_out[2], mem[adr + 32 * 2]);
66
    buf b_o_out3 (o_out[3], mem[adr + 32 * 3]);
67
    buf b_o_out4 (o_out[4], mem[adr + 32 * 4]);
68
    buf b_o_out5 (o_out[5], mem[adr + 32 * 5]);
69
    buf b_o_out6 (o_out[6], mem[adr + 32 * 6]);
70
    buf b_o_out7 (o_out[7], mem[adr + 32 * 7]);
71
 
72
    initial begin
73
        for (count = 0; count < 32; count = count + 1) begin
74
            mem[count + 32 * 0] <= INIT_00[count];
75
            mem[count + 32 * 1] <= INIT_01[count];
76
            mem[count + 32 * 2] <= INIT_02[count];
77
            mem[count + 32 * 3] <= INIT_03[count];
78
            mem[count + 32 * 4] <= INIT_04[count];
79
            mem[count + 32 * 5] <= INIT_05[count];
80
            mem[count + 32 * 6] <= INIT_06[count];
81
            mem[count + 32 * 7] <= INIT_07[count];
82
        end
83
    end
84
 
85
    always @(posedge wclk_in) begin
86
        if (we_in == 1'b1) begin
87
            mem[adr + 32 * 0] <= d_in[0];
88
            mem[adr + 32 * 1] <= d_in[1];
89
            mem[adr + 32 * 2] <= d_in[2];
90
            mem[adr + 32 * 3] <= d_in[3];
91
            mem[adr + 32 * 4] <= d_in[4];
92
            mem[adr + 32 * 5] <= d_in[5];
93
            mem[adr + 32 * 6] <= d_in[6];
94
            mem[adr + 32 * 7] <= d_in[7];
95
        end
96
    end
97
 
98
    specify
99
        if (WE)
100
            (WCLK => O[0]) = (1, 1);
101
        if (WE)
102
            (WCLK => O[1]) = (1, 1);
103
        if (WE)
104
            (WCLK => O[2]) = (1, 1);
105
        if (WE)
106
            (WCLK => O[3]) = (1, 1);
107
        if (WE)
108
            (WCLK => O[4]) = (1, 1);
109
        if (WE)
110
            (WCLK => O[5]) = (1, 1);
111
        if (WE)
112
            (WCLK => O[6]) = (1, 1);
113
        if (WE)
114
            (WCLK => O[7]) = (1, 1);
115
 
116
        (A4 => O[0]) = (1, 1);
117
        (A3 => O[0]) = (1, 1);
118
        (A2 => O[0]) = (1, 1);
119
        (A1 => O[0]) = (1, 1);
120
        (A0 => O[0]) = (1, 1);
121
        (A4 => O[1]) = (1, 1);
122
        (A3 => O[1]) = (1, 1);
123
        (A2 => O[1]) = (1, 1);
124
        (A1 => O[1]) = (1, 1);
125
        (A0 => O[1]) = (1, 1);
126
        (A4 => O[2]) = (1, 1);
127
        (A3 => O[2]) = (1, 1);
128
        (A2 => O[2]) = (1, 1);
129
        (A1 => O[2]) = (1, 1);
130
        (A0 => O[2]) = (1, 1);
131
        (A4 => O[3]) = (1, 1);
132
        (A3 => O[3]) = (1, 1);
133
        (A2 => O[3]) = (1, 1);
134
        (A1 => O[3]) = (1, 1);
135
        (A0 => O[3]) = (1, 1);
136
        (A4 => O[4]) = (1, 1);
137
        (A3 => O[4]) = (1, 1);
138
        (A2 => O[4]) = (1, 1);
139
        (A1 => O[4]) = (1, 1);
140
        (A0 => O[4]) = (1, 1);
141
        (A4 => O[5]) = (1, 1);
142
        (A3 => O[5]) = (1, 1);
143
        (A2 => O[5]) = (1, 1);
144
        (A1 => O[5]) = (1, 1);
145
        (A0 => O[5]) = (1, 1);
146
        (A4 => O[6]) = (1, 1);
147
        (A3 => O[6]) = (1, 1);
148
        (A2 => O[6]) = (1, 1);
149
        (A1 => O[6]) = (1, 1);
150
        (A0 => O[6]) = (1, 1);
151
        (A4 => O[7]) = (1, 1);
152
        (A3 => O[7]) = (1, 1);
153
        (A2 => O[7]) = (1, 1);
154
        (A1 => O[7]) = (1, 1);
155
        (A0 => O[7]) = (1, 1);
156
    endspecify
157
 
158
endmodule
159
 
160
`endcelldefine

powered by: WebSVN 2.1.0

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