Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / dmu / rtl / dmu_clu_ctm_datapipe.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: dmu_clu_ctm_datapipe.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_clu_ctm_datapipe
36 (
37 // clock
38 clk,
39 rst_l,
40
41 // jbc : dmc req/resp data port
42 d2j_data,
43 d2j_bmsk,
44 d2j_data_par,
45
46 // diu : data read port
47 di2cl_data,
48 di2cl_bmask,
49 di2cl_dpar,
50
51 // datapath select
52 dpath_sel,
53 ld_diu_data,
54//BP n2 4-28-04
55 proc_pio_err
56 );
57
58 // >>>>>>>>>>>>>>>>>>>>>>>>> Port Declarations <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
59
60 // --------------------------------------------------------
61 // Clock Signal
62 // --------------------------------------------------------
63
64 input clk;
65 input rst_l;
66
67 // --------------------------------------------------------
68 // JBC Interface
69 // --------------------------------------------------------
70
71 // Data Port -> DMC Req/Resp
72 output [(`FIRE_D2J_DATA_WDTH - 1):0] d2j_data;
73 output [(`FIRE_D2J_BMSK_WDTH - 1):0] d2j_bmsk;
74 output [(`FIRE_D2J_DPAR_WDTH - 1):0] d2j_data_par;
75
76 // --------------------------------------------------------
77 // DIU Interface
78 // --------------------------------------------------------
79
80 // Data Buffer Read Port
81 input [(`FIRE_DLC_CRD_DATA_WDTH - 1):0] di2cl_data;
82 input [(`FIRE_DLC_CRD_BMASK_WDTH - 1):0] di2cl_bmask;
83 input [(`FIRE_DLC_CRD_DPAR_WDTH - 1):0] di2cl_dpar;
84
85 // --------------------------------------------------------
86 // Datapath Select
87 // --------------------------------------------------------
88
89 input dpath_sel;
90 input ld_diu_data;
91
92 input proc_pio_err; // force 0 data on pio err cpl
93 // >>>>>>>>>>>>>>>>>>>>>>>>> Data Type Declarations <<<<<<<<<<<<<<<<<<<<<<<<<
94
95 // ~~~~~~~~~~~~~~~~~~~~~~~~~ REGISTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96
97 // ********** Flops **********
98
99 reg [(`FIRE_D2J_DATA_WDTH - 1):0] d2j_data;
100 reg [(`FIRE_D2J_BMSK_WDTH - 1):0] d2j_bmsk;
101 reg [(`FIRE_D2J_DPAR_WDTH - 1):0] d2j_data_par;
102
103 // ********** Non-Flops ******
104
105 reg [(`FIRE_D2J_DATA_WDTH - 1):0] nxt_d2j_data;
106 reg [(`FIRE_D2J_BMSK_WDTH - 1):0] nxt_d2j_bmask;
107 reg [(`FIRE_D2J_DPAR_WDTH - 1):0] nxt_d2j_dpar;
108
109 // >>>>>>>>>>>>>>>>>>>>>>>>> RTL Model <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
110
111 // --------------------------------------------------------
112 // Datapath Mux Select (DIU/Zero-fill)
113 // --------------------------------------------------------
114
115 always @(dpath_sel or di2cl_data or di2cl_bmask or di2cl_dpar or proc_pio_err)
116 begin
117
118 case ((dpath_sel || proc_pio_err)) // synopsys infer_mux
119
120 // DIU datapath
121 1'b0 :
122 begin
123 nxt_d2j_data = di2cl_data;
124 nxt_d2j_bmask = di2cl_bmask;
125 nxt_d2j_dpar = di2cl_dpar;
126 end
127
128 // Zero-fill datapath
129 1'b1 :
130 begin
131 nxt_d2j_data = {`FIRE_D2J_DATA_WDTH{1'b0}};
132 nxt_d2j_bmask = {`FIRE_D2J_BMSK_WDTH{1'b1}};
133 nxt_d2j_dpar = {`FIRE_D2J_DPAR_WDTH{1'b1}};
134 end
135
136 endcase
137 end
138
139 // --------------------------------------------------------
140 // Sequential Logic : datapath regs
141 // --------------------------------------------------------
142
143 always @(posedge clk)
144 if (~rst_l) begin
145 d2j_data <= {`FIRE_D2J_DATA_WDTH{1'b0}};
146 d2j_bmsk <= {`FIRE_D2J_BMSK_WDTH{1'b0}};
147 d2j_data_par <= {`FIRE_D2J_DPAR_WDTH{1'b0}};
148 end
149 else begin
150 if ((ld_diu_data || proc_pio_err))
151 begin
152 d2j_data <= nxt_d2j_data;
153 d2j_bmsk <= nxt_d2j_bmask;
154 d2j_data_par <= nxt_d2j_dpar;
155 end
156 end
157
158endmodule // dmu_clu_ctm_datapipe