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 4

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
  wire wbm_spc_stallreq;              // Stall request
90
 
91
  wire [3:0]  const_cpuid;
92
  wire [7:0]  const_maskid;           // To ifu of sparc_ifu.v
93
 
94
  // sscan
95
  wire        ctu_tck;                // To ifu of sparc_ifu.v
96
  wire        ctu_sscan_se;           // To ifu of sparc_ifu.v
97
  wire        ctu_sscan_snap;         // To ifu of sparc_ifu.v
98
  wire [3:0]  ctu_sscan_tid;          // To ifu of sparc_ifu.v
99
 
100
  // bist
101
  wire        ctu_tst_mbist_enable;   // To test_stub of test_stub_bist.v
102
 
103
  // efuse
104
  wire        efc_spc_fuse_clk1;
105
  wire        efc_spc_fuse_clk2;
106
  wire        efc_spc_ifuse_ashift;
107
  wire        efc_spc_ifuse_dshift;
108
  wire        efc_spc_ifuse_data;
109
  wire        efc_spc_dfuse_ashift;
110
  wire        efc_spc_dfuse_dshift;
111
  wire        efc_spc_dfuse_data;
112
 
113
  // scan and macro test
114
  wire        ctu_tst_macrotest;      // To test_stub of test_stub_bist.v
115
  wire        ctu_tst_scan_disable;   // To test_stub of test_stub_bist.v
116
  wire        ctu_tst_short_chain;    // To test_stub of test_stub_bist.v
117
  wire        global_shift_enable;    // To test_stub of test_stub_two_bist.v
118
  wire        ctu_tst_scanmode;       // To test_stub of test_stub_two_bist.v
119
  wire        spc_scanin0;
120
  wire        spc_scanin1;
121
 
122
  // clk
123
  wire        cluster_cken;           // To spc_hdr of cluster_header.v
124
  wire        gclk;                   // To spc_hdr of cluster_header.v
125
 
126
  // reset
127
  wire        cmp_grst_l;
128
  wire        cmp_arst_l;
129
  wire        ctu_tst_pre_grst_l;     // To test_stub of test_stub_bist.v
130
 
131
  wire        adbginit_l;             // To spc_hdr of cluster_header.v
132
  wire        gdbginit_l;             // To spc_hdr of cluster_header.v
133
 
134
  // Reset signal from the reset controller to the bridge
135
  wire sys_reset_final;
136
 
137
  // Interrupt Source from the interrupt controller to the bridge
138
  wire[5:0] sys_interrupt_source;
139
 
140
  /*
141
   * SPARC Core module instance
142
   */
143
 
144
  sparc sparc_0 (
145
 
146
    // Wires connected to SPARC Core outputs
147
    .spc_pcx_req_pq(spc_pcx_req_pq),
148
    .spc_pcx_atom_pq(spc_pcx_atom_pq),
149
    .spc_pcx_data_pa(spc_pcx_data_pa),
150
    .spc_sscan_so(spc_sscan_so),
151
    .spc_scanout0(spc_scanout0),
152
    .spc_scanout1(spc_scanout1),
153
    .tst_ctu_mbist_done(tst_ctu_mbist_done),
154
    .tst_ctu_mbist_fail(tst_ctu_mbist_fail),
155
    .spc_efc_ifuse_data(spc_efc_ifuse_data),
156
    .spc_efc_dfuse_data(spc_efc_dfuse_data),
157
 
158
    // Wires connected to SPARC Core inputs
159
    .pcx_spc_grant_px(pcx_spc_grant_px),
160
    .cpx_spc_data_rdy_cx2(cpx_spc_data_rdy_cx2),
161
    .cpx_spc_data_cx2(cpx_spc_data_cx2),
162
    .wbm_spc_stallreq(wbm_spc_stallreq),
163
    .const_cpuid(const_cpuid),
164
    .const_maskid(const_maskid),
165
    .ctu_tck(ctu_tck),
166
    .ctu_sscan_se(ctu_sscan_se),
167
    .ctu_sscan_snap(ctu_sscan_snap),
168
    .ctu_sscan_tid(ctu_sscan_tid),
169
    .ctu_tst_mbist_enable(ctu_tst_mbist_enable),
170
    .efc_spc_fuse_clk1(efc_spc_fuse_clk1),
171
    .efc_spc_fuse_clk2(efc_spc_fuse_clk2),
172
    .efc_spc_ifuse_ashift(efc_spc_ifuse_ashift),
173
    .efc_spc_ifuse_dshift(efc_spc_ifuse_dshift),
174
    .efc_spc_ifuse_data(efc_spc_ifuse_data),
175
    .efc_spc_dfuse_ashift(efc_spc_dfuse_ashift),
176
    .efc_spc_dfuse_dshift(efc_spc_dfuse_dshift),
177
    .efc_spc_dfuse_data(efc_spc_dfuse_data),
178
    .ctu_tst_macrotest(ctu_tst_macrotest),
179
    .ctu_tst_scan_disable(ctu_tst_scan_disable),
180
    .ctu_tst_short_chain(ctu_tst_short_chain),
181
    .global_shift_enable(global_shift_enable),
182
    .ctu_tst_scanmode(ctu_tst_scanmode),
183
    .spc_scanin0(spc_scanin0),
184
    .spc_scanin1(spc_scanin1),
185
    .cluster_cken(cluster_cken),
186
    .gclk(gclk),
187
    .cmp_grst_l(cmp_grst_l),
188
    .cmp_arst_l(cmp_arst_l),
189
    .ctu_tst_pre_grst_l(ctu_tst_pre_grst_l),
190
    .adbginit_l(adbginit_l),
191
    .gdbginit_l(gdbginit_l)
192
 
193
  );
194
 
195
  /*
196
   * SPARC Core to Wishbone Master bridge
197
   */
198
 
199
  spc2wbm spc2wbm_0 (
200
 
201
    // Top-level system inputs
202
    .sys_clock_i(sys_clock_i),
203
    .sys_reset_i(sys_reset_final),
204
    .sys_interrupt_source_i(sys_interrupt_source),
205
 
206
    // Bridge inputs connected to SPARC Core outputs
207
    .spc_req_i(spc_pcx_req_pq),
208
    .spc_atom_i(spc_pcx_atom_pq),
209
    .spc_packetout_i(spc_pcx_data_pa),
210
 
211
    // Bridge outputs connected to SPARC Core inputs
212
    .spc_grant_o(pcx_spc_grant_px),
213
    .spc_ready_o(cpx_spc_data_rdy_cx2),
214
    .spc_packetin_o(cpx_spc_data_cx2),
215
    .spc_stallreq_o(wbm_spc_stallreq),
216
 
217
    // Top-level Wishbone Interconnect inputs
218
    .wbm_ack_i(wbm_ack_i),
219
    .wbm_data_i(wbm_data_i),
220
 
221
    // Top-level Wishbone Interconnect outputs
222
    .wbm_cycle_o(wbm_cycle_o),
223
    .wbm_strobe_o(wbm_strobe_o),
224
    .wbm_we_o(wbm_we_o),
225
    .wbm_addr_o(wbm_addr_o),
226
    .wbm_data_o(wbm_data_o),
227
    .wbm_sel_o(wbm_sel_o)
228
 
229
  );
230
 
231
  /*
232
   * Reset Controller
233
   */
234
 
235
  rst_ctrl rst_ctrl_0 (
236
 
237
    // Top-level system inputs
238
    .sys_clock_i(sys_clock_i),
239
    .sys_reset_i(sys_reset_i),
240
 
241
    // Reset Controller outputs connected to SPARC Core inputs
242
    .cluster_cken_o(cluster_cken),
243
    .gclk_o(gclk),
244
    .cmp_grst_o(cmp_grst_l),
245
    .cmp_arst_o(cmp_arst_l),
246
    .ctu_tst_pre_grst_o(ctu_tst_pre_grst_l),
247
    .adbginit_o(adbginit_l),
248
    .gdbginit_o(gdbginit_l),
249
    .sys_reset_final_o(sys_reset_final)
250
 
251
  );
252
 
253
  /*
254
   * Interrupt Controller
255
   */
256
 
257
  int_ctrl int_ctrl_0 (
258
 
259
    // Top-level system inputs
260
    .sys_clock_i(sys_clock_i),
261
    .sys_reset_i(sys_reset_final),
262
    .sys_irq_i(sys_irq_i),
263
 
264
    // Interrupt Controller outputs connected to bridge inputs
265
    .sys_interrupt_source_o(sys_interrupt_source)
266
 
267
  );
268
 
269
  /*
270
   * Continuous assignments
271
   */
272
 
273
  assign const_cpuid = 4'h0;
274
  assign const_maskid = 8'h20;
275
 
276
  // sscan
277
  assign ctu_tck = 1'b0;
278
  assign ctu_sscan_se = 1'b0;
279
  assign ctu_sscan_snap = 1'b0;
280
  assign ctu_sscan_tid = 4'h1;
281
 
282
  // bist
283
  assign ctu_tst_mbist_enable = 1'b0;
284
 
285
  // efuse
286
  assign efc_spc_fuse_clk1 = 1'b0;     // Activity
287
  assign efc_spc_fuse_clk2 = 1'b0;     // Activity
288
  assign efc_spc_ifuse_ashift = 1'b0;
289
  assign efc_spc_ifuse_dshift = 1'b0;
290
  assign efc_spc_ifuse_data = 1'b0;    // Activity
291
  assign efc_spc_dfuse_ashift = 1'b0;
292
  assign efc_spc_dfuse_dshift = 1'b0;
293
  assign efc_spc_dfuse_data = 1'b0;    // Activity
294
 
295
  // scan and macro test
296
  assign ctu_tst_macrotest = 1'b0;
297
  assign ctu_tst_scan_disable = 1'b0;
298
  assign ctu_tst_short_chain = 1'b0;
299
  assign global_shift_enable = 1'b0;
300
  assign ctu_tst_scanmode = 1'b0;
301
  assign spc_scanin0 = 1'b0;
302
  assign spc_scanin1 = 1'b0;
303
 
304
  /*
305
 
306
  The following signals are handled by the Reset Controller:
307
 
308
  // clk
309
  assign cluster_cken = ...;
310
  assign gclk = ...;
311
 
312
  // reset
313
  assign cmp_grst_l = ...;
314
  assign cmp_arst_l = ...;
315
  assign ctu_tst_pre_grst_l = ...;
316
 
317
  assign adbginit_l = ...;
318
  assign gdbginit_l = ...;
319
 
320
  */
321
 
322
endmodule

powered by: WebSVN 2.1.0

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