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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_tlu_intctl.v] - Blame information for rev 113

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 95 fafa1971
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: sparc_tlu_intctl.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 113 albert.wat
`ifdef SIMPLY_RISC_TWEAKS
22
`define SIMPLY_RISC_SCANIN .si(0)
23
`else
24
`define SIMPLY_RISC_SCANIN .si()
25
`endif
26 95 fafa1971
////////////////////////////////////////////////////////////////////////
27
/*
28
//  Module Name: sparc_tlu_intctl
29
//  Description:
30
//    Contains the code for receiving interrupts from the crossbar,
31
//    and sending interrupts out to other processors through the corssbar.
32
//    The interrupt receive register (INRR, asi=0x49/VA=0),  incoming
33
//    vector register (INVR, asi=0x7f/VA=0x40), and interrupt vector
34
//    dispatch register (INDR, asi=0x77/VA=0) are implemented in this
35
//    block.  This block also initiates thread reset/wake up when a
36
//    reset packet is received.
37
//
38
*/
39
 
40 113 albert.wat
`include "iop.h"
41 95 fafa1971
 
42
// from intdp.v for now
43 113 albert.wat
`define INT_THR_HI  12
44 95 fafa1971
 
45
////////////////////////////////////////////////////////////////////////
46
// Local header file includes / local defines
47
////////////////////////////////////////////////////////////////////////
48 113 albert.wat
`include "tlu.h"
49 95 fafa1971
 
50
module sparc_tlu_intctl(/*AUTOARG*/
51
   // Outputs
52
   so, int_rst_l, tlu_ifu_hwint_i3, tlu_ifu_rstthr_i2, tlu_ifu_rstint_i2,
53
   tlu_ifu_nukeint_i2, tlu_ifu_resumint_i2, tlu_ifu_pstate_ie,
54
   int_tlu_longop_done,  inc_ind_ld_int_i1, inc_indr_req_valid,
55
   inc_ind_rstthr_i1, // inc_ind_asi_thr, inc_ind_asi_wr_inrr, 
56
   // inc_ind_asi_rd_invr, inc_ind_asi_inrr, inc_ind_asi_wr_indr, 
57
   inc_ind_indr_grant, inc_ind_thr_m, tlu_lsu_int_ld_ill_va_w2,
58
   inc_indr_req_thrid, tlu_asi_data_nf_vld_w2, tlu_asi_rdata_mxsel_g,
59
   // Inputs
60
   // modified to abide to the Niagara reset methodology 
61
   // clk, se, si, reset, const_cpuid, lsu_tlu_cpx_vld, lsu_tlu_cpx_req, 
62
   rclk, se, sehold, si, rst_tri_en, arst_l, grst_l, const_cpuid,
63
   lsu_tlu_cpx_vld, lsu_tlu_cpx_req, lsu_tlu_pcxpkt_ack, tlu_ld_data_vld_g,
64
   ind_inc_thrid_i1, ind_inc_type_i1, tlu_int_asi_vld, tlu_int_asi_load,
65
   tlu_int_asi_store, tlu_int_asi_thrid, tlu_int_asi_state, tlu_int_tid_m,
66
   tlu_int_pstate_ie, int_pending_i2_l, // indr_inc_rst_pkt, tlu_int_redmode,  
67
   tlu_asi_queue_rd_vld_g, tlu_va_ill_g); // tlu_flush_all_w2
68
 
69
//
70
// modified to abide to the Niagara reset methodology 
71
//   input            clk, se, si, reset;
72
   input            rclk, se, si;
73
   input            arst_l, grst_l;
74
   input            sehold;
75
   input            rst_tri_en;
76
   input [3:0]       const_cpuid;
77
 
78
   input            lsu_tlu_cpx_vld;    // cpx from lsu
79
   input [3:0]       lsu_tlu_cpx_req;    // cpx req type
80
   // the flush bit is included in lsu_tlu_cpx_vld
81
   // input         lsu_tlu_cpx_nc;
82
   input            lsu_tlu_pcxpkt_ack;
83
 
84
// removed unused pins
85
// input [`INT_THR_HI:0] lsu_tlu_st_rs3_data_g;
86
// input            lsu_tlu_pmode;
87
// input [3:0]  tlu_int_sftint_pend;
88
 
89
   input [4:0]   ind_inc_thrid_i1; // connect to lsu_tlu_intpkt[12:8]
90
   input [1:0]   ind_inc_type_i1;  // connect to lsu_tlu_intpkt[16]
91
 
92
   input            tlu_int_asi_vld;
93
   input            tlu_int_asi_load;  // read enable
94
   input            tlu_int_asi_store; // write enable
95
   input [1:0]   tlu_int_asi_thrid; // thread making asi request
96
   input [7:0]   tlu_int_asi_state; // asi to be read/written
97
   // input        tlu_scpd_rd_vld_g; // rdata vld from scratchpad
98
   // removed no longer necessary 
99
   // input        tlu_va_all_zero_g; // va address - all zero 
100
   input        tlu_va_ill_g;      // illega va range 
101
   input        tlu_asi_queue_rd_vld_g; // rdata vld from asi queues
102
   input        tlu_ld_data_vld_g; // rdata vld from asi queues
103
   // input        tlu_flush_all_w2;  // flush pipe from tcl 
104
 
105
   input [1:0]   tlu_int_tid_m;
106
 
107
   input [3:0]   tlu_int_pstate_ie;
108
   // input [3:0]       tlu_int_redmode;
109
 
110
   // from int_dp
111
   input [3:0]       int_pending_i2_l;   // uncleared interrupt
112
   // input         indr_inc_rst_pkt;
113
   // added for timing
114
   // input [1:0]       lsu_tlu_rst_pkt;
115
 
116
   output           int_rst_l, so;
117
 
118
   // to ifu
119
   output [3:0]     tlu_ifu_hwint_i3;   // interrupt
120
   output [3:0]     tlu_ifu_rstthr_i2;  // reset, nuke or resume
121
   output           tlu_ifu_rstint_i2;  // reset msg
122
   output           tlu_ifu_nukeint_i2; // idle/suspend message
123
   output           tlu_ifu_resumint_i2;// resume message
124
   output [3:0]      tlu_ifu_pstate_ie;
125
 
126
   output [3:0]     int_tlu_longop_done;
127
// 
128
// removed - IFU will derive the signal locally
129
//   output [3:0]     tlu_ifu_int_activate_i3;// wake up signal for thread
130
 
131
   // to int_dp
132
   output [3:0]     inc_ind_ld_int_i1;          // ld new interrupt
133
   output [3:0]     inc_ind_rstthr_i1;          // ld new rst vector
134
 
135
   // convert the signal back to non-inverting version for grape
136
   // output [3:0]     inc_ind_asi_thr_l;          // choose asi op thread
137
   // output [3:0]     inc_ind_asi_thr;          // choose asi op thread
138
   // output [3:0]     inc_ind_asi_wr_inrr;        // write to INRR (per thread)
139
   // output [3:0]     inc_ind_asi_wr_indr;        // write to INDR
140
   // output [3:0]     inc_ind_asi_rd_invr;        // read INVR and 
141
                                                // reset corr. bit in INRR
142
   // obsolete output
143
   // output        inc_ind_asi_inrr;           // choose which reg to read
144
   // convert the signal back to non-inverting version for grape
145
   // output [3:0]     inc_ind_indr_grant_l;       // move on to next pcx pkt
146
   output [3:0]     inc_ind_indr_grant;       // move on to next pcx pkt
147
   // convert the signal back to non-inverting version for grape
148
   // output [3:0]     inc_ind_thr_m_l;            // M stage thread
149
   output [3:0]     inc_ind_thr_m;            // M stage thread
150
 
151
   // pcx pkt fields
152
   output           inc_indr_req_valid;     // valid bit for PCX int pkt
153
   output [1:0] inc_indr_req_thrid;     // thread sending pcx int pkt
154
 
155
   // to tlu
156
   // output tlu_lsu_int_ldxa_vld_w2;  // valid asi data from int or scpd 
157
   output tlu_asi_data_nf_vld_w2;  // valid asi data from int or scpd 
158
   output tlu_lsu_int_ld_ill_va_w2; // illega va range - load  
159
   // to intdp
160
   output [3:0] tlu_asi_rdata_mxsel_g; // mux selects to the asi rdata
161
 
162
   // local signals
163
   // wire indr_inc_rst_pkt;
164
   wire inc_ind_asi_inrr;           // choose which reg to read
165
   wire int_tlu_asi_data_vld_g, int_tlu_asi_data_vld_w2;
166
   wire int_ld_ill_va_g, int_ld_ill_va_w2;
167
   wire hw_int_i1,
168
                rst_int_i1,
169
                nuke_int_i1,
170
                resum_int_i1;
171
 
172
   wire [3:0]        int_thr_i1,
173
                    rstthr_i1,
174
                    asi_thr;
175
 
176
   wire [3:0]        int_pending_i2;
177
//                  int_activate_i2;
178
 
179
   wire             asi_write,
180
                    asi_read,
181
                    asi_invr,
182
                    asi_indr;
183
 
184
   wire [3:0]        indr_vld,
185
                    indr_rst,
186
                    indr_vld_next,
187
                    indr_grant;
188
 
189
   // added for bug 3945
190
   wire [3:0] indr_req_vec;
191
   wire indr_req_valid_disable;
192
 
193
   // wire [3:0]            int_or_redrst;
194
   wire [3:0]        intd_done;
195
 
196
   // wire          red_thread, valid_dest;
197
   wire             local_rst;  // local reset 
198
   wire             local_rst_l;  // local reset 
199
   wire             clk;        // local clk 
200
 
201
 
202
   //
203
   // Code Starts Here
204
   //
205
   //=========================================================================================
206
   //   reset
207
   //=========================================================================================
208
 
209
   dffrl_async dffrl_local_rst_l(
210
       .din  (grst_l),
211
       .clk  (clk),
212
       .rst_l(arst_l),
213
       .q    (local_rst_l),
214
       .se   (se),
215 113 albert.wat
       `SIMPLY_RISC_SCANIN,
216 95 fafa1971
       .so   ()
217
   );
218
   assign local_rst = ~local_rst_l;
219
   assign int_rst_l = local_rst_l;
220
 
221
   // create local clk
222
   assign clk = rclk;
223
 
224
   //-------------------------------------
225
   // Basic Operation
226
   //-------------------------------------
227
   sink s1(const_cpuid[3]);
228
 
229
   assign  tlu_ifu_pstate_ie = tlu_int_pstate_ie;
230
 
231
   // process cpx interrupt type
232
   // int = 00
233
   // the flush bit from cpx packet is now included in the
234
   // lsu_tlu_cpx_vld qualification
235
   assign  hw_int_i1 = (lsu_tlu_cpx_vld &
236
                        // (lsu_tlu_cpx_req == `INT_RET) & ~lsu_tlu_cpx_nc &
237 113 albert.wat
                        (lsu_tlu_cpx_req == `INT_RET) &
238 95 fafa1971
                        (ind_inc_thrid_i1[4:2] == const_cpuid[2:0])) ?
239
                         ~ind_inc_type_i1[1] & ~ind_inc_type_i1[0] :
240
                         1'b0;
241
   //reset = 01
242
   // the flush bit from cpx packet is now included in the
243
   // lsu_tlu_cpx_vld qualification
244
   assign  rst_int_i1 = (lsu_tlu_cpx_vld &
245
                         // (lsu_tlu_cpx_req == `INT_RET) && ~lsu_tlu_cpx_nc &
246 113 albert.wat
                         (lsu_tlu_cpx_req == `INT_RET) &
247 95 fafa1971
                         (ind_inc_thrid_i1[4:2] == const_cpuid[2:0])) ?
248
                          ~ind_inc_type_i1[1] & ind_inc_type_i1[0] :
249
                          1'b0;
250
   // idle/nuke = 10
251
   // the flush bit from cpx packet is now included in the
252
   // lsu_tlu_cpx_vld qualification
253
   assign  nuke_int_i1 = (lsu_tlu_cpx_vld &
254
                           // (lsu_tlu_cpx_req == `INT_RET) & ~lsu_tlu_cpx_nc &
255 113 albert.wat
                           (lsu_tlu_cpx_req == `INT_RET) &
256 95 fafa1971
                           (ind_inc_thrid_i1[4:2] == const_cpuid[2:0])) ?
257
                            ind_inc_type_i1[1] & ~ind_inc_type_i1[0] :
258
                            1'b0;
259
   // resume = 11
260
   // the flush bit from cpx packet is now included in the
261
   // lsu_tlu_cpx_vld qualification
262
   assign  resum_int_i1 = (lsu_tlu_cpx_vld &
263
                           // (lsu_tlu_cpx_req == `INT_RET) & ~lsu_tlu_cpx_nc &
264 113 albert.wat
                           (lsu_tlu_cpx_req == `INT_RET) &
265 95 fafa1971
                           (ind_inc_thrid_i1[4:2] == const_cpuid[2:0])) ?
266
                            ind_inc_type_i1[1] & ind_inc_type_i1[0] :
267
                            1'b0;
268
 
269 113 albert.wat
   dffr_s #1  rstint_ff(.din  (rst_int_i1),
270 95 fafa1971
                      .q    (tlu_ifu_rstint_i2),
271
                      .clk  (clk),
272
//
273
// modified to abide to the Niagara reset methodology 
274
//                    .rst  (reset),
275
                      .rst  (local_rst),
276 113 albert.wat
                      .se   (se), `SIMPLY_RISC_SCANIN, .so());
277 95 fafa1971
 
278 113 albert.wat
   dffr_s #1  nukint_ff(.din  (nuke_int_i1),
279 95 fafa1971
                      .q    (tlu_ifu_nukeint_i2),
280
                      .clk  (clk),
281
//
282
// modified to abide to the Niagara reset methodology 
283
//                    .rst  (reset),
284
                      .rst  (local_rst),
285 113 albert.wat
                      .se   (se), `SIMPLY_RISC_SCANIN, .so());
286 95 fafa1971
 
287 113 albert.wat
   dffr_s #1  resint_ff(.din  (resum_int_i1),
288 95 fafa1971
                      .q    (tlu_ifu_resumint_i2),
289
                      .clk  (clk),
290
//
291
// modified to abide to the Niagara reset methodology 
292
//                    .rst  (reset),
293
                      .rst  (local_rst),
294 113 albert.wat
                      .se   (se), `SIMPLY_RISC_SCANIN, .so());
295 95 fafa1971
 
296
   // decode int thread id
297
   assign  int_thr_i1[0] = ~ind_inc_thrid_i1[1] & ~ind_inc_thrid_i1[0];
298
   assign  int_thr_i1[1] = ~ind_inc_thrid_i1[1] &  ind_inc_thrid_i1[0];
299
   assign  int_thr_i1[2] =  ind_inc_thrid_i1[1] & ~ind_inc_thrid_i1[0];
300
   assign  int_thr_i1[3] =  ind_inc_thrid_i1[1] &  ind_inc_thrid_i1[0];
301
 
302
   assign  inc_ind_ld_int_i1 = {4{hw_int_i1}} & int_thr_i1;
303
   assign  inc_ind_rstthr_i1 = {4{rst_int_i1}} & int_thr_i1;
304
   assign  rstthr_i1 = {4{rst_int_i1 | nuke_int_i1 | resum_int_i1}}
305
                        & int_thr_i1;
306
 
307
   // decode thr_m
308
   // convert the signal back to non-inverting version for grape
309
   /*
310
   assign  inc_ind_thr_m_l[0] = ~(~tlu_int_tid_m[1] & ~tlu_int_tid_m[0]);
311
   assign  inc_ind_thr_m_l[1] = ~(~tlu_int_tid_m[1] &  tlu_int_tid_m[0]);
312
   assign  inc_ind_thr_m_l[2] = ~( tlu_int_tid_m[1] & ~tlu_int_tid_m[0]);
313
   assign  inc_ind_thr_m_l[3] = ~( tlu_int_tid_m[1] &  tlu_int_tid_m[0]);
314
   */
315
 
316
   assign  inc_ind_thr_m[0] = ~tlu_int_tid_m[1] & ~tlu_int_tid_m[0];
317
   assign  inc_ind_thr_m[1] = ~tlu_int_tid_m[1] &  tlu_int_tid_m[0];
318
   assign  inc_ind_thr_m[2] =  tlu_int_tid_m[1] & ~tlu_int_tid_m[0];
319
   assign  inc_ind_thr_m[3] =  tlu_int_tid_m[1] &  tlu_int_tid_m[0];
320
 
321
 
322
   // Interrupt continues to be signalled even 1 cycle after read is
323
   // done.  This should not be a problem, since the lsu will probably
324
   // burn one cycle to complete the read by forwarding it to the reg
325
   // file.  Otherwise, just burn another cycle in the IFU before
326
   // starting the thread (this is also done right now).
327
 
328
   assign  int_pending_i2 = ~int_pending_i2_l;
329
 
330
   // removed IFU will derive the siganl locally
331
   /*
332
   assign  int_activate_i2 = ~int_pending_i2_l | tlu_int_sftint_pend;
333
   // send message to SWL to wake up thread if it is halted
334 113 albert.wat
   dff_s #4 act_signal_reg(.din (int_activate_i2[3:0]),
335 95 fafa1971
                         .q   (tlu_ifu_int_activate_i3[3:0]),
336
                         .clk (clk),
337 113 albert.wat
                         .se  (se), `SIMPLY_RISC_SCANIN, .so());
338 95 fafa1971
   */
339
 
340
   // ask IFU to schedule interrupt
341 113 albert.wat
   dff_s #4 int_signal_reg(.din (int_pending_i2[3:0]),
342 95 fafa1971
                         .q   (tlu_ifu_hwint_i3[3:0]),
343
                         .clk (clk),
344 113 albert.wat
                         .se  (se), `SIMPLY_RISC_SCANIN, .so());
345 95 fafa1971
 
346 113 albert.wat
   dff_s #4 rst_signal_reg(.din (rstthr_i1[3:0]),
347 95 fafa1971
                         .q   (tlu_ifu_rstthr_i2[3:0]),
348
                         .clk (clk),
349 113 albert.wat
                         .se  (se), `SIMPLY_RISC_SCANIN, .so());
350 95 fafa1971
 
351
 
352
   //----------------------------------
353
   // ASI Registers
354
   //----------------------------------
355
   //ASI_INTR_RECEIVE: 0x72
356
   //ASI_UDB_INTR_W: 0x73
357
   //ASI_UDB_INTR_R: 0x74
358
   //ASI_MESSAGE_MASK: 0x7D
359
 
360
   // decode asi thread
361
   assign  asi_thr[0] = ~tlu_int_asi_thrid[1] & ~tlu_int_asi_thrid[0];
362
   assign  asi_thr[1] = ~tlu_int_asi_thrid[1] &  tlu_int_asi_thrid[0];
363
   assign  asi_thr[2] =  tlu_int_asi_thrid[1] & ~tlu_int_asi_thrid[0];
364
   assign  asi_thr[3] =  tlu_int_asi_thrid[1] &  tlu_int_asi_thrid[0];
365
 
366
   // convert the signal back to non-inverting version for grape
367
   // assign  inc_ind_asi_thr_l = ~asi_thr;
368
   // assign  inc_ind_asi_thr = asi_thr;
369
 
370
   // read or write op
371
   assign  asi_write = tlu_int_asi_vld & tlu_int_asi_store;
372
   assign  asi_read = tlu_int_asi_vld & tlu_int_asi_load;
373
 
374
   // decode asi target
375
   // ASI_INTR_RECEIVE
376
   assign inc_ind_asi_inrr = ~tlu_int_asi_state[7] &
377
              tlu_int_asi_state[6]  &
378
              tlu_int_asi_state[5] &
379
              tlu_int_asi_state[4] &
380
              ~tlu_int_asi_state[3]  &
381
              ~tlu_int_asi_state[2] &
382
              tlu_int_asi_state[1] &
383
              ~tlu_int_asi_state[0];      // 0x72
384
 
385
   // need to also check if VA=0x40
386
   // what else is mapped to this asi?
387
   // ASI_UDB_INTR_R
388
   assign asi_invr = ~tlu_int_asi_state[7] &
389
              tlu_int_asi_state[6]  &
390
              tlu_int_asi_state[5]  &
391
              tlu_int_asi_state[4]  &
392
              ~tlu_int_asi_state[3]  &
393
              tlu_int_asi_state[2]  &
394
              ~tlu_int_asi_state[1]  &
395
              ~tlu_int_asi_state[0];      // 0x74
396
 
397
   // VA<63:19>=0 is not checked
398
   // ASI_UDB_INTR_W
399
   assign asi_indr = ~tlu_int_asi_state[7] &
400
              tlu_int_asi_state[6]  &
401
              tlu_int_asi_state[5]  &
402
              tlu_int_asi_state[4]  &
403
              ~tlu_int_asi_state[3] &
404
              ~tlu_int_asi_state[2]  &
405
              tlu_int_asi_state[1]  &
406
              tlu_int_asi_state[0];      // 0x73
407
   /*
408
   // ASI_MESSAGE_MASK_REG
409
   // not implemented any more
410
   assign  inc_ind_asi_wr_inrr = asi_thr & {4{inc_ind_asi_inrr & asi_write}};
411
   assign  inc_ind_asi_wr_indr = asi_thr & {4{asi_indr & asi_write}};
412
   assign  inc_ind_asi_rd_invr = asi_thr & {4{asi_invr & asi_read}};
413
 
414
   assign  red_thread = (tlu_int_redmode[0] & asi_thr[0] |
415
                         tlu_int_redmode[1] & asi_thr[1] |
416
                         tlu_int_redmode[2] & asi_thr[2] |
417
                         tlu_int_redmode[3] & asi_thr[3]);
418
   */
419
   // modified for bug 2109 
420
   // modified for one-hot mux problem and support of macro test
421
   // 
422
   assign tlu_asi_rdata_mxsel_g[0] =
423
              asi_invr & ~(rst_tri_en | sehold);
424
   assign tlu_asi_rdata_mxsel_g[1] =
425
              inc_ind_asi_inrr & ~(rst_tri_en | asi_invr | sehold);
426
   assign tlu_asi_rdata_mxsel_g[2] =
427
              ~((|tlu_asi_rdata_mxsel_g[1:0]) | tlu_asi_rdata_mxsel_g[3]);
428
   assign tlu_asi_rdata_mxsel_g[3] =
429
              tlu_asi_queue_rd_vld_g & ~(rst_tri_en | asi_invr | sehold |
430
              inc_ind_asi_inrr);
431
   // 
432
   assign int_tlu_asi_data_vld_g =
433
          ((asi_invr | inc_ind_asi_inrr) & asi_read) | tlu_ld_data_vld_g;
434
 
435
 
436 113 albert.wat
   dffr_s dffr_int_tlu_asi_data_vld_w2 (
437 95 fafa1971
    .din (int_tlu_asi_data_vld_g),
438
    .q   (int_tlu_asi_data_vld_w2),
439
    .clk (clk),
440
    .rst (local_rst),
441
    .se  (1'b0),
442 113 albert.wat
    `SIMPLY_RISC_SCANIN,
443 95 fafa1971
    .so  ()
444
);
445
 
446
// modified for timing
447
// assign tlu_lsu_int_ldxa_vld_w2 = 
448
//            int_tlu_asi_data_vld_w2 & ~tlu_flush_all_w2;
449
 
450
assign tlu_asi_data_nf_vld_w2 =
451
            int_tlu_asi_data_vld_w2;
452
   // 
453
   // illegal va range
454
   //
455
   /*
456
   assign int_ld_ill_va_g =
457
          ((asi_invr | inc_ind_asi_inrr) & asi_read &
458
            ~tlu_va_all_zero_g) | tlu_va_ill_g;
459
   */
460
   assign int_ld_ill_va_g = tlu_va_ill_g;
461
 
462 113 albert.wat
   dffr_s dffr_tlu_lsu_int_ld_ill_va_w2 (
463 95 fafa1971
    .din (int_ld_ill_va_g),
464
    // .q   (tlu_lsu_int_ld_ill_va_w2),
465
    .q   (int_ld_ill_va_w2),
466
    .clk (clk),
467
    .rst (local_rst),
468
    .se  (1'b0),
469 113 albert.wat
    `SIMPLY_RISC_SCANIN,
470 95 fafa1971
    .so  ()
471
);
472
 
473
assign tlu_lsu_int_ld_ill_va_w2 = int_ld_ill_va_w2;
474
   // Write to INDR
475
   // Can send reset pkt's only in red mode
476
   // modified for timing
477
   // modified for bug3170
478
   /*
479
   assign int_or_redrst[3:0] =
480
              ({4{~indr_inc_rst_pkt}} | tlu_int_redmode[3:0]) &
481
                            asi_thr[3:0];
482
 
483
   assign indr_vld_next[3:0] =
484
              inc_ind_asi_wr_indr[3:0] & int_or_redrst[3:0] |  // set
485
                  indr_vld[3:0] & ~indr_rst[3:0];         // reset
486
   //
487
   // original code
488
   assign indr_vld_next[3] =
489
              (asi_indr & asi_write & asi_thr[3] &
490
              (~(|lsu_tlu_rst_pkt[1:0]) | tlu_int_redmode[3])) |
491
              (indr_vld[3] & ~indr_rst[3]);
492
 
493
   assign indr_vld_next[2] =
494
              (asi_indr & asi_write & asi_thr[2] &
495
              (~(|lsu_tlu_rst_pkt[1:0]) | tlu_int_redmode[2])) |
496
              (indr_vld[2] & ~indr_rst[2]);
497
 
498
   assign indr_vld_next[1] =
499
              (asi_indr & asi_write & asi_thr[1] &
500
              (~(|lsu_tlu_rst_pkt[1:0]) | tlu_int_redmode[1])) |
501
              (indr_vld[1] & ~indr_rst[1]);
502
 
503
   assign indr_vld_next[0] =
504
              (asi_indr & asi_write & asi_thr[0] &
505
              (~(|lsu_tlu_rst_pkt[1:0]) | tlu_int_redmode[0])) |
506
              (indr_vld[0] & ~indr_rst[0]);
507
   */
508
   assign indr_vld_next[3] =
509
              (asi_indr & asi_write & asi_thr[3]) |
510
              (indr_vld[3] & ~indr_rst[3]);
511
 
512
   assign indr_vld_next[2] =
513
              (asi_indr & asi_write & asi_thr[2]) |
514
              (indr_vld[2] & ~indr_rst[2]);
515
 
516
   assign indr_vld_next[1] =
517
              (asi_indr & asi_write & asi_thr[1]) |
518
              (indr_vld[1] & ~indr_rst[1]);
519
 
520
   assign indr_vld_next[0] =
521
              (asi_indr & asi_write & asi_thr[0]) |
522
              (indr_vld[0] & ~indr_rst[0]);
523
 
524 113 albert.wat
   dff_s #4 indr_vld_reg(.din (indr_vld_next[3:0]),
525 95 fafa1971
                       .q   (indr_vld[3:0]),
526
                       .clk (clk),
527 113 albert.wat
                       .se  (se), `SIMPLY_RISC_SCANIN, .so());
528 95 fafa1971
   // 
529
   // modified for bug 3945
530 113 albert.wat
   dffr_s dffr_indr_req_valid_disable(
531 95 fafa1971
       .din (|indr_vld[3:0]),
532
           .q   (indr_req_valid_disable),
533
           .clk (clk),
534
           .rst  (local_rst | lsu_tlu_pcxpkt_ack),
535
           .se  (se),
536 113 albert.wat
       `SIMPLY_RISC_SCANIN,
537 95 fafa1971
       .so());
538
 
539 113 albert.wat
   dffe_s #(4) dffe_indr_req_vec(
540 95 fafa1971
       .din (indr_vld_next[3:0]),
541
           .q   (indr_req_vec[3:0]),
542
       .en  (~indr_req_valid_disable),
543
           .clk (clk),
544
           .se  (se),
545 113 albert.wat
       `SIMPLY_RISC_SCANIN,
546 95 fafa1971
       .so());
547
 
548
   // Round robin scheduler for indr request to pcx
549
   sparc_ifu_rndrob  indr_sched(
550
       // .req_vec (indr_vld[3:0]),
551
       .req_vec (indr_req_vec[3:0]),
552
           .advance (lsu_tlu_pcxpkt_ack),
553
           .rst_tri_enable (rst_tri_en),
554
           .clk (clk),
555
           .reset  (local_rst),
556
           .se  (se),
557
           .si (si),
558
           .grant_vec (indr_grant[3:0]),
559
           .so ());
560
 
561
// convert the signal back to non-inverting version for grape
562
// modified to fix one-hot indetermination
563
     assign  inc_ind_indr_grant[0] =
564
                 ~(|inc_ind_indr_grant[3:1]);
565
     assign  inc_ind_indr_grant[1] =
566
                 indr_grant[1];
567
     assign  inc_ind_indr_grant[2] =
568
                 indr_grant[2] & ~indr_grant[1];
569
     assign  inc_ind_indr_grant[3] =
570
                 indr_grant[3] & ~(|inc_ind_indr_grant[2:1]);
571
//
572
   assign  indr_rst[3:0] =
573
               {4{local_rst}} | (indr_grant[3:0] & {4{lsu_tlu_pcxpkt_ack}});
574
   assign  intd_done[3:0] =
575
               (indr_grant[3:0] & indr_vld[3:0] & {4{lsu_tlu_pcxpkt_ack}});
576
 
577 113 albert.wat
   dffr_s #(4) intd_reg(
578 95 fafa1971
       .din (intd_done[3:0]),
579
           .q   (int_tlu_longop_done[3:0]),
580
           .clk (clk),
581
           .rst  (local_rst),
582
           .se  (se),
583 113 albert.wat
       `SIMPLY_RISC_SCANIN,
584 95 fafa1971
       .so());
585
 
586
   // INDR pcx request control signals
587
   // modified for bug 3945
588
   // assign  inc_indr_req_valid = (|indr_vld[3:0]) & ~lsu_tlu_pcxpkt_ack;
589
   assign  inc_indr_req_valid = indr_req_valid_disable;
590
   assign  inc_indr_req_thrid[1] = indr_grant[3] | indr_grant[2];
591
   assign  inc_indr_req_thrid[0] = indr_grant[3] | indr_grant[1];
592
 
593
endmodule // sparc_tlu_intctl

powered by: WebSVN 2.1.0

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