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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [mp3/] [lib/] [xilinx/] [unisims/] [RAM16X4S.v] - Blame information for rev 1767

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/RAM16X4S.v,v 1.1.1.1 2001-11-04 18:59:50 lampret Exp $
2
 
3
/*
4
 
5
FUNCTION        : 16x4 Static RAM with synchronous write capability
6
 
7
*/
8
 
9
`timescale  100 ps / 10 ps
10
 
11
`celldefine
12
 
13
module RAM16X4S (O0, O1, O2, O3, A0, A1, A2, A3, D0, D1, D2, D3, WCLK, WE);
14
 
15
    parameter cds_action = "ignore";
16
 
17
    parameter INIT_00 = 16'h0000;
18
    parameter INIT_01 = 16'h0000;
19
    parameter INIT_02 = 16'h0000;
20
    parameter INIT_03 = 16'h0000;
21
 
22
    output O0, O1, O2, O3;
23
 
24
    input  A0, A1, A2, A3, D0, D1, D2, D3, WCLK, WE;
25
 
26
    reg  mem [64:0];
27
    reg  [8:0] count;
28
    wire [3:0] adr;
29
    wire [3:0] d_in, o_out;
30
    wire wclk_in, we_in;
31
 
32
    buf b_d0   (d_in[0], D0);
33
    buf b_d1   (d_in[1], D1);
34
    buf b_d2   (d_in[2], D2);
35
    buf b_d3   (d_in[3], D3);
36
    buf b_wclk (wclk_in, WCLK);
37
    buf b_we   (we_in, WE);
38
 
39
    buf b_a3 (adr[3], A3);
40
    buf b_a2 (adr[2], A2);
41
    buf b_a1 (adr[1], A1);
42
    buf b_a0 (adr[0], A0);
43
 
44
    buf b_o0 (O0, o_out[0]);
45
    buf b_o1 (O1, o_out[1]);
46
    buf b_o2 (O2, o_out[2]);
47
    buf b_o3 (O3, o_out[3]);
48
 
49
    buf b_o_out0 (o_out[0], mem[adr + 16 * 0]);
50
    buf b_o_out1 (o_out[1], mem[adr + 16 * 1]);
51
    buf b_o_out2 (o_out[2], mem[adr + 16 * 2]);
52
    buf b_o_out3 (o_out[3], mem[adr + 16 * 3]);
53
 
54
    initial begin
55
        for (count = 0; count < 16; count = count + 1) begin
56
            mem[count + 16 * 0] <= INIT_00[count];
57
            mem[count + 16 * 1] <= INIT_01[count];
58
            mem[count + 16 * 2] <= INIT_02[count];
59
            mem[count + 16 * 3] <= INIT_03[count];
60
        end
61
    end
62
 
63
    always @(posedge wclk_in) begin
64
        if (we_in == 1'b1) begin
65
            mem[adr + 16 * 0] <= d_in[0];
66
            mem[adr + 16 * 1] <= d_in[1];
67
            mem[adr + 16 * 2] <= d_in[2];
68
            mem[adr + 16 * 3] <= d_in[3];
69
        end
70
    end
71
 
72
    specify
73
        if (WE)
74
            (WCLK => O0) = (1, 1);
75
        if (WE)
76
            (WCLK => O1) = (1, 1);
77
        if (WE)
78
            (WCLK => O2) = (1, 1);
79
        if (WE)
80
            (WCLK => O3) = (1, 1);
81
 
82
        (A3 => O0) = (1, 1);
83
        (A2 => O0) = (1, 1);
84
        (A1 => O0) = (1, 1);
85
        (A0 => O0) = (1, 1);
86
        (A3 => O1) = (1, 1);
87
        (A2 => O1) = (1, 1);
88
        (A1 => O1) = (1, 1);
89
        (A0 => O1) = (1, 1);
90
        (A3 => O2) = (1, 1);
91
        (A2 => O2) = (1, 1);
92
        (A1 => O2) = (1, 1);
93
        (A0 => O2) = (1, 1);
94
        (A3 => O3) = (1, 1);
95
        (A2 => O3) = (1, 1);
96
        (A1 => O3) = (1, 1);
97
        (A0 => O3) = (1, 1);
98
    endspecify
99
 
100
endmodule
101
 
102
`endcelldefine

powered by: WebSVN 2.1.0

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