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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [lib/] [fasm/] [fasm_sparam.v] - Blame information for rev 195

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 195 sybreon
/* $Id: fasm_sparam.v,v 1.2 2008/06/05 20:55:15 sybreon Exp $
2
**
3
** FASM MEMORY LIBRARY
4
** Copyright (C) 2004-2009 Shawn Tan <shawn.tan@aeste.net>
5
** All rights reserved.
6
**
7
** FASM is free software: you can redistribute it and/or modify it
8
** under the terms of the GNU Lesser General Public License as
9
** published by the Free Software Foundation, either version 3 of the
10
** License, or (at your option) any later version.
11
**
12
** FASM is distributed in the hope that it will be useful, but WITHOUT
13
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
15
** Public License for more details.
16
**
17
** You should have received a copy of the GNU Lesser General Public
18
** License along with FASM. If not, see <http:**www.gnu.org/licenses/>.
19
*/
20
/*
21
 * SINGLE PORT ASYNCHRONOUS MEMORY BLOCK
22
 * Synthesis proven on:
23
 * - Xilinx ISE
24
 * - Altera Quartus (>=8.0)
25
 */
26
 
27
module fasm_sparam (/*AUTOARG*/
28
   // Outputs
29
   dat_o,
30
   // Inputs
31
   dat_i, adr_i, wre_i, stb_i, clk_i, rst_i
32
   ) ;
33
   parameter AW = 5; // 32
34
   parameter DW = 2; // x2
35
 
36
   // PORT A - READ/WRITE
37
   output [DW-1:0] dat_o;
38
   input [DW-1:0]  dat_i;
39
   input [AW-1:0]  adr_i;
40
   input           wre_i;
41
   input           stb_i; // ignored
42
 
43
   input           clk_i,
44
                   rst_i;
45
 
46
   // memory block
47
   reg [DW-1:0]    lram [(1<<AW)-1:0];
48
 
49
   always @(posedge clk_i)
50
     if (wre_i)
51
          lram[adr_i] <= #1 dat_i;
52
 
53
   assign          dat_o = lram[adr_i];
54
 
55
   // ### SIMULATION ONLY ###
56
   // synopsys translate_off
57
   integer i;
58
   initial begin
59
      for (i=0; i<(1<<AW); i=i+1) begin
60
         lram[i] <= $random;
61
      end
62
   end
63
   // synopsys translate_on
64
 
65
endmodule // fasm_sparam

powered by: WebSVN 2.1.0

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