Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / dmu / rtl / dmu_psb_default_grp.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: dmu_psb_default_grp.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 dmu_psb_default_grp
36 (
37 clk,
38 psb_dma_ext_select,
39 psb_dma_select,
40 psb_dma_ext_read_data,
41 psb_dma_ext_done,
42 psb_pio_ext_select,
43 psb_pio_select,
44 psb_pio_ext_read_data,
45 psb_pio_ext_done,
46 rst_l,
47 ext_addr_in,
48 ext_addr_out,
49 read_data_0_out,
50 ext_done_0_out
51 );
52
53//====================================================
54// Polarity declarations
55//====================================================
56input clk; // Clock signal
57output psb_dma_ext_select; // When set, register psb_dma is selected. This
58 // signal is a level.
59input psb_dma_select; // select
60input [`FIRE_CSRBUS_DATA_WIDTH - 1:0] psb_dma_ext_read_data; // Read Data
61input psb_dma_ext_done; // ExtDone
62output psb_pio_ext_select; // When set, register psb_pio is selected. This
63 // signal is a level.
64input psb_pio_select; // select
65input [`FIRE_CSRBUS_DATA_WIDTH - 1:0] psb_pio_ext_read_data; // Read Data
66input psb_pio_ext_done; // ExtDone
67input rst_l; // HW reset
68input [4:0] ext_addr_in; // Ext addr
69output [4:0] ext_addr_out; // Ext addr
70output [`FIRE_CSRBUS_DATA_WIDTH - 1:0] read_data_0_out; // Read Data
71output ext_done_0_out; // Ext Done
72
73//====================================================
74// Type declarations
75//====================================================
76wire clk; // Clock signal
77wire psb_dma_ext_select; // When set, register psb_dma is selected. This signal
78 // is a level.
79wire psb_dma_select; // select
80wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] psb_dma_ext_read_data; // Read Data
81wire psb_dma_ext_done; // ExtDone
82wire psb_pio_ext_select; // When set, register psb_pio is selected. This signal
83 // is a level.
84wire psb_pio_select; // select
85wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] psb_pio_ext_read_data; // Read Data
86wire psb_pio_ext_done; // ExtDone
87wire rst_l; // HW reset
88wire [4:0] ext_addr_in; // Ext addr
89wire [4:0] ext_addr_out; // Ext addr
90wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] read_data_0_out; // Read Data
91reg ext_done_0_out; // Ext Done
92
93
94//====================================================
95// Local signals
96//====================================================
97
98//====================================================
99// Pipelining (First stage)
100//====================================================
101//----- delayed select for ext_select
102reg psb_dma_select_piped;
103reg psb_pio_select_piped;
104
105always @(posedge clk)
106 begin
107 if(~rst_l)
108 begin
109 ext_done_0_out <= 1'b0;
110 psb_dma_select_piped <= 1'b0;
111 psb_pio_select_piped <= 1'b0;
112 end
113 else
114 begin
115 ext_done_0_out <=
116 psb_dma_ext_done |
117 psb_pio_ext_done;
118
119 psb_dma_select_piped <= psb_dma_select;
120 psb_pio_select_piped <= psb_pio_select;
121 end
122 end
123
124//====================================================
125// Assignments only (first stage)
126//====================================================
127assign ext_addr_out = ext_addr_in;
128
129//====================================================
130// Automatic hw_ld / hw_write
131//====================================================
132
133//====================================================
134// Extern select
135//====================================================
136assign psb_dma_ext_select =
137 psb_dma_select_piped;
138
139assign psb_pio_ext_select =
140 psb_pio_select_piped;
141
142
143//=====================================================
144// OUTPUT: read_data_out
145//=====================================================
146dmu_psb_csrpipe_2 dmu_psb_csrpipe_2_inst_1
147 (
148 .clk (clk),
149 .rst_l (rst_l),
150 .reg_in (1'b1),
151 .reg_out (1'b1),
152 .data0 (psb_dma_ext_read_data),
153 .sel0 (psb_dma_select),
154 .data1 (psb_pio_ext_read_data),
155 .sel1 (psb_pio_select),
156 .out (read_data_0_out)
157 );
158
159
160//====================================================
161// Instantiation of registers
162//====================================================
163
164endmodule // dmu_psb_default_grp