| 1 |
4 |
fafa1971 |
/*
|
| 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 |
113 |
albert.wat |
* 4) an Interrupt Controller;
|
| 23 |
|
|
* 5) a Floating-Point Unit from the OpenSPARC SoC.
|
| 24 |
4 |
fafa1971 |
*/
|
| 25 |
|
|
|
| 26 |
|
|
`include "s1_defs.h"
|
| 27 |
113 |
albert.wat |
|
| 28 |
4 |
fafa1971 |
module s1_top (
|
| 29 |
113 |
albert.wat |
/*
|
| 30 |
|
|
* Inputs
|
| 31 |
|
|
*/
|
| 32 |
4 |
fafa1971 |
|
| 33 |
113 |
albert.wat |
// System inputs
|
| 34 |
|
|
input sys_clock_i, // System Clock
|
| 35 |
|
|
input sys_reset_i, // System Reset
|
| 36 |
|
|
input[63:0] sys_irq_i, // Interrupt Requests
|
| 37 |
4 |
fafa1971 |
|
| 38 |
113 |
albert.wat |
// Wishbone Interconnect Master Interface inputs
|
| 39 |
|
|
input wbm_ack_i, // Ack
|
| 40 |
|
|
input[(`WB_DATA_WIDTH-1):0] wbm_data_i, // Data In
|
| 41 |
4 |
fafa1971 |
|
| 42 |
113 |
albert.wat |
/*
|
| 43 |
|
|
* Outputs
|
| 44 |
|
|
*/
|
| 45 |
4 |
fafa1971 |
|
| 46 |
113 |
albert.wat |
// Wishbone Interconnect Master Interface outputs
|
| 47 |
|
|
output wbm_cycle_o, // Cycle Start
|
| 48 |
|
|
output wbm_strobe_o, // Strobe Request
|
| 49 |
|
|
output wbm_we_o, // Write Enable
|
| 50 |
|
|
output[`WB_ADDR_WIDTH-1:0] wbm_addr_o, // Address Bus
|
| 51 |
|
|
output[`WB_DATA_WIDTH-1:0] wbm_data_o, // Data Out
|
| 52 |
|
|
output[`WB_DATA_WIDTH/8-1:0] wbm_sel_o // Select Output
|
| 53 |
|
|
);
|
| 54 |
4 |
fafa1971 |
|
| 55 |
|
|
/*
|
| 56 |
|
|
* Wires
|
| 57 |
|
|
*/
|
| 58 |
|
|
|
| 59 |
|
|
// Wires connected to SPARC Core outputs
|
| 60 |
|
|
|
| 61 |
|
|
// pcx
|
| 62 |
|
|
wire [4:0] spc_pcx_req_pq; // processor to pcx request
|
| 63 |
|
|
wire spc_pcx_atom_pq; // processor to pcx atomic request
|
| 64 |
|
|
wire [`PCX_WIDTH-1:0] spc_pcx_data_pa; // processor to pcx packet
|
| 65 |
|
|
|
| 66 |
|
|
// shadow scan
|
| 67 |
|
|
wire spc_sscan_so; // From ifu of sparc_ifu.v
|
| 68 |
|
|
wire spc_scanout0; // From test_stub of test_stub_bist.v
|
| 69 |
|
|
wire spc_scanout1; // From test_stub of test_stub_bist.v
|
| 70 |
|
|
|
| 71 |
|
|
// bist
|
| 72 |
|
|
wire tst_ctu_mbist_done; // From test_stub of test_stub_two_bist.v
|
| 73 |
|
|
wire tst_ctu_mbist_fail; // From test_stub of test_stub_two_bist.v
|
| 74 |
|
|
|
| 75 |
|
|
// fuse
|
| 76 |
|
|
wire spc_efc_ifuse_data; // From ifu of sparc_ifu.v
|
| 77 |
|
|
wire spc_efc_dfuse_data; // From ifu of sparc_ifu.v
|
| 78 |
|
|
|
| 79 |
|
|
// Wires connected to SPARC Core inputs
|
| 80 |
|
|
|
| 81 |
|
|
// cpx interface
|
| 82 |
|
|
wire [4:0] pcx_spc_grant_px; // pcx to processor grant info
|
| 83 |
|
|
wire cpx_spc_data_rdy_cx2; // cpx data inflight to sparc
|
| 84 |
|
|
wire [`CPX_WIDTH-1:0] cpx_spc_data_cx2; // cpx to sparc data packet
|
| 85 |
|
|
|
| 86 |
|
|
wire [3:0] const_cpuid;
|
| 87 |
|
|
wire [7:0] const_maskid; // To ifu of sparc_ifu.v
|
| 88 |
|
|
|
| 89 |
|
|
// sscan
|
| 90 |
|
|
wire ctu_tck; // To ifu of sparc_ifu.v
|
| 91 |
|
|
wire ctu_sscan_se; // To ifu of sparc_ifu.v
|
| 92 |
|
|
wire ctu_sscan_snap; // To ifu of sparc_ifu.v
|
| 93 |
|
|
wire [3:0] ctu_sscan_tid; // To ifu of sparc_ifu.v
|
| 94 |
|
|
|
| 95 |
|
|
// bist
|
| 96 |
|
|
wire ctu_tst_mbist_enable; // To test_stub of test_stub_bist.v
|
| 97 |
|
|
|
| 98 |
|
|
// efuse
|
| 99 |
|
|
wire efc_spc_fuse_clk1;
|
| 100 |
|
|
wire efc_spc_fuse_clk2;
|
| 101 |
|
|
wire efc_spc_ifuse_ashift;
|
| 102 |
|
|
wire efc_spc_ifuse_dshift;
|
| 103 |
|
|
wire efc_spc_ifuse_data;
|
| 104 |
|
|
wire efc_spc_dfuse_ashift;
|
| 105 |
|
|
wire efc_spc_dfuse_dshift;
|
| 106 |
|
|
wire efc_spc_dfuse_data;
|
| 107 |
|
|
|
| 108 |
|
|
// scan and macro test
|
| 109 |
|
|
wire ctu_tst_macrotest; // To test_stub of test_stub_bist.v
|
| 110 |
|
|
wire ctu_tst_scan_disable; // To test_stub of test_stub_bist.v
|
| 111 |
|
|
wire ctu_tst_short_chain; // To test_stub of test_stub_bist.v
|
| 112 |
|
|
wire global_shift_enable; // To test_stub of test_stub_two_bist.v
|
| 113 |
|
|
wire ctu_tst_scanmode; // To test_stub of test_stub_two_bist.v
|
| 114 |
|
|
wire spc_scanin0;
|
| 115 |
|
|
wire spc_scanin1;
|
| 116 |
|
|
|
| 117 |
|
|
// clk
|
| 118 |
|
|
wire cluster_cken; // To spc_hdr of cluster_header.v
|
| 119 |
|
|
wire gclk; // To spc_hdr of cluster_header.v
|
| 120 |
|
|
|
| 121 |
|
|
// reset
|
| 122 |
|
|
wire cmp_grst_l;
|
| 123 |
|
|
wire cmp_arst_l;
|
| 124 |
|
|
wire ctu_tst_pre_grst_l; // To test_stub of test_stub_bist.v
|
| 125 |
|
|
|
| 126 |
|
|
wire adbginit_l; // To spc_hdr of cluster_header.v
|
| 127 |
|
|
wire gdbginit_l; // To spc_hdr of cluster_header.v
|
| 128 |
|
|
|
| 129 |
|
|
// Reset signal from the reset controller to the bridge
|
| 130 |
|
|
wire sys_reset_final;
|
| 131 |
|
|
|
| 132 |
|
|
// Interrupt Source from the interrupt controller to the bridge
|
| 133 |
|
|
wire[5:0] sys_interrupt_source;
|
| 134 |
|
|
|
| 135 |
113 |
albert.wat |
// FIFO
|
| 136 |
|
|
reg [4:0] pcx_spc_grant_px_fifo;
|
| 137 |
|
|
|
| 138 |
|
|
`ifdef DMITRY
|
| 139 |
|
|
// Floating-Point Unit
|
| 140 |
|
|
wire fp_req;
|
| 141 |
|
|
wire [123:0] fp_pcx;
|
| 142 |
|
|
wire [ 7:0] fp_rdy;
|
| 143 |
|
|
wire [144:0] fp_cpx;
|
| 144 |
|
|
`endif
|
| 145 |
|
|
|
| 146 |
4 |
fafa1971 |
/*
|
| 147 |
|
|
* SPARC Core module instance
|
| 148 |
|
|
*/
|
| 149 |
|
|
|
| 150 |
|
|
sparc sparc_0 (
|
| 151 |
|
|
|
| 152 |
|
|
// Wires connected to SPARC Core outputs
|
| 153 |
|
|
.spc_pcx_req_pq(spc_pcx_req_pq),
|
| 154 |
|
|
.spc_pcx_atom_pq(spc_pcx_atom_pq),
|
| 155 |
|
|
.spc_pcx_data_pa(spc_pcx_data_pa),
|
| 156 |
|
|
.spc_sscan_so(spc_sscan_so),
|
| 157 |
|
|
.spc_scanout0(spc_scanout0),
|
| 158 |
|
|
.spc_scanout1(spc_scanout1),
|
| 159 |
|
|
.tst_ctu_mbist_done(tst_ctu_mbist_done),
|
| 160 |
|
|
.tst_ctu_mbist_fail(tst_ctu_mbist_fail),
|
| 161 |
|
|
.spc_efc_ifuse_data(spc_efc_ifuse_data),
|
| 162 |
|
|
.spc_efc_dfuse_data(spc_efc_dfuse_data),
|
| 163 |
|
|
|
| 164 |
|
|
// Wires connected to SPARC Core inputs
|
| 165 |
|
|
.pcx_spc_grant_px(pcx_spc_grant_px),
|
| 166 |
|
|
.cpx_spc_data_rdy_cx2(cpx_spc_data_rdy_cx2),
|
| 167 |
|
|
.cpx_spc_data_cx2(cpx_spc_data_cx2),
|
| 168 |
|
|
.const_cpuid(const_cpuid),
|
| 169 |
|
|
.const_maskid(const_maskid),
|
| 170 |
|
|
.ctu_tck(ctu_tck),
|
| 171 |
|
|
.ctu_sscan_se(ctu_sscan_se),
|
| 172 |
|
|
.ctu_sscan_snap(ctu_sscan_snap),
|
| 173 |
|
|
.ctu_sscan_tid(ctu_sscan_tid),
|
| 174 |
|
|
.ctu_tst_mbist_enable(ctu_tst_mbist_enable),
|
| 175 |
|
|
.efc_spc_fuse_clk1(efc_spc_fuse_clk1),
|
| 176 |
|
|
.efc_spc_fuse_clk2(efc_spc_fuse_clk2),
|
| 177 |
|
|
.efc_spc_ifuse_ashift(efc_spc_ifuse_ashift),
|
| 178 |
|
|
.efc_spc_ifuse_dshift(efc_spc_ifuse_dshift),
|
| 179 |
|
|
.efc_spc_ifuse_data(efc_spc_ifuse_data),
|
| 180 |
|
|
.efc_spc_dfuse_ashift(efc_spc_dfuse_ashift),
|
| 181 |
|
|
.efc_spc_dfuse_dshift(efc_spc_dfuse_dshift),
|
| 182 |
|
|
.efc_spc_dfuse_data(efc_spc_dfuse_data),
|
| 183 |
|
|
.ctu_tst_macrotest(ctu_tst_macrotest),
|
| 184 |
|
|
.ctu_tst_scan_disable(ctu_tst_scan_disable),
|
| 185 |
|
|
.ctu_tst_short_chain(ctu_tst_short_chain),
|
| 186 |
|
|
.global_shift_enable(global_shift_enable),
|
| 187 |
|
|
.ctu_tst_scanmode(ctu_tst_scanmode),
|
| 188 |
|
|
.spc_scanin0(spc_scanin0),
|
| 189 |
|
|
.spc_scanin1(spc_scanin1),
|
| 190 |
|
|
.cluster_cken(cluster_cken),
|
| 191 |
|
|
.gclk(gclk),
|
| 192 |
|
|
.cmp_grst_l(cmp_grst_l),
|
| 193 |
|
|
.cmp_arst_l(cmp_arst_l),
|
| 194 |
|
|
.ctu_tst_pre_grst_l(ctu_tst_pre_grst_l),
|
| 195 |
|
|
.adbginit_l(adbginit_l),
|
| 196 |
|
|
.gdbginit_l(gdbginit_l)
|
| 197 |
|
|
|
| 198 |
|
|
);
|
| 199 |
|
|
|
| 200 |
|
|
/*
|
| 201 |
|
|
* SPARC Core to Wishbone Master bridge
|
| 202 |
|
|
*/
|
| 203 |
113 |
albert.wat |
`ifdef DMITRY
|
| 204 |
|
|
os2wb os2wb_0 (
|
| 205 |
|
|
// Top-level system inputs
|
| 206 |
|
|
.clk(sys_clock_i),
|
| 207 |
|
|
.rstn(~sys_reset_final),
|
| 208 |
4 |
fafa1971 |
|
| 209 |
113 |
albert.wat |
// Bridge inputs connected to SPARC Core outputs
|
| 210 |
|
|
.pcx_req(spc_pcx_req_pq),
|
| 211 |
|
|
.pcx_atom(spc_pcx_atom_pq),
|
| 212 |
|
|
.pcx_data(spc_pcx_data_pa),
|
| 213 |
|
|
|
| 214 |
|
|
// Bridge outputs connected to SPARC Core inputs
|
| 215 |
|
|
.pcx_grant(pcx_spc_grant_px),
|
| 216 |
|
|
.cpx_ready(cpx_spc_data_rdy_cx2),
|
| 217 |
|
|
.cpx_packet(cpx_spc_data_cx2),
|
| 218 |
|
|
|
| 219 |
|
|
// Top-level Wishbone Interconnect inputs
|
| 220 |
|
|
.wb_data_i(wbm_data_i),
|
| 221 |
|
|
.wb_ack(wbm_ack_i),
|
| 222 |
|
|
|
| 223 |
|
|
// Top-level Wishbone Interconnect outputs
|
| 224 |
|
|
.wb_cycle(wbm_cycle_o),
|
| 225 |
|
|
.wb_strobe(wbm_strobe_o),
|
| 226 |
|
|
.wb_we(wbm_we_o),
|
| 227 |
|
|
.wb_sel(wbm_sel_o),
|
| 228 |
|
|
.wb_addr(wbm_addr_o),
|
| 229 |
|
|
.wb_data_o(wbm_data_o),
|
| 230 |
|
|
|
| 231 |
|
|
.fp_pcx(fp_pcx),
|
| 232 |
|
|
.fp_req(fp_req),
|
| 233 |
|
|
.fp_cpx(fp_cpx),
|
| 234 |
|
|
.fp_rdy(fp_rdy!=8'h00),
|
| 235 |
|
|
|
| 236 |
|
|
.eth_int(sys_interrupt_source[0])
|
| 237 |
|
|
);
|
| 238 |
|
|
`else
|
| 239 |
4 |
fafa1971 |
spc2wbm spc2wbm_0 (
|
| 240 |
113 |
albert.wat |
// System inputs
|
| 241 |
|
|
.sys_clock_i(sys_clock_i),
|
| 242 |
|
|
.sys_reset_i(sys_reset_final),
|
| 243 |
4 |
fafa1971 |
.sys_interrupt_source_i(sys_interrupt_source),
|
| 244 |
|
|
|
| 245 |
|
|
// Bridge inputs connected to SPARC Core outputs
|
| 246 |
113 |
albert.wat |
.spc_req_i(spc_pcx_req_pq),
|
| 247 |
|
|
.spc_atom_i(spc_pcx_atom_pq),
|
| 248 |
|
|
.spc_packetout_i(spc_pcx_data_pa),
|
| 249 |
4 |
fafa1971 |
|
| 250 |
|
|
// Bridge outputs connected to SPARC Core inputs
|
| 251 |
113 |
albert.wat |
.spc_grant_o(pcx_spc_grant_px),
|
| 252 |
|
|
.spc_ready_o(cpx_spc_data_rdy_cx2),
|
| 253 |
|
|
.spc_packetin_o(cpx_spc_data_cx2),
|
| 254 |
4 |
fafa1971 |
|
| 255 |
|
|
// Top-level Wishbone Interconnect inputs
|
| 256 |
113 |
albert.wat |
.wbm_ack_i(wbm_ack_i),
|
| 257 |
|
|
.wbm_data_i(wbm_data_i),
|
| 258 |
4 |
fafa1971 |
|
| 259 |
|
|
// Top-level Wishbone Interconnect outputs
|
| 260 |
113 |
albert.wat |
.wbm_cycle_o(wbm_cycle_o),
|
| 261 |
|
|
.wbm_strobe_o(wbm_strobe_o),
|
| 262 |
|
|
.wbm_we_o(wbm_we_o),
|
| 263 |
|
|
.wbm_addr_o(wbm_addr_o),
|
| 264 |
4 |
fafa1971 |
.wbm_data_o(wbm_data_o),
|
| 265 |
|
|
.wbm_sel_o(wbm_sel_o)
|
| 266 |
113 |
albert.wat |
);
|
| 267 |
|
|
`endif
|
| 268 |
|
|
/*
|
| 269 |
|
|
* Floating-Point Unit
|
| 270 |
|
|
*/
|
| 271 |
|
|
`ifdef DMITRY
|
| 272 |
|
|
fpu fpu_0 (
|
| 273 |
|
|
.pcx_fpio_data_rdy_px2(fp_req),
|
| 274 |
|
|
.pcx_fpio_data_px2(fp_pcx),
|
| 275 |
|
|
.arst_l(cmp_arst_l),
|
| 276 |
|
|
.grst_l(cmp_grst_l),
|
| 277 |
|
|
.gclk(gclk),
|
| 278 |
|
|
.cluster_cken(cluster_cken),
|
| 279 |
4 |
fafa1971 |
|
| 280 |
113 |
albert.wat |
.fp_cpx_req_cq(fp_rdy),
|
| 281 |
|
|
.fp_cpx_data_ca(fp_cpx),
|
| 282 |
|
|
|
| 283 |
|
|
.ctu_tst_pre_grst_l(ctu_tst_pre_grst_l),
|
| 284 |
|
|
.global_shift_enable(global_shift_enable),
|
| 285 |
|
|
.ctu_tst_scan_disable(ctu_tst_scan_disable),
|
| 286 |
|
|
.ctu_tst_scanmode(ctu_tst_scanmode),
|
| 287 |
|
|
.ctu_tst_macrotest(ctu_tst_macrotest),
|
| 288 |
|
|
.ctu_tst_short_chain(ctu_tst_short_chain),
|
| 289 |
|
|
|
| 290 |
|
|
.si(1'b0),
|
| 291 |
|
|
.so()
|
| 292 |
4 |
fafa1971 |
);
|
| 293 |
113 |
albert.wat |
`endif
|
| 294 |
4 |
fafa1971 |
/*
|
| 295 |
|
|
* Reset Controller
|
| 296 |
|
|
*/
|
| 297 |
|
|
|
| 298 |
|
|
rst_ctrl rst_ctrl_0 (
|
| 299 |
|
|
|
| 300 |
|
|
// Top-level system inputs
|
| 301 |
|
|
.sys_clock_i(sys_clock_i),
|
| 302 |
|
|
.sys_reset_i(sys_reset_i),
|
| 303 |
|
|
|
| 304 |
|
|
// Reset Controller outputs connected to SPARC Core inputs
|
| 305 |
|
|
.cluster_cken_o(cluster_cken),
|
| 306 |
|
|
.gclk_o(gclk),
|
| 307 |
|
|
.cmp_grst_o(cmp_grst_l),
|
| 308 |
|
|
.cmp_arst_o(cmp_arst_l),
|
| 309 |
|
|
.ctu_tst_pre_grst_o(ctu_tst_pre_grst_l),
|
| 310 |
|
|
.adbginit_o(adbginit_l),
|
| 311 |
|
|
.gdbginit_o(gdbginit_l),
|
| 312 |
|
|
.sys_reset_final_o(sys_reset_final)
|
| 313 |
|
|
|
| 314 |
|
|
);
|
| 315 |
|
|
|
| 316 |
|
|
/*
|
| 317 |
|
|
* Interrupt Controller
|
| 318 |
|
|
*/
|
| 319 |
|
|
|
| 320 |
|
|
int_ctrl int_ctrl_0 (
|
| 321 |
|
|
|
| 322 |
|
|
// Top-level system inputs
|
| 323 |
|
|
.sys_clock_i(sys_clock_i),
|
| 324 |
|
|
.sys_reset_i(sys_reset_final),
|
| 325 |
|
|
.sys_irq_i(sys_irq_i),
|
| 326 |
|
|
|
| 327 |
|
|
// Interrupt Controller outputs connected to bridge inputs
|
| 328 |
|
|
.sys_interrupt_source_o(sys_interrupt_source)
|
| 329 |
|
|
|
| 330 |
|
|
);
|
| 331 |
|
|
|
| 332 |
|
|
/*
|
| 333 |
|
|
* Continuous assignments
|
| 334 |
|
|
*/
|
| 335 |
|
|
|
| 336 |
|
|
assign const_cpuid = 4'h0;
|
| 337 |
|
|
assign const_maskid = 8'h20;
|
| 338 |
|
|
|
| 339 |
|
|
// sscan
|
| 340 |
|
|
assign ctu_tck = 1'b0;
|
| 341 |
|
|
assign ctu_sscan_se = 1'b0;
|
| 342 |
|
|
assign ctu_sscan_snap = 1'b0;
|
| 343 |
|
|
assign ctu_sscan_tid = 4'h1;
|
| 344 |
|
|
|
| 345 |
|
|
// bist
|
| 346 |
|
|
assign ctu_tst_mbist_enable = 1'b0;
|
| 347 |
|
|
|
| 348 |
|
|
// efuse
|
| 349 |
|
|
assign efc_spc_fuse_clk1 = 1'b0; // Activity
|
| 350 |
|
|
assign efc_spc_fuse_clk2 = 1'b0; // Activity
|
| 351 |
|
|
assign efc_spc_ifuse_ashift = 1'b0;
|
| 352 |
|
|
assign efc_spc_ifuse_dshift = 1'b0;
|
| 353 |
|
|
assign efc_spc_ifuse_data = 1'b0; // Activity
|
| 354 |
|
|
assign efc_spc_dfuse_ashift = 1'b0;
|
| 355 |
|
|
assign efc_spc_dfuse_dshift = 1'b0;
|
| 356 |
|
|
assign efc_spc_dfuse_data = 1'b0; // Activity
|
| 357 |
|
|
|
| 358 |
|
|
// scan and macro test
|
| 359 |
|
|
assign ctu_tst_macrotest = 1'b0;
|
| 360 |
|
|
assign ctu_tst_scan_disable = 1'b0;
|
| 361 |
|
|
assign ctu_tst_short_chain = 1'b0;
|
| 362 |
|
|
assign global_shift_enable = 1'b0;
|
| 363 |
|
|
assign ctu_tst_scanmode = 1'b0;
|
| 364 |
|
|
assign spc_scanin0 = 1'b0;
|
| 365 |
|
|
assign spc_scanin1 = 1'b0;
|
| 366 |
|
|
|
| 367 |
|
|
endmodule
|