beautypg.com

1 calling a generation procedure with parameters, Calling a generation procedure with parameters, Call directive – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 125

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

116

10.19 Using the Call Directive for Generation
Procedure Insertions

You can declare a generation procedure with parameters and then "call" the generation
procedure using the Call directive. The Call command inserts the other procedure instructions
and takes into account the passed parameters or global variables at every call. This is called
"dynamic" insertion, as opposed to the "static" insertion implemented by the insert directive.

Note: The Call directive copies instructions from the generation procedure. The Insert directive
does not copy instructions from the generation procedure. Rather, the generation parser inserts a
special Insert instruction with a reference to the "inserted" generation procedure.

10.19.1 Calling a Generation Procedure with Parameters

Using the Call directive, the parser can insert instructions from another generation procedure
and, before insertion, provide some values for local parameters for use during parsing of that
procedure.

Example 1

# Declare a packet template.

Packet

SOME_PKT_TEMPLATE

{
Field0 :

32

=

0xFEFEFEFE

}

# Declare a generation procedure with two numeric parameters.

Block1( x, y )
{

# Send a packet based on the template 'SOME_PKT_TEMPLATE'.

Send

SOME_PKT_TEMPLATE

{

# Procedure parameters 'x' and 'y' are used to override
# the default template field values.

Field0 = x + y
}
}