OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_processor/] [aeMB/] [verilog/] [src/] [aeMB2_tpsram.v] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 alirezamon
/* $Id: aeMB2_tpsram.v,v 1.3 2008-04-26 17:57:43 sybreon Exp $
2
**
3
** AEMB2 EDK 6.2 COMPATIBLE CORE
4
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9
** under the terms of the GNU Lesser General Public License as
10
** published by the Free Software Foundation, either version 3 of the
11
** License, or (at your option) any later version.
12
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
16
** Public License for more details.
17
**
18
** You should have received a copy of the GNU Lesser General Public
19
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
20
*/
21
/**
22
 * @file aeMB2_tpsram.v
23
 * @brief On-chip two-port synchronous SRAM.
24
 
25
 * Port A is used for writing and port B is used for reading
26
 * ONLY. Output buffers are cleared during reset. NOTE: Quartus
27
 * (<=7.2) does not infer a correct SYNCRAM block with read enable.
28
 
29
 */
30
`timescale  1ns/1ps
31
module aeMB2_tpsram (/*AUTOARG*/
32
   // Outputs
33
   dat_o, xdat_o,
34
   // Inputs
35
   adr_i, dat_i, wre_i, ena_i, rst_i, clk_i, xadr_i, xdat_i, xwre_i,
36
   xena_i, xrst_i, xclk_i
37
   ) ;
38
   parameter AW = 8; // 256
39
   parameter DW = 32; // x32
40
 
41
   // PORT A - WRITE
42
   output [DW-1:0] dat_o;
43
   input [AW-1:0]  adr_i;
44
   input [DW-1:0]  dat_i;
45
   input           wre_i,
46
                   ena_i,
47
                   rst_i,
48
                   clk_i;
49
 
50
   // PORT X - READ
51
   output [DW-1:0] xdat_o;
52
   input [AW-1:0]  xadr_i;
53
   input [DW-1:0]  xdat_i;
54
   input           xwre_i,
55
                   xena_i,
56
                   xrst_i,
57
                   xclk_i;
58
 
59
   /*AUTOREG*/
60
   // Beginning of automatic regs (for this module's undeclared outputs)
61
   reg [DW-1:0]          xdat_o;
62
   // End of automatics
63
   reg [DW:1]           rRAM [(1<<AW)-1:0];
64
   reg [AW:1]           rADR;
65
 
66
   always @(posedge clk_i)
67
     if (wre_i) rRAM[adr_i] <= #1 dat_i;
68
 
69
   always @(posedge xclk_i)
70
     if (xrst_i)
71
       /*AUTORESET*/
72
       // Beginning of autoreset for uninitialized flops
73
       xdat_o <= {(1+(DW-1)){1'b0}};
74
       // End of automatics
75
     else if (xena_i)
76
       xdat_o <= #1 rRAM[xadr_i];
77
 
78
   assign               dat_o = {(DW){1'bX}}; // tieoff unused outputs
79
 
80
   // --- SIMULATION ONLY ------------------------------------
81
   // synopsys translate_off
82
   integer i;
83
   initial begin
84
      for (i=0; i<(1<<AW); i=i+1) begin
85
         rRAM[i] <= $random;
86
      end
87
   end
88
   // synopsys translate_on
89
 
90
endmodule // aeMB2_tpsram
91
 
92
/*
93
 $Log: not supported by cvs2svn $
94
 Revision 1.2  2008/04/26 01:09:06  sybreon
95
 Passes basic tests. Minor documentation changes to make it compatible with iverilog pre-processor.
96
 
97
 Revision 1.1  2008/04/20 16:33:39  sybreon
98
 Initial import.
99
*/

powered by: WebSVN 2.1.0

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