10 advanced script parser features, 1 local numeric parser variables, Advanced script parser features – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual
Page 102: Local numeric parser variables, Local

Teledyne LeCroy
Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
93
10 Advanced Script Parser Features
The script parser has some advanced features that simplify creation of complicated generation
scenarios. Such features include:
Using local and global integer variables
Using local and global structure variables
Using special data pattern creators in field assignments
Using multipliers with structure variables in field assignments
Using = + in field assignments
Initializing structure variables from hex streams
Supporting arithmetic operations with parser variables
Supporting concatenation operations for structure variables
Using parser sizeof operators
Using parser while, for, and if-else operators
Calling generation procedures with parameters
Allowing users to trace/debug the parser and follow variable and template construction
Supporting name aliasing for constants, settings, data patterns, templates, variables,
instructions and named instruction parameters.
Using include paths to specify additional folders in which to look for included files
10.1 Local Numeric Parser Variables
You can declare a local numeric parser variable, which is seen only inside the generation
procedure, and use it in field assignments.
Format
[
Local
]
var = expression
Note: The Local keyword is required if you already have a global variable with the same name.
Using this keyword explicitly instructs the script parser to declare a local variable with the same
name.
Example
y = 10
# Declare a global numeric variable with name 'y'.
Main
{
x =
0x10
# Declare a local variable 'x'.
Local
y =
1
# Explicitly declare a local variable 'y'
Send
TX_PACKET
{
DevAddr = x
# Use the previously assigned variable 'x'
Endp = y +
2
# Use the previously assigned variable 'y' + 2
SeqNum = z
# Create a new variable 'z' with value 0.
}
}