1 |
2 |
dmitryr |
// ========== Copyright Header Begin ==========================================
|
2 |
|
|
//
|
3 |
|
|
// OpenSPARC T1 Processor File: sparc_tlu_intdp.v
|
4 |
|
|
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
|
5 |
|
|
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
|
6 |
|
|
//
|
7 |
|
|
// The above named program is free software; you can redistribute it and/or
|
8 |
|
|
// modify it under the terms of the GNU General Public
|
9 |
|
|
// License version 2 as published by the Free Software Foundation.
|
10 |
|
|
//
|
11 |
|
|
// The above named program is distributed in the hope that it will be
|
12 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
|
|
// General Public License for more details.
|
15 |
|
|
//
|
16 |
|
|
// You should have received a copy of the GNU General Public
|
17 |
|
|
// License along with this work; if not, write to the Free Software
|
18 |
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
19 |
|
|
//
|
20 |
|
|
// ========== Copyright Header End ============================================
|
21 |
|
|
////////////////////////////////////////////////////////////////////////
|
22 |
|
|
/*
|
23 |
|
|
// Module Name: sparc_tlu_intdp
|
24 |
|
|
// Description:
|
25 |
|
|
// Contains the code for receiving interrupts from the crossbar,
|
26 |
|
|
// and sending interrupts out to other processors through the corssbar.
|
27 |
|
|
// The interrupt receive register (INRR, asi=0x49/VA=0), incoming
|
28 |
|
|
// vector register (INVR, asi=0x7f/VA=0x40), and interrupt vector
|
29 |
|
|
// dispatch register (INDR, asi=0x77/VA=0) are implemented in this
|
30 |
|
|
// block. This block also initiates thread reset/wake up when a
|
31 |
|
|
// reset packet is received.
|
32 |
|
|
//
|
33 |
|
|
*/
|
34 |
|
|
|
35 |
|
|
////////////////////////////////////////////////////////////////////////
|
36 |
|
|
// Global header file includes
|
37 |
|
|
////////////////////////////////////////////////////////////////////////
|
38 |
|
|
`include "iop.h"
|
39 |
|
|
|
40 |
|
|
////////////////////////////////////////////////////////////////////////
|
41 |
|
|
// Local header file includes / local defines
|
42 |
|
|
////////////////////////////////////////////////////////////////////////
|
43 |
|
|
`include "tlu.h"
|
44 |
|
|
//
|
45 |
|
|
// modved defines to tlu.h
|
46 |
|
|
/*
|
47 |
|
|
`define INT_VEC_HI 5
|
48 |
|
|
`define INT_VEC_LO 0
|
49 |
|
|
`define INT_THR_HI 12
|
50 |
|
|
`define INT_THR_LO 8
|
51 |
|
|
`define INT_TYPE_HI 17
|
52 |
|
|
`define INT_TYPE_LO 16
|
53 |
|
|
*/
|
54 |
|
|
|
55 |
|
|
module sparc_tlu_intdp (/*AUTOARG*/
|
56 |
|
|
// Outputs
|
57 |
|
|
int_pending_i2_l, ind_inc_thrid_i1, // indr_inc_rst_pkt,
|
58 |
|
|
ind_inc_type_i1, tlu_lsu_int_ldxa_data_w2, int_tlu_rstid_m,
|
59 |
|
|
tlu_lsu_pcxpkt, so,
|
60 |
|
|
// Inputs
|
61 |
|
|
//
|
62 |
|
|
// modified to abide to the Niagara reset methodology
|
63 |
|
|
// clk, se, si, reset, lsu_tlu_intpkt, lsu_tlu_st_rs3_data_g,
|
64 |
|
|
rclk, se, si, tlu_rst_l, lsu_tlu_st_rs3_data_g, // lsu_tlu_intpkt,
|
65 |
|
|
inc_ind_ld_int_i1, inc_ind_rstthr_i1, inc_ind_asi_thr,
|
66 |
|
|
inc_ind_asi_wr_indr, inc_ind_indr_grant, // inc_ind_asi_inrr,
|
67 |
|
|
inc_ind_thr_m, inc_ind_asi_wr_inrr, inc_ind_asi_rd_invr,
|
68 |
|
|
inc_indr_req_valid, inc_indr_req_thrid, tlu_asi_rdata_mxsel_g,
|
69 |
|
|
tlu_asi_queue_rdata_g, tlu_scpd_asi_rdata_g, lsu_ind_intpkt_id,
|
70 |
|
|
lsu_ind_intpkt_type, lsu_ind_intpkt_thr
|
71 |
|
|
);
|
72 |
|
|
|
73 |
|
|
//
|
74 |
|
|
// modified to abide to the Niagara reset methodology
|
75 |
|
|
// input clk, se, si, reset;
|
76 |
|
|
input rclk, se, si, tlu_rst_l;
|
77 |
|
|
|
78 |
|
|
// from lsu
|
79 |
|
|
// input [17:0] lsu_tlu_intpkt; // int pkt from cpx
|
80 |
|
|
input [63:0] lsu_tlu_st_rs3_data_g; // write data for int regs
|
81 |
|
|
|
82 |
|
|
// select lines from int_ctl
|
83 |
|
|
input [3:0] inc_ind_ld_int_i1; // ld ext interrupt to inrr
|
84 |
|
|
input [3:0] inc_ind_rstthr_i1;
|
85 |
|
|
|
86 |
|
|
// changing the select from inverting to non-inverting for grape
|
87 |
|
|
// input [3:0] inc_ind_asi_thr_l; // thread issuing asi command
|
88 |
|
|
input [3:0] inc_ind_asi_thr; // thread issuing asi command
|
89 |
|
|
input [3:0] inc_ind_asi_wr_indr; // write INDR
|
90 |
|
|
// convert the signal to non-inverting version for grape
|
91 |
|
|
// input [3:0] inc_ind_indr_grant_l; // transmit INDR to PCX
|
92 |
|
|
input [3:0] inc_ind_indr_grant; // transmit INDR to PCX
|
93 |
|
|
// obsolete input
|
94 |
|
|
// input inc_ind_asi_inrr; // read INRR
|
95 |
|
|
// convert the signal to non-inverting version for grape
|
96 |
|
|
// input [3:0] inc_ind_thr_m_l;
|
97 |
|
|
input [3:0] inc_ind_thr_m;
|
98 |
|
|
|
99 |
|
|
// other controls
|
100 |
|
|
input [3:0] inc_ind_asi_wr_inrr; // write INRR
|
101 |
|
|
input [3:0] inc_ind_asi_rd_invr; // read INVR (reset corr bit in INRR)
|
102 |
|
|
|
103 |
|
|
// indr request
|
104 |
|
|
input inc_indr_req_valid; // valid value in INDR, i.e make req
|
105 |
|
|
input [1:0] inc_indr_req_thrid; // thread making request
|
106 |
|
|
//
|
107 |
|
|
// asi rdata mux select
|
108 |
|
|
input [3:0] tlu_asi_rdata_mxsel_g;
|
109 |
|
|
// asi data from other blocks
|
110 |
|
|
input [`TLU_SCPD_DATA_WIDTH-1:0] tlu_scpd_asi_rdata_g;
|
111 |
|
|
input [`TLU_ASI_QUE_WIDTH-1:0] tlu_asi_queue_rdata_g;
|
112 |
|
|
input [4:0] lsu_ind_intpkt_thr;
|
113 |
|
|
input [1:0] lsu_ind_intpkt_type;
|
114 |
|
|
input [5:0] lsu_ind_intpkt_id;
|
115 |
|
|
|
116 |
|
|
// to int ctl
|
117 |
|
|
output [3:0] int_pending_i2_l; // interrupt still pending
|
118 |
|
|
// output indr_inc_rst_pkt;
|
119 |
|
|
|
120 |
|
|
output [4:0] ind_inc_thrid_i1;
|
121 |
|
|
output [1:0] ind_inc_type_i1;
|
122 |
|
|
|
123 |
|
|
// to outside world
|
124 |
|
|
output [63:0] tlu_lsu_int_ldxa_data_w2; // read data from asi regs
|
125 |
|
|
output [5:0] int_tlu_rstid_m;
|
126 |
|
|
|
127 |
|
|
output [25:0] tlu_lsu_pcxpkt; // pcxpkt for inter processor int
|
128 |
|
|
|
129 |
|
|
output so;
|
130 |
|
|
|
131 |
|
|
// local signals
|
132 |
|
|
//
|
133 |
|
|
// added to abide to the Niagara reset methodology
|
134 |
|
|
wire local_rst; // local reset signal
|
135 |
|
|
//
|
136 |
|
|
wire [63:0] int_tlu_asi_data; // read data from int regs
|
137 |
|
|
// interrupt and reset id
|
138 |
|
|
wire [5:0] int_id_i1;
|
139 |
|
|
wire [5:0] t0_rstid_i2,
|
140 |
|
|
t1_rstid_i2,
|
141 |
|
|
t2_rstid_i2,
|
142 |
|
|
t3_rstid_i2,
|
143 |
|
|
next_t0_rstid_i1,
|
144 |
|
|
next_t1_rstid_i1,
|
145 |
|
|
next_t2_rstid_i1,
|
146 |
|
|
next_t3_rstid_i1;
|
147 |
|
|
|
148 |
|
|
// Interrupt receive register
|
149 |
|
|
wire [63:0] inrr_dec_i1,
|
150 |
|
|
inrr_rd_data_i2;
|
151 |
|
|
|
152 |
|
|
wire [63:0] t0_inrr_i2,
|
153 |
|
|
t1_inrr_i2,
|
154 |
|
|
t2_inrr_i2,
|
155 |
|
|
t3_inrr_i2,
|
156 |
|
|
t0_inrr_aw_i2,
|
157 |
|
|
t1_inrr_aw_i2,
|
158 |
|
|
t2_inrr_aw_i2,
|
159 |
|
|
t3_inrr_aw_i2,
|
160 |
|
|
t0_inrr_arw_i1,
|
161 |
|
|
t1_inrr_arw_i1,
|
162 |
|
|
t2_inrr_arw_i1,
|
163 |
|
|
t3_inrr_arw_i1,
|
164 |
|
|
next_t0_inrr_i1,
|
165 |
|
|
next_t1_inrr_i1,
|
166 |
|
|
next_t2_inrr_i1,
|
167 |
|
|
next_t3_inrr_i1;
|
168 |
|
|
|
169 |
|
|
wire [63:0] new_t0_inrr_i1,
|
170 |
|
|
new_t1_inrr_i1,
|
171 |
|
|
new_t2_inrr_i1,
|
172 |
|
|
new_t3_inrr_i1;
|
173 |
|
|
|
174 |
|
|
// clear interrupt through asi
|
175 |
|
|
wire [63:0] t0_asi_wr_data,
|
176 |
|
|
t1_asi_wr_data,
|
177 |
|
|
t2_asi_wr_data,
|
178 |
|
|
t3_asi_wr_data;
|
179 |
|
|
|
180 |
|
|
// interrupt vector
|
181 |
|
|
wire [5:0] t0_invr_i3,
|
182 |
|
|
t1_invr_i3,
|
183 |
|
|
t2_invr_i3,
|
184 |
|
|
t3_invr_i3,
|
185 |
|
|
t0_invr_i2,
|
186 |
|
|
t1_invr_i2,
|
187 |
|
|
t2_invr_i2,
|
188 |
|
|
t3_invr_i2;
|
189 |
|
|
wire [5:0] invr_rd_data_i3;
|
190 |
|
|
|
191 |
|
|
// highest priority interrupt
|
192 |
|
|
wire [63:0] pe_ivec_i3,
|
193 |
|
|
t0_pe_ivec_i3,
|
194 |
|
|
t1_pe_ivec_i3,
|
195 |
|
|
t2_pe_ivec_i3,
|
196 |
|
|
t3_pe_ivec_i3;
|
197 |
|
|
|
198 |
|
|
// interrupt dispatch
|
199 |
|
|
// removed the obsolete bits
|
200 |
|
|
// wire [12:0] indr_wr_pkt;
|
201 |
|
|
wire [10:0] indr_wr_pkt;
|
202 |
|
|
|
203 |
|
|
// removed the obsolete bits
|
204 |
|
|
// wire [12:0] indr_pcxpkt,
|
205 |
|
|
wire [10:0] indr_pcxpkt,
|
206 |
|
|
t0_indr,
|
207 |
|
|
t1_indr,
|
208 |
|
|
t2_indr,
|
209 |
|
|
t3_indr,
|
210 |
|
|
t0_indr_next,
|
211 |
|
|
t1_indr_next,
|
212 |
|
|
t2_indr_next,
|
213 |
|
|
t3_indr_next;
|
214 |
|
|
//
|
215 |
|
|
// local clock
|
216 |
|
|
wire clk;
|
217 |
|
|
|
218 |
|
|
//
|
219 |
|
|
// Code Starts Here
|
220 |
|
|
//
|
221 |
|
|
//----------------------------------------------------------------------
|
222 |
|
|
// creating local clock
|
223 |
|
|
//----------------------------------------------------------------------
|
224 |
|
|
assign clk = rclk;
|
225 |
|
|
|
226 |
|
|
//----------------------------------------------------------------------
|
227 |
|
|
// Interrupt Receive
|
228 |
|
|
//----------------------------------------------------------------------
|
229 |
|
|
//
|
230 |
|
|
// create local reset signal
|
231 |
|
|
assign local_rst = ~tlu_rst_l;
|
232 |
|
|
|
233 |
|
|
// I1 Stage
|
234 |
|
|
// decode interrupt vector
|
235 |
|
|
// modified due to interface clean-up
|
236 |
|
|
/*
|
237 |
|
|
assign int_id_i1 = lsu_tlu_intpkt[`INT_VEC_HI:`INT_VEC_LO];
|
238 |
|
|
assign ind_inc_type_i1 = lsu_tlu_intpkt[`INT_TYPE_HI:`INT_TYPE_LO];
|
239 |
|
|
assign ind_inc_thrid_i1 = lsu_tlu_intpkt[`INT_THR_HI:`INT_THR_LO];
|
240 |
|
|
*/
|
241 |
|
|
assign int_id_i1[5:0] = lsu_ind_intpkt_id[5:0];
|
242 |
|
|
assign ind_inc_type_i1[1:0] = lsu_ind_intpkt_type[1:0];
|
243 |
|
|
assign ind_inc_thrid_i1[4:0] = lsu_ind_intpkt_thr[4:0];
|
244 |
|
|
|
245 |
|
|
// rstid enable mux
|
246 |
|
|
dp_mux2es #6 rid_mux0(.dout (next_t0_rstid_i1[5:0]),
|
247 |
|
|
.in0 (t0_rstid_i2[5:0]),
|
248 |
|
|
.in1 (int_id_i1[5:0]),
|
249 |
|
|
.sel (inc_ind_rstthr_i1[0]));
|
250 |
|
|
|
251 |
|
|
`ifdef FPGA_SYN_1THREAD
|
252 |
|
|
dff_s #6 rid0_reg(.din (next_t0_rstid_i1[5:0]),
|
253 |
|
|
.q (t0_rstid_i2[5:0]),
|
254 |
|
|
.clk (clk),
|
255 |
|
|
.se (se), .si(), .so());
|
256 |
|
|
assign int_tlu_rstid_m[5:0] = t0_rstid_i2[5:0];
|
257 |
|
|
|
258 |
|
|
`else
|
259 |
|
|
|
260 |
|
|
dp_mux2es #6 rid_mux1(.dout (next_t1_rstid_i1[5:0]),
|
261 |
|
|
.in0 (t1_rstid_i2[5:0]),
|
262 |
|
|
.in1 (int_id_i1[5:0]),
|
263 |
|
|
.sel (inc_ind_rstthr_i1[1]));
|
264 |
|
|
|
265 |
|
|
dp_mux2es #6 rid_mux2(.dout (next_t2_rstid_i1[5:0]),
|
266 |
|
|
.in0 (t2_rstid_i2[5:0]),
|
267 |
|
|
.in1 (int_id_i1[5:0]),
|
268 |
|
|
.sel (inc_ind_rstthr_i1[2]));
|
269 |
|
|
|
270 |
|
|
dp_mux2es #6 rid_mux3(.dout (next_t3_rstid_i1[5:0]),
|
271 |
|
|
.in0 (t3_rstid_i2[5:0]),
|
272 |
|
|
.in1 (int_id_i1[5:0]),
|
273 |
|
|
.sel (inc_ind_rstthr_i1[3]));
|
274 |
|
|
|
275 |
|
|
// rst id flops
|
276 |
|
|
dff_s #6 rid0_reg(.din (next_t0_rstid_i1[5:0]),
|
277 |
|
|
.q (t0_rstid_i2[5:0]),
|
278 |
|
|
.clk (clk),
|
279 |
|
|
.se (se), .si(), .so());
|
280 |
|
|
dff_s #6 rid1_reg(.din (next_t1_rstid_i1[5:0]),
|
281 |
|
|
.q (t1_rstid_i2[5:0]),
|
282 |
|
|
.clk (clk),
|
283 |
|
|
.se (se), .si(), .so());
|
284 |
|
|
dff_s #6 rid2_reg(.din (next_t2_rstid_i1[5:0]),
|
285 |
|
|
.q (t2_rstid_i2[5:0]),
|
286 |
|
|
.clk (clk),
|
287 |
|
|
.se (se), .si(), .so());
|
288 |
|
|
dff_s #6 rid3_reg(.din (next_t3_rstid_i1[5:0]),
|
289 |
|
|
.q (t3_rstid_i2[5:0]),
|
290 |
|
|
.clk (clk),
|
291 |
|
|
.se (se), .si(), .so());
|
292 |
|
|
|
293 |
|
|
// rstid to tlu in M stage
|
294 |
|
|
// changing the select from inverting to non-inverting for grape
|
295 |
|
|
/*
|
296 |
|
|
dp_mux4ds #6 tlurid_mux(.dout (int_tlu_rstid_m[5:0]),
|
297 |
|
|
.in0 (t0_rstid_i2[5:0]),
|
298 |
|
|
.in1 (t1_rstid_i2[5:0]),
|
299 |
|
|
.in2 (t2_rstid_i2[5:0]),
|
300 |
|
|
.in3 (t3_rstid_i2[5:0]),
|
301 |
|
|
.sel0_l (inc_ind_thr_m_l[0]),
|
302 |
|
|
.sel1_l (inc_ind_thr_m_l[1]),
|
303 |
|
|
.sel2_l (inc_ind_thr_m_l[2]),
|
304 |
|
|
.sel3_l (inc_ind_thr_m_l[3]));
|
305 |
|
|
*/
|
306 |
|
|
dp_mux4ds #6 tlurid_mux(.dout (int_tlu_rstid_m[5:0]),
|
307 |
|
|
.in0 (t0_rstid_i2[5:0]),
|
308 |
|
|
.in1 (t1_rstid_i2[5:0]),
|
309 |
|
|
.in2 (t2_rstid_i2[5:0]),
|
310 |
|
|
.in3 (t3_rstid_i2[5:0]),
|
311 |
|
|
.sel0_l (~inc_ind_thr_m[0]),
|
312 |
|
|
.sel1_l (~inc_ind_thr_m[1]),
|
313 |
|
|
.sel2_l (~inc_ind_thr_m[2]),
|
314 |
|
|
.sel3_l (~inc_ind_thr_m[3]));
|
315 |
|
|
|
316 |
|
|
`endif // !`ifdef FPGA_SYN_1THREAD
|
317 |
|
|
|
318 |
|
|
sparc_tlu_dec64 iv_dec(.in (int_id_i1[5:0]),
|
319 |
|
|
.out (inrr_dec_i1[63:0]));
|
320 |
|
|
|
321 |
|
|
// merge decoded interrupt vector with inrr
|
322 |
|
|
assign new_t0_inrr_i1 = inrr_dec_i1 | t0_inrr_arw_i1;
|
323 |
|
|
assign new_t1_inrr_i1 = inrr_dec_i1 | t1_inrr_arw_i1;
|
324 |
|
|
assign new_t2_inrr_i1 = inrr_dec_i1 | t2_inrr_arw_i1;
|
325 |
|
|
assign new_t3_inrr_i1 = inrr_dec_i1 | t3_inrr_arw_i1;
|
326 |
|
|
|
327 |
|
|
// enable mux to load new interrupt to INRR
|
328 |
|
|
dp_mux2es #64 inrr_en_mux0(.dout (next_t0_inrr_i1[63:0]),
|
329 |
|
|
.in0 (t0_inrr_arw_i1[63:0]),
|
330 |
|
|
.in1 (new_t0_inrr_i1[63:0]),
|
331 |
|
|
.sel (inc_ind_ld_int_i1[0]));
|
332 |
|
|
`ifdef FPGA_SYN_1THREAD
|
333 |
|
|
// interrupt receive register (INRR)
|
334 |
|
|
// change to dff -- software will reset before IE turns on
|
335 |
|
|
dffr_s #64 t0_inrr (.din (next_t0_inrr_i1[63:0]),
|
336 |
|
|
.q (t0_inrr_i2[63:0]),
|
337 |
|
|
.clk (clk),
|
338 |
|
|
//
|
339 |
|
|
// modified to abide to the Niagara reset methodology
|
340 |
|
|
// .rst (reset),
|
341 |
|
|
.rst (local_rst),
|
342 |
|
|
.se (se), .si(), .so());
|
343 |
|
|
assign inrr_rd_data_i2[63:0] = t0_inrr_i2[63:0];
|
344 |
|
|
|
345 |
|
|
`else
|
346 |
|
|
|
347 |
|
|
dp_mux2es #64 inrr_en_mux1(.dout (next_t1_inrr_i1[63:0]),
|
348 |
|
|
.in0 (t1_inrr_arw_i1[63:0]),
|
349 |
|
|
.in1 (new_t1_inrr_i1[63:0]),
|
350 |
|
|
.sel (inc_ind_ld_int_i1[1]));
|
351 |
|
|
dp_mux2es #64 inrr_en_mux2(.dout (next_t2_inrr_i1[63:0]),
|
352 |
|
|
.in0 (t2_inrr_arw_i1[63:0]),
|
353 |
|
|
.in1 (new_t2_inrr_i1[63:0]),
|
354 |
|
|
.sel (inc_ind_ld_int_i1[2]));
|
355 |
|
|
dp_mux2es #64 inrr_en_mux3(.dout (next_t3_inrr_i1[63:0]),
|
356 |
|
|
.in0 (t3_inrr_arw_i1[63:0]),
|
357 |
|
|
.in1 (new_t3_inrr_i1[63:0]),
|
358 |
|
|
.sel (inc_ind_ld_int_i1[3]));
|
359 |
|
|
|
360 |
|
|
// interrupt receive register (INRR)
|
361 |
|
|
// change to dff -- software will reset before IE turns on
|
362 |
|
|
dffr_s #64 t0_inrr (.din (next_t0_inrr_i1[63:0]),
|
363 |
|
|
.q (t0_inrr_i2[63:0]),
|
364 |
|
|
.clk (clk),
|
365 |
|
|
//
|
366 |
|
|
// modified to abide to the Niagara reset methodology
|
367 |
|
|
// .rst (reset),
|
368 |
|
|
.rst (local_rst),
|
369 |
|
|
.se (se), .si(), .so());
|
370 |
|
|
dffr_s #64 t1_inrr (.din (next_t1_inrr_i1[63:0]),
|
371 |
|
|
.q (t1_inrr_i2[63:0]),
|
372 |
|
|
.clk (clk),
|
373 |
|
|
//
|
374 |
|
|
// modified to abide to the Niagara reset methodology
|
375 |
|
|
// .rst (reset),
|
376 |
|
|
.rst (local_rst),
|
377 |
|
|
.se (se), .si(), .so());
|
378 |
|
|
dffr_s #64 t2_inrr (.din (next_t2_inrr_i1[63:0]),
|
379 |
|
|
.q (t2_inrr_i2[63:0]),
|
380 |
|
|
.clk (clk),
|
381 |
|
|
//
|
382 |
|
|
// modified to abide to the Niagara reset methodology
|
383 |
|
|
// .rst (reset),
|
384 |
|
|
.rst (local_rst),
|
385 |
|
|
.se (se), .si(), .so());
|
386 |
|
|
dffr_s #64 t3_inrr (.din (next_t3_inrr_i1[63:0]),
|
387 |
|
|
.q (t3_inrr_i2[63:0]),
|
388 |
|
|
.clk (clk),
|
389 |
|
|
//
|
390 |
|
|
// modified to abide to the Niagara reset methodology
|
391 |
|
|
// .rst (reset),
|
392 |
|
|
.rst (local_rst),
|
393 |
|
|
.se (se), .si(), .so());
|
394 |
|
|
|
395 |
|
|
// I2 Stage
|
396 |
|
|
// read out INRR to asi
|
397 |
|
|
// changing the select from inverting to non-inverting for grape
|
398 |
|
|
/*
|
399 |
|
|
dp_mux4ds #64 inrr_rd_mux(.dout (inrr_rd_data_i2[63:0]),
|
400 |
|
|
.in0 (t0_inrr_i2[63:0]),
|
401 |
|
|
.in1 (t1_inrr_i2[63:0]),
|
402 |
|
|
.in2 (t2_inrr_i2[63:0]),
|
403 |
|
|
.in3 (t3_inrr_i2[63:0]),
|
404 |
|
|
.sel0_l (inc_ind_asi_thr_l[0]),
|
405 |
|
|
.sel1_l (inc_ind_asi_thr_l[1]),
|
406 |
|
|
.sel2_l (inc_ind_asi_thr_l[2]),
|
407 |
|
|
.sel3_l (inc_ind_asi_thr_l[3]));
|
408 |
|
|
*/
|
409 |
|
|
dp_mux4ds #64 inrr_rd_mux(.dout (inrr_rd_data_i2[63:0]),
|
410 |
|
|
.in0 (t0_inrr_i2[63:0]),
|
411 |
|
|
.in1 (t1_inrr_i2[63:0]),
|
412 |
|
|
.in2 (t2_inrr_i2[63:0]),
|
413 |
|
|
.in3 (t3_inrr_i2[63:0]),
|
414 |
|
|
.sel0_l (~inc_ind_asi_thr[0]),
|
415 |
|
|
.sel1_l (~inc_ind_asi_thr[1]),
|
416 |
|
|
.sel2_l (~inc_ind_asi_thr[2]),
|
417 |
|
|
.sel3_l (~inc_ind_asi_thr[3]));
|
418 |
|
|
|
419 |
|
|
`endif // !`ifdef FPGA_SYN_1THREAD
|
420 |
|
|
|
421 |
|
|
// signal interrupt pending
|
422 |
|
|
sparc_tlu_zcmp64 zcmp0(.in (t0_inrr_i2[63:0]),
|
423 |
|
|
.zero (int_pending_i2_l[0]));
|
424 |
|
|
|
425 |
|
|
`ifdef FPGA_SYN_1THREAD
|
426 |
|
|
assign t0_asi_wr_data = ~(~lsu_tlu_st_rs3_data_g &
|
427 |
|
|
{64{inc_ind_asi_wr_inrr[0]}});
|
428 |
|
|
assign t0_inrr_aw_i2 = t0_inrr_i2 & t0_asi_wr_data;
|
429 |
|
|
sparc_tlu_penc64 t0_invr_penc(.in (t0_inrr_i2[63:0]),
|
430 |
|
|
.out (t0_invr_i2[5:0]));
|
431 |
|
|
dff_s #6 t0_invr (.din (t0_invr_i2[5:0]),
|
432 |
|
|
.q (t0_invr_i3[5:0]),
|
433 |
|
|
.clk (clk),
|
434 |
|
|
.se (se), .si(), .so());
|
435 |
|
|
assign invr_rd_data_i3[5:0] = t0_invr_i3[5:0];
|
436 |
|
|
|
437 |
|
|
`else
|
438 |
|
|
|
439 |
|
|
sparc_tlu_zcmp64 zcmp1(.in (t1_inrr_i2[63:0]),
|
440 |
|
|
.zero (int_pending_i2_l[1]));
|
441 |
|
|
sparc_tlu_zcmp64 zcmp2(.in (t2_inrr_i2[63:0]),
|
442 |
|
|
.zero (int_pending_i2_l[2]));
|
443 |
|
|
sparc_tlu_zcmp64 zcmp3(.in (t3_inrr_i2[63:0]),
|
444 |
|
|
.zero (int_pending_i2_l[3]));
|
445 |
|
|
|
446 |
|
|
// write data -- only zeros may be written to the INRR. An attempt
|
447 |
|
|
// to write 1 is ignored.
|
448 |
|
|
// Force to all 1 if no write
|
449 |
|
|
assign t0_asi_wr_data = ~(~lsu_tlu_st_rs3_data_g &
|
450 |
|
|
{64{inc_ind_asi_wr_inrr[0]}});
|
451 |
|
|
assign t1_asi_wr_data = ~(~lsu_tlu_st_rs3_data_g &
|
452 |
|
|
{64{inc_ind_asi_wr_inrr[1]}});
|
453 |
|
|
assign t2_asi_wr_data = ~(~lsu_tlu_st_rs3_data_g &
|
454 |
|
|
{64{inc_ind_asi_wr_inrr[2]}});
|
455 |
|
|
assign t3_asi_wr_data = ~(~lsu_tlu_st_rs3_data_g &
|
456 |
|
|
{64{inc_ind_asi_wr_inrr[3]}});
|
457 |
|
|
|
458 |
|
|
assign t0_inrr_aw_i2 = t0_inrr_i2 & t0_asi_wr_data;
|
459 |
|
|
assign t1_inrr_aw_i2 = t1_inrr_i2 & t1_asi_wr_data;
|
460 |
|
|
assign t2_inrr_aw_i2 = t2_inrr_i2 & t2_asi_wr_data;
|
461 |
|
|
assign t3_inrr_aw_i2 = t3_inrr_i2 & t3_asi_wr_data;
|
462 |
|
|
|
463 |
|
|
// priority encode INRR to 6 bits to get INVR
|
464 |
|
|
// b63 has the highest priority
|
465 |
|
|
sparc_tlu_penc64 t0_invr_penc(.in (t0_inrr_i2[63:0]),
|
466 |
|
|
.out (t0_invr_i2[5:0]));
|
467 |
|
|
sparc_tlu_penc64 t1_invr_penc(.in (t1_inrr_i2[63:0]),
|
468 |
|
|
.out (t1_invr_i2[5:0]));
|
469 |
|
|
sparc_tlu_penc64 t2_invr_penc(.in (t2_inrr_i2[63:0]),
|
470 |
|
|
.out (t2_invr_i2[5:0]));
|
471 |
|
|
sparc_tlu_penc64 t3_invr_penc(.in (t3_inrr_i2[63:0]),
|
472 |
|
|
.out (t3_invr_i2[5:0]));
|
473 |
|
|
|
474 |
|
|
// Interrupt Vector Register (INVR)
|
475 |
|
|
// Cannot write to INVR
|
476 |
|
|
dff_s #6 t0_invr (.din (t0_invr_i2[5:0]),
|
477 |
|
|
.q (t0_invr_i3[5:0]),
|
478 |
|
|
.clk (clk),
|
479 |
|
|
.se (se), .si(), .so());
|
480 |
|
|
dff_s #6 t1_invr (.din (t1_invr_i2[5:0]),
|
481 |
|
|
.q (t1_invr_i3[5:0]),
|
482 |
|
|
.clk (clk),
|
483 |
|
|
.se (se), .si(), .so());
|
484 |
|
|
dff_s #6 t2_invr (.din (t2_invr_i2[5:0]),
|
485 |
|
|
.q (t2_invr_i3[5:0]),
|
486 |
|
|
.clk (clk),
|
487 |
|
|
.se (se), .si(), .so());
|
488 |
|
|
dff_s #6 t3_invr (.din (t3_invr_i2[5:0]),
|
489 |
|
|
.q (t3_invr_i3[5:0]),
|
490 |
|
|
.clk (clk),
|
491 |
|
|
.se (se), .si(), .so());
|
492 |
|
|
|
493 |
|
|
// I3 stage
|
494 |
|
|
// read out to asi data
|
495 |
|
|
// changing the select from inverting to non-inverting for grape
|
496 |
|
|
/*
|
497 |
|
|
dp_mux4ds #6 invr_rd_mux(.dout (invr_rd_data_i3[5:0]),
|
498 |
|
|
.in0 (t0_invr_i3[5:0]),
|
499 |
|
|
.in1 (t1_invr_i3[5:0]),
|
500 |
|
|
.in2 (t2_invr_i3[5:0]),
|
501 |
|
|
.in3 (t3_invr_i3[5:0]),
|
502 |
|
|
.sel0_l (inc_ind_asi_thr_l[0]),
|
503 |
|
|
.sel1_l (inc_ind_asi_thr_l[1]),
|
504 |
|
|
.sel2_l (inc_ind_asi_thr_l[2]),
|
505 |
|
|
.sel3_l (inc_ind_asi_thr_l[3]));
|
506 |
|
|
*/
|
507 |
|
|
dp_mux4ds #6 invr_rd_mux(.dout (invr_rd_data_i3[5:0]),
|
508 |
|
|
.in0 (t0_invr_i3[5:0]),
|
509 |
|
|
.in1 (t1_invr_i3[5:0]),
|
510 |
|
|
.in2 (t2_invr_i3[5:0]),
|
511 |
|
|
.in3 (t3_invr_i3[5:0]),
|
512 |
|
|
.sel0_l (~inc_ind_asi_thr[0]),
|
513 |
|
|
.sel1_l (~inc_ind_asi_thr[1]),
|
514 |
|
|
.sel2_l (~inc_ind_asi_thr[2]),
|
515 |
|
|
.sel3_l (~inc_ind_asi_thr[3]));
|
516 |
|
|
`endif // !`ifdef FPGA_SYN_1THREAD
|
517 |
|
|
|
518 |
|
|
//
|
519 |
|
|
// modified for bug 2109
|
520 |
|
|
// asi rd data mux
|
521 |
|
|
dp_mux4ds #(64) asi_rd_mux(
|
522 |
|
|
.in0 ({58'b0, invr_rd_data_i3[5:0]}),
|
523 |
|
|
.in1 (inrr_rd_data_i2[63:0]),
|
524 |
|
|
.in2 (tlu_scpd_asi_rdata_g[`TLU_SCPD_DATA_WIDTH-1:0]),
|
525 |
|
|
.in3 ({50'b0, tlu_asi_queue_rdata_g[`TLU_ASI_QUE_WIDTH-1:0],6'b0}),
|
526 |
|
|
.sel0_l (~tlu_asi_rdata_mxsel_g[0]),
|
527 |
|
|
.sel1_l (~tlu_asi_rdata_mxsel_g[1]),
|
528 |
|
|
.sel2_l (~tlu_asi_rdata_mxsel_g[2]),
|
529 |
|
|
.sel3_l (~tlu_asi_rdata_mxsel_g[3]),
|
530 |
|
|
.dout (int_tlu_asi_data[63:0]));
|
531 |
|
|
|
532 |
|
|
dff_s #(64) dff_tlu_lsu_int_ldxa_data_w2 (
|
533 |
|
|
.din (int_tlu_asi_data[63:0]),
|
534 |
|
|
.q (tlu_lsu_int_ldxa_data_w2[63:0]),
|
535 |
|
|
.clk (clk),
|
536 |
|
|
.se (se),
|
537 |
|
|
.si(),
|
538 |
|
|
.so());
|
539 |
|
|
|
540 |
|
|
sparc_tlu_dec64 inrr_pe_dec(.in (invr_rd_data_i3[5:0]),
|
541 |
|
|
.out (pe_ivec_i3[63:0]));
|
542 |
|
|
|
543 |
|
|
// when INVR is read, zero out the corresponding bit in INRR
|
544 |
|
|
assign t0_pe_ivec_i3 = pe_ivec_i3 & {64{inc_ind_asi_rd_invr[0]}};
|
545 |
|
|
assign t1_pe_ivec_i3 = pe_ivec_i3 & {64{inc_ind_asi_rd_invr[1]}};
|
546 |
|
|
assign t2_pe_ivec_i3 = pe_ivec_i3 & {64{inc_ind_asi_rd_invr[2]}};
|
547 |
|
|
assign t3_pe_ivec_i3 = pe_ivec_i3 & {64{inc_ind_asi_rd_invr[3]}};
|
548 |
|
|
|
549 |
|
|
assign t0_inrr_arw_i1 = t0_inrr_aw_i2 & ~t0_pe_ivec_i3;
|
550 |
|
|
assign t1_inrr_arw_i1 = t1_inrr_aw_i2 & ~t1_pe_ivec_i3;
|
551 |
|
|
assign t2_inrr_arw_i1 = t2_inrr_aw_i2 & ~t2_pe_ivec_i3;
|
552 |
|
|
assign t3_inrr_arw_i1 = t3_inrr_aw_i2 & ~t3_pe_ivec_i3;
|
553 |
|
|
|
554 |
|
|
//----------------------------------------------------------------------
|
555 |
|
|
// Interrupt Dispatch
|
556 |
|
|
//----------------------------------------------------------------------
|
557 |
|
|
// modified to remove the unused bits
|
558 |
|
|
//
|
559 |
|
|
// assign indr_wr_pkt = {lsu_tlu_st_rs3_data_g[`INT_TYPE_HI:`INT_TYPE_LO],
|
560 |
|
|
assign indr_wr_pkt = {lsu_tlu_st_rs3_data_g[`INT_THR_HI:`INT_THR_LO],
|
561 |
|
|
lsu_tlu_st_rs3_data_g[`INT_VEC_HI:`INT_VEC_LO]};
|
562 |
|
|
//
|
563 |
|
|
// removed for timing
|
564 |
|
|
// assign indr_inc_rst_pkt = lsu_tlu_st_rs3_data_g[`INT_TYPE_HI] |
|
565 |
|
|
// lsu_tlu_st_rs3_data_g[`INT_TYPE_LO];
|
566 |
|
|
|
567 |
|
|
dp_mux2es #11 t0_indr_mux(.dout (t0_indr_next[10:0]),
|
568 |
|
|
.in0 (t0_indr[10:0]),
|
569 |
|
|
.in1 (indr_wr_pkt[10:0]),
|
570 |
|
|
.sel (inc_ind_asi_wr_indr[0]));
|
571 |
|
|
`ifdef FPGA_SYN_1THREAD
|
572 |
|
|
dff_s #11 t0_indr_reg(.din (t0_indr_next[10:0]),
|
573 |
|
|
.q (t0_indr[10:0]),
|
574 |
|
|
.clk (clk),
|
575 |
|
|
.se (se), .si(), .so());
|
576 |
|
|
assign indr_pcxpkt[10:0] = t0_indr[10:0];
|
577 |
|
|
|
578 |
|
|
`else
|
579 |
|
|
|
580 |
|
|
dp_mux2es #11 t1_indr_mux(.dout (t1_indr_next[10:0]),
|
581 |
|
|
.in0 (t1_indr[10:0]),
|
582 |
|
|
.in1 (indr_wr_pkt[10:0]),
|
583 |
|
|
.sel (inc_ind_asi_wr_indr[1]));
|
584 |
|
|
dp_mux2es #11 t2_indr_mux(.dout (t2_indr_next[10:0]),
|
585 |
|
|
.in0 (t2_indr[10:0]),
|
586 |
|
|
.in1 (indr_wr_pkt[10:0]),
|
587 |
|
|
.sel (inc_ind_asi_wr_indr[2]));
|
588 |
|
|
dp_mux2es #11 t3_indr_mux(.dout (t3_indr_next[10:0]),
|
589 |
|
|
.in0 (t3_indr[10:0]),
|
590 |
|
|
.in1 (indr_wr_pkt[10:0]),
|
591 |
|
|
.sel (inc_ind_asi_wr_indr[3]));
|
592 |
|
|
|
593 |
|
|
dff_s #11 t0_indr_reg(.din (t0_indr_next[10:0]),
|
594 |
|
|
.q (t0_indr[10:0]),
|
595 |
|
|
.clk (clk),
|
596 |
|
|
.se (se), .si(), .so());
|
597 |
|
|
dff_s #11 t1_indr_reg(.din (t1_indr_next[10:0]),
|
598 |
|
|
.q (t1_indr[10:0]),
|
599 |
|
|
.clk (clk),
|
600 |
|
|
.se (se), .si(), .so());
|
601 |
|
|
dff_s #11 t2_indr_reg(.din (t2_indr_next[10:0]),
|
602 |
|
|
.q (t2_indr[10:0]),
|
603 |
|
|
.clk (clk),
|
604 |
|
|
.se (se), .si(), .so());
|
605 |
|
|
dff_s #11 t3_indr_reg(.din (t3_indr_next[10:0]),
|
606 |
|
|
.q (t3_indr[10:0]),
|
607 |
|
|
.clk (clk),
|
608 |
|
|
.se (se), .si(), .so());
|
609 |
|
|
|
610 |
|
|
// changing the select from inverting to non-inverting for grape
|
611 |
|
|
/*
|
612 |
|
|
dp_mux4ds #13 int_dsp_mux(.dout (indr_pcxpkt[12:0]),
|
613 |
|
|
.in0 (t0_indr[12:0]),
|
614 |
|
|
.in1 (t1_indr[12:0]),
|
615 |
|
|
.in2 (t2_indr[12:0]),
|
616 |
|
|
.in3 (t3_indr[12:0]),
|
617 |
|
|
.sel0_l (inc_ind_indr_grant_l[0]),
|
618 |
|
|
.sel1_l (inc_ind_indr_grant_l[1]),
|
619 |
|
|
.sel2_l (inc_ind_indr_grant_l[2]),
|
620 |
|
|
.sel3_l (inc_ind_indr_grant_l[3]));
|
621 |
|
|
*/
|
622 |
|
|
dp_mux4ds #11 int_dsp_mux(.dout (indr_pcxpkt[10:0]),
|
623 |
|
|
.in0 (t0_indr[10:0]),
|
624 |
|
|
.in1 (t1_indr[10:0]),
|
625 |
|
|
.in2 (t2_indr[10:0]),
|
626 |
|
|
.in3 (t3_indr[10:0]),
|
627 |
|
|
.sel0_l (~inc_ind_indr_grant[0]),
|
628 |
|
|
.sel1_l (~inc_ind_indr_grant[1]),
|
629 |
|
|
.sel2_l (~inc_ind_indr_grant[2]),
|
630 |
|
|
.sel3_l (~inc_ind_indr_grant[3]));
|
631 |
|
|
`endif // !`ifdef FPGA_SYN_1THREAD
|
632 |
|
|
|
633 |
|
|
|
634 |
|
|
assign tlu_lsu_pcxpkt[25:0] = {inc_indr_req_valid, // 25
|
635 |
|
|
{`INT_RQ}, // 24:20
|
636 |
|
|
inc_indr_req_thrid[1:0], // 19:18
|
637 |
|
|
// indr_pcxpkt[12:11], -- cannot send rst
|
638 |
|
|
{2'b00}, // 17:16
|
639 |
|
|
3'b0, // 15:13 rsvd
|
640 |
|
|
indr_pcxpkt[10:6], // 12:8
|
641 |
|
|
2'b0, // 7:6 rsvd
|
642 |
|
|
indr_pcxpkt[5:0]}; // 5:0
|
643 |
|
|
|
644 |
|
|
// TBD:
|
645 |
|
|
// 1. disable sending of reset/nuke/resum packets from indr -- DONE 1/6
|
646 |
|
|
|
647 |
|
|
endmodule
|
648 |
|
|
|
649 |
|
|
|