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

Subversion Repositories altor32

[/] [altor32/] [trunk/] [rtl/] [cpu/] [altor32_ram_sp.v] - Diff between revs 36 and 37

Show entire file | Details | Blame | View Log

Rev 36 Rev 37
Line 8... Line 8...
//               Email: admin@ultra-embedded.com
//               Email: admin@ultra-embedded.com
//
//
//                       License: LGPL
//                       License: LGPL
//-----------------------------------------------------------------
//-----------------------------------------------------------------
//
//
// Copyright (C) 2011 - 2013 Ultra-Embedded.com
// Copyright (C) 2011 - 2014 Ultra-Embedded.com
//
//
// This source file may be used and distributed without         
// This source file may be used and distributed without         
// restriction provided that this copyright statement is not    
// restriction provided that this copyright statement is not    
// removed from the file and that any derivative work contains  
// removed from the file and that any derivative work contains  
// the original copyright notice and the associated disclaimer. 
// the original copyright notice and the associated disclaimer. 
Line 53... Line 53...
 
 
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Registers
// Registers
//-----------------------------------------------------------------
//-----------------------------------------------------------------
reg [(WIDTH - 1):0]     ram [((2<< (SIZE-1)) - 1):0] /*verilator public*/;
reg [(WIDTH - 1):0]     ram [((2<< (SIZE-1)) - 1):0] /*verilator public*/;
reg [(SIZE - 1):0]      rd_addr;
reg [(SIZE - 1):0]      rd_addr_q;
 
 
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Processes
// Processes
//-----------------------------------------------------------------
//-----------------------------------------------------------------
always @ (posedge clk_i)
always @ (posedge clk_i)
begin
begin
    if (wr_i == 1'b1)
    if (wr_i == 1'b1)
        ram[adr_i] <= dat_i;
        ram[adr_i] <= dat_i;
    rd_addr <= adr_i;
    rd_addr_q <= adr_i;
end
end
 
 
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// Combinatorial
// Combinatorial
//-------------------------------------------------------------------
//-------------------------------------------------------------------
assign dat_o = ram[rd_addr];
assign dat_o = ram[rd_addr_q];
 
 
 
//-----------------------------------------------------------------
 
// Init Memory
 
//-----------------------------------------------------------------
 
`ifdef ALTOR32_CLEAR_RAM
 
    integer i;
 
    initial
 
    begin
 
        for (i=0;i<((2<< (SIZE-1)) - 1);i=i+1)
 
        begin
 
            ram[i] = 0;
 
        end
 
    end
 
`endif
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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