Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: niu_zcp_ififo_sm.v | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | /*%W% %G%*/ | |
36 | ||
37 | /*************************************************************** | |
38 | * | |
39 | * File Name : niu_zcp_ififo_sm.v | |
40 | * Author Name : John Lo | |
41 | * Description : niu_zcp_fflp_intf control path | |
42 | * Parent Module: | |
43 | * Child Module: | |
44 | * Interface Mod: | |
45 | * Date Created : 3/18/05 | |
46 | * | |
47 | * Copyright (c) 2020, Sun Microsystems, Inc. | |
48 | * Sun Proprietary and Confidential | |
49 | * | |
50 | * Modification : | |
51 | * | |
52 | * Synthesis Notes: | |
53 | * | |
54 | * Design Notes: When adding more CAL states DON'T forget to | |
55 | * modify tt_atomic_op. | |
56 | * | |
57 | * | |
58 | **************************************************************/ | |
59 | ||
60 | ||
61 | module niu_zcp_ififo_sm | |
62 | (/*AUTOARG*/ | |
63 | // Outputs | |
64 | ififo_ren1, ififo_ren, ififo_state, | |
65 | // Inputs | |
66 | clk, reset, empty | |
67 | ); | |
68 | ||
69 | ||
70 | input clk; | |
71 | input reset; | |
72 | input empty; | |
73 | // outputs | |
74 | output ififo_ren1; | |
75 | output [2:0] ififo_ren; | |
76 | output [2:0] ififo_state; | |
77 | ||
78 | wire [2:0] ififo_state; | |
79 | reg [2:0] nx_ififo_state; | |
80 | reg kickoff_rd; | |
81 | parameter ZERO = 3'h0, | |
82 | ONE = 3'h1, | |
83 | TWO = 3'h2, | |
84 | THREE = 3'h3, | |
85 | FOUR = 3'h4, | |
86 | FIVE = 3'h5, | |
87 | SIX = 3'h6, | |
88 | SEVEN = 3'h7; | |
89 | ||
90 | // comb part | |
91 | always @ (/*AUTOSENSE*/empty or ififo_state) | |
92 | begin | |
93 | nx_ififo_state = ZERO; | |
94 | kickoff_rd = 0; | |
95 | casex (ififo_state) // synopsys parallel_case | |
96 | ZERO: if (~empty) | |
97 | begin | |
98 | nx_ififo_state = ONE; | |
99 | kickoff_rd = 1; | |
100 | end // if (~empty) | |
101 | else nx_ififo_state = ififo_state; // stay | |
102 | ONE: nx_ififo_state = TWO; | |
103 | TWO: nx_ififo_state = THREE; | |
104 | THREE: nx_ififo_state = FOUR; | |
105 | FOUR: nx_ififo_state = FIVE; | |
106 | FIVE: nx_ififo_state = SIX; | |
107 | SIX: nx_ififo_state = SEVEN; | |
108 | SEVEN: nx_ififo_state = ZERO; | |
109 | default:begin | |
110 | nx_ififo_state = ZERO; | |
111 | kickoff_rd = 0; | |
112 | // synopsys translate_off | |
113 | $display("(* ERROR: at sim time = %d, niu_zcp_ififo_sm is in forbidden state *) \n", $time); | |
114 | // synopsys translate_on | |
115 | end | |
116 | endcase // casex(ififo_state) | |
117 | end // always @ (... | |
118 | ||
119 | ||
120 | // seq part | |
121 | zcp_RegRst #(3) ififo_state_RegRst(.din(nx_ififo_state[2:0]),.clk(clk),.reset(reset),.qout(ififo_state[2:0])); | |
122 | ||
123 | // glue logic | |
124 | zcp_RegRst #(4) ififo_ren_RegRst(.din({4{kickoff_rd}}),.clk(clk),.reset(reset),.qout({ififo_ren1,ififo_ren[2:0]})); | |
125 | ||
126 | ||
127 | ||
128 | endmodule // niu_zcp_ififo_sm | |
129 |