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

Subversion Repositories mips789

[/] [mips789/] [branches/] [avendor/] [rtl/] [verilog/] [sim_ram.v] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 mcupro
module sim_syn_ram0(
2
        data,
3
        wraddress,
4
        rdaddress_a,
5
        rdaddress_b,
6
        wren,
7
        clock,
8
        qa,
9
        qb);
10
 
11
    input   [7:0]  data;
12
    input   [10:0]  wraddress;
13
    input   [10:0]  rdaddress_a;
14
    input   [10:0]  rdaddress_b;
15
    input     wren;
16
    reg [7:0]  r_data;
17
    reg [10:0]  r_wraddress;
18
    reg [10:0]  r_rdaddress_a;
19
    reg [10:0]  r_rdaddress_b;
20
    reg   r_wren;
21
    input     clock;
22
    output  [7:0]  qa;
23
    output  [7:0]  qb;
24
    reg [7:0] mem_bank  [0:2047]  ;
25
    initial begin
26
        mem_bank[0] = 'h00 ; mem_bank[1] = 'hac ; mem_bank[2] = 'h00 ; mem_bank[3] = 'hc0 ; mem_bank[4] = 'h00 ; mem_bank[5] = 'hc4 ; mem_bank[6] = 'h00 ; mem_bank[7] = 'hc0 ; mem_bank[8] = 'h00 ; mem_bank[9] = 'h2a ;
27
        mem_bank[10] = 'hfd ; mem_bank[11] = 'h04 ; mem_bank[12] = 'h17 ; mem_bank[13] = 'h00 ; mem_bank[14] = 'h0e ; mem_bank[15] = 'h7f ; mem_bank[16] = 'h14 ; mem_bank[17] = 'hff ; mem_bank[18] = 'hff ; mem_bank[19] = 'hff ;
28
        mem_bank[20] = 'hff ; mem_bank[21] = 'h08 ; mem_bank[22] = 'h01 ; mem_bank[23] = 'he8 ; mem_bank[24] = 'h14 ; mem_bank[25] = 'h10 ; mem_bank[26] = 'h25 ; mem_bank[27] = 'h25 ; mem_bank[28] = 'h01 ; mem_bank[29] = 'hff ;
29
        mem_bank[30] = 'h24 ; mem_bank[31] = 'h25 ; mem_bank[32] = 'h0f ; mem_bank[33] = 'h00 ; mem_bank[34] = 'hf9 ; mem_bank[35] = 'h25 ; mem_bank[36] = 'hff ; mem_bank[37] = 'h00 ; mem_bank[38] = 'h10 ; mem_bank[39] = 'h08 ;
30
        mem_bank[40] = 'h00 ; mem_bank[41] = 'h00 ; mem_bank[42] = 'h00 ; mem_bank[43] = 'h00 ; mem_bank[44] = 'h00 ; mem_bank[45] = 'h00 ; mem_bank[46] = 'h00 ; mem_bank[47] = 'h00 ; mem_bank[48] = 'h00 ;
31
    end
32
    always @ (posedge clock) if (r_wren) mem_bank[r_wraddress]<=r_data;
33
    always @ (posedge clock)
34
    begin
35
        r_data<=data;
36
        r_wraddress<=wraddress;
37
        r_rdaddress_a<=rdaddress_a;
38
        r_rdaddress_b<=rdaddress_b;
39
        r_wren<=wren;
40
    end
41
    assign qa =mem_bank[r_rdaddress_a];
42
    assign qb =mem_bank[r_rdaddress_b];
43
endmodule
44
 
45
 
46
 
47
module sim_syn_ram1(
48
        data,
49
        wraddress,
50
        rdaddress_a,
51
        rdaddress_b,
52
        wren,
53
        clock,
54
        qa,
55
        qb);
56
 
57
    input   [7:0]  data;
58
    input   [10:0]  wraddress;
59
    input   [10:0]  rdaddress_a;
60
    input   [10:0]  rdaddress_b;
61
    input     wren;
62
    reg [7:0]  r_data;
63
    reg [10:0]  r_wraddress;
64
    reg [10:0]  r_rdaddress_a;
65
    reg [10:0]  r_rdaddress_b;
66
    reg   r_wren;
67
    input     clock;
68
    output  [7:0]  qa;
69
    output  [7:0]  qb;
70
    reg [7:0] mem_bank  [0:2047]  ;
71
    initial begin
72
        mem_bank[0] = 'h00 ; mem_bank[1] = 'h80 ; mem_bank[2] = 'h00 ; mem_bank[3] = 'h00 ; mem_bank[4] = 'h00 ; mem_bank[5] = 'h00 ; mem_bank[6] = 'h00 ; mem_bank[7] = 'h02 ; mem_bank[8] = 'h00 ; mem_bank[9] = 'h18 ;
73
        mem_bank[10] = 'hff ; mem_bank[11] = 'h00 ; mem_bank[12] = 'h00 ; mem_bank[13] = 'h00 ; mem_bank[14] = 'h00 ; mem_bank[15] = 'h00 ; mem_bank[16] = 'h28 ; mem_bank[17] = 'hff ; mem_bank[18] = 'hff ; mem_bank[19] = 'hff ;
74
        mem_bank[20] = 'hff ; mem_bank[21] = 'h00 ; mem_bank[22] = 'h00 ; mem_bank[23] = 'hff ; mem_bank[24] = 'h00 ; mem_bank[25] = 'h00 ; mem_bank[26] = 'h80 ; mem_bank[27] = 'h20 ; mem_bank[28] = 'h00 ; mem_bank[29] = 'h00 ;
75
        mem_bank[30] = 'h00 ; mem_bank[31] = 'h80 ; mem_bank[32] = 'h00 ; mem_bank[33] = 'h00 ; mem_bank[34] = 'hff ; mem_bank[35] = 'h20 ; mem_bank[36] = 'h00 ; mem_bank[37] = 'h80 ; mem_bank[38] = 'h00 ; mem_bank[39] = 'h00 ;
76
        mem_bank[40] = 'h00 ; mem_bank[41] = 'h00 ; mem_bank[42] = 'h00 ; mem_bank[43] = 'h00 ; mem_bank[44] = 'h00 ; mem_bank[45] = 'h00 ; mem_bank[46] = 'h00 ; mem_bank[47] = 'h00 ; mem_bank[48] = 'h00 ;
77
    end
78
    always @ (posedge clock) if (r_wren) mem_bank[r_wraddress]<=r_data;
79
    always @ (posedge clock)
80
    begin
81
        r_data<=data;
82
        r_wraddress<=wraddress;
83
        r_rdaddress_a<=rdaddress_a;
84
        r_rdaddress_b<=rdaddress_b;
85
        r_wren<=wren;
86
    end
87
    assign qa =mem_bank[r_rdaddress_a];
88
    assign qb =mem_bank[r_rdaddress_b];
89
endmodule
90
 
91
 
92
 
93
module sim_syn_ram2(
94
        data,
95
        wraddress,
96
        rdaddress_a,
97
        rdaddress_b,
98
        wren,
99
        clock,
100
        qa,
101
        qb);
102
 
103
    input   [7:0]  data;
104
    input   [10:0]  wraddress;
105
    input   [10:0]  rdaddress_a;
106
    input   [10:0]  rdaddress_b;
107
    input     wren;
108
    reg [7:0]  r_data;
109
    reg [10:0]  r_wraddress;
110
    reg [10:0]  r_rdaddress_a;
111
    reg [10:0]  r_rdaddress_b;
112
    reg   r_wren;
113
    input     clock;
114
    output  [7:0]  qa;
115
    output  [7:0]  qb;
116
    reg [7:0] mem_bank  [0:2047]  ;
117
    initial begin
118
        mem_bank[0] = 'h1c ; mem_bank[1] = 'h9c ; mem_bank[2] = 'h04 ; mem_bank[3] = 'h84 ; mem_bank[4] = 'h05 ; mem_bank[5] = 'ha5 ; mem_bank[6] = 'h1d ; mem_bank[7] = 'hbd ; mem_bank[8] = 'h80 ; mem_bank[9] = 'h85 ;
119
        mem_bank[10] = 'h60 ; mem_bank[11] = 'h84 ; mem_bank[12] = 'h00 ; mem_bank[13] = 'h00 ; mem_bank[14] = 'h00 ; mem_bank[15] = 'h02 ; mem_bank[16] = 'h42 ; mem_bank[17] = 'h03 ; mem_bank[18] = 'h42 ; mem_bank[19] = 'h43 ;
120
        mem_bank[20] = 'h42 ; mem_bank[21] = 'he0 ; mem_bank[22] = 'h42 ; mem_bank[23] = 'hbd ; mem_bank[24] = 'hbf ; mem_bank[25] = 'hb0 ; mem_bank[26] = 'h00 ; mem_bank[27] = 'h00 ; mem_bank[28] = 'h02 ; mem_bank[29] = 'h42 ;
121
        mem_bank[30] = 'h00 ; mem_bank[31] = 'h40 ; mem_bank[32] = 'h00 ; mem_bank[33] = 'h00 ; mem_bank[34] = 'h00 ; mem_bank[35] = 'h00 ; mem_bank[36] = 'h84 ; mem_bank[37] = 'h02 ; mem_bank[38] = 'h42 ; mem_bank[39] = 'he0 ;
122
        mem_bank[40] = 'h44 ; mem_bank[41] = 'h00 ; mem_bank[42] = 'h00 ; mem_bank[43] = 'h00 ; mem_bank[44] = 'h00 ; mem_bank[45] = 'h00 ; mem_bank[46] = 'h00 ; mem_bank[47] = 'h00 ; mem_bank[48] = 'h00 ;
123
    end
124
    always @ (posedge clock) if (r_wren) mem_bank[r_wraddress]<=r_data;
125
    always @ (posedge clock)
126
    begin
127
        r_data<=data;
128
        r_wraddress<=wraddress;
129
        r_rdaddress_a<=rdaddress_a;
130
        r_rdaddress_b<=rdaddress_b;
131
        r_wren<=wren;
132
    end
133
    assign qa =mem_bank[r_rdaddress_a];
134
    assign qb =mem_bank[r_rdaddress_b];
135
endmodule
136
 
137
 
138
 
139
module sim_syn_ram3(
140
        data,
141
        wraddress,
142
        rdaddress_a,
143
        rdaddress_b,
144
        wren,
145
        clock,
146
        qa,
147
        qb);
148
 
149
    input   [7:0]  data;
150
    input   [10:0]  wraddress;
151
    input   [10:0]  rdaddress_a;
152
    input   [10:0]  rdaddress_b;
153
    input     wren;
154
    reg [7:0]  r_data;
155
    reg [10:0]  r_wraddress;
156
    reg [10:0]  r_rdaddress_a;
157
    reg [10:0]  r_rdaddress_b;
158
    reg   r_wren;
159
    input     clock;
160
    output  [7:0]  qa;
161
    output  [7:0]  qb;
162
    reg [7:0] mem_bank  [0:2047]  ;
163
    initial begin
164
        mem_bank[0] = 'h3c ; mem_bank[1] = 'h37 ; mem_bank[2] = 'h3c ; mem_bank[3] = 'h34 ; mem_bank[4] = 'h3c ; mem_bank[5] = 'h34 ; mem_bank[6] = 'h3c ; mem_bank[7] = 'h37 ; mem_bank[8] = 'hac ; mem_bank[9] = 'h00 ;
165
        mem_bank[10] = 'h14 ; mem_bank[11] = 'h24 ; mem_bank[12] = 'h0c ; mem_bank[13] = 'h00 ; mem_bank[14] = 'h08 ; mem_bank[15] = 'h3c ; mem_bank[16] = 'h34 ; mem_bank[17] = 'h24 ; mem_bank[18] = 'h24 ; mem_bank[19] = 'h14 ;
166
        mem_bank[20] = 'h24 ; mem_bank[21] = 'h03 ; mem_bank[22] = 'h24 ; mem_bank[23] = 'h27 ; mem_bank[24] = 'haf ; mem_bank[25] = 'haf ; mem_bank[26] = 'h00 ; mem_bank[27] = 'h02 ; mem_bank[28] = 'h26 ; mem_bank[29] = 'h30 ;
167
        mem_bank[30] = 'h0c ; mem_bank[31] = 'h00 ; mem_bank[32] = 'h0c ; mem_bank[33] = 'h00 ; mem_bank[34] = 'h10 ; mem_bank[35] = 'h02 ; mem_bank[36] = 'h30 ; mem_bank[37] = 'h3c ; mem_bank[38] = 'h34 ; mem_bank[39] = 'h03 ;
168
        mem_bank[40] = 'ha0 ; mem_bank[41] = 'h00 ; mem_bank[42] = 'h00 ; mem_bank[43] = 'h00 ; mem_bank[44] = 'h00 ; mem_bank[45] = 'h00 ; mem_bank[46] = 'h00 ; mem_bank[47] = 'h00 ; mem_bank[48] = 'h00 ;
169
    end
170
    always @ (posedge clock) if (r_wren) mem_bank[r_wraddress]<=r_data;
171
    always @ (posedge clock)
172
    begin
173
        r_data<=data;
174
        r_wraddress<=wraddress;
175
        r_rdaddress_a<=rdaddress_a;
176
        r_rdaddress_b<=rdaddress_b;
177
        r_wren<=wren;
178
    end
179
    assign qa =mem_bank[r_rdaddress_a];
180
    assign qb =mem_bank[r_rdaddress_b];
181
endmodule
182
 
183
 
184
 

powered by: WebSVN 2.1.0

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