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

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [autogen/] [dcache.v] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 alfik
//======================================================== conditions
2
wire cond_0 = state == STATE_IDLE;
3
wire cond_1 = invddata_do;
4
wire cond_2 = wbinvddata_do;
5
wire cond_3 = dcachewrite_do;
6
wire cond_4 = dcacheread_do;
7
wire cond_5 = state == STATE_READ_CHECK;
8
wire cond_6 = matched;
9
wire cond_7 = cache_disable;
10
wire cond_8 = writeback_needed;
11
wire cond_9 = state == STATE_WRITE_CHECK;
12
wire cond_10 = matched_index == 2'd0;
13
wire cond_11 = matched_index == 2'd1;
14
wire cond_12 = matched_index == 2'd2;
15
wire cond_13 = matched_index == 2'd3;
16
wire cond_14 = write_through;
17
wire cond_15 = state == STATE_READ_BURST;
18
wire cond_16 = readburst_done;
19
wire cond_17 = state == STATE_WRITE_BACK;
20
wire cond_18 = writeline_done;
21
wire cond_19 = state == STATE_READ_LINE;
22
wire cond_20 = readline_done;
23
wire cond_21 = is_write;
24
wire cond_22 = plru_index == 2'd0;
25
wire cond_23 = plru_index == 2'd1;
26
wire cond_24 = plru_index == 2'd2;
27
wire cond_25 = plru_index == 2'd3;
28
wire cond_26 = state == STATE_WRITE_THROUGH;
29
wire cond_27 = writeburst_done;
30
//======================================================== saves
31
wire  is_write_to_reg =
32
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( `TRUE) :
33
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? ( `FALSE) :
34
    is_write;
35
wire [31:0] address_to_reg =
36
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (        dcachewrite_address) :
37
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (        dcacheread_address) :
38
    address;
39
wire [2:0] state_to_reg =
40
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( STATE_WRITE_CHECK) :
41
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? ( STATE_READ_CHECK) :
42
    (cond_5 && cond_6)? ( STATE_IDLE) :
43
    (cond_5 && ~cond_6 && cond_7)? ( STATE_READ_BURST) :
44
    (cond_5 && ~cond_6 && ~cond_7 && cond_8)? ( STATE_WRITE_BACK) :
45
    (cond_5 && ~cond_6 && ~cond_7 && ~cond_8)? ( STATE_READ_LINE) :
46
    (cond_9 && cond_6 && cond_14)? ( STATE_WRITE_THROUGH) :
47
    (cond_9 && cond_6 && ~cond_14)? ( STATE_IDLE) :
48
    (cond_9 && ~cond_6 && cond_7)? ( STATE_WRITE_THROUGH) :
49
    (cond_9 && ~cond_6 && ~cond_7 && cond_8)? ( STATE_WRITE_BACK) :
50
    (cond_9 && ~cond_6 && ~cond_7 && ~cond_8)? ( STATE_READ_LINE) :
51
    (cond_15 && cond_16)? ( STATE_IDLE) :
52
    (cond_17 && cond_18)? ( STATE_READ_LINE) :
53
    (cond_19 && cond_20 && cond_21 && cond_14)? ( STATE_WRITE_THROUGH) :
54
    (cond_19 && cond_20 && cond_21 && ~cond_14)? ( STATE_IDLE) :
55
    (cond_19 && cond_20 && ~cond_21)? ( STATE_IDLE) :
56
    (cond_26 && cond_27)? ( STATE_IDLE) :
57
    state;
58
wire [3:0] length_to_reg =
59
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (         { 1'b0, dcachewrite_length }) :
60
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (         dcacheread_length) :
61
    length;
62
wire  write_through_to_reg =
63
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (  dcachewrite_write_through) :
64
    write_through;
65
wire [31:0] write_data_to_reg =
66
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (     dcachewrite_data) :
67
    write_data;
68
wire  cache_disable_to_reg =
69
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (  dcachewrite_cache_disable) :
70
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (  dcacheread_cache_disable) :
71
    cache_disable;
72
//======================================================== always
73
always @(posedge clk or negedge rst_n) begin
74
    if(rst_n == 1'b0) is_write <= 1'd0;
75
    else              is_write <= is_write_to_reg;
76
end
77
always @(posedge clk or negedge rst_n) begin
78
    if(rst_n == 1'b0) address <= 32'd0;
79
    else              address <= address_to_reg;
80
end
81
always @(posedge clk or negedge rst_n) begin
82
    if(rst_n == 1'b0) state <= 3'd0;
83
    else              state <= state_to_reg;
84
end
85
always @(posedge clk or negedge rst_n) begin
86
    if(rst_n == 1'b0) length <= 4'd0;
87
    else              length <= length_to_reg;
88
end
89
always @(posedge clk or negedge rst_n) begin
90
    if(rst_n == 1'b0) write_through <= 1'd0;
91
    else              write_through <= write_through_to_reg;
92
end
93
always @(posedge clk or negedge rst_n) begin
94
    if(rst_n == 1'b0) write_data <= 32'd0;
95
    else              write_data <= write_data_to_reg;
96
end
97
always @(posedge clk or negedge rst_n) begin
98
    if(rst_n == 1'b0) cache_disable <= 1'd0;
99
    else              cache_disable <= cache_disable_to_reg;
100
end
101
//======================================================== sets
102
assign control_ram_read_do =
103
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (`TRUE) :
104
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (`TRUE) :
105
    1'd0;
106
assign data_ram3_write_do =
107
    (cond_9 && cond_6 && cond_13)? (`TRUE) :
108
    (cond_19 && cond_20 && cond_21 && cond_25)? (`TRUE) :
109
    (cond_19 && cond_20 && ~cond_21 && cond_25)? (`TRUE) :
110
    1'd0;
111
assign writeburst_byteenable_0 =
112
    (cond_9 && cond_6 && cond_14)? ( write_burst_byteenable_0) :
113
    (cond_9 && ~cond_6 && cond_7)? ( write_burst_byteenable_0) :
114
    (cond_19 && cond_20 && cond_21 && cond_14)? ( write_burst_byteenable_0) :
115
    4'd0;
116
assign writeburst_byteenable_1 =
117
    (cond_9 && cond_6 && cond_14)? ( write_burst_byteenable_1) :
118
    (cond_9 && ~cond_6 && cond_7)? ( write_burst_byteenable_1) :
119
    (cond_19 && cond_20 && cond_21 && cond_14)? ( write_burst_byteenable_1) :
120
    4'd0;
121
assign dcachewrite_done =
122
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (`TRUE) :
123
    1'd0;
124
assign data_ram0_address =
125
    (cond_0 && ~cond_1 && cond_2)? ( { 20'd0, wbinvdread_address, 4'd0 }) :
126
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( dcachewrite_address) :
127
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? ( dcacheread_address) :
128
    (cond_9 && cond_6 && cond_10)? (   address) :
129
    (cond_19 && cond_20 && cond_21 && cond_22)? (   address) :
130
    (cond_19 && cond_20 && ~cond_21 && cond_22)? (   address) :
131
    32'd0;
132
assign data_ram0_data =
133
    (cond_9 && cond_6 && cond_10)? (      line_merged) :
134
    (cond_19 && cond_20 && cond_21 && cond_22)? (      line_merged) :
135
    (cond_19 && cond_20 && ~cond_21 && cond_22)? (      readline_line) :
136
    128'd0;
137
assign data_ram1_write_do =
138
    (cond_9 && cond_6 && cond_11)? (`TRUE) :
139
    (cond_19 && cond_20 && cond_21 && cond_23)? (`TRUE) :
140
    (cond_19 && cond_20 && ~cond_21 && cond_23)? (`TRUE) :
141
    1'd0;
142
assign readburst_byte_length =
143
    (cond_5 && ~cond_6 && cond_7)? (  read_burst_byte_length) :
144
    4'd0;
145
assign data_ram0_read_do =
146
    (cond_0 && ~cond_1 && cond_2)? ( wbinvdread_do) :
147
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (`TRUE) :
148
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (`TRUE) :
149
    1'd0;
150
assign data_ram2_data =
151
    (cond_9 && cond_6 && cond_12)? (      line_merged) :
152
    (cond_19 && cond_20 && cond_21 && cond_24)? (      line_merged) :
153
    (cond_19 && cond_20 && ~cond_21 && cond_24)? (      readline_line) :
154
    128'd0;
155
assign dcache_writeline_line =
156
    (cond_5 && ~cond_6 && ~cond_7 && cond_8)? (    plru_data_line[127:0]) :
157
    (cond_9 && ~cond_6 && ~cond_7 && cond_8)? (    plru_data_line[127:0]) :
158
    128'd0;
159
assign readline_do =
160
    (cond_5 && ~cond_6 && ~cond_7 && ~cond_8)? (`TRUE) :
161
    (cond_9 && ~cond_6 && ~cond_7 && ~cond_8)? (`TRUE) :
162
    (cond_17 && cond_18)? (`TRUE) :
163
    1'd0;
164
assign readline_address =
165
    (cond_5 && ~cond_6 && ~cond_7 && ~cond_8)? ( { address[31:4], 4'd0 }) :
166
    (cond_9 && ~cond_6 && ~cond_7 && ~cond_8)? ( { address[31:4], 4'd0 }) :
167
    (cond_17 && cond_18)? ( { address[31:4], 4'd0 }) :
168
    32'd0;
169
assign dcachetoicache_write_do =
170
    (cond_9 && cond_6 && ~cond_14)? (`TRUE) :
171
    (cond_19 && cond_20 && cond_21 && ~cond_14)? (`TRUE) :
172
    (cond_26 && cond_27)? (`TRUE) :
173
    1'd0;
174
assign writeburst_data =
175
    (cond_9 && cond_6 && cond_14)? (         write_burst_data) :
176
    (cond_9 && ~cond_6 && cond_7)? (         write_burst_data) :
177
    (cond_19 && cond_20 && cond_21 && cond_14)? (         write_burst_data) :
178
    56'd0;
179
assign readburst_address =
180
    (cond_5 && ~cond_6 && cond_7)? (      address) :
181
    32'd0;
182
assign readburst_dword_length =
183
    (cond_5 && ~cond_6 && cond_7)? ( read_burst_dword_length) :
184
    2'd0;
185
assign dcachetoicache_write_address =
186
    (cond_9 && cond_6 && ~cond_14)? ( address) :
187
    (cond_19 && cond_20 && cond_21 && ~cond_14)? ( address) :
188
    (cond_26 && cond_27)? ( address) :
189
    32'd0;
190
assign data_ram0_write_do =
191
    (cond_9 && cond_6 && cond_10)? (`TRUE) :
192
    (cond_19 && cond_20 && cond_21 && cond_22)? (`TRUE) :
193
    (cond_19 && cond_20 && ~cond_21 && cond_22)? (`TRUE) :
194
    1'd0;
195
assign dcache_writeline_address =
196
    (cond_5 && ~cond_6 && ~cond_7 && cond_8)? ( { plru_data_line[147:128], address[11:4], 4'd0 }) :
197
    (cond_9 && ~cond_6 && ~cond_7 && cond_8)? ( { plru_data_line[147:128], address[11:4], 4'd0 }) :
198
    32'd0;
199
assign data_ram2_write_do =
200
    (cond_9 && cond_6 && cond_12)? (`TRUE) :
201
    (cond_19 && cond_20 && cond_21 && cond_24)? (`TRUE) :
202
    (cond_19 && cond_20 && ~cond_21 && cond_24)? (`TRUE) :
203
    1'd0;
204
assign data_ram1_read_do =
205
    (cond_0 && ~cond_1 && cond_2)? ( wbinvdread_do) :
206
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (`TRUE) :
207
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (`TRUE) :
208
    1'd0;
209
assign data_ram3_data =
210
    (cond_9 && cond_6 && cond_13)? (      line_merged) :
211
    (cond_19 && cond_20 && cond_21 && cond_25)? (      line_merged) :
212
    (cond_19 && cond_20 && ~cond_21 && cond_25)? (      readline_line) :
213
    128'd0;
214
assign data_ram3_read_do =
215
    (cond_0 && ~cond_1 && cond_2)? ( wbinvdread_do) :
216
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (`TRUE) :
217
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (`TRUE) :
218
    1'd0;
219
assign data_ram3_address =
220
    (cond_0 && ~cond_1 && cond_2)? ( { 20'd0, wbinvdread_address, 4'd0 }) :
221
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( dcachewrite_address) :
222
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? ( dcacheread_address) :
223
    (cond_9 && cond_6 && cond_13)? (   address) :
224
    (cond_19 && cond_20 && cond_21 && cond_25)? (   address) :
225
    (cond_19 && cond_20 && ~cond_21 && cond_25)? (   address) :
226
    32'd0;
227
assign writeburst_do =
228
    (cond_9 && cond_6 && cond_14)? (`TRUE) :
229
    (cond_9 && ~cond_6 && cond_7)? (`TRUE) :
230
    (cond_19 && cond_20 && cond_21 && cond_14)? (`TRUE) :
231
    1'd0;
232
assign data_ram1_data =
233
    (cond_9 && cond_6 && cond_11)? (      line_merged) :
234
    (cond_19 && cond_20 && cond_21 && cond_23)? (      line_merged) :
235
    (cond_19 && cond_20 && ~cond_21 && cond_23)? ( readline_line) :
236
    128'd0;
237
assign dcache_writeline_do =
238
    (cond_5 && ~cond_6 && ~cond_7 && cond_8)? (`TRUE) :
239
    (cond_9 && ~cond_6 && ~cond_7 && cond_8)? (`TRUE) :
240
    1'd0;
241
assign dcacheread_done =
242
    (cond_5 && cond_6)? (`TRUE) :
243
    (cond_15 && cond_16)? (`TRUE) :
244
    (cond_19 && cond_20 && ~cond_21)? (`TRUE) :
245
    1'd0;
246
assign control_ram_write_do =
247
    (cond_5 && cond_6)? (`TRUE) :
248
    (cond_9 && cond_6)? (`TRUE) :
249
    (cond_19 && cond_20 && cond_21)? (`TRUE) :
250
    (cond_19 && cond_20 && ~cond_21)? (`TRUE) :
251
    1'd0;
252
assign control_ram_data =
253
    (cond_5 && cond_6)? (        control_after_match) :
254
    (cond_9 && cond_6)? (        control_after_write_to_existing) :
255
    (cond_19 && cond_20 && cond_21)? (        control_after_write_to_new) :
256
    (cond_19 && cond_20 && ~cond_21)? (        control_after_line_read) :
257
    11'd0;
258
assign writeburst_dword_length =
259
    (cond_9 && cond_6 && cond_14)? ( write_burst_dword_length) :
260
    (cond_9 && ~cond_6 && cond_7)? ( write_burst_dword_length) :
261
    (cond_19 && cond_20 && cond_21 && cond_14)? ( write_burst_dword_length) :
262
    2'd0;
263
assign data_ram2_address =
264
    (cond_0 && ~cond_1 && cond_2)? ( { 20'd0, wbinvdread_address, 4'd0 }) :
265
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( dcachewrite_address) :
266
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? ( dcacheread_address) :
267
    (cond_9 && cond_6 && cond_12)? (   address) :
268
    (cond_19 && cond_20 && cond_21 && cond_24)? (   address) :
269
    (cond_19 && cond_20 && ~cond_21 && cond_24)? (   address) :
270
    32'd0;
271
assign data_ram1_address =
272
    (cond_0 && ~cond_1 && cond_2)? ( { 20'd0, wbinvdread_address, 4'd0 }) :
273
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( dcachewrite_address) :
274
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? ( dcacheread_address) :
275
    (cond_9 && cond_6 && cond_11)? (   address) :
276
    (cond_19 && cond_20 && cond_21 && cond_23)? (   address) :
277
    (cond_19 && cond_20 && ~cond_21 && cond_23)? (    address) :
278
    32'd0;
279
assign data_ram2_read_do =
280
    (cond_0 && ~cond_1 && cond_2)? ( wbinvdread_do) :
281
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? (`TRUE) :
282
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (`TRUE) :
283
    1'd0;
284
assign writeburst_address =
285
    (cond_9 && cond_6 && cond_14)? (      address) :
286
    (cond_9 && ~cond_6 && cond_7)? (      address) :
287
    (cond_19 && cond_20 && cond_21 && cond_14)? (      address) :
288
    32'd0;
289
assign readburst_do =
290
    (cond_5 && ~cond_6 && cond_7)? (`TRUE) :
291
    1'd0;
292
assign control_ram_address =
293
    (cond_0 && ~cond_1 && ~cond_2 && cond_3)? ( dcachewrite_address) :
294
    (cond_0 && ~cond_1 && ~cond_2 && ~cond_3 && cond_4)? (     dcacheread_address) :
295
    (cond_5 && cond_6)? (     address) :
296
    (cond_9 && cond_6)? (     address) :
297
    (cond_19 && cond_20 && cond_21)? (     address) :
298
    (cond_19 && cond_20 && ~cond_21)? (     address) :
299
    32'd0;
300
assign dcacheread_data =
301
    (cond_5 && cond_6)? ( read_from_line) :
302
    (cond_15 && cond_16)? ( read_from_burst) :
303
    (cond_19 && cond_20 && ~cond_21)? ( read_from_line) :
304
    64'd0;

powered by: WebSVN 2.1.0

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