Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / niu / rtl / niu_ram_1024x152.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_ram_1024x152.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 ============================================
35
36/**********************************************************
37***********************************************************
38
39 Project : Niu
40
41 File name : niu_ram_1024x152.v
42
43 Module(s) name : niu_ram_1024x152
44
45 Parent modules :
46
47 Child modules :
48
49 Author's name : George Chu
50
51 Date : April. 2004
52
53 Description :
54
55 Synthesis Notes:
56
57 Modification History:
58 Date Description
59 ---- -----------
60
61************************************************************
62***********************************************************/
63
64`timescale 1ns/10ps
65
66module niu_ram_1024x152 (
67 reset,
68 tcu_aclk,
69 tcu_bclk,
70 tcu_scan_en,
71 tcu_se_scancollar_in,
72 tcu_se_scancollar_out,
73 tcu_array_wr_inhibit,
74 scan_in,
75 scan_out,
76 hdr_sram_rvalue,
77 hdr_sram_rid,
78 hdr_sram_wr_en,
79 hdr_sram_red_clr,
80 sram_hdr_read_data,
81 l2clk_2x,
82 mbi_wdata,
83 mbi_rd_adr,
84 mbi_wr_adr,
85 mbi_wr_en,
86 mbi_rd_en,
87 mbi_run,
88 data_inp,
89 addr_rd,
90 addr_wt,
91 wt_enable,
92 cs_rd,
93 clk,
94 data_out
95 );
96
97parameter DATA_WIDTH_MINUS1 = 151;
98parameter ADDR_WIDTH_MINUS1 = 9;
99
100input reset; // if 1, reset the logic
101input tcu_aclk;
102input tcu_bclk;
103input tcu_scan_en;
104input tcu_se_scancollar_in;
105input tcu_se_scancollar_out;
106input tcu_array_wr_inhibit;
107input scan_in;
108output scan_out;
109
110input [6:0] hdr_sram_rvalue;
111input [2:0] hdr_sram_rid;
112input hdr_sram_wr_en;
113input hdr_sram_red_clr;
114output [6:0] sram_hdr_read_data;
115
116input l2clk_2x;
117
118input [DATA_WIDTH_MINUS1:0] mbi_wdata;
119input [ADDR_WIDTH_MINUS1:0] mbi_rd_adr;
120input [ADDR_WIDTH_MINUS1:0] mbi_wr_adr;
121input mbi_wr_en;
122input mbi_rd_en;
123input mbi_run;
124
125input [DATA_WIDTH_MINUS1:0] data_inp; // data_input, via port_B
126input [ADDR_WIDTH_MINUS1:0] addr_rd; // read_address, via port_A
127input [ADDR_WIDTH_MINUS1:0] addr_wt; // write_address, via port_B
128input wt_enable; // write_enable, via port_B
129input cs_rd; // chip_selet_rd_port, i.e., port_A
130input clk;
131output [DATA_WIDTH_MINUS1:0] data_out; // data read out, via port_A
132
133wire [DATA_WIDTH_MINUS1:0] data_out;
134wire scan_out;
135
136wire [6:0] sram_hdr_read_data;
137
138wire [ADDR_WIDTH_MINUS1:0] mux_wr_adr;
139wire mux_wr_en;
140wire [ADDR_WIDTH_MINUS1:0] mux_rd_adr;
141wire mux_rd_en;
142wire [DATA_WIDTH_MINUS1:0] mux_wdata;
143
144 assign mux_wdata = mbi_run ? mbi_wdata : data_inp;
145 assign mux_rd_adr = mbi_run ? mbi_rd_adr : addr_rd;
146 assign mux_wr_adr = mbi_run ? mbi_wr_adr : addr_wt;
147 assign mux_wr_en = mbi_run ? mbi_wr_en : wt_enable;
148 assign mux_rd_en = mbi_run ? mbi_rd_en : cs_rd;
149
150 n2_niu_dp_1024x152s_cust ram_1024x152_0 (
151 .reset (reset),
152 .tcu_aclk (tcu_aclk),
153 .tcu_bclk (tcu_bclk),
154 .tcu_scan_en (tcu_scan_en),
155 .tcu_se_scancollar_in (tcu_se_scancollar_in),
156 .tcu_se_scancollar_out (tcu_se_scancollar_out),
157 .tcu_pce_ov (1'h1),
158 .pce (1'h1),
159 .tcu_array_wr_inhibit (tcu_array_wr_inhibit),
160 .scan_in (scan_in),
161 .scan_out (scan_out),
162 .hdr_sram_rvalue (hdr_sram_rvalue[6:0]),
163 .hdr_sram_rid (hdr_sram_rid[2:0]),
164 .hdr_sram_wr_en (hdr_sram_wr_en),
165 .hdr_sram_red_clr (hdr_sram_red_clr),
166 .sram_hdr_read_data (sram_hdr_read_data[6:0]),
167 .wr_adr (mux_wr_adr[9:0]),
168 .wr_en (mux_wr_en),
169 .rd_adr (mux_rd_adr[9:0]),
170 .rd_en (mux_rd_en),
171 .din (mux_wdata[151:0]),
172 .dout (data_out[151:0]),
173 .l2clk_2x (l2clk_2x),
174 .l2clk (clk)
175 );
176
177endmodule