Changeset 22 in XOpenSparcT1 for trunk/os2wb/os2wb.v


Ignore:
Timestamp:
03/31/11 12:31:26 (13 years ago)
Author:
pntsvt00
Message:

checkpoint: la DDR effettua l'init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/os2wb/os2wb.v

    r17 r22  
    119119`define PCX_REQ_CAS_COMPARE 5'b11111 
    120120 
    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 
    123126`define TEST_DRAM        1 
    124127`define DEBUGGING        1 
     
    178181pcx_fifo pcx_fifo_inst(  
    179182    .clk(clk), 
    180         .rst(!rstn), 
     183    .rst(!rstn), 
    181184    .din({pcx_atom_1,pcx_req_1,pcx_data}), 
    182185    .rd_en(fifo_rd), 
    183186    .wr_en((pcx_req_1!=5'b00000 && pcx_data[123]) || (pcx_atom_2 && pcx_data_123_d)),  
    184187    .empty(pcx_fifo_empty), 
     188    .full(), 
    185189    .dout(pcx_data_fifo) 
    186190); 
     
    209213   if(rstn==0) 
    210214      begin 
     215         //$display("INFO: OS2WB: RST_DRAM at %t",$time); 
    211216         if(`TEST_DRAM) 
    212217            state<=`TEST_DRAM_1; 
    213218         else 
    214             state<=`INIT_DRAM_1; // DRAM initialization is mandatory! 
     219         state<=`INIT_DRAM_1; // DRAM initialization is mandatory! 
    215220         cpx_ready<=0; 
    216221         fifo_rd<=0; 
     
    230235         `TEST_DRAM_1: 
    231236            begin 
     237               $display("INFO: OS2WB: TEST_DRAM_1"); 
    232238               wb_cycle<=1; 
    233239               wb_strobe<=1; 
     
    239245            if(wb_ack) 
    240246               begin 
     247               $display("INFO: OS2WB: TEST_DRAM_2 at time %d with wb_addr=%x",$time,wb_addr); 
    241248                  wb_strobe<=0; 
    242249                  if(wb_addr<`MEM_SIZE-8) 
     
    258265         `TEST_DRAM_3: 
    259266            begin 
     267               $display("INFO: OS2WB: TEST_DRAM_3"); 
    260268               wb_cycle<=1; 
    261269               wb_strobe<=1; 
     
    266274            if(wb_ack) 
    267275               begin 
     276                  $display("INFO: OS2WB: TEST_DRAM_4 at %t",$time); 
    268277                  wb_strobe<=0; 
    269278                  if(wb_addr<`MEM_SIZE-8) 
     
    274283                              state<=`TEST_DRAM_3; 
    275284                           end 
     285                        else  
     286                              $display("INFO: OS2WB: TEST_DRAM_4 error in read addres %x at %t",wb_addr,$time); 
     287 
    276288                     end 
    277289                  else 
    278290                     begin 
     291                        $display("INFO: OS2WB: INIT_DRAM at %t",$time); 
    279292                        state<=`INIT_DRAM_1; 
    280293                        wb_cycle<=0; 
     
    300313                  if(wb_addr<`MEM_SIZE-8) 
    301314                     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                        // 
    302319                        wb_addr[31:0]<=wb_addr[31:0]+8; 
    303320                        pcx_packet_d[64+11:64+4]<=pcx_packet_d[64+11:64+4]+1; // Address for cachedir init 
     
    306323                  else 
    307324                     begin 
     325                        $display("INFO: OS2WB: WAKEUP_DRAM at %t",$time); 
    308326                        state<=`WAKEUP; 
    309327                        wb_cycle<=0; 
     
    349367               if(`DEBUGGING) 
    350368                  begin 
     369                     $display("INFO: OS2WB: GOT_PCX_REQ"); 
    351370                     wb_sel[1:0]<=pcx_packet[113:112]; 
    352371                     wb_sel[2]<=1; 
     
    12361255    
    12371256   .wren_b(icache1_alloc || icache1_dealloc || icache_inval_all || cache_init), 
    1238    .address_b({2'b01,icache_index}), 
     1257   .address_b({2'b0,icache_index}), 
    12391258   .data_b(icache_data), 
    12401259   .q_b(icache1_do)  
     
    12451264   .enable(dir_en), 
    12461265   .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}), 
    12481267   .data_a(icache_data), 
    12491268   .q_a(icache2_do), 
    12501269    
    12511270   .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}), 
    12531272   .data_b(icache_data), 
    12541273   .q_b(icache3_do)  
Note: See TracChangeset for help on using the changeset viewer.