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 98

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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