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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [lsu_rrobin_picker2.v] - Blame information for rev 105

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

Line No. Rev Author Line
1 95 fafa1971
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: lsu_rrobin_picker2.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
//      Description:    Round-Robin Picker for 4 eventss.
24
//                      (see description of picker at the end of this file)
25
*/
26
////////////////////////////////////////////////////////////////////////
27
// Global header file includes
28
////////////////////////////////////////////////////////////////////////
29
// system level definition file which contains the/*
30
/* ========== Copyright Header Begin ==========================================
31
*
32
* OpenSPARC T1 Processor File: sys.h
33
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
35
*
36
* The above named program is free software; you can redistribute it and/or
37
* modify it under the terms of the GNU General Public
38
* License version 2 as published by the Free Software Foundation.
39
*
40
* The above named program is distributed in the hope that it will be
41
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
42
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
43
* General Public License for more details.
44
*
45
* You should have received a copy of the GNU General Public
46
* License along with this work; if not, write to the Free Software
47
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
48
*
49
* ========== Copyright Header End ============================================
50
*/
51
// -*- verilog -*-
52
////////////////////////////////////////////////////////////////////////
53
/*
54
//
55
// Description:         Global header file that contain definitions that
56
//                      are common/shared at the systme level
57
*/
58
////////////////////////////////////////////////////////////////////////
59
//
60
// Setting the time scale
61
// If the timescale changes, JP_TIMESCALE may also have to change.
62
`timescale      1ps/1ps
63
 
64
//
65
// JBUS clock
66
// =========
67
//
68
 
69
 
70
 
71
// Afara Link Defines
72
// ==================
73
 
74
// Reliable Link
75
 
76
 
77
 
78
 
79
// Afara Link Objects
80
 
81
 
82
// Afara Link Object Format - Reliable Link
83
 
84
 
85
 
86
 
87
 
88
 
89
 
90
 
91
 
92
 
93
// Afara Link Object Format - Congestion
94
 
95
 
96
 
97
 
98
 
99
 
100
 
101
 
102
 
103
 
104
 
105
// Afara Link Object Format - Acknowledge
106
 
107
 
108
 
109
 
110
 
111
 
112
 
113
 
114
 
115
 
116
 
117
// Afara Link Object Format - Request
118
 
119
 
120
 
121
 
122
 
123
 
124
 
125
 
126
 
127
 
128
 
129
 
130
 
131
 
132
 
133
 
134
 
135
// Afara Link Object Format - Message
136
 
137
 
138
 
139
// Acknowledge Types
140
 
141
 
142
 
143
 
144
// Request Types
145
 
146
 
147
 
148
 
149
 
150
// Afara Link Frame
151
 
152
 
153
 
154
//
155
// UCB Packet Type
156
// ===============
157
//
158
 
159
 
160
 
161
 
162
 
163
 
164
 
165
 
166
 
167
 
168
 
169
 
170
 
171
 
172
 
173
 
174
 
175
//
176
// UCB Data Packet Format
177
// ======================
178
//
179
 
180
 
181
 
182
 
183
 
184
 
185
 
186
 
187
 
188
 
189
 
190
 
191
 
192
 
193
 
194
 
195
 
196
 
197
 
198
 
199
 
200
 
201
 
202
 
203
 
204
 
205
 
206
 
207
 
208
 
209
// Size encoding for the UCB_SIZE_HI/LO field
210
// 000 - byte
211
// 001 - half-word
212
// 010 - word
213
// 011 - double-word
214
// 111 - quad-word
215
 
216
 
217
 
218
 
219
 
220
 
221
 
222
//
223
// UCB Interrupt Packet Format
224
// ===========================
225
//
226
 
227
 
228
 
229
 
230
 
231
 
232
 
233
 
234
 
235
 
236
//`define UCB_THR_HI             9      // (6) cpu/thread ID shared with
237
//`define UCB_THR_LO             4             data packet format
238
//`define UCB_PKT_HI             3      // (4) packet type shared with
239
//`define UCB_PKT_LO             0      //     data packet format
240
 
241
 
242
 
243
 
244
 
245
 
246
 
247
//
248
// FCRAM Bus Widths
249
// ================
250
//
251
 
252
 
253
 
254
 
255
 
256
 
257
//
258
// ENET clock periods
259
// ==================
260
//
261
 
262
 
263
 
264
 
265
//
266
// JBus Bridge defines
267
// =================
268
//
269
 
270
 
271
 
272
 
273
 
274
 
275
 
276
 
277
 
278
 
279
 
280
//
281
// PCI Device Address Configuration
282
// ================================
283
//
284
 
285
 
286
 
287
 
288
 
289
 
290
 
291
 
292
 
293
 
294
 
295
 
296
 
297
 
298
 
299
 
300
 
301
 
302
 
303
 
304
 
305
 
306
 
307
                                        // time scale definition
308
 
309
////////////////////////////////////////////////////////////////////////
310
// Local header file includes / local defines
311
////////////////////////////////////////////////////////////////////////    
312
 
313
module lsu_rrobin_picker2 (/*AUTOARG*/
314
   // Outputs
315
   so, pick_one_hot,
316
   // Inputs
317
   rclk, grst_l, arst_l, si, se, events, events_picked, thread_force
318
   );
319
 
320
input           rclk ;
321
input           grst_l;
322
input           arst_l;
323
input           si;
324
input           se;
325
output          so;
326
 
327
 
328
input   [3:0]    events ;                // multi-hot; events that could be chosen
329
input   [3:0]    events_picked ;         // one-hot; events that were picked - same cycle as pick
330
input   [3:0]    thread_force ;          // multi-hot; thread events that have high priority
331
 
332
output  [3:0]    pick_one_hot ;          // one-hot
333
 
334
wire         clk;
335
wire         reset,dbb_reset_l ;
336
 
337
wire  [3:0]  thread_force_pe_mask ;
338
wire  [3:0]  pick_thread_force_1hot ;
339
wire         thread_force_events_sel ;
340
 
341
wire  [3:0]  pick_rrobin_1hot, pick_rev_rrobin_1hot, pick_rrobin_1hot_mx ;
342
wire         events_pick_dir_d1 ;
343
wire         events_pick_dir ;
344
wire  [3:0]  pick_rrobin_status_or_one_hot ;
345
wire  [3:0]  pick_rrobin_din ;
346
wire  [3:0]  pick_rrobin ;
347
wire         pick_rrobin_reset ;
348
wire         pick_rrobin_dir_upd ;
349
wire  [3:0]  pick_rrobin_events ;
350
 
351
 
352
 
353
    dffrl_async rstff(.din (grst_l),
354
                        .q   (dbb_reset_l),
355
                        .clk (clk), .se(se), .si(), .so(),
356
                        .rst_l (arst_l));
357
 
358
assign  reset =  ~dbb_reset_l;
359
assign  clk = rclk;
360
 
361
 
362
//*******************************************************************************************************
363
//PICK  
364
//*******************************************************************************************************
365
 
366
   //pick for thread force events
367
assign  thread_force_events_sel = |(events[3:0] & thread_force[3:0]) ;
368
 
369
assign  thread_force_pe_mask[3:0]  =  events[3:0] & thread_force[3:0] ;
370
assign  pick_thread_force_1hot[0] = thread_force_pe_mask[0] ;
371
assign  pick_thread_force_1hot[1] = thread_force_pe_mask[1] & ~thread_force_pe_mask[0] ;
372
assign  pick_thread_force_1hot[2] = thread_force_pe_mask[2] & ~|thread_force_pe_mask[1:0] ;
373
assign  pick_thread_force_1hot[3] = thread_force_pe_mask[3] & ~|thread_force_pe_mask[2:0] ;
374
 
375
   //pick for round robin events
376
assign  pick_rrobin_events[3:0]  =  events[3:0] & ~pick_rrobin[3:0] ;
377
 
378
assign  pick_rrobin_1hot[0] = ~events_pick_dir_d1 & pick_rrobin_events[0] ;
379
assign  pick_rrobin_1hot[1] = ~events_pick_dir_d1 & pick_rrobin_events[1] & ~pick_rrobin_events[0] ;
380
assign  pick_rrobin_1hot[2] = ~events_pick_dir_d1 & pick_rrobin_events[2] & ~|pick_rrobin_events[1:0] ;
381
assign  pick_rrobin_1hot[3] = ~events_pick_dir_d1 & pick_rrobin_events[3] & ~|pick_rrobin_events[2:0] ;
382
 
383
   //pick for reverse round robin events
384
assign  pick_rev_rrobin_1hot[0] = events_pick_dir_d1 & pick_rrobin_events[0] & ~|pick_rrobin_events[3:1] ;
385
assign  pick_rev_rrobin_1hot[1] = events_pick_dir_d1 & pick_rrobin_events[1] & ~|pick_rrobin_events[3:2] ;
386
assign  pick_rev_rrobin_1hot[2] = events_pick_dir_d1 & pick_rrobin_events[2] & ~|pick_rrobin_events[3] ;
387
assign  pick_rev_rrobin_1hot[3] = events_pick_dir_d1 & pick_rrobin_events[3] ;
388
 
389
assign  pick_rrobin_1hot_mx[3:0]  =  pick_rev_rrobin_1hot[3:0] | pick_rrobin_1hot[3:0] ;
390
assign  pick_one_hot[3:0]    =  thread_force_events_sel ? pick_thread_force_1hot[3:0] :
391
                                                          pick_rrobin_1hot_mx[3:0] ;
392
 
393
//*******************************************************************************************************
394
 
395
 
396
 
397
//*******************************************************************************************************
398
//PICK ROUND ROBIN (bug4814)
399
//*******************************************************************************************************
400
// this is used if there are no requests to be picked based on pick_status[3:0]
401
 
402
assign pick_rrobin_status_or_one_hot[3:0] = pick_rrobin[3:0] | events_picked[3:0] ;
403
assign pick_rrobin_reset = reset | ~|(events[3:0] & ~pick_rrobin_status_or_one_hot[3:0]) ;
404
   //change direction bit only when events are non-zero
405
assign pick_rrobin_dir_upd = |events[3:0] & (~|(events[3:0] & ~pick_rrobin_status_or_one_hot[3:0])) ;
406
 
407
   // make reset dominant
408
assign pick_rrobin_din[3:0] = pick_rrobin_status_or_one_hot[3:0] & ~{4{pick_rrobin_reset}};
409
 
410
dff   #(4) ff_pick_rrobin (
411
           .din    (pick_rrobin_din[3:0]),
412
           .q      (pick_rrobin[3:0]    ),
413
           .clk    (clk),
414
           .se     (1'b0),       .si (),          .so ()
415
            );
416
//*******************************************************************************************************
417
 
418
 
419
//*******************************************************************************************************
420
// PICK DIRECTION
421
//*******************************************************************************************************
422
 
423
   //bug4609 - change direction of pick all events are picked in round robin pick
424
   //          this is needed when the condition below occurs. assuming misc is less frequent
425
   //          this should pick load/store in round robin fashion
426
   //-------------------------------------------------------
427
   // cycle                 0   1   2
428
   //-------------------------------------------------------
429
   // history{misc,st,ld}  010 011 011
430
   // vld{misc,st,ld}      011 011 011
431
   //-------------------------------------------------------
432
 
433
assign events_pick_dir  =  ~reset &
434
                           (( ~pick_rrobin_dir_upd & events_pick_dir_d1) |              //hold
435
                            (  pick_rrobin_dir_upd & ~events_pick_dir_d1)) ;            //set - invert direction
436
 
437
   dff   #(1) ff_events_pick_dir (
438
        .din    (events_pick_dir),
439
        .q      (events_pick_dir_d1),
440
        .clk    (clk),
441
        .se     (1'b0),       .si (),          .so ()
442
        );
443
 
444
//*******************************************************************************************************
445
endmodule

powered by: WebSVN 2.1.0

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