Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / libs / n2sram / async / n2_com_64x132async_dp_cust_l / n2_com_64x132async_dp_cust / rtl / n2_com_64x132async_dp_cust_array.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: n2_com_64x132async_dp_cust_array.v
4// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
5// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
6//
7// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; version 2 of the License.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// For the avoidance of doubt, and except that if any non-GPL license
23// choice is available it will apply instead, Sun elects to use only
24// the General Public License version 2 (GPLv2) at this time for any
25// software where a choice of GPL license versions is made
26// available with the language indicating that GPLv2 or any later version
27// may be used, or where a choice of which version of the GPL is applied is
28// otherwise unspecified.
29//
30// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
31// CA 95054 USA or visit www.sun.com if you need additional information or
32// have any questions.
33//
34// ========== Copyright Header End ============================================
35module n2_com_64x132async_dp_cust_array (
36
37 wr_clk,
38 wr_addr_array,
39 wr_en_array,
40 din_array,
41
42 rd_clk,
43 rd_addr_array,
44 rd_en_array,
45 dout_array
46
47);
48
49
50input wr_clk; // write clk
51input [5:0] wr_addr_array; // write port address in
52input wr_en_array; // write port enable
53input [131:0] din_array; // data in
54
55input rd_clk; // read clk
56input [5:0] rd_addr_array; // read port address in
57input rd_en_array; // read port enable
58output [131:0] dout_array; // data out
59
60
61// ----------------------------------------------------------------------------
62// Zero In Checkers
63// ----------------------------------------------------------------------------
64// checker to verify on accesses's that no bits are x
65// 0in kndr -var rd_addr_array
66// 0in kndr -var wr_addr_array
67// 0in kndr -var rd_en_array
68// 0in kndr -var wr_en_array
69
70
71reg [131:0] array_ram [0:63];
72reg [131:0] dout_array;
73
74// Initialize the array
75`ifndef NOINITMEM
76integer i;
77
78initial begin
79 for (i=0; i<64; i=i+1) begin
80 array_ram[i] = 132'b0;
81 end
82 dout_array[131:0] = 132'b0; // N2+ Bug 103693
83end
84`endif
85
86// ----------------------------------------------------------------------------
87// Read the array
88// ----------------------------------------------------------------------------
89/* AT:
90always @(rd_clk or rd_en_array or rd_addr_array ) begin
91 if (rd_clk) begin
92 if (rd_en_array) begin
93 dout_array[131:0] <= array_ram[rd_addr_array[5:0]];
94 end
95 end
96end
97*/
98
99always @(rd_clk or rd_en_array or rd_addr_array or wr_en_array or
100 wr_addr_array) begin
101 if (rd_clk) begin
102 if (rd_en_array) begin
103 if (wr_en_array & (rd_addr_array == wr_addr_array)) // 0in < fire -severity 1 -message "Detected rd/wr collision in PEU I/EHB RAM, dout driven as X's" -group mbist_mode
104 dout_array[131:0] <= {132{1'bx}} ;
105 else
106
107 dout_array[131:0] <= array_ram[rd_addr_array[5:0]];
108 end
109 end
110end
111
112
113
114// ----------------------------------------------------------------------------
115// Write the array, note: it is written when the clock is low
116// ----------------------------------------------------------------------------
117always @(wr_en_array or wr_addr_array or wr_clk or din_array ) begin
118 if (~wr_clk) begin
119 if(wr_en_array ) begin
120 array_ram[wr_addr_array[5:0]] <= din_array[131:0];
121 end
122 end
123end
124
125
126endmodule // n2_com_64x132async_dp_cust_array
127
128