blob: 46b8d054ac25243f50ca0d38a042503c11272c5a [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2000-2017 Ericsson Telecom AB //
// //
// All rights reserved. This program and the accompanying materials //
// are made available under the terms of the Eclipse Public License v2.0 //
// which accompanies this distribution, and is available at //
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: EPTF_LGenBase_PerfTest_FSM_Functions
//
// Purpose:
// This module provides functions for testing LGenBase FSM
//
// Module depends on:
// -
//
// Current Owner:
// Jozsef Gyurusi (ETHJGI)
//
// Last Review Date:
// -
//
// Detailed Comments:
// -
//
//
///////////////////////////////////////////////////////////////
module EPTF_LGenBase_PerfTest_FSM_Functions
{
import from EPTF_LGenBase_PerfTest_FSM_Definitions all;
import from EPTF_CLL_Base_Definitions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_LGenBase_Functions all;
import from EPTF_CLL_LGenBase_ConfigFunctions all;
import from EPTF_CLL_LGenBase_ConfigDefinitions all;
import from EPTF_CLL_LGenBase_Definitions all;
import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
import from EPTF_CLL_LGenBase_TrafficFunctions all;
import from EPTF_CLL_LGenBaseStats_Definitions all;
import from EPTF_CLL_Variable_Functions all;
import from EPTF_CLL_LGenBase_StepFunctions all;
import from ttcn_ericsson_se_TitanSim_Perftest all;
import from TestResultGen all;
import from EPTF_CLL_Common_Definitions all;
import from TCCFileIO_Functions all;
import from TCCConversion_Functions all;
const float c_EPTF_LGenBase_Test_maxExecutionTime := 180.0; // the main component shuts down the test if LGen does not finish until this time
group SimplestFSM {
const EPTF_LGenBase_FsmTableDeclarator c_EPTF_LGenBase_PerfTest_simplest_FSM := {
name := "SimplestFSM",
fsmParams := {
{stateList := {"idle"}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_trafficSuccess, omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, omit}}
}
}
}
}
function f_EPTF_LGenBase_PerfTest_FSM_simplest_Behaviour(
in charstring pl_startTime, //the time the test was started
in integer pl_EPTF_LGenBase_Test_nofEntities := 1, // number of the entities in the entity group
in integer pl_EPTF_LGenBase_Test_nofSuccesses := 1000, // test is executed until nofSuccess reaches this (entity is successful if received event reaches pl_EPTF_LGenBase_Test_nofEvents)
in float pl_EPTF_LGenBase_Test_maxExecutionTime := 60.0, // the main component shuts down the test if LGen does not finish until this time
in float pl_EPTF_LGenBase_Test_tcCPS := 20000.0 // the target CPS used in the traffic case
) runs on EPTF_LGenBase_PerfTest_FSM_CT {
f_EPTF_LGenBase_init("simplestFSM_Behaviour");
var charstring vl_trafficGenerationMode := "MultiBurst (targetCPS="&float2str(pl_EPTF_LGenBase_Test_tcCPS)&", EntityNum="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
if (pl_EPTF_LGenBase_Test_nofSuccesses==1) {
vl_trafficGenerationMode := "SingleBurst (BurstSize="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
}
var Testresult vl_testResult;
vl_testResult.name := "LGenBase Simplest FSM Performance Measurement with "&vl_trafficGenerationMode;
vl_testResult.purpose := "To measure the maximal CPS using the most simple FSM, traffic generation mode is "&vl_trafficGenerationMode;
f_TestResultGen_getEnvironment(vl_testResult.environment);
vl_testResult.parameter_list := {
{name := "Number of Entities", unit := "entities", base := log2str(pl_EPTF_LGenBase_Test_nofEntities) },
{name := "Number of Successes to Reach", unit := "successes", base := log2str(pl_EPTF_LGenBase_Test_nofSuccesses) },
{name := "Max Execution Time", unit := "sec", base := log2str(pl_EPTF_LGenBase_Test_maxExecutionTime) },
{name := "Target CPS", unit := "start/sec", base := log2str(pl_EPTF_LGenBase_Test_tcCPS) },
{name := "EPTF_DEBUG", unit := "-", base := log2str(c_EPTF_Common_debugSwitch) }
};
vl_testResult.start_time := pl_startTime;
v_myBCtxIdx := f_EPTF_LGenBase_declareBehaviorType("b1", -1, null, null, null);
f_EPTF_LGenBase_declareEntityType("et1", {"b1"});
f_EPTF_LGenBase_declareFSMTable(c_EPTF_LGenBase_PerfTest_simplest_FSM);
f_EPTF_LGenBase_createEntityGroup({"eg1", "et1", pl_EPTF_LGenBase_Test_nofEntities});
var EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList vl_tcTypes := {};
vl_tcTypes[0] := {
name := "TCType",
fsmName := "SimplestFSM",
entityType := "et1",
customEntitySucc := ""
}
f_EPTF_LGenBase_declareTcType2(vl_tcTypes[0]);
var EPTF_LGenBase_TcMgmt_ScenarioDeclarator2 vl_sc := {
name:="Sc1",
tcList := {}
}
vl_sc.tcList[0] := {
"", // charstring tcName,
0.0,// float startDelay optional,
0.0,// float cpsToReach,
true,// boolean enableEntities,
true,// boolean enable,
omit,// EPTF_LGenBase_TcMgmt_ParamRangeDeclaratorList ranges optional,
omit,// EPTF_LGenBase_TcMgmt_tcCustomParamDeclaratorList params optional,
omit,// EPTF_LGenBase_TcMgmt_GroupFinishConditions2 groupFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityFinishConditions entityFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityActionsList entityFinishActions optional,
omit// EPTF_LGenBase_TcMgmt_GroupActions2List tcFinishActions optional
}
vl_sc.tcList[0].tcName := "TCType";
vl_sc.tcList[0].cpsToReach := pl_EPTF_LGenBase_Test_tcCPS;
f_EPTF_LGenBase_declareScenarioType2(vl_sc);
f_EPTF_LGenBase_createScenario2EntityGroup({"eg1","Sc1"},false);
// name of var that contains the success counter
var charstring pl_dataVarName := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType") & c_EPTF_LGenBaseStats_nameOfTcNrOfSuccesses;
timer t_wait := 0.0;
t_wait.start; // wait for pl_EPTF_LGenBase_Test_nofSuccesses success
timer t_maxExecution := pl_EPTF_LGenBase_Test_maxExecutionTime;
var charstring vl_execTimeInfoStr := "";
var float vl_startTime := 0.0, vl_endTime := 0.0;
var float vl_startTCTime := f_EPTF_Base_getRelTimeInSecs();
f_EPTF_LGenBase_startTrafficCase("eg1", "Sc1", "TCType");
vl_startTime := f_EPTF_Base_getRelTimeInSecs();
t_maxExecution.start;
alt {
[] t_maxExecution.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
vl_execTimeInfoStr := log2str("The test result may not be reliable because the number of expected successes (",pl_EPTF_LGenBase_Test_nofSuccesses,") was not reached in time. Current number of succ: ", f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName)));
}
[f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName))>=pl_EPTF_LGenBase_Test_nofSuccesses] t_wait.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
}
}
// check if all events were executed:
var integer vl_nofSuccess := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName));
action("vl_nofSuccess: ", vl_nofSuccess);
var float vl_tcStartupTime := vl_startTime - vl_startTCTime;
action("vl_tcStartupTime: ", vl_tcStartupTime);
var float vl_executionTime := vl_endTime - vl_startTime;
action("executionTime: ", vl_executionTime);
vl_testResult.result_list := {
{
name := "TC startup time",
unit := "sec",
base := log2str(vl_tcStartupTime)
},
{
name := "Execution time",
unit := "sec",
base := log2str(vl_executionTime)
},{
name := "Number of successes",
unit := "successes",
base := log2str(vl_nofSuccess)
},
{
name := "Measured Success rate",
unit := "success/sec",
base := log2str(int2float(vl_nofSuccess)/vl_executionTime)
}
};
// check measured success rate with respect to the target CPS:
if (int2float(vl_nofSuccess)/vl_executionTime>pl_EPTF_LGenBase_Test_tcCPS*0.8) {
// test result may not be reliable because the target CPS is close to the measured one
var charstring vl_infoStr := log2str("The test result may not be reliable because the measured CPS is close to or above (",
100.0*int2float(vl_nofSuccess)/vl_executionTime/pl_EPTF_LGenBase_Test_tcCPS,
"% of) the target.");
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "Info",
unit := "-",
base := vl_infoStr
}
}
//check single burst:
if(pl_EPTF_LGenBase_Test_nofSuccesses == 1) {
if (vl_nofSuccess!=pl_EPTF_LGenBase_Test_nofEntities) {
// maybe single burst was not performed properly
var charstring vl_infoStr := log2str("Single burst might not have been performed properly, test result might be unreliable.");
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "SingleBurstInfo",
unit := "-",
base := vl_infoStr
}
}
}
// execTime limit:
if (vl_execTimeInfoStr!="") {
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "ExecTimeInfo",
unit := "-",
base := vl_execTimeInfoStr
}
}
f_EPTF_LGenBase_stopTrafficCase("eg1", "Sc1", "TCType");
vl_testResult.end_time := f_TestResultGen_getCurrentTime();
f_TestResultGen_appendResult("LGenBase_Test_FSM_simplest_Performance_"&pl_startTime&".xml", vl_testResult);
f_EPTF_Base_stop(pass);
}
} // group SimplestFSM
group FSMWithHoldingTime {
template EPTF_LGenBase_FsmTableDeclarator t_EPTF_LGenBase_PerfTest_simplest_FSMWithHoldingTime(in float pl_holdingTime) := {
name := "FSMWithHoldingTime",
fsmParams := {
{stateList := {"idle"}},
{timerList := {{name := "T_Holding", startValue := pl_holdingTime}}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_trafficSuccess, omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, omit}}
}
}
}
}
function f_EPTF_LGenBase_PerfTest_FSM_withHoldingTime_Behaviour(
in charstring pl_startTime, //the time the test was started
in integer pl_EPTF_LGenBase_Test_nofEntities := 1, // number of the entities in the entity group
in integer pl_EPTF_LGenBase_Test_nofSuccesses := 1000, // test is executed until nofSuccess reaches this (entity is successful if received event reaches pl_EPTF_LGenBase_Test_nofEvents)
in float pl_EPTF_LGenBase_Test_maxExecutionTime := 60.0, // the main component shuts down the test if LGen does not finish until this time
in float pl_EPTF_LGenBase_Test_tcCPS := 20000.0, // the target CPS used in the traffic case
in float pl_holdingTime := 0.0 // the holding time of running entity
) runs on EPTF_LGenBase_PerfTest_FSM_CT {
f_EPTF_LGenBase_init("FSMWithHoldingTime_Behaviour");
var charstring vl_trafficGenerationMode := "MultiBurst (targetCPS="&float2str(pl_EPTF_LGenBase_Test_tcCPS)&", EntityNum="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
if (pl_EPTF_LGenBase_Test_nofSuccesses==1) {
vl_trafficGenerationMode := "SingleBurst (BurstSize="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
}
var Testresult vl_testResult;
vl_testResult.name := "LGenBase FSM With HoldingTime Performance Measurement with "&vl_trafficGenerationMode&", holding time="&float2str(pl_holdingTime);
vl_testResult.purpose := "To measure the maximal CPS using an FSM with holding time="&float2str(pl_holdingTime)&", traffic generation mode is "&vl_trafficGenerationMode;
f_TestResultGen_getEnvironment(vl_testResult.environment);
vl_testResult.parameter_list := {
{name := "Number of Entities", unit := "entities", base := log2str(pl_EPTF_LGenBase_Test_nofEntities) },
{name := "Number of Successes to Reach", unit := "successes", base := log2str(pl_EPTF_LGenBase_Test_nofSuccesses) },
{name := "Max Execution Time", unit := "sec", base := log2str(pl_EPTF_LGenBase_Test_maxExecutionTime) },
{name := "Target CPS", unit := "start/sec", base := log2str(pl_EPTF_LGenBase_Test_tcCPS) },
{name := "Holding Time", unit := "sec", base := log2str(pl_holdingTime) },
{name := "EPTF_DEBUG", unit := "-", base := log2str(c_EPTF_Common_debugSwitch) }
};
vl_testResult.start_time := pl_startTime;
v_myBCtxIdx := f_EPTF_LGenBase_declareBehaviorType("b1", -1, null, null, null);
f_EPTF_LGenBase_declareEntityType("et1", {"b1"});
f_EPTF_LGenBase_declareFSMTable(valueof(t_EPTF_LGenBase_PerfTest_simplest_FSMWithHoldingTime(pl_holdingTime)));
f_EPTF_LGenBase_createEntityGroup({"eg1", "et1", pl_EPTF_LGenBase_Test_nofEntities});
var EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList vl_tcTypes := {};
vl_tcTypes[0] := {
name := "TCType",
fsmName := "FSMWithHoldingTime",
entityType := "et1",
customEntitySucc := ""
}
f_EPTF_LGenBase_declareTcType2(vl_tcTypes[0]);
var EPTF_LGenBase_TcMgmt_ScenarioDeclarator2 vl_sc := {
name:="Sc1",
tcList := {}
}
vl_sc.tcList[0] := {
"", // charstring tcName,
0.0,// float startDelay optional,
0.0,// float cpsToReach,
true,// boolean enableEntities,
true,// boolean enable,
omit,// EPTF_LGenBase_TcMgmt_ParamRangeDeclaratorList ranges optional,
omit,// EPTF_LGenBase_TcMgmt_tcCustomParamDeclaratorList params optional,
omit,// EPTF_LGenBase_TcMgmt_GroupFinishConditions2 groupFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityFinishConditions entityFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityActionsList entityFinishActions optional,
omit// EPTF_LGenBase_TcMgmt_GroupActions2List tcFinishActions optional
}
vl_sc.tcList[0].tcName := "TCType";
vl_sc.tcList[0].cpsToReach := pl_EPTF_LGenBase_Test_tcCPS;
f_EPTF_LGenBase_declareScenarioType2(vl_sc);
f_EPTF_LGenBase_createScenario2EntityGroup({"eg1","Sc1"},false);
// name of var that contains the success counter
var charstring pl_dataVarName := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType") & c_EPTF_LGenBaseStats_nameOfTcNrOfSuccesses;
timer t_wait := 0.0;
t_wait.start; // wait for pl_EPTF_LGenBase_Test_nofSuccesses success
timer t_maxExecution := pl_EPTF_LGenBase_Test_maxExecutionTime;
var charstring vl_execTimeInfoStr := "";
var float vl_startTime := 0.0, vl_endTime := 0.0;
var float vl_startTCTime := f_EPTF_Base_getRelTimeInSecs();
f_EPTF_LGenBase_startTrafficCase("eg1", "Sc1", "TCType");
vl_startTime := f_EPTF_Base_getRelTimeInSecs();
t_maxExecution.start;
alt {
[] t_maxExecution.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
vl_execTimeInfoStr := log2str("The test result may not be reliable because the number of expected successes (",pl_EPTF_LGenBase_Test_nofSuccesses,") was not reached in time. Current number of succ: ", f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName)));
}
[f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName))>=pl_EPTF_LGenBase_Test_nofSuccesses] t_wait.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
}
}
// check if all events were executed:
var integer vl_nofSuccess := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName));
action("vl_nofSuccess: ", vl_nofSuccess);
var float vl_tcStartupTime := vl_startTime - vl_startTCTime;
action("vl_tcStartupTime: ", vl_tcStartupTime);
var float vl_executionTime := vl_endTime - vl_startTime;
action("executionTime: ", vl_executionTime);
vl_testResult.result_list := {
{
name := "TC startup time",
unit := "sec",
base := log2str(vl_tcStartupTime)
},
{
name := "Execution time",
unit := "sec",
base := log2str(vl_executionTime)
},{
name := "Number of successes",
unit := "successes",
base := log2str(vl_nofSuccess)
},
{
name := "Measured Success rate",
unit := "success/sec",
base := log2str(int2float(vl_nofSuccess)/vl_executionTime)
}
};
// check measured success rate with respect to the target CPS:
if (int2float(vl_nofSuccess)/vl_executionTime>pl_EPTF_LGenBase_Test_tcCPS*0.8) {
// test result may not be reliable because the target CPS is close to the measured one
var charstring vl_infoStr := log2str("The test result may not be reliable because the measured CPS is close to or above (",
100.0*int2float(vl_nofSuccess)/vl_executionTime/pl_EPTF_LGenBase_Test_tcCPS,
"% of) the target.");
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "Info",
unit := "-",
base := vl_infoStr
}
}
//check single burst:
if(pl_EPTF_LGenBase_Test_nofSuccesses == 1) {
if (vl_nofSuccess!=pl_EPTF_LGenBase_Test_nofEntities) {
// maybe single burst was not performed properly
var charstring vl_infoStr := log2str("Single burst might not have been performed properly, test result might be unreliable.");
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "SingleBurstInfo",
unit := "-",
base := vl_infoStr
}
}
}
// execTime limit:
if (vl_execTimeInfoStr!="") {
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "ExecTimeInfo",
unit := "-",
base := vl_execTimeInfoStr
}
}
// check available entities:
if ((pl_holdingTime+0.05)*int2float(vl_nofSuccess)/vl_executionTime>int2float(pl_EPTF_LGenBase_Test_nofEntities)) {
var charstring vl_infoStr := log2str("Not enough entities. Test result might be unreliable. Needed ",
(pl_holdingTime+0.05)*int2float(vl_nofSuccess)/vl_executionTime, " but available only: ",pl_EPTF_LGenBase_Test_nofEntities);
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "EntityAvailabilityInfo",
unit := "-",
base := vl_infoStr
}
}
f_EPTF_LGenBase_stopTrafficCase("eg1", "Sc1", "TCType");
vl_testResult.end_time := f_TestResultGen_getCurrentTime();
f_TestResultGen_appendResult("LGenBase_Test_FSM_withHoldingTime_Performance_"&pl_startTime&".xml", vl_testResult);
f_EPTF_Base_stop(pass);
}
} // group FSMWithHoldingTime
group PostDispatch {
function f_EPTF_LGenBase_PerfTest_FSM_postALotEvents(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_LGenBase_PerfTest_FSM_CT {
//action(log2str(%definitionId&"(pl_ptr:= ",pl_ptr,"): called"));
if (v_EPTF_LGenBase_Test_nofEvents==0) {
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
return;
}
for(var integer i:=0; i<v_EPTF_LGenBase_Test_nofEvents; i:=i+1) {
f_EPTF_LGenBase_postEvent({
event := {
bIdx := v_myBCtxIdx,
iIdx := v_EPTF_LGenBase_PerfTest_FSM_eventIDs[0],
target := {eIdx := pl_ptr.eIdx, fsmCtxIdx := pl_ptr.refContext.fCtxIdx},
source := {eIdx := pl_ptr.eIdx, fsmCtxIdx := pl_ptr.refContext.fCtxIdx}
},
reportedArgs := {i}
});
}
}
function f_EPTF_LGenBase_PerfTest_FSM_dispatchALotEvents(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_LGenBase_PerfTest_FSM_CT {
//action(log2str(%definitionId&"(pl_ptr:= ",pl_ptr,"): called"));
if (v_EPTF_LGenBase_Test_nofEvents==0) {
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
return;
}
for(var integer i:=0; i<v_EPTF_LGenBase_Test_nofEvents; i:=i+1) {
f_EPTF_LGenBase_dispatchEvent({
event := {
bIdx := v_myBCtxIdx,
iIdx := v_EPTF_LGenBase_PerfTest_FSM_eventIDs[0],
target := {eIdx := pl_ptr.eIdx, fsmCtxIdx := pl_ptr.refContext.fCtxIdx},
source := {eIdx := pl_ptr.eIdx, fsmCtxIdx := pl_ptr.refContext.fCtxIdx}
},
reportedArgs := {i}
});
}
}
function f_EPTF_LGenBase_PerfTest_FSM_logEvent(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_LGenBase_PerfTest_FSM_CT {
// timer t_wait := 0.1;
// t_wait.start; t_wait.timeout;
//action(log2str(%definitionId&"(pl_ptr:= ",pl_ptr,"): called"));
v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter := v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter + 1 ;
if (not isbound(v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[pl_ptr.eIdx])) {
v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[pl_ptr.eIdx] := 0;
}
v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[pl_ptr.eIdx] := v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[pl_ptr.eIdx] + 1;
//report success if all events were received:
if (v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[pl_ptr.eIdx] == v_EPTF_LGenBase_Test_nofEvents) {
v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[pl_ptr.eIdx] := 0;
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
}
}
function f_EPTF_LGenBase_PerfTest_FSM_postOrDispatch_Behaviour(
in EPTF_LGenBase_PerfTest_FSM_PostOrDispatch pl_postOrDispatch := post,
in charstring pl_startTime, //the time the test was started
in integer pl_EPTF_LGenBase_Test_nofEntities := 1, // number of the entities in the entity group
in integer pl_EPTF_LGenBase_Test_nofEvents := 5000, // number of events each entity posts for itself
in integer pl_EPTF_LGenBase_Test_nofSuccesses := 1000, // test is executed until nofSuccess reaches this (entity is successful if received event reaches pl_EPTF_LGenBase_Test_nofEvents)
in float pl_EPTF_LGenBase_Test_maxExecutionTime := 60.0, // the main component shuts down the test if LGen does not finish until this time
in float pl_EPTF_LGenBase_Test_tcCPS := 20000.0 // the target CPS used in the traffic case
) runs on EPTF_LGenBase_PerfTest_FSM_CT {
f_EPTF_LGenBase_init("longCallStackSegfaultBehaviour");
var charstring vl_postOrDispatchStr := "post";
if (pl_postOrDispatch != post) {
vl_postOrDispatchStr := "dispatch";
}
var charstring vl_trafficGenerationMode := "MultiBurst (Events/start="&int2str(pl_EPTF_LGenBase_Test_nofEvents)&", targetCPS="&float2str(pl_EPTF_LGenBase_Test_tcCPS)&", EntityNum="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
if (pl_EPTF_LGenBase_Test_nofSuccesses==1) {
vl_trafficGenerationMode := "SingleBurst (Events/start="&int2str(pl_EPTF_LGenBase_Test_nofEvents)&", BurstSize="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
}
v_EPTF_LGenBase_Test_nofEvents := pl_EPTF_LGenBase_Test_nofEvents;
var Testresult vl_testResult;
vl_testResult.name := "LGenBase "&vl_postOrDispatchStr&"Event Performance Measurement with "&vl_trafficGenerationMode;
vl_testResult.purpose := "To measure the time needed to "&vl_postOrDispatchStr&" and handle a given amount of events in a simple FSM, traffic generation mode is "&vl_trafficGenerationMode;
f_TestResultGen_getEnvironment(vl_testResult.environment);
vl_testResult.parameter_list := {
{name := "Number of Entities", unit := "entities", base := log2str(pl_EPTF_LGenBase_Test_nofEntities) },
{name := "Number of Events per Starts", unit := "event/start", base := log2str(v_EPTF_LGenBase_Test_nofEvents) },
{name := "Event Reporting method", unit := "method", base := log2str(vl_postOrDispatchStr) },
{name := "Number of Successes to Reach", unit := "successes", base := log2str(pl_EPTF_LGenBase_Test_nofSuccesses) },
{name := "Max Execution Time", unit := "sec", base := log2str(pl_EPTF_LGenBase_Test_maxExecutionTime) },
{name := "Target CPS", unit := "start/sec", base := log2str(pl_EPTF_LGenBase_Test_tcCPS) },
{name := "EPTF_DEBUG", unit := "-", base := log2str(c_EPTF_Common_debugSwitch) }
};
vl_testResult.start_time := pl_startTime;
v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter := 0; // count the events
v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity := {}; // count the events per entity
v_myBCtxIdx := f_EPTF_LGenBase_declareBehaviorType("b1", -1, null, null, null);
f_EPTF_LGenBase_declareEntityType("et1", {"b1"});
v_EPTF_LGenBase_PerfTest_FSM_eventIDs[0] := f_EPTF_LGenBase_declareFsmEvent("b1", "Event"); // the event ID
if (pl_postOrDispatch == post) {
f_EPTF_LGenBase_declareFunction("reportALotEvents",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_postALotEvents)})
} else {
f_EPTF_LGenBase_declareFunction("reportALotEvents",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_dispatchALotEvents)})
}
f_EPTF_LGenBase_declareFunction("logEvent",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_logEvent)})
f_EPTF_LGenBase_declareFSMTable({
name := "FSM1",
fsmParams := {
{stateList := {"idle"}}
},
table := {
classicTable := {
{eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {{
{
{"reportALotEvents", omit}
},
omit, omit
}}
},
{eventToListen := {"b1","Event",fsm},
cellRow := {{
{
{"logEvent", omit}
},
omit, omit
}}
}
}
}
});
f_EPTF_LGenBase_createEntityGroup({"eg1", "et1", pl_EPTF_LGenBase_Test_nofEntities});
var EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList vl_tcTypes := {};
vl_tcTypes[0] := {
name := "TCType",
fsmName := "FSM1",
entityType := "et1",
customEntitySucc := ""
}
f_EPTF_LGenBase_declareTcType2(vl_tcTypes[0]);
var EPTF_LGenBase_TcMgmt_ScenarioDeclarator2 vl_sc := {
name:="Sc1",
tcList := {}
}
vl_sc.tcList[0] := {
"", // charstring tcName,
0.0,// float startDelay optional,
0.0,// float cpsToReach,
true,// boolean enableEntities,
true,// boolean enable,
omit,// EPTF_LGenBase_TcMgmt_ParamRangeDeclaratorList ranges optional,
omit,// EPTF_LGenBase_TcMgmt_tcCustomParamDeclaratorList params optional,
omit,// EPTF_LGenBase_TcMgmt_GroupFinishConditions2 groupFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityFinishConditions entityFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityActionsList entityFinishActions optional,
omit// EPTF_LGenBase_TcMgmt_GroupActions2List tcFinishActions optional
}
vl_sc.tcList[0].tcName := "TCType";
vl_sc.tcList[0].cpsToReach := pl_EPTF_LGenBase_Test_tcCPS;
f_EPTF_LGenBase_declareScenarioType2(vl_sc);
f_EPTF_LGenBase_createScenario2EntityGroup({"eg1","Sc1"},false);
// name of var that contains the success counter
var charstring pl_dataVarName := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType") & c_EPTF_LGenBaseStats_nameOfTcNrOfSuccesses;
timer t_wait := 0.0;
t_wait.start; // wait for pl_EPTF_LGenBase_Test_nofSuccesses success
timer t_maxExecution := pl_EPTF_LGenBase_Test_maxExecutionTime;
var charstring vl_execTimeInfoStr := "";
var float vl_startTime := 0.0, vl_endTime := 0.0;
var float vl_startTCTime := f_EPTF_Base_getRelTimeInSecs();
f_EPTF_LGenBase_startTrafficCase("eg1", "Sc1", "TCType");
vl_startTime := f_EPTF_Base_getRelTimeInSecs();
t_maxExecution.start;
alt {
[] t_maxExecution.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
vl_execTimeInfoStr := log2str("The test result may not be reliable because the number of expected successes (",pl_EPTF_LGenBase_Test_nofSuccesses,") was not reached in time. Current number of succ: ", f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName)));
}
[f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName))>=pl_EPTF_LGenBase_Test_nofSuccesses] t_wait.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
}
}
// check if all events were executed:
var integer vl_nofSuccess := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName));
action("vl_nofSuccess: ", vl_nofSuccess);
action("nofEntities used: ", sizeof(v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity));
action("v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter: ", v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter);
var float vl_tcStartupTime := vl_startTime - vl_startTCTime;
action("vl_tcStartupTime: ", vl_tcStartupTime);
var float vl_executionTime := vl_endTime - vl_startTime;
action("executionTime: ", vl_executionTime);
// check the counters:
if (v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter != vl_nofSuccess*v_EPTF_LGenBase_Test_nofEvents) {
setverdict(fail,log2str("Number of all received events (",v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter,") is different than expected: ",vl_nofSuccess*v_EPTF_LGenBase_Test_nofEvents));
}
for(var integer i:=0; i<sizeof(v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity); i:=i+1) {
if (v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[i] rem v_EPTF_LGenBase_Test_nofEvents!= 0) {
setverdict(fail,log2str("Number of events received by entity #",i," (",v_EPTF_LGenBase_PerfTest_FSM_nofSuccessPerEntity[i],") is not the multiple of ",v_EPTF_LGenBase_Test_nofEvents));
}
}
vl_testResult.result_list := {
{
name := "TC startup time",
unit := "sec",
base := log2str(vl_tcStartupTime)
},
{
name := "Execution time",
unit := "sec",
base := log2str(vl_executionTime)
},{
name := "Number of successes",
unit := "successes",
base := log2str(vl_nofSuccess)
},
{
name := "Total Number of events handled",
unit := "events handled",
base := log2str(v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter)
},
{
name := "Event execution rate",
unit := "event/sec",
base := log2str(int2float(v_EPTF_LGenBase_PerfTest_FSM_nofEventCounter-v_EPTF_LGenBase_Test_nofEvents)/vl_executionTime)
},
{
name := "Measured Success rate",
unit := "success/sec",
base := log2str(int2float(vl_nofSuccess)/vl_executionTime)
}
};
// check measured success rate with respect to the target CPS:
if (int2float(vl_nofSuccess)/vl_executionTime>pl_EPTF_LGenBase_Test_tcCPS*0.8) {
// test result may not be reliable because the target CPS is close to the measured one
var charstring vl_infoStr := log2str("The test result may not be reliable because the measured CPS is close to or above (",
100.0*int2float(vl_nofSuccess)/vl_executionTime/pl_EPTF_LGenBase_Test_tcCPS,
"% of) the target.");
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "Info",
unit := "-",
base := vl_infoStr
}
}
//check single burst:
if(pl_EPTF_LGenBase_Test_nofSuccesses == 1) {
if (vl_nofSuccess!=pl_EPTF_LGenBase_Test_nofEntities) {
// maybe single burst was not performed properly
var charstring vl_infoStr := log2str("Single burst might not have been performed properly, test result might be unreliable.");
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "SingleBurstInfo",
unit := "-",
base := vl_infoStr
}
}
}
// execTime limit:
if (vl_execTimeInfoStr!="") {
vl_testResult.result_list[sizeof(vl_testResult.result_list)] := {
name := "ExecTimeInfo",
unit := "-",
base := vl_execTimeInfoStr
}
}
f_EPTF_LGenBase_stopTrafficCase("eg1", "Sc1", "TCType");
vl_testResult.end_time := f_TestResultGen_getCurrentTime();
f_TestResultGen_appendResult("LGenBase_Test_FSM_"&vl_postOrDispatchStr&"Performance_"&pl_startTime&".xml", vl_testResult);
f_EPTF_Base_stop(pass);
}
} // group PostDispatch
group FSMWithHoldingTimeAndStates {
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTime(in float pl_holdingTime) := {
name := "FSMWithHoldingTime",
fsmParams := {
{stateList := {"idle"}},
{timerList := {{name := "T_Holding", startValue := pl_holdingTime}}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding",fsm},
cellRow := {{{
{"startCycleOrSuccess", omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, omit}}
}
}
}
}
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_TwoStates(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_TwoStates",
fsmParams := {
{stateList := {
"idle",
"state_1"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/2.0}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }}
}, omit, "idle"},
//state_1
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, omit, "state_1"},
//state_1
{{
{"startCycleOrSuccess", omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_OneState(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_OneState",
fsmParams := {
{stateList := {"idle"}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0},
{name := "T_Holding_04", startValue := pl_holdingTime/10.0},
{name := "T_Holding_05", startValue := pl_holdingTime/10.0},
{name := "T_Holding_06", startValue := pl_holdingTime/10.0},
{name := "T_Holding_07", startValue := pl_holdingTime/10.0},
{name := "T_Holding_08", startValue := pl_holdingTime/10.0},
{name := "T_Holding_09", startValue := pl_holdingTime/10.0},
{name := "T_Holding_10", startValue := pl_holdingTime/10.0}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_02" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_03" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_04" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_04",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_05" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_05",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_06" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_06",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_07" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_07",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_08" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_08",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_09" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_09",fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_10" }}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_10",fsm},
cellRow := {{{
{"startCycleOrSuccess", omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, omit}}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, omit}}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStates(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStates",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0},
{name := "T_Holding_04", startValue := pl_holdingTime/10.0},
{name := "T_Holding_05", startValue := pl_holdingTime/10.0},
{name := "T_Holding_06", startValue := pl_holdingTime/10.0},
{name := "T_Holding_07", startValue := pl_holdingTime/10.0},
{name := "T_Holding_08", startValue := pl_holdingTime/10.0},
{name := "T_Holding_09", startValue := pl_holdingTime/10.0},
{name := "T_Holding_10", startValue := pl_holdingTime/10.0}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_02" }}
}, omit, "state_1"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_03" }}
}, omit, "state_2"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_04" }}
}, omit, "state_3"},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_04",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_05" }}
}, omit, "state_4"},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_05",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_06" }}
}, omit, "state_1"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_06",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_07" }}
}, omit, "state_3"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_07",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_08" }}
}, omit, "state_4"},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_08",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_09" }}
}, omit, "state_2"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_09",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_10" }}
}, omit, "state_1"},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_10",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{"startCycleOrSuccess", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_TenStates(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_TenStates",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4",
"state_5",
"state_6",
"state_7",
"state_8",
"state_9"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0},
{name := "T_Holding_04", startValue := pl_holdingTime/10.0},
{name := "T_Holding_05", startValue := pl_holdingTime/10.0},
{name := "T_Holding_06", startValue := pl_holdingTime/10.0},
{name := "T_Holding_07", startValue := pl_holdingTime/10.0},
{name := "T_Holding_08", startValue := pl_holdingTime/10.0},
{name := "T_Holding_09", startValue := pl_holdingTime/10.0},
{name := "T_Holding_10", startValue := pl_holdingTime/10.0}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_02" }}
}, omit, "state_1"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_03" }}
}, omit, "state_2"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_04" }}
}, omit, "state_3"},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_04",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_05" }}
}, omit, "state_4"},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_05",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_06" }}
}, omit, "state_5"},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_06",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_07" }}
}, omit, "state_6"},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_07",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_08" }}
}, omit, "state_7"},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_08",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_09" }}
}, omit, "state_8"},
//state_8
{omit, omit, omit},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_09",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_10" }}
}, omit, "state_9"},
//state_9
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_10",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit},
//state_5
{omit, omit, omit},
//state_6
{omit, omit, omit},
//state_7
{omit, omit, omit},
//state_8
{omit, omit, omit},
//state_9
{{
{"startCycleOrSuccess", omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompact(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompact",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, omit, "state_1"},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, omit, "state_2"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, omit, "state_3"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, omit, "state_1"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, omit, "state_3"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_03" }}
}, omit, "state_1"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, omit, "state_2"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{"startCycleOrSuccess", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompactWithEvents(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompactWithEvents",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{"reportAnEvent", {stepContextArgs := {0}}}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {"b1","Event1",fsm},
cellRow := {
//idle
{{
{"reportAnEvent", {stepContextArgs := {0}}}
}, omit, "state_1"},
//state_1
{{
{"reportAnEvent", {stepContextArgs := {0}}}
}, omit, "state_2"},
//state_2
{{
{"reportAnEvent", {stepContextArgs := {0}}}
}, omit, "state_3"},
//state_3
{{
{"reportAnEvent", {stepContextArgs := {0}}}
}, omit, "state_4"},
//state_4
{{
{"reportAnEvent", {stepContextArgs := {1}}}
}, omit, "state_1"}
}
},
{ eventToListen := {"b1","Event2",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{"reportAnEvent", {stepContextArgs := {1}}}
}, omit, "state_3"},
//state_2
{{
{"reportAnEvent", {stepContextArgs := {2}}}
}, omit, "state_1"},
//state_3
{{
{"reportAnEvent", {stepContextArgs := {1}}}
}, omit, "state_4"},
//state_4
{{
{"reportAnEvent", {stepContextArgs := {1}}}
}, omit, "state_2"}
}
},
{ eventToListen := {"b1","Event3",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{"startCycleOrSuccessEvents", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompactWithNextStateCalc(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompactWithNextStateCalc",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }}
}, {"nextStateCalc", {0}}, omit},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, {"nextStateCalc", {1}}, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, {"nextStateCalc", {2}}, omit},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, {"nextStateCalc", {3}}, omit},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }}
}, {"nextStateCalc", {4}}, omit},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, {"nextStateCalc", {1}}, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, {"nextStateCalc", {3}}, omit},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_03" }}
}, {"nextStateCalc", {1}}, omit},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, {"nextStateCalc", {4}}, omit},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }}
}, {"nextStateCalc", {2}}, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{"startCycleOrSuccess", omit}
}, {"nextStateCalc", {0}}, omit}, //idle
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVars(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVars",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0}
}},
{varList := {
{
name := "TCvar_0",
initValue := { intVal := 1 },
scope := TC
}, {
name := "TCvar_1",
initValue := { intVal := 1 },
scope := TC
}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_03" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }},
{"startCycleOrSuccess", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVarsAndStats(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVarsAndStats",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0}
}},
{varList := {
{
name := "TCvar_0",
initValue := { intVal := 1 },
scope := TC
}, {
name := "TCvar_1",
initValue := { intVal := 1 },
scope := TC
}
}},
{statisticList := {
{
name := "TCstat_0",
providersList := {{"TCvar_0"}},
statMethod := "Max",
statResetValue := { intVal := 1 },
scope := TC
},
{
name := "TCstat_1",
providersList := {{"TCvar_1"}},
statMethod := "Max",
statResetValue := { intVal := 1 },
scope := TC
}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_03" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_0", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }},
{"startCycleOrSuccess", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVars(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVars",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0}
}},
{varList := {
{
name := "FSMvar_1",
initValue := { intVal := 1 },
scope := FSM
}, {
name := "TCvar_1",
initValue := { intVal := 1 },
scope := TC
}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_03" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }},
{"startCycleOrSuccess", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
template EPTF_LGenBase_FsmTableDeclarator t_FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVarsAndStats(float pl_holdingTime) := {
name := "FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVarsAndStats",
fsmParams := {
{stateList := {
"idle",
"state_1",
"state_2",
"state_3",
"state_4"
}},
{timerList := {
{name := "T_Holding_01", startValue := pl_holdingTime/10.0},
{name := "T_Holding_02", startValue := pl_holdingTime/10.0},
{name := "T_Holding_03", startValue := pl_holdingTime/10.0}
}},
{varList := {
{
name := "FSMvar_1",
initValue := { intVal := 1 },
scope := FSM
}, {
name := "TCvar_1",
initValue := { intVal := 1 },
scope := TC
}
}},
{statisticList := {
{
name := "FSMstat_1",
providersList := {{"FSMvar_1"}},
statMethod := "Max",
statResetValue := { intVal := 1 },
scope := FSM
},
{
name := "TCstat_1",
providersList := {{"TCvar_1"}},
statMethod := "Max",
statResetValue := { intVal := 1 },
scope := TC
}
}}
},
table := {
classicTable := {
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "idle"},
//state_1
{omit, omit, omit},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_01",fsm},
cellRow := {
//idle
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_01" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_02",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_3"},
//state_2
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_03" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_1"},
//state_3
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_4"},
//state_4
{{
{c_EPTF_LGenBase_stepName_timerStartOrRestart,{timerName:= "T_Holding_02" }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }}
}, omit, "state_2"}
}
},
{ eventToListen := {c_EPTF_LGenBase_specialBName_timerTimeout,"T_Holding_03",fsm},
cellRow := {
//idle
{omit, omit, omit},
//state_1
{{
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "FSMvar_1", paramValue := { intVal := 0 } } }},
{c_EPTF_LGenBase_stepName_fsmVarInc,{varParams := {varName := "TCvar_1", paramValue := { intVal := 0 } } }},
{"startCycleOrSuccess", omit}
}, omit, "idle"},
//state_2
{omit, omit, omit},
//state_3
{omit, omit, omit},
//state_4
{omit, omit, omit}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityStopped, omit}
}, omit, "idle"}
}
},
{ eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm},
cellRow := {
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"},
{{
{c_EPTF_LGenBase_stepName_entityAborted, omit}
}, omit, "idle"}
}
}
}
}
};
function f_EPTF_LGenBase_PerfTest_FSM_step_startCycleOrSuccess(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_LGenBase_PerfTest_FSM_CT {
//action(log2str(%definitionId&"(pl_ptr:= ",pl_ptr,"): called"));
if (not isbound(v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx])) {
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] := 0;
}
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] := v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] + 1;
if (v_EPTF_LGenBase_Test_nofEvents<=v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx]) {
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] := 0;
return;
}
pl_ptr.refContext.fRefArgs := {0}; // starting timer : T_Holding_01
f_EPTF_LGenBase_step_timerStartOrRestart(pl_ptr);
}
function f_EPTF_LGenBase_PerfTest_FSM_step_startCycleOrSuccessEvents(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_LGenBase_PerfTest_FSM_CT {
//action(log2str(%definitionId&"(pl_ptr:= ",pl_ptr,"): called"));
if (not isbound(v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx])) {
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] := 0;
}
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] := v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] + 1;
if (v_EPTF_LGenBase_Test_nofEvents<=v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx]) {
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity[pl_ptr.eIdx] := 0;
return;
}
pl_ptr.refContext.fRefArgs := {0}; // starting timer : T_Holding_01
f_EPTF_LGenBase_PerfTest_FSM_postAnEvent(pl_ptr);
}
function f_EPTF_LGenBase_PerfTest_FSM_nextStateCalc(
in integer eIdx,
in integer fIdx,
in EPTF_IntegerList contextArgs,
in EPTF_LGenBase_FsmTableCellReference pl_cell,
in EPTF_IntegerList pl_stepArgs //supply args to actions
) runs on EPTF_LGenBase_PerfTest_FSM_CT return integer {
return contextArgs[0];
}
function f_EPTF_LGenBase_PerfTest_FSM_postAnEvent(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_LGenBase_PerfTest_FSM_CT {
f_EPTF_LGenBase_postEvent({
event := {
bIdx := v_myBCtxIdx,
iIdx := v_EPTF_LGenBase_PerfTest_FSM_eventIDs[pl_ptr.refContext.fRefArgs[0]],
target := {eIdx := pl_ptr.eIdx, fsmCtxIdx := pl_ptr.refContext.fCtxIdx},
source := {eIdx := pl_ptr.eIdx, fsmCtxIdx := pl_ptr.refContext.fCtxIdx}
},
reportedArgs := {pl_ptr.refContext.fRefArgs[0]}
});
}
function f_EPTF_LGenBase_PerfTest_FSM_cleanUp() runs on EPTF_LGenBase_PerfTest_FSM_CT {
if (v_EPTF_LGenBase_PerfTest_FSM_testFinished) {
return;
}
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list := {
{
name := "Load time",
unit := "sec",
base := log2str(f_EPTF_Base_getRelTimeInSecs())
},
{
name := "TC startup time",
unit := "sec",
base := "N/A"
},{
name := "Execution time",
unit := "sec",
base := "N/A"
},{
name := "Number of successes",
unit := "successes",
base := "N/A"
},
{
name := "Measured Success rate",
unit := "success/sec",
base := "N/A"
}
};
var charstring vl_infoStr := log2str("The test result is not available: Test did not finish in time!");
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "Test Finish Info",
unit := "-",
base := vl_infoStr
}
v_EPTF_LGenBase_PerfTest_FSM_testResult.end_time := f_TestResultGen_getCurrentTime();
f_TestResultGen_appendResult("LGenBase_Test_FSM_withHoldingTimeAndStates_Performance_"&v_EPTF_LGenBase_PerfTest_FSM_startTime&".xml", v_EPTF_LGenBase_PerfTest_FSM_testResult);
}
function f_EPTF_LGenBase_PerfTest_FSM_stopLGens(in EPTF_LGenBase_PerfTest_FSM_CT_List pl_lgens) runs on EPTF_LGenBase_PerfTest_FSM_Main_CT {
var charstring vl_verdictMessage := "";
for(var integer i:=0; i<sizeof(pl_lgens); i:=i+1) {
if (pl_lgens[i].running) {
f_EPTF_Base_stopRemote(pl_lgens[i]);
vl_verdictMessage := vl_verdictMessage & "LGen component #"&log2str(i, ": ", pl_lgens[i])&" was not terminated in time. "
}
}
if (vl_verdictMessage!="") {
setverdict(inconc, vl_verdictMessage);
}
}
type record EPTF_LGenBase_PerfTest_FSM_withHoldingTimeAndStates_Args {
charstring pl_startTime, //the time the test was started
integer pl_EPTF_LGenBase_Test_nofEntities, // number of the entities in the entity group
integer pl_EPTF_LGenBase_Test_nofSuccesses, // test is executed until nofSuccess reaches this (entity is successful if received event reaches pl_EPTF_LGenBase_Test_nofEvents)
float pl_EPTF_LGenBase_Test_maxExecutionTime, // the main component shuts down the test if LGen does not finish until this time
float pl_EPTF_LGenBase_Test_tcCPS, // the target CPS used in the traffic case
float pl_holdingTime, // the holding time of running entity
integer pl_nofCycles, //number of Cycles until success (>= 1)
charstring pl_fsmName // the name of the executed fsm
}
type record of EPTF_LGenBase_PerfTest_FSM_withHoldingTimeAndStates_Args EPTF_LGenBase_PerfTest_FSM_withHoldingTimeAndStates_ArgsList;
function f_EPTF_LGenBase_PerfTest_FSM_withHoldingTimeAndStates_Behaviour(
in charstring pl_startTime, //the time the test was started
in integer pl_EPTF_LGenBase_Test_nofEntities := 1, // number of the entities in the entity group
in integer pl_EPTF_LGenBase_Test_nofSuccesses := 1000, // test is executed until nofSuccess reaches this (entity is successful if received event reaches pl_EPTF_LGenBase_Test_nofEvents)
in float pl_EPTF_LGenBase_Test_maxExecutionTime := 60.0, // the main component shuts down the test if LGen does not finish until this time
in float pl_EPTF_LGenBase_Test_tcCPS := 20000.0, // the target CPS used in the traffic case
in float pl_holdingTime := 0.0, // the holding time of running entity
in integer pl_nofCycles := 1, //number of Cycles until success (>= 1)
in charstring pl_fsmName := "FSMWithHoldingTimeAnd_OneState" // the name of the executed fsm
) runs on EPTF_LGenBase_PerfTest_FSM_CT {
f_EPTF_LGenBase_init("FSMWithHoldingTimeAndStates_Behaviour");
var charstring vl_trafficGenerationMode := "MultiBurst (targetCPS="&float2str(pl_EPTF_LGenBase_Test_tcCPS)&", EntityNum="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
if (pl_EPTF_LGenBase_Test_nofSuccesses==1) {
vl_trafficGenerationMode := "SingleBurst (BurstSize="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
}
v_EPTF_LGenBase_PerfTest_FSM_testResult.name := "LGenBase FSM With HoldingTime And States Performance Measurement with "&vl_trafficGenerationMode&", holding time="&float2str(pl_holdingTime) & ", cycles=" & int2str(pl_nofCycles);
v_EPTF_LGenBase_PerfTest_FSM_testResult.purpose := "To measure the maximal CPS using an FSM with holding time="&float2str(pl_holdingTime)& ", and multiple states"&", traffic generation mode is "&vl_trafficGenerationMode;
f_TestResultGen_getEnvironment(v_EPTF_LGenBase_PerfTest_FSM_testResult.environment);
v_EPTF_LGenBase_PerfTest_FSM_testResult.parameter_list := {
{name := "Number of Entities", unit := "entities", base := log2str(pl_EPTF_LGenBase_Test_nofEntities) },
{name := "Number of Successes to Reach", unit := "successes", base := log2str(pl_EPTF_LGenBase_Test_nofSuccesses) },
{name := "Max Execution Time", unit := "sec", base := log2str(pl_EPTF_LGenBase_Test_maxExecutionTime) },
{name := "Target CPS", unit := "start/sec", base := log2str(pl_EPTF_LGenBase_Test_tcCPS) },
{name := "Holding Time", unit := "sec", base := log2str(pl_holdingTime) },
{name := "Cycles", unit := "-", base := log2str(pl_nofCycles) },
{name := "FSM", unit := "-", base := pl_fsmName },
{name := "EPTF_DEBUG", unit := "-", base := log2str(c_EPTF_Common_debugSwitch) }
};
v_EPTF_LGenBase_PerfTest_FSM_testResult.start_time := f_TestResultGen_getCurrentTime();
v_EPTF_LGenBase_PerfTest_FSM_startTime := pl_startTime; //saved for cleanUp function
f_EPTF_Base_registerCleanup(refers(f_EPTF_LGenBase_PerfTest_FSM_cleanUp));
v_EPTF_LGenBase_PerfTest_FSM_testFinished := false;
v_EPTF_LGenBase_Test_nofEvents := pl_nofCycles;
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity := {}; //contains current cycle counter per entities
v_myBCtxIdx := f_EPTF_LGenBase_declareBehaviorType("b1", -1, null, null, null);
f_EPTF_LGenBase_declareEntityType("et1", {"b1"});
v_EPTF_LGenBase_PerfTest_FSM_eventIDs[0] := f_EPTF_LGenBase_declareFsmEvent("b1", "Event1");
v_EPTF_LGenBase_PerfTest_FSM_eventIDs[1] := f_EPTF_LGenBase_declareFsmEvent("b1", "Event2");
v_EPTF_LGenBase_PerfTest_FSM_eventIDs[2] := f_EPTF_LGenBase_declareFsmEvent("b1", "Event3");
f_EPTF_LGenBase_declareFunction("startCycleOrSuccess",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_step_startCycleOrSuccess)});
f_EPTF_LGenBase_declareFunction("startCycleOrSuccessEvents",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_step_startCycleOrSuccessEvents)});
f_EPTF_LGenBase_declareFunction("nextStateCalc",{nextStateCalcFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_nextStateCalc)});
f_EPTF_LGenBase_declareFunction("reportAnEvent",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_postAnEvent)});
select (pl_fsmName) {
case (c_EPTF_LGenBase_PerfTest_simplest_FSM.name) {
f_EPTF_LGenBase_declareFSMTable(c_EPTF_LGenBase_PerfTest_simplest_FSM);
}
case (t_FSMWithHoldingTime(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTime(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_TwoStates(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_TwoStates(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_OneState(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_OneState(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStates(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStates(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_TenStates(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_TenStates(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompact(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompact(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompactWithEvents(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompactWithEvents(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompactWithNextStateCalc(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompactWithNextStateCalc(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVars(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVars(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVarsAndStats(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompactWithTCVarsAndStats(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVars(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVars(pl_holdingTime)));
}
case (t_FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVarsAndStats(pl_holdingTime).name) {
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompactWithFSMVarsAndStats(pl_holdingTime)));
}
}
f_EPTF_LGenBase_createEntityGroup({"eg1", "et1", pl_EPTF_LGenBase_Test_nofEntities});
var EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList vl_tcTypes := {};
vl_tcTypes[0] := {
name := "TCType",
fsmName := pl_fsmName,
entityType := "et1",
customEntitySucc := ""
}
f_EPTF_LGenBase_declareTcType2(vl_tcTypes[0]);
var EPTF_LGenBase_TcMgmt_ScenarioDeclarator2 vl_sc := {
name:="Sc1",
tcList := {}
}
vl_sc.tcList[0] := {
"", // charstring tcName,
0.0,// float startDelay optional,
0.0,// float cpsToReach,
true,// boolean enableEntities,
true,// boolean enable,
omit,// EPTF_LGenBase_TcMgmt_ParamRangeDeclaratorList ranges optional,
omit,// EPTF_LGenBase_TcMgmt_tcCustomParamDeclaratorList params optional,
omit,// EPTF_LGenBase_TcMgmt_GroupFinishConditions2 groupFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityFinishConditions entityFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityActionsList entityFinishActions optional,
omit// EPTF_LGenBase_TcMgmt_GroupActions2List tcFinishActions optional
}
vl_sc.tcList[0].tcName := "TCType";
vl_sc.tcList[0].cpsToReach := pl_EPTF_LGenBase_Test_tcCPS;
f_EPTF_LGenBase_declareScenarioType2(vl_sc);
f_EPTF_LGenBase_createScenario2EntityGroup({"eg1","Sc1"},false);
// name of var that contains the success counter
var charstring pl_dataVarName := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType") & c_EPTF_LGenBaseStats_nameOfTcNrOfSuccesses;
var charstring pl_dataVarName_minAvail := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType") & c_EPTF_LGenBaseStats_nameOfTcMinAvailable;
var charstring pl_dataVarName_maxRunning := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType") & c_EPTF_LGenBaseStats_nameOfTcMaxRunning;
timer t_wait := 0.0;
t_wait.start; // wait for pl_EPTF_LGenBase_Test_nofSuccesses success
timer t_maxExecution := pl_EPTF_LGenBase_Test_maxExecutionTime;
var charstring vl_execTimeInfoStr := "";
var float vl_startTime := 0.0, vl_endTime := 0.0;
var float vl_startTCTime := f_EPTF_Base_getRelTimeInSecs();
f_EPTF_LGenBase_startTrafficCase("eg1", "Sc1", "TCType");
vl_startTime := f_EPTF_Base_getRelTimeInSecs();
t_maxExecution.start;
alt {
[] t_maxExecution.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
vl_execTimeInfoStr := log2str("The test result may not be reliable because the number of expected successes (",pl_EPTF_LGenBase_Test_nofSuccesses,") was not reached in time. Current number of succ: ", f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName)));
}
[f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName))>=pl_EPTF_LGenBase_Test_nofSuccesses] t_wait.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
}
}
// check if all events were executed:
var integer vl_nofSuccess := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName));
var integer vl_minAvail := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName_minAvail));
var integer vl_maxRunning := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName_maxRunning));
action("FSM: ", pl_fsmName, " with holding time: ", pl_holdingTime, " cycles: ", pl_nofCycles, " entities: ", pl_EPTF_LGenBase_Test_nofEntities);
action("vl_nofSuccess: ", vl_nofSuccess, " Min avail: ", vl_minAvail, " max running: ", vl_maxRunning);
action("load time: ", vl_startTime)
var float vl_tcStartupTime := vl_startTime - vl_startTCTime;
action("vl_tcStartupTime: ", vl_tcStartupTime);
var float vl_executionTime := vl_endTime - vl_startTime;
action("executionTime: ", vl_executionTime);
action("CPS: ", int2float(vl_nofSuccess)/vl_executionTime);
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list := {
{
name := "Load time",
unit := "sec",
base := log2str(vl_startTime)
},
{
name := "TC startup time",
unit := "sec",
base := log2str(vl_tcStartupTime)
},{
name := "Max running entities",
unit := "-",
base := log2str(vl_maxRunning)
},{
name := "Execution time",
unit := "sec",
base := log2str(vl_executionTime)
},{
name := "Number of successes",
unit := "successes",
base := log2str(vl_nofSuccess)
},
{
name := "Measured Success rate",
unit := "success/sec",
base := log2str(int2float(vl_nofSuccess)/vl_executionTime)
}
};
// check measured success rate with respect to the target CPS:
if (int2float(vl_nofSuccess)/vl_executionTime>pl_EPTF_LGenBase_Test_tcCPS*0.8) {
// test result may not be reliable because the target CPS is close to the measured one
var charstring vl_infoStr := log2str("The test result may not be reliable because the measured CPS is close to or above (",
100.0*int2float(vl_nofSuccess)/vl_executionTime/pl_EPTF_LGenBase_Test_tcCPS,
"% of) the target.");
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "Info",
unit := "-",
base := vl_infoStr
}
}
//check single burst:
if(pl_EPTF_LGenBase_Test_nofSuccesses == 1) {
if (vl_nofSuccess!=pl_EPTF_LGenBase_Test_nofEntities) {
// maybe single burst was not performed properly
var charstring vl_infoStr := log2str("Single burst might not have been performed properly, test result might be unreliable.");
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "SingleBurstInfo",
unit := "-",
base := vl_infoStr
}
}
}
// execTime limit:
if (vl_execTimeInfoStr!="") {
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "ExecTimeInfo",
unit := "-",
base := vl_execTimeInfoStr
}
}
// check available entities:
if (vl_minAvail==0) {
var charstring vl_infoStr := log2str("Not enough entities. Test result might be unreliable. Max running entities: ",vl_maxRunning);
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "EntityAvailabilityInfo",
unit := "-",
base := vl_infoStr
}
}
f_EPTF_LGenBase_stopTrafficCase("eg1", "Sc1", "TCType");
v_EPTF_LGenBase_PerfTest_FSM_testResult.end_time := f_TestResultGen_getCurrentTime();
f_TestResultGen_appendResult("LGenBase_Test_FSM_withHoldingTimeAndStates_Performance_"&pl_startTime&".xml", v_EPTF_LGenBase_PerfTest_FSM_testResult);
v_EPTF_LGenBase_PerfTest_FSM_testFinished := true;
f_EPTF_Base_stop(pass);
}
function f_EPTF_LGenBase_PerfTest_FSM_fillParams(in Testresults pl_testresults, inout Testresult pl_testresult) {
for(var integer i:=0; i<sizeof(pl_testresults.testresult_list[0].parameter_list); i:=i+1) {
if (
//pl_testresults.testresult_list[0].parameter_list[i].name == "Holding Time"
//or pl_testresults.testresult_list[0].parameter_list[i].name == "Cycles"
//or
pl_testresults.testresult_list[0].parameter_list[i].name == "EPTF_DEBUG"
) {
pl_testresult.parameter_list[sizeof(pl_testresult.parameter_list)] := pl_testresults.testresult_list[0].parameter_list[i];
}
}
}
type record FSMResult {
charstring fsmName,
float sumCPS,
integer nofCPS
}
type record of FSMResult FSMResultList;
function f_EPTF_LGenBase_PerfTest_FSM_addCPS(in charstring pl_fsmName, in float pl_cps, inout FSMResultList pl_fsmResultList) {
var integer vl_foundId := -1;
for (var integer i:=0; i<sizeof(pl_fsmResultList); i:=i+1) {
if (pl_fsmResultList[i].fsmName == pl_fsmName) {
vl_foundId := i;
break;
}
}
if (vl_foundId==-1) {
// add new item
vl_foundId:=sizeof(pl_fsmResultList);
pl_fsmResultList[vl_foundId] := {pl_fsmName, pl_cps, 1};
} else {
// update existing item
pl_fsmResultList[vl_foundId].sumCPS := pl_fsmResultList[vl_foundId].sumCPS + pl_cps;
pl_fsmResultList[vl_foundId].nofCPS := pl_fsmResultList[vl_foundId].nofCPS + 1;
}
}
function f_EPTF_LGenBase_PerfTest_FSM_getParamValue(in Testresult pl_testResult, in charstring pl_paramName) return charstring {
for(var integer i:=0; i<sizeof(pl_testResult.parameter_list); i:=i+1) {
if (f_unichar2charstr(pl_testResult.parameter_list[i].name) == pl_paramName) {
return f_unichar2charstr(pl_testResult.parameter_list[i].base);
}
}
return "";
}
function f_EPTF_LGenBase_PerfTest_FSM_getResultValue(in Testresult pl_testResult, in charstring pl_resultName) return charstring {
for(var integer i:=0; i<sizeof(pl_testResult.result_list); i:=i+1) {
if (f_unichar2charstr(pl_testResult.result_list[i].name) == pl_resultName) {
return f_unichar2charstr(pl_testResult.result_list[i].base);
}
}
return "";
}
function f_EPTF_LGenBase_PerfTest_FSM_fillResults(in Testresults pl_testresults, inout Testresult pl_testresult) {
var FSMResultList vl_fsmResultList := {};
for(var integer i:=0; i<sizeof(pl_testresults.testresult_list); i:=i+1) {
var charstring vl_fsmName := f_EPTF_LGenBase_PerfTest_FSM_getParamValue(pl_testresults.testresult_list[i], "FSM");
var charstring vl_cpsStr := f_EPTF_LGenBase_PerfTest_FSM_getResultValue(pl_testresults.testresult_list[i], "Measured Success rate");
if (vl_cpsStr!="" and vl_cpsStr!= "N/A"
and not match(f_EPTF_LGenBase_PerfTest_FSM_getResultValue(pl_testresults.testresult_list[i], "Info"), pattern "*measured CPS is close to or above*")
and ( ( not match(f_EPTF_LGenBase_PerfTest_FSM_getResultValue(pl_testresults.testresult_list[i], "EntityAvailabilityInfo"), pattern "*Not enough entities*")
and "0.000000" != f_EPTF_LGenBase_PerfTest_FSM_getParamValue(pl_testresults.testresult_list[i], "Holding Time")
) or "0.000000" == f_EPTF_LGenBase_PerfTest_FSM_getParamValue(pl_testresults.testresult_list[i], "Holding Time")
)
and "1" != f_EPTF_LGenBase_PerfTest_FSM_getParamValue(pl_testresults.testresult_list[i], "Number of Entities")
) {
f_EPTF_LGenBase_PerfTest_FSM_addCPS(vl_fsmName,str2float(vl_cpsStr),vl_fsmResultList);
}
}
var charstring vl_holdingTime := f_EPTF_LGenBase_PerfTest_FSM_getParamValue(pl_testresults.testresult_list[0], "Holding Time");
var charstring vl_cycles := f_EPTF_LGenBase_PerfTest_FSM_getParamValue(pl_testresults.testresult_list[0], "Cycles");
for(var integer i:=0; i<sizeof(vl_fsmResultList); i:=i+1) {
var integer vl_lastIndex := sizeof(pl_testresult.result_list);
pl_testresult.result_list[vl_lastIndex] := {
name := "Max CPS for FSM "&vl_fsmResultList[i].fsmName&" (holding time: "&vl_holdingTime&", cycles: "&vl_cycles&")",
unit := "success/sec",
base := "N/A"
}
if (vl_fsmResultList[i].nofCPS>0) {
pl_testresult.result_list[vl_lastIndex].base := float2str(vl_fsmResultList[i].sumCPS/int2float(vl_fsmResultList[i].nofCPS));
}
}
}
function f_EPTF_LGenBase_PerfTest_FSM_storeXMLsForCompactResults() runs on EPTF_Base_CT {
// save the result to be used by the testcase tc_EPTF_LGenBase_PerfTest_FSM_withHoldingTimeAndStates_MultiBurst_CalculateResults
// rename the files to .xml.sav
var charstring vl_stdout,vl_stderr;
if (0!=f_EPTF_Base_executeShell(
pl_command := "echo 'for file in LGenBase_Test_FSM_withHoldingTimeAndStates_Performance_*xml;do' > rename.sh; echo 'cp $file $file.sav;done' >> rename.sh;chmod u+x rename.sh; ./rename.sh; \\rm rename.sh",
pl_stdOut := vl_stdout,
pl_stdErr := vl_stderr
)) {
setverdict(fail, "Cannot determine list of input files: ", vl_stderr)
}
}
function f_EPTF_LGenBase_PerfTest_FSM_removeStoredXMLsForCompactResults() runs on EPTF_Base_CT {
// remove the saved results used by the testcase tc_EPTF_LGenBase_PerfTest_FSM_withHoldingTimeAndStates_MultiBurst_CalculateResults
// delete the files to .xml.sav
var charstring vl_stdout,vl_stderr;
if (0!=f_EPTF_Base_executeShell(
pl_command := "\\rm LGenBase_Test_FSM_withHoldingTimeAndStates_Performance_*xml.sav",
pl_stdOut := vl_stdout,
pl_stdErr := vl_stderr
)) {
setverdict(fail, "Cannot determine list of input files: ", vl_stderr)
}
}
function f_EPTF_LGenBase_PerfTest_FSM_compactResults(in charstring pl_filename, inout Testresult pl_testresult) return boolean {
var Testresults vl_testresults := {{}};
var integer vl_fd := f_FIO_open_append_rdwr_excl(pl_filename);
if (vl_fd == -1) {
setverdict(fail, %definitionId&": Cannot open file "&pl_filename);
return false;
}
var octetstring vl_data;
var integer vl_fileSize := f_FIO_seek_end(vl_fd);
f_FIO_seek_home(vl_fd)
f_FIO_read_data(vl_fd,vl_data,vl_fileSize);
if (vl_fileSize>0 and dec_Testresults(vl_data,vl_testresults)!=0) {
setverdict(fail,%definitionId&": Cannot decode input file "&pl_filename);
f_FIO_close(vl_fd);
return false;
}
f_FIO_close(vl_fd);
// compact vl_testresults:
if (sizeof(vl_testresults)==0) {
setverdict(fail, "Not enough results found in file ",pl_filename);
return false;
}
var Testresult vl_compactedResult;
if (isbound(pl_testresult)) {
vl_compactedResult := pl_testresult;
} else {
vl_compactedResult := vl_testresults.testresult_list[0];
vl_compactedResult.parameter_list := {};
vl_compactedResult.result_list := {};
vl_compactedResult.name := "Overall Results for LGenBase FSM With HoldingTime And States Performance Measurement with MultiBurst";
vl_compactedResult.purpose := "To calculate the average Maximal CPS from the previous test results for different FSMs";
f_EPTF_LGenBase_PerfTest_FSM_fillParams(vl_testresults,vl_compactedResult);
}
f_EPTF_LGenBase_PerfTest_FSM_fillResults(vl_testresults,vl_compactedResult);
pl_testresult := vl_compactedResult;
return true;
}
function f_EPTF_LGenBase_PerfTest_FSM_withMultipleTrafficCases_Behaviour(
in charstring pl_startTime, //the time the test was started
in integer pl_EPTF_LGenBase_Test_nofEntities := 1, // number of the entities in the entity group
in integer pl_EPTF_LGenBase_Test_nofSuccesses := 1000, // test is executed until nofSuccess reaches this (entity is successful if received event reaches pl_EPTF_LGenBase_Test_nofEvents)
in float pl_EPTF_LGenBase_Test_maxExecutionTime := 60.0, // the main component shuts down the test if LGen does not finish until this time
in float pl_EPTF_LGenBase_Test_tcCPS := 20000.0, // the target CPS used in the traffic case
in float pl_holdingTime := 0.0, // the holding time of running entity
in integer pl_nofCycles := 1, //number of Cycles until success (>= 1)
in charstring pl_fsmName := "FSMWithHoldingTimeAnd_FiveStatesCompact" // the name of the executed fsm
) runs on EPTF_LGenBase_PerfTest_FSM_CT {
f_EPTF_LGenBase_init("FSMWithMultipleTrafficCases_Behaviour");
var charstring vl_trafficGenerationMode := "MultiBurst (targetCPS="&float2str(pl_EPTF_LGenBase_Test_tcCPS)&", EntityNum="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
if (pl_EPTF_LGenBase_Test_nofSuccesses==1) {
vl_trafficGenerationMode := "SingleBurst (BurstSize="&int2str(pl_EPTF_LGenBase_Test_nofEntities)&")";
}
v_EPTF_LGenBase_PerfTest_FSM_testResult.name := "LGenBase FSM With Multiple TrafficCases Performance Measurement with "&vl_trafficGenerationMode&", holding time="&float2str(pl_holdingTime) & ", cycles=" & int2str(pl_nofCycles);
v_EPTF_LGenBase_PerfTest_FSM_testResult.purpose := "To measure the maximal CPS using an FSM with holding time="&float2str(pl_holdingTime)& ", and multiple traffic cases"&", traffic generation mode is "&vl_trafficGenerationMode;
f_TestResultGen_getEnvironment(v_EPTF_LGenBase_PerfTest_FSM_testResult.environment);
v_EPTF_LGenBase_PerfTest_FSM_testResult.parameter_list := {
{name := "Number of Entities", unit := "entities", base := log2str(pl_EPTF_LGenBase_Test_nofEntities) },
{name := "Number of Successes to Reach", unit := "successes", base := log2str(pl_EPTF_LGenBase_Test_nofSuccesses) },
{name := "Max Execution Time", unit := "sec", base := log2str(pl_EPTF_LGenBase_Test_maxExecutionTime) },
{name := "Target CPS", unit := "start/sec", base := log2str(pl_EPTF_LGenBase_Test_tcCPS) },
{name := "Holding Time", unit := "sec", base := log2str(pl_holdingTime) },
{name := "Cycles", unit := "-", base := log2str(pl_nofCycles) },
{name := "FSM", unit := "-", base := pl_fsmName },
{name := "EPTF_DEBUG", unit := "-", base := log2str(c_EPTF_Common_debugSwitch) }
};
v_EPTF_LGenBase_PerfTest_FSM_testResult.start_time := f_TestResultGen_getCurrentTime();
v_EPTF_LGenBase_PerfTest_FSM_startTime := pl_startTime; //saved for cleanUp function
f_EPTF_Base_registerCleanup(refers(f_EPTF_LGenBase_PerfTest_FSM_cleanUp));
v_EPTF_LGenBase_PerfTest_FSM_testFinished := false;
v_EPTF_LGenBase_Test_nofEvents := pl_nofCycles;
v_EPTF_LGenBase_PerfTest_FSM_nofCyclesPerEntity := {}; //contains current cycle counter per entities
v_myBCtxIdx := f_EPTF_LGenBase_declareBehaviorType("b1", -1, null, null, null);
f_EPTF_LGenBase_declareEntityType("et1", {"b1"});
f_EPTF_LGenBase_declareFunction("startCycleOrSuccess",{testStepFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_step_startCycleOrSuccess)});
f_EPTF_LGenBase_declareFunction("nextStateCalc",{nextStateCalcFunction := refers(f_EPTF_LGenBase_PerfTest_FSM_nextStateCalc)});
f_EPTF_LGenBase_declareFSMTable(valueof(t_FSMWithHoldingTimeAnd_FiveStatesCompact(pl_holdingTime)));
f_EPTF_LGenBase_createEntityGroup({"eg1", "et1", pl_EPTF_LGenBase_Test_nofEntities});
var EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList vl_tcTypes := {};
vl_tcTypes[0] := {
name := "TCType0",
fsmName := pl_fsmName,
entityType := "et1",
customEntitySucc := ""
}
vl_tcTypes[1] := {
name := "TCType1",
fsmName := pl_fsmName,
entityType := "et1",
customEntitySucc := ""
}
f_EPTF_LGenBase_declareTcType2(vl_tcTypes[0]);
f_EPTF_LGenBase_declareTcType2(vl_tcTypes[1]);
var EPTF_LGenBase_TcMgmt_ScenarioDeclarator2 vl_sc := {
name:="Sc1",
tcList := {}
}
vl_sc.tcList[0] := {
"", // charstring tcName,
0.0,// float startDelay optional,
0.0,// float cpsToReach,
true,// boolean enableEntities,
true,// boolean enable,
omit,// EPTF_LGenBase_TcMgmt_ParamRangeDeclaratorList ranges optional,
omit,// EPTF_LGenBase_TcMgmt_tcCustomParamDeclaratorList params optional,
omit,// EPTF_LGenBase_TcMgmt_GroupFinishConditions2 groupFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityFinishConditions entityFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityActionsList entityFinishActions optional,
omit// EPTF_LGenBase_TcMgmt_GroupActions2List tcFinishActions optional
}
vl_sc.tcList[0].tcName := "TCType0";
vl_sc.tcList[0].cpsToReach := pl_EPTF_LGenBase_Test_tcCPS;
vl_sc.tcList[1] := {
"", // charstring tcName,
0.0,// float startDelay optional,
0.0,// float cpsToReach,
true,// boolean enableEntities,
true,// boolean enable,
omit,// EPTF_LGenBase_TcMgmt_ParamRangeDeclaratorList ranges optional,
omit,// EPTF_LGenBase_TcMgmt_tcCustomParamDeclaratorList params optional,
omit,// EPTF_LGenBase_TcMgmt_GroupFinishConditions2 groupFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityFinishConditions entityFinishConditions optional,
omit,// EPTF_LGenBase_TcMgmt_EntityActionsList entityFinishActions optional,
omit// EPTF_LGenBase_TcMgmt_GroupActions2List tcFinishActions optional
}
vl_sc.tcList[1].tcName := "TCType1";
vl_sc.tcList[1].cpsToReach := pl_EPTF_LGenBase_Test_tcCPS;
f_EPTF_LGenBase_declareScenarioType2(vl_sc);
f_EPTF_LGenBase_createScenario2EntityGroup({"eg1","Sc1"},false);
// name of var that contains the success counter
var charstring pl_dataVarName0 := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType0") & c_EPTF_LGenBaseStats_nameOfTcNrOfSuccesses;
var charstring pl_dataVarName1 := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType1") & c_EPTF_LGenBaseStats_nameOfTcNrOfSuccesses;
var charstring pl_dataVarName_minAvail0 := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType0") & c_EPTF_LGenBaseStats_nameOfTcMinAvailable;
var charstring pl_dataVarName_minAvail1 := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType1") & c_EPTF_LGenBaseStats_nameOfTcMinAvailable;
var charstring pl_dataVarName_maxRunning0 := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType0") & c_EPTF_LGenBaseStats_nameOfTcMaxRunning;
var charstring pl_dataVarName_maxRunning1 := f_EPTF_LGenBase_getNamePrefix("eg1","Sc1","TCType1") & c_EPTF_LGenBaseStats_nameOfTcMaxRunning;
timer t_wait := 0.0;
t_wait.start; // wait for pl_EPTF_LGenBase_Test_nofSuccesses success
timer t_maxExecution := pl_EPTF_LGenBase_Test_maxExecutionTime;
var charstring vl_execTimeInfoStr := "";
var float vl_startTime := 0.0, vl_endTime := 0.0;
var float vl_startTCTime := f_EPTF_Base_getRelTimeInSecs();
f_EPTF_LGenBase_startTrafficCase("eg1", "Sc1", "TCType0");
f_EPTF_LGenBase_startTrafficCase("eg1", "Sc1", "TCType1");
vl_startTime := f_EPTF_Base_getRelTimeInSecs();
t_maxExecution.start;
alt {
[] t_maxExecution.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
vl_execTimeInfoStr := log2str(
"The test result may not be reliable because the number of expected successes (",
pl_EPTF_LGenBase_Test_nofSuccesses,") was not reached in time. Current number of succ: ",
f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName0)) + f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName1)));
}
[f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName0))+f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName1))>=pl_EPTF_LGenBase_Test_nofSuccesses] t_wait.timeout {
vl_endTime := f_EPTF_Base_getRelTimeInSecs();
}
}
// check if all events were executed:
var integer vl_nofSuccess0 := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName0));
var integer vl_nofSuccess1 := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName1));
var integer vl_minAvail0 := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName_minAvail0));
var integer vl_minAvail1 := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName_minAvail1));
var integer vl_maxRunning0 := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName_maxRunning0));
var integer vl_maxRunning1 := f_EPTF_Var_getIntValue(f_EPTF_Var_getId(pl_dataVarName_maxRunning1));
action("FSM: ", t_FSMWithHoldingTimeAnd_FiveStatesCompact(pl_holdingTime).name, " with holding time: ", pl_holdingTime, " cycles: ", pl_nofCycles, " entities: ", pl_EPTF_LGenBase_Test_nofEntities);
action("vl_nofSuccess: ", vl_nofSuccess0+vl_nofSuccess1, " Min avail: ", vl_minAvail0, ",", vl_minAvail1, " max running: ", vl_maxRunning0,",",vl_maxRunning1);
action("load time: ", vl_startTime)
var float vl_tcStartupTime := vl_startTime - vl_startTCTime;
action("vl_tcStartupTime: ", vl_tcStartupTime);
var float vl_executionTime := vl_endTime - vl_startTime;
action("executionTime: ", vl_executionTime);
action("CPS: ", int2float(vl_nofSuccess0+vl_nofSuccess1)/vl_executionTime);
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list := {
{
name := "Load time",
unit := "sec",
base := log2str(vl_startTime)
},
{
name := "TC startup time",
unit := "sec",
base := log2str(vl_tcStartupTime)
},{
name := "Max running entities (TC1,TC2)",
unit := "-",
base := log2str(vl_maxRunning0, ",", vl_maxRunning1)
},{
name := "Execution time",
unit := "sec",
base := log2str(vl_executionTime)
},{
name := "Number of successes",
unit := "successes",
base := log2str(vl_nofSuccess0+vl_nofSuccess1)
},
{
name := "Measured Success rate",
unit := "success/sec",
base := log2str(int2float(vl_nofSuccess0+vl_nofSuccess1)/vl_executionTime)
}
};
// check measured success rate with respect to the target CPS:
if (int2float(vl_nofSuccess0+vl_nofSuccess1)/vl_executionTime>pl_EPTF_LGenBase_Test_tcCPS*0.8) {
// test result may not be reliable because the target CPS is close to the measured one
var charstring vl_infoStr := log2str("The test result may not be reliable because the measured CPS is close to or above (",
100.0*int2float(vl_nofSuccess0+vl_nofSuccess1)/vl_executionTime/pl_EPTF_LGenBase_Test_tcCPS,
"% of) the target.");
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "Info",
unit := "-",
base := vl_infoStr
}
}
//check single burst:
if(pl_EPTF_LGenBase_Test_nofSuccesses == 1) {
if (vl_nofSuccess0+vl_nofSuccess1!=pl_EPTF_LGenBase_Test_nofEntities) {
// maybe single burst was not performed properly
var charstring vl_infoStr := log2str("Single burst might not have been performed properly, test result might be unreliable.");
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "SingleBurstInfo",
unit := "-",
base := vl_infoStr
}
}
}
// execTime limit:
if (vl_execTimeInfoStr!="") {
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "ExecTimeInfo",
unit := "-",
base := vl_execTimeInfoStr
}
}
// check available entities:
if (vl_minAvail0==0 or vl_minAvail1==0) {
var charstring vl_infoStr := log2str("Not enough entities. Test result might be unreliable. Max running entities: ", vl_maxRunning0, ",", vl_maxRunning1);
v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list[sizeof(v_EPTF_LGenBase_PerfTest_FSM_testResult.result_list)] := {
name := "EntityAvailabilityInfo",
unit := "-",
base := vl_infoStr
}
}
f_EPTF_LGenBase_stopTrafficCase("eg1", "Sc1", "TCType0");
f_EPTF_LGenBase_stopTrafficCase("eg1", "Sc1", "TCType1");
v_EPTF_LGenBase_PerfTest_FSM_testResult.end_time := f_TestResultGen_getCurrentTime();
f_TestResultGen_appendResult("LGenBase_Test_FSM_withMultipleTrafficCases_Performance"&pl_startTime&".xml", v_EPTF_LGenBase_PerfTest_FSM_testResult);
v_EPTF_LGenBase_PerfTest_FSM_testFinished := true;
f_EPTF_Base_stop(pass);
}
} // group FSMWithHoldingTimeAndStates
} //end of module