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

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [os2wb/] [s1_top.v] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dmitryr
/*
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 6 dmitryr
    input         sys_clock_i,
28
    input         sys_reset_i,
29 2 dmitryr
 
30 6 dmitryr
    input         eth_irq_i,
31
 
32
    input         wbm_ack_i,
33 2 dmitryr
    input  [63:0] wbm_data_i,
34 6 dmitryr
    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 2 dmitryr
    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 6 dmitryr
  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 2 dmitryr
 
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 6 dmitryr
  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 2 dmitryr
 
78
  wire [3:0]  const_cpuid;
79 6 dmitryr
  wire [3:0]  const_cpuid1;
80 2 dmitryr
  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 6 dmitryr
reg [  4:0] pcx_spc_grant_px_fifo;
131
reg [  4:0] pcx1_spc_grant_px_fifo;
132 2 dmitryr
 
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
  );
182 6 dmitryr
 
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
  );
232
 
233 2 dmitryr
  /*
234
   * SPARC Core to Wishbone Master bridge
235
   */
236
 
237 6 dmitryr
wire         fp_req;
238
wire [123:0] fp_pcx;
239
wire [  7:0] fp_rdy;
240
wire [144:0] fp_cpx;
241
 
242
os2wb_dual os2wb_inst (
243
    .clk(sys_clock_i),
244
    .rstn(~sys_reset_final),
245
 
246
    .pcx_req(spc_pcx_req_pq),
247
    .pcx_atom(spc_pcx_atom_pq),
248
    .pcx_data(spc_pcx_data_pa),
249
    .pcx_grant(pcx_spc_grant_px),
250
    .cpx_ready(cpx_spc_data_rdy_cx2),
251
    .cpx_packet(cpx_spc_data_cx2),
252
 
253
    .pcx1_req(spc1_pcx_req_pq),
254
    .pcx1_atom(spc1_pcx_atom_pq),
255
    .pcx1_data(spc1_pcx_data_pa),
256
    .pcx1_grant(pcx1_spc_grant_px),
257
    .cpx1_ready(cpx1_spc_data_rdy_cx2),
258
    .cpx1_packet(cpx1_spc_data_cx2),
259
 
260
    .wb_data_i(wbm_data_i),
261
    .wb_ack(wbm_ack_i),
262
    .wb_cycle(wbm_cycle_o),
263
    .wb_strobe(wbm_strobe_o),
264
    .wb_we(wbm_we_o),
265
    .wb_sel(wbm_sel_o),
266
    .wb_addr(wbm_addr_o),
267
    .wb_data_o(wbm_data_o),
268
 
269
    .fp_pcx(fp_pcx),
270
    .fp_req(fp_req),
271
    .fp_cpx(fp_cpx),
272
    .fp_rdy(fp_rdy!=8'h00),
273
 
274
    .eth_int(0/*eth_irq_i*/)
275
);
276
 
277
// FPU
278
fpu fpu_inst(
279
        .pcx_fpio_data_rdy_px2(fp_req),
280
        .pcx_fpio_data_px2(fp_pcx),
281
        .arst_l(cmp_arst_l),
282
        .grst_l(cmp_grst_l),
283
        .gclk(gclk),
284
        .cluster_cken(cluster_cken),
285
 
286
        .fp_cpx_req_cq(fp_rdy),
287
        .fp_cpx_data_ca(fp_cpx),
288
 
289
        .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l),
290
        .global_shift_enable(global_shift_enable),
291
        .ctu_tst_scan_disable(ctu_tst_scan_disable),
292
        .ctu_tst_scanmode(ctu_tst_scanmode),
293
        .ctu_tst_macrotest(ctu_tst_macrotest),
294
        .ctu_tst_short_chain(ctu_tst_short_chain),
295
 
296
        .si(0),
297
        .so()
298
);
299
 
300 2 dmitryr
  /*
301
   * Reset Controller
302
   */
303
 
304
  rst_ctrl rst_ctrl_0 (
305
 
306
    // Top-level system inputs
307
    .sys_clock_i(sys_clock_i),
308
    .sys_reset_i(sys_reset_i),
309
 
310
    // Reset Controller outputs connected to SPARC Core inputs
311
    .cluster_cken_o(cluster_cken),
312
    .gclk_o(gclk),
313
    .cmp_grst_o(cmp_grst_l),
314
    .cmp_arst_o(cmp_arst_l),
315
    .ctu_tst_pre_grst_o(ctu_tst_pre_grst_l),
316
    .adbginit_o(adbginit_l),
317
    .gdbginit_o(gdbginit_l),
318
    .sys_reset_final_o(sys_reset_final)
319
 
320
  );
321
 
322
  /*
323
   * Continuous assignments
324
   */
325
 
326
  assign const_cpuid = 4'h0;
327 6 dmitryr
  assign const_cpuid1 = 4'h1;
328 2 dmitryr
  assign const_maskid = 8'h20;
329
 
330
  // sscan
331
  assign ctu_tck = 1'b0;
332
  assign ctu_sscan_se = 1'b0;
333
  assign ctu_sscan_snap = 1'b0;
334
  assign ctu_sscan_tid = 4'h1;
335
 
336
  // bist
337
  assign ctu_tst_mbist_enable = 1'b0;
338
 
339
  // efuse
340
  assign efc_spc_fuse_clk1 = 1'b0;     // Activity
341
  assign efc_spc_fuse_clk2 = 1'b0;     // Activity
342
  assign efc_spc_ifuse_ashift = 1'b0;
343
  assign efc_spc_ifuse_dshift = 1'b0;
344
  assign efc_spc_ifuse_data = 1'b0;    // Activity
345
  assign efc_spc_dfuse_ashift = 1'b0;
346
  assign efc_spc_dfuse_dshift = 1'b0;
347
  assign efc_spc_dfuse_data = 1'b0;    // Activity
348
 
349
  // scan and macro test
350
  assign ctu_tst_macrotest = 1'b0;
351
  assign ctu_tst_scan_disable = 1'b0;
352
  assign ctu_tst_short_chain = 1'b0;
353
  assign global_shift_enable = 1'b0;
354
  assign ctu_tst_scanmode = 1'b0;
355
  assign spc_scanin0 = 1'b0;
356
  assign spc_scanin1 = 1'b0;
357
 
358
endmodule

powered by: WebSVN 2.1.0

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