12 preprocessor integer arithmetic, Preprocessor integer arithmetic – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual
Page 119

Teledyne LeCroy
Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
110
10.12 Preprocessor Integer Arithmetic
You can declare a preprocessor DWORD variable, make arithmetic operations with it, and use it
in field and setting/parameter assignments.
Note: Arithmetic expressions are allowed only in numeric variable assignments. Some legal
expressions are.
x = y + 2
TX_PACKET ( Delay = (x+y)*7 )
TX_PACKET ( x + 12 )
Examples
Const
TX_PAYLOAD_OFFSET =
16 * 8
Const
"Some Hex Data"
=
0xAABB
Main
{
x = 2
y = ( z = 12 ) + ( TX_PAYLOAD_OFFSET + 36 ) / 8
z = 0x1 << 5
s =
"Some Hex Data"
# Constants may be used in operations.
x++
y--
z += ( x + y )
x = ( ( y & 0xFF ) >> 5 ) / 12
Send
TX_PACKET ( Delay = x )
Send
TX_PACKET
{
Endp = 0xEEEE
# Example of a data payload assignment that uses
# integer variables, constants, hex literals, binary literals,
# and a data pattern
.
Data = { y y y
7a7a7a
"Some Hex Data"
"Some Hex Data"
8b 8b _11110000 _00001111
z z z
[PATTERN_3] }
}
( Delay = y )
# Use an integer variable for a parameter setting.
}