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

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [T1-CPU/] [tlu/] [sparc_tlu_intctl.v] - Blame information for rev 5

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

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

powered by: WebSVN 2.1.0

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