beautypg.com

Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 126

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

117

# The generation procedure now has one structure variable parameter and
# two numeric parameters.

Block2( SOME_PKT_TEMPLATE $pkt_param, x, y )
{

# Send a packet based on the structure variable parameter
# to 'pkt_param'.

Send

pkt_param

{
Field0 = x + y
}
}

# Call another generation procedure.

Main

{

Send

TX_PACKET

# Send packet based on the template 'TX_PACKET'.


$X = SOME_PKT_TEMPLATE

# Declare a variable X as a packet of type

# SOME_PKT_TEMPLATE.

w =

1

u =

0xAABB

# "Call" the procedure 'Block2' with parameters.
# Note: The actual structure variable parameter
# must have '$' before the name of a variable.

Call

Block2 ( $X, w, u )


$X

# Change the local structure variable 'X'.

{
Field0 =

5096

}

w =

1024

# Change the local numeric variable 'w'.

u =

12

# Change the local numeric variable 'u'.


Call

Block2 ( $X, w, u )

# Call the procedure 'Block2' with new

# parameters.
# Note: The parser checks the variable structure parameters when
# processing the Call directive and allows only structure variables
# derived from the templates specified in the procedure declaration.

$X = DIFFERENT_TEMPLATE

# Redeclare a structure variable using a

# template not derived from 'SOME_PKT_TEMPLATE'.


Call

Block2 ( $X, w, w )

# !!! yields a parsing error.

}