The operation belongs to the family of procedure-based communication operations. It is used to specify that a test component calls a procedure in the system under test or in another test component. The communication may be either blocking or non-blocking.
Related keywords:
1. Non-blocking communication
port_reference.call ( template_instance [ ,nowait ] ) [ to address_reference ]; |
port_reference points out the port where the procedure is called at.
The call keyword introduces the procedure call.
template_instance is one of the following:
TITAN specific restriction compared to the standard:
|
The optional keyword nowait is used when the signature is intended for blocking communication. but the process call should be made in a non-blocking way.
The optional to keyword is used when a port is connected to several entities and identification of the communication partner is required.
address_reference is one of the following:
2. Blocking communication
port_reference.call ( template_instance [ ,call_timer ] ) [ to address_reference ] {[ response_handling_part ] [ exception_handling_part ]}; |
port_reference points out the port where the procedure is called at.
The call keyword introduces the procedure call.
template_instance is one of the following:
TITAN specific restriction compared to the standard:
|
The optional call_timer (a floating point value) determines the waiting time for a response in seconds.
The optional to keyword is used when a port is connected to several entities and identification of the communication partner is required.
address_reference is one of the following:
The response and exception handling part between curly brackets is used to handle responses and exceptions. It has the same structure as an alt statement. Its elements may occur several times; they are separated by semicolons (see the example 4).
Example 1: in-line signature template
signature S_MyProc (out integer pl_MyPar1, inout boolean pl_MyPar2, in charset pl_MyPar3) noblock;
MujPort_PCO.call(S_MyProc:{ -, true, "marcipaan"}) to system;
The signature S_MyProc suitable for non-blocking communication is defined in the first line. It has three parameters (pl_MyPar1, pl_MyPar2 and pl_MyPar3).
In the second line, the procedure is called at the port MujPort_PCO. The port is connected to several components therefore it must be addressed, in our case to the test system interface. The
first parameter has no value assigned because it is an out parameter from the point of view of the called procedure. The second parameter (pl_MyPar2) has the value true, the third one contains
"marcipaan".
Example 2: signature template
template S_MyProc t_NiaTemplate (boolean pl_param) := {
field1 := 16,
field2 := pl_param,
field3 := "massepain"
}
MujPort_PCO.call (t_NiaTemplate(true));
The parameterized template (t_NiaTemplate) has three fields. When called as shown in the second line, the values true and "massepain" will be sent to the port MujPort_PCO. The first parameter is don't care because it is defined as an out parameter.
Example 3: modified signature template
MujPort_PCO.call (modifies t_NiaTemplate(false) := {field3 := "pate d'amande"});
The template defined in example 2 is modified. When sent as shown, the values false and ""pate d'amande" will be sent to the port MujPort_PCO as second and third parameters.
Example 4: blocking communication
signature S_MyProcc (in integer pl_MyPar41, inout integer pl_MyPar42) return integer exception (integer, float);
MujPort_PCO.call(S_MyProcc:{512, 1024}, 1E-1) to system {
[] MujPort_PCO.getreply(MyProcc:{?, ?}) -> value v_MyResult param (v_MyPar1Var,v_MyPar2Var) { }
[] MujPort_PCO.catch(MyProcc, MyExceptionOne) {
setverdict(fail);
stop;
}
[] MujPort_PCO.catch(MyProcc, ExceptionTypeTwo : ?) {
setverdict(inconc);
}
[v_MyCondition] MujPort_PCO.catch(MyProcc, MyExceptionThree) { }
[] MyPort.catch(timeout) {
setverdict(fail);
stop;
}
}
The signature S_MyProcc suitable for blocking communication is defined in the first line. It has two parameters (pl_MyPar41 and pl_MyPar42). The procedure returns an integer value and may raise
exceptions, the type of the latter is integer respective float.
In the second line, the procedure is called with a time supervision of 100 ms at the port MujPort_PCO. The port is connected to several components therefore it must be addressed, in our case to
the test system interface. The first parameter has the integer value 512, the second one (pl_MyPar2) has the integer value 1024.
The first alternative in the response and exception handling part processes the reply: all values are matched, the returned integer value is stored in the variable v_MyResult and the two returned
parameters are stored in the variables v_MyPar1Var and v_MyPar2Var respectively.
The second alternative catches the first exception using the template MyExceptionOne, sets the verdict to fail and stops the test case.
The third alternative catches the second exception using the template MyExceptionTwo and sets the verdict to inconc.
The fourth alternative catches the third exception using the template MyExceptionThree provided that the varibale v_MyCondition equals true and does nothing.
The fifth alternative is activated when timeout occurs, sets the verdict to fail and stops the test case.
BNF definition of call