source: XOpenSparcT1/trunk/T1-CPU/lsu/lsu_stb_ctldp.v @ 6

Revision 6, 9.8 KB checked in by pntsvt00, 13 years ago (diff)

versione iniziale opensparc

Line 
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T1 Processor File: lsu_stb_ctldp.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//FPGA_SYN enables all FPGA related modifications
22`ifdef FPGA_SYN 
23`define FPGA_SYN_CLK_EN
24`define FPGA_SYN_CLK_DFF
25`endif
26
27module lsu_stb_ctldp (/*AUTOARG*/
28   // Outputs
29   so, stb_state_si_0, stb_state_si_1, stb_state_si_2, 
30   stb_state_si_3, stb_state_si_4, stb_state_si_5, stb_state_si_6, 
31   stb_state_si_7, stb_state_rtype_0, stb_state_rtype_1, 
32   stb_state_rtype_2, stb_state_rtype_3, stb_state_rtype_4, 
33   stb_state_rtype_5, stb_state_rtype_6, stb_state_rtype_7, 
34   stb_state_rmo, 
35   // Inputs
36   rclk, si, se, stb_clk_en_l, lsu_stb_va_m, lsu_st_rq_type_m, 
37   lsu_st_rmo_m
38   );
39   
40   input rclk;
41   input si;
42   input se;
43//   input tmb_l;
44
45   output so;
46   
47   input [7:0] stb_clk_en_l;
48
49   input [7:6] lsu_stb_va_m;
50   input [2:1] lsu_st_rq_type_m;
51   input       lsu_st_rmo_m;
52
53   output [3:2] stb_state_si_0;
54   output [3:2] stb_state_si_1;
55   output [3:2] stb_state_si_2;
56   output [3:2] stb_state_si_3;
57   output [3:2] stb_state_si_4;
58   output [3:2] stb_state_si_5;
59   output [3:2] stb_state_si_6;
60   output [3:2] stb_state_si_7;
61
62   output [2:1] stb_state_rtype_0;
63   output [2:1] stb_state_rtype_1;
64   output [2:1] stb_state_rtype_2;
65   output [2:1] stb_state_rtype_3;
66   output [2:1] stb_state_rtype_4;
67   output [2:1] stb_state_rtype_5;
68   output [2:1] stb_state_rtype_6;
69   output [2:1] stb_state_rtype_7;
70
71   output [7:0] stb_state_rmo;
72   
73
74   wire [7:0] stb_clk;
75
76   wire       clk;
77   assign     clk = rclk;
78   
79`ifdef FPGA_SYN_CLK_EN
80`else
81   clken_buf stb0_clkbuf (
82                .rclk   (clk),
83                .enb_l  (stb_clk_en_l[0]),
84                .tmb_l  (~se),
85                .clk    (stb_clk[0])
86                ) ;
87`endif
88
89`ifdef FPGA_SYN_CLK_EN
90`else
91   clken_buf stb1_clkbuf (
92                .rclk   (clk),
93                .enb_l  (stb_clk_en_l[1]),
94                .tmb_l  (~se),
95                .clk    (stb_clk[1])
96                ) ;
97`endif
98
99`ifdef FPGA_SYN_CLK_EN
100`else
101   clken_buf stb2_clkbuf (
102                .rclk   (clk),
103                .enb_l  (stb_clk_en_l[2]),
104                .tmb_l  (~se),
105                .clk    (stb_clk[2])
106                ) ;
107`endif
108
109`ifdef FPGA_SYN_CLK_EN
110`else
111   clken_buf stb3_clkbuf (
112                .rclk   (clk),
113                .enb_l  (stb_clk_en_l[3]),
114                .tmb_l  (~se),
115                .clk    (stb_clk[3])
116                ) ;
117`endif
118
119`ifdef FPGA_SYN_CLK_EN
120`else
121   clken_buf stb4_clkbuf (
122                .rclk   (clk),
123                .enb_l  (stb_clk_en_l[4]),
124                .tmb_l  (~se),
125                .clk    (stb_clk[4])
126                ) ;
127`endif
128
129`ifdef FPGA_SYN_CLK_EN
130`else
131   clken_buf stb5_clkbuf (
132                .rclk   (clk),
133                .enb_l  (stb_clk_en_l[5]),
134                .tmb_l  (~se),
135                .clk    (stb_clk[5])
136                ) ;
137`endif
138
139`ifdef FPGA_SYN_CLK_EN
140`else
141   clken_buf stb6_clkbuf (
142                .rclk   (clk),
143                .enb_l  (stb_clk_en_l[6]),
144                .tmb_l  (~se),
145                .clk    (stb_clk[6])
146                ) ;
147`endif
148
149`ifdef FPGA_SYN_CLK_EN
150`else
151   clken_buf stb7_clkbuf (
152                .rclk   (clk),
153                .enb_l  (stb_clk_en_l[7]),
154                .tmb_l  (~se),
155                .clk    (stb_clk[7])
156                ) ;
157`endif
158
159   
160   
161`ifdef FPGA_SYN_CLK_DFF
162  dffe_s #(5)  ff_spec_write_0         (
163        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
164                                      lsu_st_rmo_m}),
165        .q      ({stb_state_si_0[3:2], stb_state_rtype_0[2:1],     
166                                       stb_state_rmo[0]}    ),
167        .en (~(stb_clk_en_l[0])), .clk(clk),
168        .se     (se), .si (), .so ()
169        );
170`else
171  dff_s #(5)  ff_spec_write_0         (
172        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
173                                      lsu_st_rmo_m}),
174        .q      ({stb_state_si_0[3:2], stb_state_rtype_0[2:1],     
175                                       stb_state_rmo[0]}    ),
176        .clk    (stb_clk[0]),
177        .se     (se), .si (), .so ()
178        );
179`endif
180
181`ifdef FPGA_SYN_CLK_DFF
182  dffe_s #(5)  ff_spec_write_1         (
183        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
184                                      lsu_st_rmo_m}),
185        .q      ({stb_state_si_1[3:2], stb_state_rtype_1[2:1],     
186                                   stb_state_rmo[1]}    ),
187        .en (~(stb_clk_en_l[1])), .clk(clk),
188        .se     (se), .si (), .so ()
189        );
190`else
191  dff_s #(5)  ff_spec_write_1         (
192        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
193                                      lsu_st_rmo_m}),
194        .q      ({stb_state_si_1[3:2], stb_state_rtype_1[2:1],     
195                                   stb_state_rmo[1]}    ),
196        .clk    (stb_clk[1]),
197        .se     (se), .si (), .so ()
198        );
199`endif
200
201`ifdef FPGA_SYN_CLK_DFF
202  dffe_s #(5)  ff_spec_write_2         (
203        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
204                                    lsu_st_rmo_m}),
205        .q      ({stb_state_si_2[3:2], stb_state_rtype_2[2:1],     
206                                   stb_state_rmo[2]}    ),
207        .en (~(stb_clk_en_l[2])), .clk(clk),
208        .se     (se), .si (), .so ()
209        );
210`else
211  dff_s #(5)  ff_spec_write_2         (
212        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
213                                    lsu_st_rmo_m}),
214        .q      ({stb_state_si_2[3:2], stb_state_rtype_2[2:1],     
215                                   stb_state_rmo[2]}    ),
216        .clk    (stb_clk[2]),
217        .se     (se), .si (), .so ()
218        );
219`endif
220`ifdef FPGA_SYN_CLK_DFF
221  dffe_s #(5)  ff_spec_write_3         (
222        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
223                                    lsu_st_rmo_m}),
224        .q      ({stb_state_si_3[3:2], stb_state_rtype_3[2:1],     
225                                   stb_state_rmo[3]}    ),
226        .en (~(stb_clk_en_l[3])), .clk(clk),
227        .se     (se), .si (), .so ()
228        );
229`else
230  dff_s #(5)  ff_spec_write_3         (
231        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
232                                    lsu_st_rmo_m}),
233        .q      ({stb_state_si_3[3:2], stb_state_rtype_3[2:1],     
234                                   stb_state_rmo[3]}    ),
235        .clk    (stb_clk[3]),
236        .se     (se), .si (), .so ()
237        );
238`endif
239`ifdef FPGA_SYN_CLK_DFF
240  dffe_s #(5)  ff_spec_write_4         (
241        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
242                                    lsu_st_rmo_m}),
243        .q      ({stb_state_si_4[3:2], stb_state_rtype_4[2:1],     
244                                   stb_state_rmo[4]}    ),
245        .en (~(stb_clk_en_l[4])), .clk(clk),
246        .se     (se), .si (), .so ()
247        );
248`else
249  dff_s #(5)  ff_spec_write_4         (
250        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
251                                    lsu_st_rmo_m}),
252        .q      ({stb_state_si_4[3:2], stb_state_rtype_4[2:1],     
253                                   stb_state_rmo[4]}    ),
254        .clk    (stb_clk[4]),
255        .se     (se), .si (), .so ()
256        );
257`endif
258`ifdef FPGA_SYN_CLK_DFF
259  dffe_s #(5)  ff_spec_write_5         (
260        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
261                                    lsu_st_rmo_m}),
262        .q      ({stb_state_si_5[3:2], stb_state_rtype_5[2:1],     
263                                   stb_state_rmo[5]}    ),
264        .en (~(stb_clk_en_l[5])), .clk(clk),
265        .se     (se), .si (), .so ()
266        );
267`else
268  dff_s #(5)  ff_spec_write_5         (
269        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
270                                    lsu_st_rmo_m}),
271        .q      ({stb_state_si_5[3:2], stb_state_rtype_5[2:1],     
272                                   stb_state_rmo[5]}    ),
273        .clk    (stb_clk[5]),
274        .se     (se), .si (), .so ()
275        );
276`endif
277`ifdef FPGA_SYN_CLK_DFF
278  dffe_s #(5)  ff_spec_write_6         (
279        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
280                                    lsu_st_rmo_m}),
281        .q      ({stb_state_si_6[3:2], stb_state_rtype_6[2:1],     
282                                   stb_state_rmo[6]}    ),
283        .en (~(stb_clk_en_l[6])), .clk(clk),
284        .se     (se), .si (), .so ()
285        );
286`else
287  dff_s #(5)  ff_spec_write_6         (
288        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
289                                    lsu_st_rmo_m}),
290        .q      ({stb_state_si_6[3:2], stb_state_rtype_6[2:1],     
291                                   stb_state_rmo[6]}    ),
292        .clk    (stb_clk[6]),
293        .se     (se), .si (), .so ()
294        );
295`endif
296
297`ifdef FPGA_SYN_CLK_DFF
298  dffe_s #(5)  ff_spec_write_7         (
299        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
300                                    lsu_st_rmo_m}),
301        .q      ({stb_state_si_7[3:2], stb_state_rtype_7[2:1],     
302                             stb_state_rmo[7]}    ),
303        .en (~(stb_clk_en_l[7])), .clk(clk),
304        .se     (se), .si (), .so ()
305        );
306`else
307  dff_s #(5)  ff_spec_write_7         (
308        .din    ({lsu_stb_va_m[7:6], lsu_st_rq_type_m[2:1], 
309                                    lsu_st_rmo_m}),
310        .q      ({stb_state_si_7[3:2], stb_state_rtype_7[2:1],     
311                             stb_state_rmo[7]}    ),
312        .clk    (stb_clk[7]),
313        .se     (se), .si (), .so ()
314        );
315`endif
316
317
318endmodule // lsu_stb_ctldp
Note: See TracBrowser for help on using the repository browser.