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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [basal/] [src/] [FIFOs/] [CummingsSNUG2002SJ_FIFO1/] [fifomem.v] - Rev 47

Go to most recent revision | Compare with Previous | Blame | View Log

// --------------------------------------------------------------------
//
 
 
module
  fifomem
  #(
    parameter DATASIZE = 8,   // Memory data word width
    parameter ADDRSIZE = 4    // Number of mem address bits
  )
  (
    output [DATASIZE-1:0] rdata,
    input [DATASIZE-1:0]  wdata,
    input [ADDRSIZE-1:0]  waddr,
    input [ADDRSIZE-1:0]  raddr,
    input wclken,
    input wfull,
    input wclk
  );
 
`ifdef VENDORRAM
  // instantiation of a vendor's dual-port RAM
  vendor_ram
    mem
    (
      .dout(rdata), 
      .din(wdata),
      .waddr(waddr), 
      .raddr(raddr),
      .wclken(wclken),
      .wclken_n(wfull), 
      .clk(wclk)
    );
`else
  // RTL Verilog memory model
  localparam DEPTH = 1<<ADDRSIZE;
  reg [DATASIZE-1:0] mem [0:DEPTH-1];
  assign rdata = mem[raddr];
 
  always @(posedge wclk)
    if(wclken && !wfull) 
      mem[waddr] <= wdata;
 
`endif
 
endmodule
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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