1 | // ========== Copyright Header Begin ========================================== |
---|
2 | // |
---|
3 | // OpenSPARC T1 Processor File: swrvr_dlib.v |
---|
4 | // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. |
---|
5 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. |
---|
6 | // |
---|
7 | // The above named program is free software; you can redistribute it and/or |
---|
8 | // modify it under the terms of the GNU General Public |
---|
9 | // License version 2 as published by the Free Software Foundation. |
---|
10 | // |
---|
11 | // The above named program is distributed in the hope that it will be |
---|
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | // General Public License for more details. |
---|
15 | // |
---|
16 | // You should have received a copy of the GNU General Public |
---|
17 | // License along with this work; if not, write to the Free Software |
---|
18 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | // |
---|
20 | // ========== Copyright Header End ============================================ |
---|
21 | // DP library |
---|
22 | |
---|
23 | // 2:1 MUX WITH ENCODED SELECT |
---|
24 | module dp_mux2es (dout, in0, in1, sel) ; |
---|
25 | // synopsys template |
---|
26 | |
---|
27 | parameter SIZE = 1; |
---|
28 | |
---|
29 | output [SIZE-1:0] dout; |
---|
30 | input [SIZE-1:0] in0; |
---|
31 | input [SIZE-1:0] in1; |
---|
32 | input sel; |
---|
33 | |
---|
34 | reg [SIZE-1:0] dout ; |
---|
35 | |
---|
36 | always @ (sel or in0 or in1) |
---|
37 | |
---|
38 | begin |
---|
39 | case (sel) |
---|
40 | 1'b1: dout = in1 ; |
---|
41 | 1'b0: dout = in0; |
---|
42 | default: |
---|
43 | begin |
---|
44 | if (in0 == in1) begin |
---|
45 | dout = in0; |
---|
46 | end |
---|
47 | else |
---|
48 | dout = {SIZE{1'bx}}; |
---|
49 | end |
---|
50 | endcase // case(sel) |
---|
51 | end |
---|
52 | |
---|
53 | endmodule // dp_mux2es |
---|
54 | |
---|
55 | // ---------------------------------------------------------------------- |
---|
56 | |
---|
57 | |
---|
58 | // 4:1 MUX WITH DECODED SELECTS |
---|
59 | module dp_mux4ds (dout, in0, in1, in2, in3, |
---|
60 | sel0_l, sel1_l, sel2_l, sel3_l) ; |
---|
61 | // synopsys template |
---|
62 | |
---|
63 | parameter SIZE = 1; |
---|
64 | |
---|
65 | output [SIZE-1:0] dout; |
---|
66 | input [SIZE-1:0] in0; |
---|
67 | input [SIZE-1:0] in1; |
---|
68 | input [SIZE-1:0] in2; |
---|
69 | input [SIZE-1:0] in3; |
---|
70 | input sel0_l; |
---|
71 | input sel1_l; |
---|
72 | input sel2_l; |
---|
73 | input sel3_l; |
---|
74 | |
---|
75 | // reg declaration does not imply state being maintained |
---|
76 | // across cycles. Used to construct case statement and |
---|
77 | // always updated by inputs every cycle. |
---|
78 | reg [SIZE-1:0] dout ; |
---|
79 | |
---|
80 | `ifdef VERPLEX |
---|
81 | $constraint dl_1c_chk4 ($one_cold ({sel3_l,sel2_l,sel1_l,sel0_l})); |
---|
82 | `endif |
---|
83 | |
---|
84 | wire [3:0] sel = {sel3_l,sel2_l,sel1_l,sel0_l}; // 0in one_cold |
---|
85 | |
---|
86 | always @ (sel0_l or sel1_l or sel2_l or sel3_l or in0 or in1 or in2 or in3) |
---|
87 | |
---|
88 | case ({sel3_l,sel2_l,sel1_l,sel0_l}) |
---|
89 | 4'b1110 : dout = in0 ; |
---|
90 | 4'b1101 : dout = in1 ; |
---|
91 | 4'b1011 : dout = in2 ; |
---|
92 | 4'b0111 : dout = in3 ; |
---|
93 | 4'b1111 : dout = {SIZE{1'bx}} ; |
---|
94 | default : dout = {SIZE{1'bx}} ; |
---|
95 | endcase |
---|
96 | |
---|
97 | endmodule // dp_mux4ds |
---|
98 | |
---|
99 | // ---------------------------------------------------------------------- |
---|
100 | |
---|
101 | |
---|
102 | // 5:1 MUX WITH DECODED SELECTS |
---|
103 | module dp_mux5ds (dout, in0, in1, in2, in3, in4, |
---|
104 | sel0_l, sel1_l, sel2_l, sel3_l, sel4_l) ; |
---|
105 | // synopsys template |
---|
106 | |
---|
107 | parameter SIZE = 1; |
---|
108 | |
---|
109 | output [SIZE-1:0] dout; |
---|
110 | input [SIZE-1:0] in0; |
---|
111 | input [SIZE-1:0] in1; |
---|
112 | input [SIZE-1:0] in2; |
---|
113 | input [SIZE-1:0] in3; |
---|
114 | input [SIZE-1:0] in4; |
---|
115 | input sel0_l; |
---|
116 | input sel1_l; |
---|
117 | input sel2_l; |
---|
118 | input sel3_l; |
---|
119 | input sel4_l; |
---|
120 | |
---|
121 | // reg declaration does not imply state being maintained |
---|
122 | // across cycles. Used to construct case statement and |
---|
123 | // always updated by inputs every cycle. |
---|
124 | reg [SIZE-1:0] dout ; |
---|
125 | |
---|
126 | `ifdef VERPLEX |
---|
127 | $constraint dl_1c_chk5 ($one_cold ({sel4_l,sel3_l,sel2_l,sel1_l,sel0_l})); |
---|
128 | `endif |
---|
129 | |
---|
130 | wire [4:0] sel = {sel4_l,sel3_l,sel2_l,sel1_l,sel0_l}; // 0in one_cold |
---|
131 | |
---|
132 | always @ (sel0_l or sel1_l or sel2_l or sel3_l or sel4_l or |
---|
133 | in0 or in1 or in2 or in3 or in4) |
---|
134 | |
---|
135 | case ({sel4_l,sel3_l,sel2_l,sel1_l,sel0_l}) |
---|
136 | 5'b11110 : dout = in0 ; |
---|
137 | 5'b11101 : dout = in1 ; |
---|
138 | 5'b11011 : dout = in2 ; |
---|
139 | 5'b10111 : dout = in3 ; |
---|
140 | 5'b01111 : dout = in4 ; |
---|
141 | 5'b11111 : dout = {SIZE{1'bx}} ; |
---|
142 | default : dout = {SIZE{1'bx}} ; |
---|
143 | endcase |
---|
144 | |
---|
145 | endmodule // dp_mux5ds |
---|
146 | |
---|
147 | // -------------------------------------------------------------------- |
---|
148 | |
---|
149 | // 8:1 MUX WITH DECODED SELECTS |
---|
150 | module dp_mux8ds (dout, in0, in1, in2, in3, |
---|
151 | in4, in5, in6, in7, |
---|
152 | sel0_l, sel1_l, sel2_l, sel3_l, |
---|
153 | sel4_l, sel5_l, sel6_l, sel7_l) ; |
---|
154 | // synopsys template |
---|
155 | |
---|
156 | parameter SIZE = 1; |
---|
157 | |
---|
158 | output [SIZE-1:0] dout; |
---|
159 | input [SIZE-1:0] in0; |
---|
160 | input [SIZE-1:0] in1; |
---|
161 | input [SIZE-1:0] in2; |
---|
162 | input [SIZE-1:0] in3; |
---|
163 | input [SIZE-1:0] in4; |
---|
164 | input [SIZE-1:0] in5; |
---|
165 | input [SIZE-1:0] in6; |
---|
166 | input [SIZE-1:0] in7; |
---|
167 | input sel0_l; |
---|
168 | input sel1_l; |
---|
169 | input sel2_l; |
---|
170 | input sel3_l; |
---|
171 | input sel4_l; |
---|
172 | input sel5_l; |
---|
173 | input sel6_l; |
---|
174 | input sel7_l; |
---|
175 | |
---|
176 | // reg declaration does not imply state being maintained |
---|
177 | // across cycles. Used to construct case statement and |
---|
178 | // always updated by inputs every cycle. |
---|
179 | reg [SIZE-1:0] dout ; |
---|
180 | |
---|
181 | `ifdef VERPLEX |
---|
182 | $constraint dl_1c_chk8 ($one_cold ({sel7_l,sel6_l,sel5_l,sel4_l, |
---|
183 | sel3_l,sel2_l,sel1_l,sel0_l})); |
---|
184 | `endif |
---|
185 | |
---|
186 | wire [7:0] sel = {sel7_l,sel6_l,sel5_l,sel4_l, |
---|
187 | sel3_l,sel2_l,sel1_l,sel0_l}; // 0in one_cold |
---|
188 | |
---|
189 | always @ (sel0_l or sel1_l or sel2_l or sel3_l or in0 or in1 or in2 or in3 or |
---|
190 | sel4_l or sel5_l or sel6_l or sel7_l or in4 or in5 or in6 or in7) |
---|
191 | |
---|
192 | case ({sel7_l,sel6_l,sel5_l,sel4_l,sel3_l,sel2_l,sel1_l,sel0_l}) |
---|
193 | 8'b11111110 : dout = in0 ; |
---|
194 | 8'b11111101 : dout = in1 ; |
---|
195 | 8'b11111011 : dout = in2 ; |
---|
196 | 8'b11110111 : dout = in3 ; |
---|
197 | 8'b11101111 : dout = in4 ; |
---|
198 | 8'b11011111 : dout = in5 ; |
---|
199 | 8'b10111111 : dout = in6 ; |
---|
200 | 8'b01111111 : dout = in7 ; |
---|
201 | 8'b11111111 : dout = {SIZE{1'bx}} ; |
---|
202 | default : dout = {SIZE{1'bx}} ; |
---|
203 | endcase |
---|
204 | |
---|
205 | endmodule // dp_mux8ds |
---|
206 | |
---|
207 | |
---|
208 | // ---------------------------------------------------------------------- |
---|
209 | |
---|
210 | |
---|
211 | // 3:1 MUX WITH DECODED SELECTS |
---|
212 | module dp_mux3ds (dout, in0, in1, in2, |
---|
213 | sel0_l, sel1_l, sel2_l); |
---|
214 | // synopsys template |
---|
215 | |
---|
216 | parameter SIZE = 1; |
---|
217 | |
---|
218 | output [SIZE-1:0] dout; |
---|
219 | input [SIZE-1:0] in0; |
---|
220 | input [SIZE-1:0] in1; |
---|
221 | input [SIZE-1:0] in2; |
---|
222 | input sel0_l; |
---|
223 | input sel1_l; |
---|
224 | input sel2_l; |
---|
225 | |
---|
226 | // reg declaration does not imply state being maintained |
---|
227 | // across cycles. Used to construct case statement and |
---|
228 | // always updated by inputs every cycle. |
---|
229 | reg [SIZE-1:0] dout ; |
---|
230 | |
---|
231 | `ifdef VERPLEX |
---|
232 | $constraint dl_1c_chk3 ($one_cold ({sel2_l,sel1_l,sel0_l})); |
---|
233 | `endif |
---|
234 | |
---|
235 | wire [2:0] sel = {sel2_l,sel1_l,sel0_l}; // 0in one_cold |
---|
236 | |
---|
237 | always @ (sel0_l or sel1_l or sel2_l or in0 or in1 or in2) |
---|
238 | |
---|
239 | case ({sel2_l,sel1_l,sel0_l}) |
---|
240 | 3'b110 : dout = in0 ; |
---|
241 | 3'b101 : dout = in1 ; |
---|
242 | 3'b011 : dout = in2 ; |
---|
243 | default : dout = {SIZE{1'bx}} ; |
---|
244 | endcase |
---|
245 | |
---|
246 | endmodule // dp_mux3ds |
---|
247 | |
---|
248 | // ---------------------------------------------------------------------- |
---|
249 | |
---|
250 | |
---|
251 | module dp_buffer(dout, in); |
---|
252 | // synopsys template |
---|
253 | |
---|
254 | parameter SIZE = 1; |
---|
255 | |
---|
256 | output [SIZE-1:0] dout; |
---|
257 | input [SIZE-1:0] in; |
---|
258 | |
---|
259 | assign dout = in; |
---|
260 | |
---|
261 | endmodule // dp_buffer |
---|
262 | |
---|
263 | |
---|
264 | |
---|
265 | |
---|
266 | |
---|
267 | |
---|
268 | |
---|
269 | |
---|
270 | |
---|