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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [vlog/] [system/] [main_mem.v] - Diff between revs 35 and 57

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 35 Rev 57
Line 150... Line 150...
 
 
                          // Wrap the address at 32 MB, or full width
                          // Wrap the address at 32 MB, or full width
        addr_d1        <= i_mem_ctrl ? {5'd0, i_wb_adr[24:2]} : i_wb_adr[29:2];
        addr_d1        <= i_mem_ctrl ? {5'd0, i_wb_adr[24:2]} : i_wb_adr[29:2];
 
 
        if ( wr_en )
        if ( wr_en )
 
            begin
            ram [addr_d1[27:2]]  <= masked_wdata;
            ram [addr_d1[27:2]]  <= masked_wdata;
 
            `ifdef AMBER_MEMIF_DEBUG
 
            $write("%09d  ", `U_TB.clk_count);
 
            $display("Main memory write: address %h, data %h, be %d%d%d%d",
 
                        {2'd0, addr_d1, 2'd0}, wr_data[31:0],
 
                        ~wr_mask[addr_d1[1:0]*4+3],
 
                        ~wr_mask[addr_d1[1:0]*4+2],
 
                        ~wr_mask[addr_d1[1:0]*4+1],
 
                        ~wr_mask[addr_d1[1:0]*4+0]                        );
 
            `endif
 
            end
        end
        end
 
 
 
 
    for (i=0;i<16;i=i+1) begin : masked
    for (i=0;i<16;i=i+1) begin : masked
        assign masked_wdata[8*i+7:8*i] = wr_mask[i] ? rd_data[8*i+7:8*i] : wr_data[8*i+7:8*i];
        assign masked_wdata[8*i+7:8*i] = wr_mask[i] ? rd_data[8*i+7:8*i] : wr_data[8*i+7:8*i];

powered by: WebSVN 2.1.0

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