Changeset 22 in XOpenSparcT1 for trunk/os2wb/os2wb.v
- Timestamp:
- 03/31/11 12:31:26 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/os2wb/os2wb.v
r17 r22 119 119 `define PCX_REQ_CAS_COMPARE 5'b11111 120 120 121 `define MEM_SIZE 64'h00000000_10000000 122 121 //`define MEM_SIZE 64'h00000000_10000000 //256 MB 122 //`define MEM_SIZE 64'h00000000_00100000 //1MB 123 `define MEM_SIZE 64'h00000000_00001000 //256KB 124 125 // sal: escludo test della DRAM `define TEST_DRAM 1 123 126 `define TEST_DRAM 1 124 127 `define DEBUGGING 1 … … 178 181 pcx_fifo pcx_fifo_inst( 179 182 .clk(clk), 180 183 .rst(!rstn), 181 184 .din({pcx_atom_1,pcx_req_1,pcx_data}), 182 185 .rd_en(fifo_rd), 183 186 .wr_en((pcx_req_1!=5'b00000 && pcx_data[123]) || (pcx_atom_2 && pcx_data_123_d)), 184 187 .empty(pcx_fifo_empty), 188 .full(), 185 189 .dout(pcx_data_fifo) 186 190 ); … … 209 213 if(rstn==0) 210 214 begin 215 //$display("INFO: OS2WB: RST_DRAM at %t",$time); 211 216 if(`TEST_DRAM) 212 217 state<=`TEST_DRAM_1; 213 218 else 214 219 state<=`INIT_DRAM_1; // DRAM initialization is mandatory! 215 220 cpx_ready<=0; 216 221 fifo_rd<=0; … … 230 235 `TEST_DRAM_1: 231 236 begin 237 $display("INFO: OS2WB: TEST_DRAM_1"); 232 238 wb_cycle<=1; 233 239 wb_strobe<=1; … … 239 245 if(wb_ack) 240 246 begin 247 $display("INFO: OS2WB: TEST_DRAM_2 at time %d with wb_addr=%x",$time,wb_addr); 241 248 wb_strobe<=0; 242 249 if(wb_addr<`MEM_SIZE-8) … … 258 265 `TEST_DRAM_3: 259 266 begin 267 $display("INFO: OS2WB: TEST_DRAM_3"); 260 268 wb_cycle<=1; 261 269 wb_strobe<=1; … … 266 274 if(wb_ack) 267 275 begin 276 $display("INFO: OS2WB: TEST_DRAM_4 at %t",$time); 268 277 wb_strobe<=0; 269 278 if(wb_addr<`MEM_SIZE-8) … … 274 283 state<=`TEST_DRAM_3; 275 284 end 285 else 286 $display("INFO: OS2WB: TEST_DRAM_4 error in read addres %x at %t",wb_addr,$time); 287 276 288 end 277 289 else 278 290 begin 291 $display("INFO: OS2WB: INIT_DRAM at %t",$time); 279 292 state<=`INIT_DRAM_1; 280 293 wb_cycle<=0; … … 300 313 if(wb_addr<`MEM_SIZE-8) 301 314 begin 315 //for debug 316 // if (wb_addr[10:3]==8'b0) 317 // $display("INFO: OS2WB: INIT_DRAM_2 at time %d with wb_addr=%x",$time,wb_addr); 318 // 302 319 wb_addr[31:0]<=wb_addr[31:0]+8; 303 320 pcx_packet_d[64+11:64+4]<=pcx_packet_d[64+11:64+4]+1; // Address for cachedir init … … 306 323 else 307 324 begin 325 $display("INFO: OS2WB: WAKEUP_DRAM at %t",$time); 308 326 state<=`WAKEUP; 309 327 wb_cycle<=0; … … 349 367 if(`DEBUGGING) 350 368 begin 369 $display("INFO: OS2WB: GOT_PCX_REQ"); 351 370 wb_sel[1:0]<=pcx_packet[113:112]; 352 371 wb_sel[2]<=1; … … 1236 1255 1237 1256 .wren_b(icache1_alloc || icache1_dealloc || icache_inval_all || cache_init), 1238 .address_b({2'b0 1,icache_index}),1257 .address_b({2'b0,icache_index}), 1239 1258 .data_b(icache_data), 1240 1259 .q_b(icache1_do) … … 1245 1264 .enable(dir_en), 1246 1265 .wren_a(icache2_alloc || icache2_dealloc || icache_inval_all || cache_init), 1247 .address_a({ 1'b0,icache_index}),1266 .address_a({2'b0,icache_index}), 1248 1267 .data_a(icache_data), 1249 1268 .q_a(icache2_do), 1250 1269 1251 1270 .wren_b(icache3_alloc || icache3_dealloc || icache_inval_all || cache_init), 1252 .address_b({ 1'b1,icache_index}),1271 .address_b({2'b0,icache_index}), 1253 1272 .data_b(icache_data), 1254 1273 .q_b(icache3_do)
Note: See TracChangeset
for help on using the changeset viewer.