Changeset 206

Show
Ignore:
Timestamp:
20.11.2008 22:29:14 (2 months ago)
Author:
seb
Message:

The joys of Verilog simulations

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cores/hpdmc/rtl/hpdmc_rfifo.v

    r205 r206  
    5656        end else begin 
    5757                if(r_capture) begin 
    58                         $display("write to the Read FIFO: %x -> %x [avail %x]", di, produce, data_available); 
    5958                        storage[produce] = di; 
    6059                        produce = produce + 3'd1; 
     
    6261                end 
    6362                if(r_burst_start) begin 
    64                         data_available = data_available + consume[1:0] - 4'd4; 
     63                        data_available = data_available + {2'b00, consume[1:0]} - 4'd4; 
    6564                        consume = {~consume[2], 2'b00}; 
    6665                end else if(r_release) begin 
  • cores/hpdmc/rtl/hpdmc_scheduler.v

    r205 r206  
    128128                        if(wb1_cyc_i & wb1_stb_i & (~mgmt_stb | mgmt_ack)) begin 
    129129                                register_mgmt = 1'b1; 
     130                                reload_burst_counter = 1'b1; 
    130131                                if(wb1_we_i) begin 
    131                                         wb1_ack_o = 1'b1; 
     132                                        wb1_ack_o = #0.5 1'b1; 
    132133                                        w_burst_start = 1'b1; 
    133                                         reload_burst_counter = 1'b1; 
    134134                                        if(burst_on) 
    135135                                                next_state = WRITEBURST; 
  • cores/hpdmc/rtl/hpdmc_wfifo.v

    r205 r206  
    5555                                storage_mask[3] = 8'hff; 
    5656                                storage_data[0] = di; 
     57                                $display("FIFO write (start): %x -> 0", di); 
    5758                        end else begin 
    5859                                storage_mask[4] = mi; 
     
    6162                                storage_mask[7] = 8'hff; 
    6263                                storage_data[4] = di; 
     64                                $display("FIFO write (start): %x -> 4", di); 
    6365                        end 
    6466                        produce = {~produce[2], 2'b01}; 
     
    6668                        available_words = {available_words[3:2] - 2'b1, available_words[1:0]}; 
    6769                end else if(w_capture) begin 
     70                        $display("FIFO write (cont): %x -> %x", di, produce); 
    6871                        storage_mask[produce] = mi; 
    6972                        storage_data[produce] = di; 
  • cores/hpdmc/test/ddr.v

    r150 r206  
    165165`endif 
    166166 
    167 // added by lekernel: for testing reads before testing writes 
    168 /*integer fillmem_i; 
    169 initial begin 
    170         for(fillmem_i=0;fillmem_i<4000;fillmem_i=fillmem_i+1) begin 
    171                 mem_array[fillmem_i] = $random; 
    172         end 
    173 end*/ 
    174  
    175167    // Dqs edge checking 
    176168    integer i; 
  • cores/hpdmc/test/ddr_parameters.vh

    r150 r206  
    141141    parameter no_halt          =       1; // If set to 1, the model won't halt on command sequence/major errors 
    142142    parameter DEBUG            =       1; // Turn on DEBUG message 
    143  
    144 `define FULL_MEM 
  • cores/hpdmc/test/tb_hpdmc.v

    r205 r206  
    262262integer i; 
    263263begin 
     264        #1; 
    264265        wb_adr_i = address; 
    265266        wb_dat_i = data; 
     
    270271        wb_cti_i = 3'b000; 
    271272        i = 0; 
    272         #1; 
    273273        while(~wb_ack_o) begin 
    274274                i = i+1; 
     
    287287integer i; 
    288288begin 
     289        #1; 
    289290        wb_adr_i = address; 
    290291        wb_cyc_i = 1'b1; 
     
    295296        wb_cti_i = 3'b010; 
    296297        i = 0; 
    297         #1; 
    298298        while(~wb_ack_o) begin 
    299299                i = i+1; 
    300300                waitclock; 
    301301        end 
    302         if(i == 0) waitclock; 
    303302        $display("Memory Write : %x=%x acked in %d clocks", address, wb_dat_i, i); 
    304303        for(i=0;i<3;i=i+1) begin 
     
    418417        waitnclock(200); 
    419418         
    420         /* SDRAM initialization complete. 
    421          * Now, disable Bypass mode and bring up the hardware controller. 
    422          */ 
    423          
    424         /* We want to know what it sends to the SDRAM chips */ 
     419        /* SDRAM initialization completed */ 
     420         
     421        /* Now, we want to know what the controller will send to the SDRAM chips */ 
    425422        $dumpvars(0, dut); 
    426423         
     424        /* Bring up the controller ! */ 
    427425        wbcwrite(32'h00, 32'h04); 
    428426        waitnclock(30); 
     
    431429         * Try some transfers. 
    432430         */ 
    433         /* 
     431        wbwrite(32'h00000000, 64'h1111222233334444); 
     432        wbwriteburst(32'h00); 
     433        //wbwriteburst(32'h20); 
     434        //wbwriteburst(32'h40); 
     435         
    434436        wbreadburst(32'h00); 
    435         wbreadburst(32'h00001020); 
    436         wbreadburst(32'h40); 
    437         wbreadburst(32'h60);*/ 
    438          
    439         //wbwrite(32'h00000000, 64'h1111222233334444); 
    440          
    441         wbwriteburst(32'h00); 
    442         wbwriteburst(32'h20); 
    443         wbwriteburst(32'h40); 
    444         /*wbwriteburst(32'h40); 
    445         wbwriteburst(32'h12340); 
    446         wbwriteburst(32'h12360); 
    447         wbreadburst(32'h00);*/ 
     437        //wbreadburst(32'h20); 
     438        //wbreadburst(32'h40); 
    448439        waitnclock(20); 
    449         wbreadburst(32'h00); 
    450         wbreadburst(32'h20); 
    451         wbreadburst(32'h40); 
    452         waitnclock(20); 
    453440         
    454441        $finish;