beautypg.com

2 field definitions, 1 defining a field at a specific offset, Field definitions – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 41: Defining a field at a specific offset, Fields_d

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

32

8.2 Field Definitions

You can define template fields using the following syntax:

Field_Name :

[

offset,

]

length

[

(Byte Order attribute)

]

[

= Field_Value

]

[

[ list of possible values ]

]

or

Field_Name

[

: length

]

{ Subfield definitions }

[

(Byte Order attribute)

[

= Field_Value

]

[

[ list of

possible values ]

]

Note 1: Specify all field offsets and lengths in bits. Numeric expressions with declared constants

are allowed in field offset and length definitions. All field and subfield names must be unique
inside a template.

Note 2: You can define local fields for packet variable instances and when sending a packet. See

sections

Changing Structure Parser Variables

and

Send Packet Instruction

for more information.

8.2.1 Defining a Field at a Specific Offset

If the offset parameter is in a field definition, the field is bound to a specific offset.

Examples

const

F3_OFFSET =

16

const

F3_LEN =

8

# Declare the packet template 'SomeTemplate'.

Packet

SomeTemplate

{
F1 :

0

,

16

# Declare the 16-bit field 'F1' at offset 0.

F2 :

64

,

32

# Declare the 32-bit field 'F2' at offset 64.

F3 :

F3_OFFSET,

F3_LEN

# Declare the 8-bit field 'F2' at offset 16.

F4 :

F3_OFFSET + F3_LEN,

16

# Declare the 16-bit field 'F4' at

# offset 16+8.

}