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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB2_dparam.v] - Diff between revs 134 and 191

Only display areas with differences | Details | Blame | View Log

Rev 134 Rev 191
/* $Id: aeMB2_dparam.v,v 1.1 2008-04-26 17:57:43 sybreon Exp $
/* $Id: aeMB2_dparam.v,v 1.1 2008-04-26 17:57:43 sybreon Exp $
**
**
** AEMB2 EDK 6.2 COMPATIBLE CORE
** AEMB2 EDK 6.2 COMPATIBLE CORE
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
**
**
** This file is part of AEMB.
** This file is part of AEMB.
**
**
** AEMB is free software: you can redistribute it and/or modify it
** AEMB is free software: you can redistribute it and/or modify it
** under the terms of the GNU Lesser General Public License as
** under the terms of the GNU Lesser General Public License as
** published by the Free Software Foundation, either version 3 of the
** published by the Free Software Foundation, either version 3 of the
** License, or (at your option) any later version.
** License, or (at your option) any later version.
**
**
** AEMB is distributed in the hope that it will be useful, but WITHOUT
** AEMB is distributed in the hope that it will be useful, but WITHOUT
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
** Public License for more details.
** Public License for more details.
**
**
** You should have received a copy of the GNU Lesser General Public
** You should have received a copy of the GNU Lesser General Public
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
*/
*/
/**
/**
 * @file aeMB2_dparam.v
 * @file aeMB2_dparam.v
 * @brief On-chip dual-port asynchronous SRAM.
 * @brief On-chip dual-port asynchronous SRAM.
 
 
 * This will be implemented as distributed RAM with one read/write
 * This will be implemented as distributed RAM with one read/write
   port and one read-only port.
   port and one read-only port.
 
 
 */
 */
 
 
// 32x64 = 77
// 32x64 = 77
// 64x32 = 146
// 64x32 = 146
 
 
module aeMB2_dparam (/*AUTOARG*/
module aeMB2_dparam (/*AUTOARG*/
   // Outputs
   // Outputs
   dat_o, xdat_o,
   dat_o, xdat_o,
   // Inputs
   // Inputs
   adr_i, dat_i, wre_i, xadr_i, xdat_i, xwre_i, clk_i, ena_i
   adr_i, dat_i, wre_i, xadr_i, xdat_i, xwre_i, clk_i, ena_i
   ) ;
   ) ;
   parameter AW = 5; // 32
   parameter AW = 5; // 32
   parameter DW = 2; // x2
   parameter DW = 2; // x2
 
 
   // PORT A - READ/WRITE
   // PORT A - READ/WRITE
   output [DW-1:0] dat_o;
   output [DW-1:0] dat_o;
   input [AW-1:0]  adr_i;
   input [AW-1:0]  adr_i;
   input [DW-1:0]  dat_i;
   input [DW-1:0]  dat_i;
   input           wre_i;
   input           wre_i;
 
 
   // PORT X - READ ONLY
   // PORT X - READ ONLY
   output [DW-1:0] xdat_o;
   output [DW-1:0] xdat_o;
   input [AW-1:0]  xadr_i;
   input [AW-1:0]  xadr_i;
   input [DW-1:0]  xdat_i;
   input [DW-1:0]  xdat_i;
   input           xwre_i;
   input           xwre_i;
 
 
   // SYSCON
   // SYSCON
   input           clk_i,
   input           clk_i,
                   ena_i;
                   ena_i;
 
 
   /*AUTOREG*/
   /*AUTOREG*/
   reg [DW-1:0]    rRAM [(1<<AW)-1:0];
   reg [DW-1:0]    rRAM [(1<<AW)-1:0];
 
 
   always @(posedge clk_i)
   always @(posedge clk_i)
     if (wre_i) rRAM[adr_i] <= #1 dat_i;
     if (wre_i) rRAM[adr_i] <= #1 dat_i;
 
 
   assign          dat_o = rRAM[adr_i];
   assign          dat_o = rRAM[adr_i];
   assign          xdat_o = rRAM[xadr_i];
   assign          xdat_o = rRAM[xadr_i];
 
 
   // --- SIMULATION ONLY ------------------------------------
   // --- SIMULATION ONLY ------------------------------------
   // synopsys translate_off
   // synopsys translate_off
   integer         i;
   integer         i;
   initial begin
   initial begin
      for (i=0; i<(1<<AW); i=i+1)
      for (i=0; i<(1<<AW); i=i+1)
        begin
        begin
           rRAM[i] <= {(DW){1'b0}};
           rRAM[i] <= {(DW){1'b0}};
end
end
   end
   end
   // synopsys translate_on
   // synopsys translate_on
 
 
endmodule // aeMB2_dparam
endmodule // aeMB2_dparam
 
 
/*
/*
 $Log: not supported by cvs2svn $
 $Log: not supported by cvs2svn $
 Revision 1.1  2008/04/20 16:33:39  sybreon
 Revision 1.1  2008/04/20 16:33:39  sybreon
 Initial import.
 Initial import.
 
 

powered by: WebSVN 2.1.0

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