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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_exu_rndrob.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_exu_rndrob.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_exu_rndrob
29
//  Description:
30
//  Round robin scheduler.  Least priority to the last granted
31
//  customer.  If no requests, the priority remains the same.
32
*/
33
////////////////////////////////////////////////////////////////////////
34
 
35
module sparc_exu_rndrob(/*AUTOARG*/
36
   // Outputs
37
   grant_vec,
38
   // Inputs
39
   clk, reset, se, req_vec, advance
40
   );
41
 
42
   input     clk, reset, se;
43
 
44
   input  [3:0] req_vec;
45
   input        advance;
46
 
47
   output [3:0] grant_vec;
48
 
49
   wire [3:0]    pv,
50
                next_pv,
51
                park_vec;
52
 
53
 
54
   assign  next_pv =  advance ? grant_vec : park_vec;
55
 
56 113 albert.wat
   dffr_s #4  park_reg(.din  (next_pv[3:0]),
57 95 fafa1971
                    .clk  (clk),
58
                    .q    (pv[3:0]),
59
                    .rst  (reset),
60 113 albert.wat
                    .se   (se), `SIMPLY_RISC_SCANIN, .so());
61 95 fafa1971
 
62
   assign  park_vec = pv;
63
 
64
   // if noone requests, don't advance, otherwise we'll go back to 0
65
   // and will not be fair to other requestors
66
   assign grant_vec[0] =  park_vec[3] & req_vec[0] |
67
                  park_vec[2] & ~req_vec[3] & req_vec[0] |
68
                  park_vec[1] & ~req_vec[2] & ~req_vec[3] & req_vec[0] |
69
                  ~req_vec[1] & ~req_vec[2] & ~req_vec[3];
70
 
71
   assign grant_vec[1] = park_vec[0] & req_vec[1] |
72
                  park_vec[3] & ~req_vec[0] & req_vec[1] |
73
                  park_vec[2] & ~req_vec[3] & ~req_vec[0] & req_vec[1] |
74
                  req_vec[1] & ~req_vec[2] & ~req_vec[3] & ~req_vec[0];
75
 
76
   assign grant_vec[2] = park_vec[1] & req_vec[2] |
77
                  park_vec[0] & ~req_vec[1] & req_vec[2] |
78
                  park_vec[3] & ~req_vec[0] & ~req_vec[1] & req_vec[2] |
79
                  req_vec[2] & ~req_vec[3] & ~req_vec[0] & ~req_vec[1];
80
 
81
   assign grant_vec[3] = park_vec[2] & req_vec[3] |
82
                  park_vec[1] & ~req_vec[2] & req_vec[3] |
83
                  park_vec[0] & ~req_vec[1] & ~req_vec[2] & req_vec[3] |
84
                  req_vec[3] & ~req_vec[0] & ~req_vec[1] & ~req_vec[2];
85
 
86
endmodule // sparc_exu_rndrob
87
 
88
 
89
 

powered by: WebSVN 2.1.0

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