18 global numeric and structure variables, Global numeric and structure variables – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual
Page 124

Teledyne LeCroy
Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
115
10.18 Global Numeric and Structure Variables
You can declare global numeric and structure variables that can be used in different generation
procedures during parsing. Such global variables can be changed in one generation procedure,
and then the changes are used in other generation procedures.
Example
Const
MY_CONST =
77
x =
0xAA
# Declare global numeric variable 'x'.
y =
0x12
# Declare global numeric variable 'y'.
z = MY_CONST
# Declare global numeric variable 'z'.
# Declare a global structure variable 'Z' based on the template
# 'TX_PACKET'.
TX_PACKET $Z
# Declare a global structure variable 'Y' based on the template
# 'TX_PACKET'and change the default template field values.
TX_PACKET $Y
{
DevAddr =
0xAABB
}
# Another way to declare global structure variables:
# Declare the global structure variable 'Z' based on the template
#'TX_PACKET'.
$Z = TX_PACKET
# Declare the global structure variable 'Y' based on the template
# 'TX_PACKET' and change the default template field values.
$Y = TX_PACKET
{
DevAddr =
0xAABB
}
Main
{
Send $Z
# Send a packet based on the global structure variable Z.
Send SOME_PKT_TEMPLATE
{
Field0 = y
# Use the global numeric variable 'y' to change the
# default template field values.
}
}
For more examples of using global variables, see the examples for the CALL directive in the next
section.