beautypg.com

10 advanced script parser features, 1 local numeric parser variables, Local numeric parser variables – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual

Page 79: Local inst

background image

LeCroy Corporation

UWBTrainer Exerciser - Generation Script Language Reference Manual

71

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 struct variables in field assignments
• Using = + in field assignments
• Initializing struct 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 =

0xAABB

# Declare a local variable 'x'.

Local

y =

20

# Explicitly declare a local variable 'y'

Send

TX_FRAME

{

DestAddr = x

# Use the previously assigned variable 'x'

SrcAddr = y +

10

# Use the previously assigned variable 'x' + 10

SeqCtrl = z

# Create a new variable 'z' with value 0.

}

}