[6] | 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 | //.tst_ctu_mbist_done(tst_ctu_mbist_done), |
---|
| 143 | //.tst_ctu_mbist_fail(tst_ctu_mbist_fail), |
---|
| 144 | //.spc_efc_ifuse_data(spc_efc_ifuse_data), |
---|
| 145 | //.spc_efc_dfuse_data(spc_efc_dfuse_data), |
---|
| 146 | |
---|
| 147 | // Wires connected to SPARC Core inputs |
---|
| 148 | .pcx_spc_grant_px(pcx_spc_grant_px), |
---|
| 149 | .cpx_spc_data_rdy_cx2(cpx_spc_data_rdy_cx2), |
---|
| 150 | .cpx_spc_data_cx2(cpx_spc_data_cx2), |
---|
| 151 | .const_cpuid(const_cpuid), |
---|
| 152 | .const_maskid(const_maskid), |
---|
| 153 | .ctu_tck(ctu_tck), |
---|
| 154 | .ctu_sscan_se(ctu_sscan_se), |
---|
| 155 | .ctu_sscan_snap(ctu_sscan_snap), |
---|
| 156 | .ctu_sscan_tid(ctu_sscan_tid), |
---|
| 157 | .ctu_tst_mbist_enable(ctu_tst_mbist_enable), |
---|
| 158 | .efc_spc_fuse_clk1(efc_spc_fuse_clk1), |
---|
| 159 | .efc_spc_fuse_clk2(efc_spc_fuse_clk2), |
---|
| 160 | .efc_spc_ifuse_ashift(efc_spc_ifuse_ashift), |
---|
| 161 | .efc_spc_ifuse_dshift(efc_spc_ifuse_dshift), |
---|
| 162 | .efc_spc_ifuse_data(efc_spc_ifuse_data), |
---|
| 163 | .efc_spc_dfuse_ashift(efc_spc_dfuse_ashift), |
---|
| 164 | .efc_spc_dfuse_dshift(efc_spc_dfuse_dshift), |
---|
| 165 | .efc_spc_dfuse_data(efc_spc_dfuse_data), |
---|
| 166 | .ctu_tst_macrotest(ctu_tst_macrotest), |
---|
| 167 | .ctu_tst_scan_disable(ctu_tst_scan_disable), |
---|
| 168 | .ctu_tst_short_chain(ctu_tst_short_chain), |
---|
| 169 | .global_shift_enable(global_shift_enable), |
---|
| 170 | .ctu_tst_scanmode(ctu_tst_scanmode), |
---|
| 171 | .spc_scanin0(spc_scanin0), |
---|
| 172 | .spc_scanin1(spc_scanin1), |
---|
| 173 | .cluster_cken(cluster_cken), |
---|
| 174 | .gclk(gclk), |
---|
| 175 | .cmp_grst_l(cmp_grst_l), |
---|
| 176 | .cmp_arst_l(cmp_arst_l), |
---|
| 177 | .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l), |
---|
| 178 | .adbginit_l(adbginit_l), |
---|
| 179 | .gdbginit_l(gdbginit_l) |
---|
| 180 | |
---|
| 181 | ); |
---|
[10] | 182 | /* |
---|
[6] | 183 | sparc sparc_1 ( |
---|
| 184 | |
---|
| 185 | // Wires connected to SPARC Core outputs |
---|
| 186 | .spc_pcx_req_pq(spc1_pcx_req_pq), |
---|
| 187 | .spc_pcx_atom_pq(spc1_pcx_atom_pq), |
---|
| 188 | .spc_pcx_data_pa(spc1_pcx_data_pa), |
---|
| 189 | //.spc_sscan_so(spc_sscan_so), |
---|
| 190 | //.spc_scanout0(spc_scanout0), |
---|
| 191 | //.spc_scanout1(spc_scanout1), |
---|
| 192 | //.tst_ctu_mbist_done(tst_ctu_mbist_done), |
---|
| 193 | //.tst_ctu_mbist_fail(tst_ctu_mbist_fail), |
---|
| 194 | //.spc_efc_ifuse_data(spc_efc_ifuse_data), |
---|
| 195 | //.spc_efc_dfuse_data(spc_efc_dfuse_data), |
---|
| 196 | |
---|
| 197 | // Wires connected to SPARC Core inputs |
---|
| 198 | .pcx_spc_grant_px(pcx1_spc_grant_px), |
---|
| 199 | .cpx_spc_data_rdy_cx2(cpx1_spc_data_rdy_cx2), |
---|
| 200 | .cpx_spc_data_cx2(cpx1_spc_data_cx2), |
---|
| 201 | .const_cpuid(const_cpuid1), |
---|
| 202 | .const_maskid(const_maskid), |
---|
| 203 | .ctu_tck(ctu_tck), |
---|
| 204 | .ctu_sscan_se(ctu_sscan_se), |
---|
| 205 | .ctu_sscan_snap(ctu_sscan_snap), |
---|
| 206 | .ctu_sscan_tid(ctu_sscan_tid), |
---|
| 207 | .ctu_tst_mbist_enable(ctu_tst_mbist_enable), |
---|
| 208 | .efc_spc_fuse_clk1(efc_spc_fuse_clk1), |
---|
| 209 | .efc_spc_fuse_clk2(efc_spc_fuse_clk2), |
---|
| 210 | .efc_spc_ifuse_ashift(efc_spc_ifuse_ashift), |
---|
| 211 | .efc_spc_ifuse_dshift(efc_spc_ifuse_dshift), |
---|
| 212 | .efc_spc_ifuse_data(efc_spc_ifuse_data), |
---|
| 213 | .efc_spc_dfuse_ashift(efc_spc_dfuse_ashift), |
---|
| 214 | .efc_spc_dfuse_dshift(efc_spc_dfuse_dshift), |
---|
| 215 | .efc_spc_dfuse_data(efc_spc_dfuse_data), |
---|
| 216 | .ctu_tst_macrotest(ctu_tst_macrotest), |
---|
| 217 | .ctu_tst_scan_disable(ctu_tst_scan_disable), |
---|
| 218 | .ctu_tst_short_chain(ctu_tst_short_chain), |
---|
| 219 | .global_shift_enable(global_shift_enable), |
---|
| 220 | .ctu_tst_scanmode(ctu_tst_scanmode), |
---|
| 221 | .spc_scanin0(spc_scanin0), |
---|
| 222 | .spc_scanin1(spc_scanin1), |
---|
| 223 | .cluster_cken(cluster_cken), |
---|
| 224 | .gclk(gclk), |
---|
| 225 | .cmp_grst_l(cmp_grst_l), |
---|
| 226 | .cmp_arst_l(cmp_arst_l), |
---|
| 227 | .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l), |
---|
| 228 | .adbginit_l(adbginit_l), |
---|
| 229 | .gdbginit_l(gdbginit_l) |
---|
| 230 | |
---|
| 231 | ); |
---|
[10] | 232 | */ |
---|
[6] | 233 | /* |
---|
| 234 | * SPARC Core to Wishbone Master bridge |
---|
| 235 | */ |
---|
| 236 | |
---|
| 237 | wire fp_req; |
---|
| 238 | wire [123:0] fp_pcx; |
---|
| 239 | wire [ 7:0] fp_rdy; |
---|
| 240 | wire [144:0] fp_cpx; |
---|
| 241 | |
---|
[10] | 242 | //os2wb_dual os2wb_inst ( |
---|
| 243 | os2wb os2wb_inst ( |
---|
[6] | 244 | .clk(sys_clock_i), |
---|
| 245 | .rstn(~sys_reset_final), |
---|
| 246 | |
---|
| 247 | .pcx_req(spc_pcx_req_pq), |
---|
| 248 | .pcx_atom(spc_pcx_atom_pq), |
---|
| 249 | .pcx_data(spc_pcx_data_pa), |
---|
| 250 | .pcx_grant(pcx_spc_grant_px), |
---|
| 251 | .cpx_ready(cpx_spc_data_rdy_cx2), |
---|
| 252 | .cpx_packet(cpx_spc_data_cx2), |
---|
| 253 | |
---|
[10] | 254 | //.pcx1_req(spc1_pcx_req_pq), |
---|
| 255 | //.pcx1_atom(spc1_pcx_atom_pq), |
---|
| 256 | //.pcx1_data(spc1_pcx_data_pa), |
---|
| 257 | //.pcx1_grant(pcx1_spc_grant_px), |
---|
| 258 | //.cpx1_ready(cpx1_spc_data_rdy_cx2), |
---|
| 259 | //.cpx1_packet(cpx1_spc_data_cx2), |
---|
[6] | 260 | |
---|
| 261 | .wb_data_i(wbm_data_i), |
---|
| 262 | .wb_ack(wbm_ack_i), |
---|
| 263 | .wb_cycle(wbm_cycle_o), |
---|
| 264 | .wb_strobe(wbm_strobe_o), |
---|
| 265 | .wb_we(wbm_we_o), |
---|
| 266 | .wb_sel(wbm_sel_o), |
---|
| 267 | .wb_addr(wbm_addr_o), |
---|
| 268 | .wb_data_o(wbm_data_o), |
---|
| 269 | |
---|
| 270 | .fp_pcx(fp_pcx), |
---|
| 271 | .fp_req(fp_req), |
---|
| 272 | .fp_cpx(fp_cpx), |
---|
| 273 | .fp_rdy(fp_rdy!=8'h00), |
---|
| 274 | |
---|
| 275 | .eth_int(0/*eth_irq_i*/) |
---|
| 276 | ); |
---|
| 277 | |
---|
| 278 | // FPU |
---|
| 279 | fpu fpu_inst( |
---|
| 280 | .pcx_fpio_data_rdy_px2(fp_req), |
---|
| 281 | .pcx_fpio_data_px2(fp_pcx), |
---|
| 282 | .arst_l(cmp_arst_l), |
---|
| 283 | .grst_l(cmp_grst_l), |
---|
| 284 | .gclk(gclk), |
---|
| 285 | .cluster_cken(cluster_cken), |
---|
| 286 | |
---|
| 287 | .fp_cpx_req_cq(fp_rdy), |
---|
| 288 | .fp_cpx_data_ca(fp_cpx), |
---|
| 289 | |
---|
| 290 | .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l), |
---|
| 291 | .global_shift_enable(global_shift_enable), |
---|
| 292 | .ctu_tst_scan_disable(ctu_tst_scan_disable), |
---|
| 293 | .ctu_tst_scanmode(ctu_tst_scanmode), |
---|
| 294 | .ctu_tst_macrotest(ctu_tst_macrotest), |
---|
| 295 | .ctu_tst_short_chain(ctu_tst_short_chain), |
---|
| 296 | |
---|
| 297 | .si(0), |
---|
| 298 | .so() |
---|
| 299 | ); |
---|
| 300 | |
---|
| 301 | /* |
---|
| 302 | * Reset Controller |
---|
| 303 | */ |
---|
| 304 | |
---|
| 305 | rst_ctrl rst_ctrl_0 ( |
---|
| 306 | |
---|
| 307 | // Top-level system inputs |
---|
| 308 | .sys_clock_i(sys_clock_i), |
---|
| 309 | .sys_reset_i(sys_reset_i), |
---|
| 310 | |
---|
| 311 | // Reset Controller outputs connected to SPARC Core inputs |
---|
| 312 | .cluster_cken_o(cluster_cken), |
---|
| 313 | .gclk_o(gclk), |
---|
| 314 | .cmp_grst_o(cmp_grst_l), |
---|
| 315 | .cmp_arst_o(cmp_arst_l), |
---|
| 316 | .ctu_tst_pre_grst_o(ctu_tst_pre_grst_l), |
---|
| 317 | .adbginit_o(adbginit_l), |
---|
| 318 | .gdbginit_o(gdbginit_l), |
---|
| 319 | .sys_reset_final_o(sys_reset_final) |
---|
| 320 | |
---|
| 321 | ); |
---|
| 322 | |
---|
| 323 | /* |
---|
| 324 | * Continuous assignments |
---|
| 325 | */ |
---|
| 326 | |
---|
| 327 | assign const_cpuid = 4'h0; |
---|
| 328 | assign const_cpuid1 = 4'h1; |
---|
| 329 | assign const_maskid = 8'h20; |
---|
| 330 | |
---|
| 331 | // sscan |
---|
| 332 | assign ctu_tck = 1'b0; |
---|
| 333 | assign ctu_sscan_se = 1'b0; |
---|
| 334 | assign ctu_sscan_snap = 1'b0; |
---|
| 335 | assign ctu_sscan_tid = 4'h1; |
---|
| 336 | |
---|
| 337 | // bist |
---|
| 338 | assign ctu_tst_mbist_enable = 1'b0; |
---|
| 339 | |
---|
| 340 | // efuse |
---|
| 341 | assign efc_spc_fuse_clk1 = 1'b0; // Activity |
---|
| 342 | assign efc_spc_fuse_clk2 = 1'b0; // Activity |
---|
| 343 | assign efc_spc_ifuse_ashift = 1'b0; |
---|
| 344 | assign efc_spc_ifuse_dshift = 1'b0; |
---|
| 345 | assign efc_spc_ifuse_data = 1'b0; // Activity |
---|
| 346 | assign efc_spc_dfuse_ashift = 1'b0; |
---|
| 347 | assign efc_spc_dfuse_dshift = 1'b0; |
---|
| 348 | assign efc_spc_dfuse_data = 1'b0; // Activity |
---|
| 349 | |
---|
| 350 | // scan and macro test |
---|
| 351 | assign ctu_tst_macrotest = 1'b0; |
---|
| 352 | assign ctu_tst_scan_disable = 1'b0; |
---|
| 353 | assign ctu_tst_short_chain = 1'b0; |
---|
| 354 | assign global_shift_enable = 1'b0; |
---|
| 355 | assign ctu_tst_scanmode = 1'b0; |
---|
| 356 | assign spc_scanin0 = 1'b0; |
---|
| 357 | assign spc_scanin1 = 1'b0; |
---|
| 358 | |
---|
[10] | 359 | endmodule |
---|