1 | /* |
---|
2 | * Simply RISC S1 Core Top-Level |
---|
3 | * |
---|
4 | * (C) 2007 Simply RISC LLP |
---|
5 | * AUTHOR: Fabrizio Fazzino <fabrizio.fazzino@srisc.com> |
---|
6 | * |
---|
7 | * LICENSE: |
---|
8 | * This is a Free Hardware Design; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * version 2 as published by the Free Software Foundation. |
---|
11 | * The above named program is distributed in the hope that it will |
---|
12 | * be useful, but WITHOUT ANY WARRANTY; without even the implied |
---|
13 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
14 | * See the GNU General Public License for more details. |
---|
15 | * |
---|
16 | * DESCRIPTION: |
---|
17 | * This block implements the top-level of the S1 Core. |
---|
18 | * It is just a schematic with four instances: |
---|
19 | * 1) one single SPARC Core of the OpenSPARC T1; |
---|
20 | * 2) a SPARC Core to Wishbone Master bridge; |
---|
21 | * 3) a Reset Controller; |
---|
22 | * 4) an Interrupt Controller. |
---|
23 | * |
---|
24 | */ |
---|
25 | |
---|
26 | module s1_top ( |
---|
27 | input sys_clock_i, |
---|
28 | input sys_reset_i, |
---|
29 | |
---|
30 | input eth_irq_i, |
---|
31 | |
---|
32 | input wbm_ack_i, |
---|
33 | input [63:0] wbm_data_i, |
---|
34 | output wbm_cycle_o, |
---|
35 | output wbm_strobe_o, |
---|
36 | output wbm_we_o, |
---|
37 | output [63:0] wbm_addr_o, |
---|
38 | output [63:0] wbm_data_o, |
---|
39 | output [ 7:0] wbm_sel_o |
---|
40 | ); |
---|
41 | /* |
---|
42 | * Wires |
---|
43 | */ |
---|
44 | |
---|
45 | // Wires connected to SPARC Core outputs |
---|
46 | |
---|
47 | // pcx |
---|
48 | wire [4:0] spc_pcx_req_pq; // processor to pcx request |
---|
49 | wire spc_pcx_atom_pq; // processor to pcx atomic request |
---|
50 | wire [123:0] spc_pcx_data_pa; // processor to pcx packet |
---|
51 | wire [4:0] spc1_pcx_req_pq; // processor to pcx request |
---|
52 | wire spc1_pcx_atom_pq; // processor to pcx atomic request |
---|
53 | wire [123:0] spc1_pcx_data_pa; // processor to pcx packet |
---|
54 | |
---|
55 | // shadow scan |
---|
56 | wire spc_sscan_so; // From ifu of sparc_ifu.v |
---|
57 | wire spc_scanout0; // From test_stub of test_stub_bist.v |
---|
58 | wire spc_scanout1; // From test_stub of test_stub_bist.v |
---|
59 | |
---|
60 | // bist |
---|
61 | wire tst_ctu_mbist_done; // From test_stub of test_stub_two_bist.v |
---|
62 | wire tst_ctu_mbist_fail; // From test_stub of test_stub_two_bist.v |
---|
63 | |
---|
64 | // fuse |
---|
65 | wire spc_efc_ifuse_data; // From ifu of sparc_ifu.v |
---|
66 | wire spc_efc_dfuse_data; // From ifu of sparc_ifu.v |
---|
67 | |
---|
68 | // Wires connected to SPARC Core inputs |
---|
69 | |
---|
70 | // cpx interface |
---|
71 | wire [4:0] pcx_spc_grant_px; // pcx to processor grant info |
---|
72 | wire cpx_spc_data_rdy_cx2; // cpx data inflight to sparc |
---|
73 | wire [144:0] cpx_spc_data_cx2; // cpx to sparc data packet |
---|
74 | wire [4:0] pcx1_spc_grant_px; // pcx to processor grant info |
---|
75 | wire cpx1_spc_data_rdy_cx2; // cpx data inflight to sparc |
---|
76 | wire [144:0] cpx1_spc_data_cx2; // cpx to sparc data packet |
---|
77 | |
---|
78 | wire [3:0] const_cpuid; |
---|
79 | wire [3:0] const_cpuid1; |
---|
80 | wire [7:0] const_maskid; // To ifu of sparc_ifu.v |
---|
81 | |
---|
82 | // sscan |
---|
83 | wire ctu_tck; // To ifu of sparc_ifu.v |
---|
84 | wire ctu_sscan_se; // To ifu of sparc_ifu.v |
---|
85 | wire ctu_sscan_snap; // To ifu of sparc_ifu.v |
---|
86 | wire [3:0] ctu_sscan_tid; // To ifu of sparc_ifu.v |
---|
87 | |
---|
88 | // bist |
---|
89 | wire ctu_tst_mbist_enable; // To test_stub of test_stub_bist.v |
---|
90 | |
---|
91 | // efuse |
---|
92 | wire efc_spc_fuse_clk1; |
---|
93 | wire efc_spc_fuse_clk2; |
---|
94 | wire efc_spc_ifuse_ashift; |
---|
95 | wire efc_spc_ifuse_dshift; |
---|
96 | wire efc_spc_ifuse_data; |
---|
97 | wire efc_spc_dfuse_ashift; |
---|
98 | wire efc_spc_dfuse_dshift; |
---|
99 | wire efc_spc_dfuse_data; |
---|
100 | |
---|
101 | // scan and macro test |
---|
102 | wire ctu_tst_macrotest; // To test_stub of test_stub_bist.v |
---|
103 | wire ctu_tst_scan_disable; // To test_stub of test_stub_bist.v |
---|
104 | wire ctu_tst_short_chain; // To test_stub of test_stub_bist.v |
---|
105 | wire global_shift_enable; // To test_stub of test_stub_two_bist.v |
---|
106 | wire ctu_tst_scanmode; // To test_stub of test_stub_two_bist.v |
---|
107 | wire spc_scanin0; |
---|
108 | wire spc_scanin1; |
---|
109 | |
---|
110 | // clk |
---|
111 | wire cluster_cken; // To spc_hdr of cluster_header.v |
---|
112 | wire gclk; // To spc_hdr of cluster_header.v |
---|
113 | |
---|
114 | // reset |
---|
115 | wire cmp_grst_l; |
---|
116 | wire cmp_arst_l; |
---|
117 | wire ctu_tst_pre_grst_l; // To test_stub of test_stub_bist.v |
---|
118 | |
---|
119 | wire adbginit_l; // To spc_hdr of cluster_header.v |
---|
120 | wire gdbginit_l; // To spc_hdr of cluster_header.v |
---|
121 | |
---|
122 | // Reset signal from the reset controller to the bridge |
---|
123 | wire sys_reset_final; |
---|
124 | |
---|
125 | // Interrupt Source from the interrupt controller to the bridge |
---|
126 | |
---|
127 | /* |
---|
128 | * SPARC Core module instance |
---|
129 | */ |
---|
130 | reg [ 4:0] pcx_spc_grant_px_fifo; |
---|
131 | reg [ 4:0] pcx1_spc_grant_px_fifo; |
---|
132 | |
---|
133 | sparc sparc_0 ( |
---|
134 | |
---|
135 | // Wires connected to SPARC Core outputs |
---|
136 | .spc_pcx_req_pq(spc_pcx_req_pq), |
---|
137 | .spc_pcx_atom_pq(spc_pcx_atom_pq), |
---|
138 | .spc_pcx_data_pa(spc_pcx_data_pa), |
---|
139 | //.spc_sscan_so(spc_sscan_so), |
---|
140 | //.spc_scanout0(spc_scanout0), |
---|
141 | //.spc_scanout1(spc_scanout1), |
---|
142 | //sal: controllare se in sintesi questi 4 segnali danno problemi!!! |
---|
143 | .tst_ctu_mbist_done(), |
---|
144 | .tst_ctu_mbist_fail(), |
---|
145 | .spc_efc_ifuse_data(), |
---|
146 | .spc_efc_dfuse_data(), |
---|
147 | // |
---|
148 | // Wires connected to SPARC Core inputs |
---|
149 | .pcx_spc_grant_px(pcx_spc_grant_px), |
---|
150 | .cpx_spc_data_rdy_cx2(cpx_spc_data_rdy_cx2), |
---|
151 | .cpx_spc_data_cx2(cpx_spc_data_cx2), |
---|
152 | .const_cpuid(const_cpuid), |
---|
153 | .const_maskid(const_maskid), |
---|
154 | .ctu_tck(ctu_tck), |
---|
155 | .ctu_sscan_se(ctu_sscan_se), |
---|
156 | .ctu_sscan_snap(ctu_sscan_snap), |
---|
157 | .ctu_sscan_tid(ctu_sscan_tid), |
---|
158 | .ctu_tst_mbist_enable(ctu_tst_mbist_enable), |
---|
159 | .efc_spc_fuse_clk1(efc_spc_fuse_clk1), |
---|
160 | .efc_spc_fuse_clk2(efc_spc_fuse_clk2), |
---|
161 | .efc_spc_ifuse_ashift(efc_spc_ifuse_ashift), |
---|
162 | .efc_spc_ifuse_dshift(efc_spc_ifuse_dshift), |
---|
163 | .efc_spc_ifuse_data(efc_spc_ifuse_data), |
---|
164 | .efc_spc_dfuse_ashift(efc_spc_dfuse_ashift), |
---|
165 | .efc_spc_dfuse_dshift(efc_spc_dfuse_dshift), |
---|
166 | .efc_spc_dfuse_data(efc_spc_dfuse_data), |
---|
167 | .ctu_tst_macrotest(ctu_tst_macrotest), |
---|
168 | .ctu_tst_scan_disable(ctu_tst_scan_disable), |
---|
169 | .ctu_tst_short_chain(ctu_tst_short_chain), |
---|
170 | .global_shift_enable(global_shift_enable), |
---|
171 | .ctu_tst_scanmode(ctu_tst_scanmode), |
---|
172 | .spc_scanin0(spc_scanin0), |
---|
173 | .spc_scanin1(spc_scanin1), |
---|
174 | .cluster_cken(cluster_cken), |
---|
175 | .gclk(gclk), |
---|
176 | .cmp_grst_l(cmp_grst_l), |
---|
177 | .cmp_arst_l(cmp_arst_l), |
---|
178 | .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l), |
---|
179 | .adbginit_l(adbginit_l), |
---|
180 | .gdbginit_l(gdbginit_l) |
---|
181 | |
---|
182 | ); |
---|
183 | /* |
---|
184 | sparc sparc_1 ( |
---|
185 | |
---|
186 | // Wires connected to SPARC Core outputs |
---|
187 | .spc_pcx_req_pq(spc1_pcx_req_pq), |
---|
188 | .spc_pcx_atom_pq(spc1_pcx_atom_pq), |
---|
189 | .spc_pcx_data_pa(spc1_pcx_data_pa), |
---|
190 | //.spc_sscan_so(spc_sscan_so), |
---|
191 | //.spc_scanout0(spc_scanout0), |
---|
192 | //.spc_scanout1(spc_scanout1), |
---|
193 | //.tst_ctu_mbist_done(tst_ctu_mbist_done), |
---|
194 | //.tst_ctu_mbist_fail(tst_ctu_mbist_fail), |
---|
195 | //.spc_efc_ifuse_data(spc_efc_ifuse_data), |
---|
196 | //.spc_efc_dfuse_data(spc_efc_dfuse_data), |
---|
197 | |
---|
198 | // Wires connected to SPARC Core inputs |
---|
199 | .pcx_spc_grant_px(pcx1_spc_grant_px), |
---|
200 | .cpx_spc_data_rdy_cx2(cpx1_spc_data_rdy_cx2), |
---|
201 | .cpx_spc_data_cx2(cpx1_spc_data_cx2), |
---|
202 | .const_cpuid(const_cpuid1), |
---|
203 | .const_maskid(const_maskid), |
---|
204 | .ctu_tck(ctu_tck), |
---|
205 | .ctu_sscan_se(ctu_sscan_se), |
---|
206 | .ctu_sscan_snap(ctu_sscan_snap), |
---|
207 | .ctu_sscan_tid(ctu_sscan_tid), |
---|
208 | .ctu_tst_mbist_enable(ctu_tst_mbist_enable), |
---|
209 | .efc_spc_fuse_clk1(efc_spc_fuse_clk1), |
---|
210 | .efc_spc_fuse_clk2(efc_spc_fuse_clk2), |
---|
211 | .efc_spc_ifuse_ashift(efc_spc_ifuse_ashift), |
---|
212 | .efc_spc_ifuse_dshift(efc_spc_ifuse_dshift), |
---|
213 | .efc_spc_ifuse_data(efc_spc_ifuse_data), |
---|
214 | .efc_spc_dfuse_ashift(efc_spc_dfuse_ashift), |
---|
215 | .efc_spc_dfuse_dshift(efc_spc_dfuse_dshift), |
---|
216 | .efc_spc_dfuse_data(efc_spc_dfuse_data), |
---|
217 | .ctu_tst_macrotest(ctu_tst_macrotest), |
---|
218 | .ctu_tst_scan_disable(ctu_tst_scan_disable), |
---|
219 | .ctu_tst_short_chain(ctu_tst_short_chain), |
---|
220 | .global_shift_enable(global_shift_enable), |
---|
221 | .ctu_tst_scanmode(ctu_tst_scanmode), |
---|
222 | .spc_scanin0(spc_scanin0), |
---|
223 | .spc_scanin1(spc_scanin1), |
---|
224 | .cluster_cken(cluster_cken), |
---|
225 | .gclk(gclk), |
---|
226 | .cmp_grst_l(cmp_grst_l), |
---|
227 | .cmp_arst_l(cmp_arst_l), |
---|
228 | .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l), |
---|
229 | .adbginit_l(adbginit_l), |
---|
230 | .gdbginit_l(gdbginit_l) |
---|
231 | |
---|
232 | ); |
---|
233 | */ |
---|
234 | /* |
---|
235 | * SPARC Core to Wishbone Master bridge |
---|
236 | */ |
---|
237 | |
---|
238 | wire fp_req; |
---|
239 | wire [123:0] fp_pcx; |
---|
240 | wire [ 7:0] fp_rdy; |
---|
241 | wire [144:0] fp_cpx; |
---|
242 | |
---|
243 | //os2wb_dual os2wb_inst ( |
---|
244 | os2wb os2wb_inst ( |
---|
245 | .clk(sys_clock_i), |
---|
246 | .rstn(~sys_reset_final), |
---|
247 | |
---|
248 | .pcx_req(spc_pcx_req_pq), |
---|
249 | .pcx_atom(spc_pcx_atom_pq), |
---|
250 | .pcx_data(spc_pcx_data_pa), |
---|
251 | .pcx_grant(pcx_spc_grant_px), |
---|
252 | .cpx_ready(cpx_spc_data_rdy_cx2), |
---|
253 | .cpx_packet(cpx_spc_data_cx2), |
---|
254 | |
---|
255 | //.pcx1_req(spc1_pcx_req_pq), |
---|
256 | //.pcx1_atom(spc1_pcx_atom_pq), |
---|
257 | //.pcx1_data(spc1_pcx_data_pa), |
---|
258 | //.pcx1_grant(pcx1_spc_grant_px), |
---|
259 | //.cpx1_ready(cpx1_spc_data_rdy_cx2), |
---|
260 | //.cpx1_packet(cpx1_spc_data_cx2), |
---|
261 | |
---|
262 | .wb_data_i(wbm_data_i), |
---|
263 | .wb_ack(wbm_ack_i), |
---|
264 | .wb_cycle(wbm_cycle_o), |
---|
265 | .wb_strobe(wbm_strobe_o), |
---|
266 | .wb_we(wbm_we_o), |
---|
267 | .wb_sel(wbm_sel_o), |
---|
268 | .wb_addr(wbm_addr_o), |
---|
269 | .wb_data_o(wbm_data_o), |
---|
270 | |
---|
271 | .fp_pcx(fp_pcx), |
---|
272 | .fp_req(fp_req), |
---|
273 | .fp_cpx(fp_cpx), |
---|
274 | .fp_rdy(fp_rdy!=8'h00), |
---|
275 | |
---|
276 | .eth_int(1'b0/*eth_irq_i*/) |
---|
277 | ); |
---|
278 | |
---|
279 | // FPU |
---|
280 | fpu fpu_inst( |
---|
281 | .pcx_fpio_data_rdy_px2(fp_req), |
---|
282 | .pcx_fpio_data_px2(fp_pcx), |
---|
283 | .arst_l(cmp_arst_l), |
---|
284 | .grst_l(cmp_grst_l), |
---|
285 | .gclk(gclk), |
---|
286 | .cluster_cken(cluster_cken), |
---|
287 | |
---|
288 | .fp_cpx_req_cq(fp_rdy), |
---|
289 | .fp_cpx_data_ca(fp_cpx), |
---|
290 | |
---|
291 | .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l), |
---|
292 | .global_shift_enable(global_shift_enable), |
---|
293 | .ctu_tst_scan_disable(ctu_tst_scan_disable), |
---|
294 | .ctu_tst_scanmode(ctu_tst_scanmode), |
---|
295 | .ctu_tst_macrotest(ctu_tst_macrotest), |
---|
296 | .ctu_tst_short_chain(ctu_tst_short_chain), |
---|
297 | |
---|
298 | .si(1'b0), |
---|
299 | .so() |
---|
300 | ); |
---|
301 | |
---|
302 | /* |
---|
303 | * Reset Controller |
---|
304 | */ |
---|
305 | |
---|
306 | rst_ctrl rst_ctrl_0 ( |
---|
307 | |
---|
308 | // Top-level system inputs |
---|
309 | .sys_clock_i(sys_clock_i), |
---|
310 | .sys_reset_i(sys_reset_i), |
---|
311 | |
---|
312 | // Reset Controller outputs connected to SPARC Core inputs |
---|
313 | .cluster_cken_o(cluster_cken), |
---|
314 | .gclk_o(gclk), |
---|
315 | .cmp_grst_o(cmp_grst_l), |
---|
316 | .cmp_arst_o(cmp_arst_l), |
---|
317 | .ctu_tst_pre_grst_o(ctu_tst_pre_grst_l), |
---|
318 | .adbginit_o(adbginit_l), |
---|
319 | .gdbginit_o(gdbginit_l), |
---|
320 | .sys_reset_final_o(sys_reset_final) |
---|
321 | |
---|
322 | ); |
---|
323 | |
---|
324 | /* |
---|
325 | * Continuous assignments |
---|
326 | */ |
---|
327 | |
---|
328 | assign const_cpuid = 4'h0; |
---|
329 | assign const_cpuid1 = 4'h1; |
---|
330 | assign const_maskid = 8'h20; |
---|
331 | |
---|
332 | // sscan |
---|
333 | assign ctu_tck = 1'b0; |
---|
334 | assign ctu_sscan_se = 1'b0; |
---|
335 | assign ctu_sscan_snap = 1'b0; |
---|
336 | assign ctu_sscan_tid = 4'h1; |
---|
337 | |
---|
338 | // bist |
---|
339 | assign ctu_tst_mbist_enable = 1'b0; |
---|
340 | |
---|
341 | // efuse |
---|
342 | assign efc_spc_fuse_clk1 = 1'b0; // Activity |
---|
343 | assign efc_spc_fuse_clk2 = 1'b0; // Activity |
---|
344 | assign efc_spc_ifuse_ashift = 1'b0; |
---|
345 | assign efc_spc_ifuse_dshift = 1'b0; |
---|
346 | assign efc_spc_ifuse_data = 1'b0; // Activity |
---|
347 | assign efc_spc_dfuse_ashift = 1'b0; |
---|
348 | assign efc_spc_dfuse_dshift = 1'b0; |
---|
349 | assign efc_spc_dfuse_data = 1'b0; // Activity |
---|
350 | |
---|
351 | // scan and macro test |
---|
352 | assign ctu_tst_macrotest = 1'b0; |
---|
353 | assign ctu_tst_scan_disable = 1'b0; |
---|
354 | assign ctu_tst_short_chain = 1'b0; |
---|
355 | assign global_shift_enable = 1'b0; |
---|
356 | assign ctu_tst_scanmode = 1'b0; |
---|
357 | assign spc_scanin0 = 1'b0; |
---|
358 | assign spc_scanin1 = 1'b0; |
---|
359 | |
---|
360 | endmodule |
---|