4 changing structure parser variables, Changing structure parser variables – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual
Page 106
Teledyne LeCroy
Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
97
10.4 Changing Structure Parser Variables
You can change a structure variable in a generation procedure by changing a field value, length,
offset, or hex stream assignment, or you can add to or edit the structure variable by declaring
local fields. You can also redeclare the variable.
Note 1: If you change a structure variable by a hex stream assignment and the structure variable
has some variable-length fields, then only the first variable-length field is filled with data and all
other variable-length fields have zero length.
Note 2: If you declare local fields within a structure variable, they are only valid in that structure
variable, not the packet template. New structure variables can be declared based on the structure
variable with local fields. However, it is illegal to assign an existing structure variable to a
structure variable that contains declared local fields, and this generates parse errors.
Examples
Struct
MY_STRUCT
{
V1 :
16
V2 :
8
V3 :
8
V4 :
32
}
Struct
MY_STRUCT_2
{
F1 :
8
F2 :
32
F3 :
*
# Variable length
F4 :
*
# Variable length
F5 :
32
}
Main
{
# Change some fields in a structure variable.
$X { DevAddr =
0x12
}
# Assign some values at some offsets:
# The format is $PktVar[offset, length] =
# appropriate field assignment (numeric value, data pattern, etc.)
$X[
16
,
8
] =
0xAA
$X[
16
] =
0xAA