Line 17... |
Line 17... |
* This block implements the top-level of the S1 Core.
|
* This block implements the top-level of the S1 Core.
|
* It is just a schematic with four instances:
|
* It is just a schematic with four instances:
|
* 1) one single SPARC Core of the OpenSPARC T1;
|
* 1) one single SPARC Core of the OpenSPARC T1;
|
* 2) a SPARC Core to Wishbone Master bridge;
|
* 2) a SPARC Core to Wishbone Master bridge;
|
* 3) a Reset Controller;
|
* 3) a Reset Controller;
|
* 4) an Interrupt Controller.
|
* 4) an Interrupt Controller;
|
*
|
* 5) a Floating-Point Unit from the OpenSPARC SoC.
|
*/
|
*/
|
|
|
`include "s1_defs.h"
|
`include "s1_defs.h"
|
|
|
module s1_top (
|
module s1_top (
|
sys_clock_i, sys_reset_i, sys_irq_i,
|
|
wbm_ack_i, wbm_data_i,
|
|
wbm_cycle_o, wbm_strobe_o, wbm_we_o, wbm_addr_o, wbm_data_o, wbm_sel_o
|
|
);
|
|
|
|
/*
|
/*
|
* Inputs
|
* Inputs
|
*/
|
*/
|
|
|
// System inputs
|
// System inputs
|
input sys_clock_i; // System Clock
|
input sys_clock_i, // System Clock
|
input sys_reset_i; // System Reset
|
input sys_reset_i, // System Reset
|
input[63:0] sys_irq_i; // Interrupt Requests
|
input[63:0] sys_irq_i, // Interrupt Requests
|
|
|
// Wishbone Interconnect Master Interface inputs
|
// Wishbone Interconnect Master Interface inputs
|
input wbm_ack_i; // Ack
|
input wbm_ack_i, // Ack
|
input[(`WB_DATA_WIDTH-1):0] wbm_data_i; // Data In
|
input[(`WB_DATA_WIDTH-1):0] wbm_data_i, // Data In
|
|
|
/*
|
/*
|
* Outputs
|
* Outputs
|
*/
|
*/
|
|
|
// Wishbone Interconnect Master Interface outputs
|
// Wishbone Interconnect Master Interface outputs
|
output wbm_cycle_o; // Cycle Start
|
output wbm_cycle_o, // Cycle Start
|
output wbm_strobe_o; // Strobe Request
|
output wbm_strobe_o, // Strobe Request
|
output wbm_we_o; // Write Enable
|
output wbm_we_o, // Write Enable
|
output[`WB_ADDR_WIDTH-1:0] wbm_addr_o; // Address Bus
|
output[`WB_ADDR_WIDTH-1:0] wbm_addr_o, // Address Bus
|
output[`WB_DATA_WIDTH-1:0] wbm_data_o; // Data Out
|
output[`WB_DATA_WIDTH-1:0] wbm_data_o, // Data Out
|
output[`WB_DATA_WIDTH/8-1:0] wbm_sel_o; // Select Output
|
output[`WB_DATA_WIDTH/8-1:0] wbm_sel_o // Select Output
|
|
);
|
|
|
/*
|
/*
|
* Wires
|
* Wires
|
*/
|
*/
|
|
|
Line 84... |
Line 80... |
|
|
// cpx interface
|
// cpx interface
|
wire [4:0] pcx_spc_grant_px; // pcx to processor grant info
|
wire [4:0] pcx_spc_grant_px; // pcx to processor grant info
|
wire cpx_spc_data_rdy_cx2; // cpx data inflight to sparc
|
wire cpx_spc_data_rdy_cx2; // cpx data inflight to sparc
|
wire [`CPX_WIDTH-1:0] cpx_spc_data_cx2; // cpx to sparc data packet
|
wire [`CPX_WIDTH-1:0] cpx_spc_data_cx2; // cpx to sparc data packet
|
wire wbm_spc_stall; // Stall requests
|
|
wire wbm_spc_resume; // Resume requests
|
|
|
|
wire [3:0] const_cpuid;
|
wire [3:0] const_cpuid;
|
wire [7:0] const_maskid; // To ifu of sparc_ifu.v
|
wire [7:0] const_maskid; // To ifu of sparc_ifu.v
|
|
|
// sscan
|
// sscan
|
Line 136... |
Line 130... |
wire sys_reset_final;
|
wire sys_reset_final;
|
|
|
// Interrupt Source from the interrupt controller to the bridge
|
// Interrupt Source from the interrupt controller to the bridge
|
wire[5:0] sys_interrupt_source;
|
wire[5:0] sys_interrupt_source;
|
|
|
|
// FIFO
|
|
reg [4:0] pcx_spc_grant_px_fifo;
|
|
|
|
`ifdef DMITRY
|
|
// Floating-Point Unit
|
|
wire fp_req;
|
|
wire [123:0] fp_pcx;
|
|
wire [ 7:0] fp_rdy;
|
|
wire [144:0] fp_cpx;
|
|
`endif
|
|
|
/*
|
/*
|
* SPARC Core module instance
|
* SPARC Core module instance
|
*/
|
*/
|
|
|
sparc sparc_0 (
|
sparc sparc_0 (
|
Line 158... |
Line 163... |
|
|
// Wires connected to SPARC Core inputs
|
// Wires connected to SPARC Core inputs
|
.pcx_spc_grant_px(pcx_spc_grant_px),
|
.pcx_spc_grant_px(pcx_spc_grant_px),
|
.cpx_spc_data_rdy_cx2(cpx_spc_data_rdy_cx2),
|
.cpx_spc_data_rdy_cx2(cpx_spc_data_rdy_cx2),
|
.cpx_spc_data_cx2(cpx_spc_data_cx2),
|
.cpx_spc_data_cx2(cpx_spc_data_cx2),
|
.wbm_spc_stall(wbm_spc_stall),
|
|
.wbm_spc_resume(wbm_spc_resume),
|
|
.const_cpuid(const_cpuid),
|
.const_cpuid(const_cpuid),
|
.const_maskid(const_maskid),
|
.const_maskid(const_maskid),
|
.ctu_tck(ctu_tck),
|
.ctu_tck(ctu_tck),
|
.ctu_sscan_se(ctu_sscan_se),
|
.ctu_sscan_se(ctu_sscan_se),
|
.ctu_sscan_snap(ctu_sscan_snap),
|
.ctu_sscan_snap(ctu_sscan_snap),
|
Line 195... |
Line 198... |
);
|
);
|
|
|
/*
|
/*
|
* SPARC Core to Wishbone Master bridge
|
* SPARC Core to Wishbone Master bridge
|
*/
|
*/
|
|
`ifdef DMITRY
|
|
os2wb os2wb_0 (
|
|
// Top-level system inputs
|
|
.clk(sys_clock_i),
|
|
.rstn(~sys_reset_final),
|
|
|
spc2wbm spc2wbm_0 (
|
// Bridge inputs connected to SPARC Core outputs
|
|
.pcx_req(spc_pcx_req_pq),
|
|
.pcx_atom(spc_pcx_atom_pq),
|
|
.pcx_data(spc_pcx_data_pa),
|
|
|
// Top-level system inputs
|
// Bridge outputs connected to SPARC Core inputs
|
|
.pcx_grant(pcx_spc_grant_px),
|
|
.cpx_ready(cpx_spc_data_rdy_cx2),
|
|
.cpx_packet(cpx_spc_data_cx2),
|
|
|
|
// Top-level Wishbone Interconnect inputs
|
|
.wb_data_i(wbm_data_i),
|
|
.wb_ack(wbm_ack_i),
|
|
|
|
// Top-level Wishbone Interconnect outputs
|
|
.wb_cycle(wbm_cycle_o),
|
|
.wb_strobe(wbm_strobe_o),
|
|
.wb_we(wbm_we_o),
|
|
.wb_sel(wbm_sel_o),
|
|
.wb_addr(wbm_addr_o),
|
|
.wb_data_o(wbm_data_o),
|
|
|
|
.fp_pcx(fp_pcx),
|
|
.fp_req(fp_req),
|
|
.fp_cpx(fp_cpx),
|
|
.fp_rdy(fp_rdy!=8'h00),
|
|
|
|
.eth_int(sys_interrupt_source[0])
|
|
);
|
|
`else
|
|
spc2wbm spc2wbm_0 (
|
|
// System inputs
|
.sys_clock_i(sys_clock_i),
|
.sys_clock_i(sys_clock_i),
|
.sys_reset_i(sys_reset_final),
|
.sys_reset_i(sys_reset_final),
|
.sys_interrupt_source_i(sys_interrupt_source),
|
.sys_interrupt_source_i(sys_interrupt_source),
|
|
|
// Bridge inputs connected to SPARC Core outputs
|
// Bridge inputs connected to SPARC Core outputs
|
Line 212... |
Line 249... |
|
|
// Bridge outputs connected to SPARC Core inputs
|
// Bridge outputs connected to SPARC Core inputs
|
.spc_grant_o(pcx_spc_grant_px),
|
.spc_grant_o(pcx_spc_grant_px),
|
.spc_ready_o(cpx_spc_data_rdy_cx2),
|
.spc_ready_o(cpx_spc_data_rdy_cx2),
|
.spc_packetin_o(cpx_spc_data_cx2),
|
.spc_packetin_o(cpx_spc_data_cx2),
|
.spc_stall_o(wbm_spc_stall),
|
|
.spc_resume_o(wbm_spc_resume),
|
|
|
|
// Top-level Wishbone Interconnect inputs
|
// Top-level Wishbone Interconnect inputs
|
.wbm_ack_i(wbm_ack_i),
|
.wbm_ack_i(wbm_ack_i),
|
.wbm_data_i(wbm_data_i),
|
.wbm_data_i(wbm_data_i),
|
|
|
Line 226... |
Line 261... |
.wbm_strobe_o(wbm_strobe_o),
|
.wbm_strobe_o(wbm_strobe_o),
|
.wbm_we_o(wbm_we_o),
|
.wbm_we_o(wbm_we_o),
|
.wbm_addr_o(wbm_addr_o),
|
.wbm_addr_o(wbm_addr_o),
|
.wbm_data_o(wbm_data_o),
|
.wbm_data_o(wbm_data_o),
|
.wbm_sel_o(wbm_sel_o)
|
.wbm_sel_o(wbm_sel_o)
|
|
|
);
|
);
|
|
`endif
|
|
/*
|
|
* Floating-Point Unit
|
|
*/
|
|
`ifdef DMITRY
|
|
fpu fpu_0 (
|
|
.pcx_fpio_data_rdy_px2(fp_req),
|
|
.pcx_fpio_data_px2(fp_pcx),
|
|
.arst_l(cmp_arst_l),
|
|
.grst_l(cmp_grst_l),
|
|
.gclk(gclk),
|
|
.cluster_cken(cluster_cken),
|
|
|
|
.fp_cpx_req_cq(fp_rdy),
|
|
.fp_cpx_data_ca(fp_cpx),
|
|
|
|
.ctu_tst_pre_grst_l(ctu_tst_pre_grst_l),
|
|
.global_shift_enable(global_shift_enable),
|
|
.ctu_tst_scan_disable(ctu_tst_scan_disable),
|
|
.ctu_tst_scanmode(ctu_tst_scanmode),
|
|
.ctu_tst_macrotest(ctu_tst_macrotest),
|
|
.ctu_tst_short_chain(ctu_tst_short_chain),
|
|
|
|
.si(1'b0),
|
|
.so()
|
|
);
|
|
`endif
|
/*
|
/*
|
* Reset Controller
|
* Reset Controller
|
*/
|
*/
|
|
|
rst_ctrl rst_ctrl_0 (
|
rst_ctrl rst_ctrl_0 (
|
Line 302... |
Line 362... |
assign global_shift_enable = 1'b0;
|
assign global_shift_enable = 1'b0;
|
assign ctu_tst_scanmode = 1'b0;
|
assign ctu_tst_scanmode = 1'b0;
|
assign spc_scanin0 = 1'b0;
|
assign spc_scanin0 = 1'b0;
|
assign spc_scanin1 = 1'b0;
|
assign spc_scanin1 = 1'b0;
|
|
|
/*
|
|
|
|
The following signals are handled by the Reset Controller:
|
|
|
|
// clk
|
|
assign cluster_cken = ...;
|
|
assign gclk = ...;
|
|
|
|
// reset
|
|
assign cmp_grst_l = ...;
|
|
assign cmp_arst_l = ...;
|
|
assign ctu_tst_pre_grst_l = ...;
|
|
|
|
assign adbginit_l = ...;
|
|
assign gdbginit_l = ...;
|
|
|
|
*/
|
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|