Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / ilu_peu / vera / context / ilupeuIngressContext.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ilupeuIngressContext.vr
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 ============================================
35class ilupeuIngressContext extends ilupeuContextBase {
36
37
38 //Inherited from CTContextBase
39 //integer NumStrat;
40 //string Name = "";
41 //protected CTTransactionID ID = new;
42
43
44 // Strategy Type Encoding
45 protected integer strat_type_tlp_enc;
46 protected integer strat_type_dllp_enc;
47
48 local bit HangDetect = 0;
49 local integer WaitCount;
50
51 // Constructor
52 task new ( ReportClass _Report,
53 CSRCollection _CSR,
54 ilupeuPodClass _Pod, //Xactors
55 ilupeuScenario _Scenario );
56
57 // Public Methods
58 task Execute();
59
60
61 function CTStrategyBase ProvideTlpStrategy();
62 function CTStrategyBase ProvideDllpStrategy();
63 function CTStrategyBase FinalizeTlpParms( CTStrategyBase FinalStrategy );
64 function CTStrategyBase FinalizeDllpParms( CTStrategyBase FinalStrategy );
65
66} //End ILUPEUINgressContext extends CTContextBase
67
68task ilupeuIngressContext::new ( ReportClass _Report,
69 CSRCollection _CSR,
70 ilupeuPodClass _Pod,
71 ilupeuScenario _Scenario)
72{
73
74 string Name = "ilupeuIngressContext" ;
75
76 super.new ( _Report,
77 _CSR,
78 _Pod,
79 _Scenario,
80 Name );
81
82
83} //End ilupeuIngressContext::new
84
85function CTStrategyBase ilupeuIngressContext::ProvideTlpStrategy()
86{
87 // All Supported TLP Strategies Should Be Listed Here
88 ilupeuIngressTlpStrategy TlpStrat;
89
90 //Provide the strategy based on test parameters
91 randcase{
92
93 Scenario.IngrTlpWt: {
94
95 strat_type_tlp_enc = ILUPEU_TLP_STRAT_ENC;
96 TlpStrat = new ( Report,
97 CSR,
98 Pod,
99 Scenario ) ;
100
101 ProvideTlpStrategy = TlpStrat;
102 }
103 }
104} //End ilupeuIngressContext::ProvideTlpStrategy()
105
106
107function CTStrategyBase ilupeuIngressContext::ProvideDllpStrategy()
108{
109/*
110 // All Supported DLLP Strategies Should Be Listed Here
111//review - Will probably allow Denali to handle all flow control
112 ilupeuIngressDllpFCStrategy DllpFCStrat;
113// ilupeuIngressDllpPMStrategy DllpPMStrat;
114
115 //Provide the strategy based on test parameters
116 randcase{
117 Scenario.IngrDllpFCWt: {
118
119 strat_type_dllp_enc = ILUPEU_DLLP_FC_STRAT_ENC;
120 DllpFCStrat = new ( Report,
121 CSR,
122 Pod,
123 Scenario ) ;
124
125 ProvideDllpStrategy = DllpFCStrat;
126 }
127 Scenario.IngrDllpPMWt: {
128
129 strat_type_dllp_enc = ILUPEU_DLLP_PM_STRAT_ENC;
130 DllpPMStrat = new ( Report,
131 CSR,
132 Pod,
133 Scenario ) ;
134
135 ProvideDllpStrategy = DllpPMStrat;
136 }
137 }
138*/
139} //End ilupeuIngressContext::ProvideDllpStrategy()
140
141function CTStrategyBase ilupeuIngressContext::FinalizeTlpParms( CTStrategyBase FinalStrategy )
142{
143
144 // All Supported TLP Strategies Should Be Listed Here
145 ilupeuIngressTlpStrategy TlpStrat;
146
147 //Cast assign to the correct Type
148 case( strat_type_tlp_enc ){
149 ILUPEU_TLP_STRAT_ENC : cast_assign( TlpStrat, FinalStrategy );
150
151 default : QuickReport( Report, RTYP_TEST_ERROR,
152 "ilupeuIngressContext FinalizeTlpParms() -> hit default case strat_type_tlp_enc=%0d",
153 strat_type_tlp_enc );
154 }
155
156 //Set up Necessary Parameters
157 case( strat_type_tlp_enc ){
158 ILUPEU_TLP_STRAT_ENC : FinalizeTlpParms = TlpStrat;
159 }
160
161} //End ilupeuIngressContext::FinalizeTlpParms
162
163
164function CTStrategyBase ilupeuIngressContext::FinalizeDllpParms( CTStrategyBase FinalStrategy )
165{
166
167/*
168 // All Supported DLLP Strategies Should Be Listed Here
169 ilupeuIngressDllpFCStrategy DllpFCStrat;
170// ilupeuIngressDllpPMStrategy DllpPMStrat;
171
172 //Cast assign to the correct Type
173 case( strat_type_dllp_enc ){
174 ILUPEU_DLLP_FC_STRAT_ENC : cast_assign( DllpFCStrat, FinalStrategy );
175// ILUPEU_DLLP_PM_STRAT_ENC : cast_assign( DllpPMStrat, FinalStrategy );
176
177 default : QuickReport( Report, RTYP_TEST_ERROR,
178 "ilupeuIngressContext FinalizeDllpParms() -> hit default case strat_type_dllp_enc=%0d",
179 strat_type_dllp_enc );
180 }
181
182 //Set up Necessary Parameters
183 case( strat_type_dllp_enc ){
184 ILUPEU_DLLP_FC_STRAT_ENC : FinalizeDllpParms = DllpFCStrat;
185// ILUPEU_DLLP_PM_STRAT_ENC : FinalizeDllpParms = DllpPMStrat;
186 }
187*/
188
189} //End ilupeuIngressContext::FinalizeDllpParms
190
191task ilupeuIngressContext::Execute() {
192 //Determine the number of strategies for each type
193 tlpNumStrat = RandUtil.Rand32( Scenario.IngrTlpMinStrats, Scenario.IngrTlpMaxStrats );
194 dllpNumStrat = RandUtil.Rand32( Scenario.IngrDllpMinStrats, Scenario.IngrDllpMaxStrats );
195
196 //Set the min and max issue delay values
197 tlpMinDelay = Scenario.IngrTlpMinIssueDly;
198 tlpMaxDelay = Scenario.IngrTlpMaxIssueDly;
199 dllpMinDelay = Scenario.IngrDllpMinIssueDly;
200 dllpMaxDelay = Scenario.IngrDllpMaxIssueDly;
201
202 //Set the min and max active strats values
203 tlpMinActiveStrats = Scenario.IngrTlpMinActiveStrats;
204 tlpMaxActiveStrats = Scenario.IngrTlpMaxActiveStrats;
205 dllpMinActiveStrats = Scenario.IngrDllpMinActiveStrats;
206 dllpMaxActiveStrats = Scenario.IngrDllpMaxActiveStrats;
207
208 QuickReport( Report,RTYP_INFO, "Starting Context %s ID = %0d tlpNumStrat=%0d dllpNumStrat=%0d",
209 Name, ID.GetContextID(), tlpNumStrat,dllpNumStrat );
210
211 //Fork off a seperate thread for TLP's and DLLP's for better control
212 fork
213 {
214 if( tlpNumStrat > 0 && Scenario.IngrTlpWt > 0 ){
215 ExecuteTlp();
216 }
217 }
218 {
219 if( dllpNumStrat > 0 && ( Scenario.IngrDllpFCWt > 0 || Scenario.IngrDllpPMWt > 0 ) ){
220 ExecuteDllp();
221 }
222 }
223 join
224
225 //Delay to let any Report Errors filter through
226 repeat(20) @(posedge CLOCK);
227
228 QuickReport( Report,RTYP_INFO, "Finishing Context %s ID = %0d",
229 Name,
230 ID.GetContextID() );
231
232}
233
234