OpenCores
URL https://opencores.org/ocsvn/s1_core/s1_core/trunk

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [s1_top/] [s1_top.v] - Blame information for rev 114

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.