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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_ifu_ctr5.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_ifu_ctr5.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_ifu_ctr5
29
//  Description:
30
//  5 bit counter for starvation detect
31
*/
32
 
33
module sparc_ifu_ctr5(/*AUTOARG*/
34
   // Outputs
35
   limit, so,
36
   // Inputs
37
   clk, se, si, rst_ctr_l
38
   );
39
 
40
   input     clk;
41
   input     se, si;
42
 
43
   input     rst_ctr_l;
44
 
45
   output    limit;
46
   output    so;
47
 
48
   wire [4:0] count,
49
              count_nxt,
50
              sum;
51
 
52
   assign   sum[0] = ~count[0];
53
   assign   sum[1] = count[1] ^ count[0];
54
   assign   sum[2] = count[2] ^ (count[1] & count[0]);
55
   assign   sum[3] = count[3] ^ (count[2] & count[1] & count[0]);
56
   assign   sum[4] = count[4] ^ (count[3] & count[2] & count[1] & count[0]);
57
   assign   count_nxt = sum & {5{rst_ctr_l}};
58
 
59 113 albert.wat
   dff_s #(5) cnt_reg(.din (count_nxt),
60 95 fafa1971
                                .q   (count),
61
                                .clk (clk),
62 113 albert.wat
                                .se  (se), `SIMPLY_RISC_SCANIN, .so());
63 95 fafa1971
 
64
   // limit set to 24 for now
65
   assign   limit = count[4] & count[3];
66
 
67
 
68
endmodule
69
 

powered by: WebSVN 2.1.0

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