beautypg.com

2 defining a field at the current offset, Defining a field at the current offset – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 42

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

33

8.2.2 Defining a Field at the Current Offset

If the field offset is omitted, the field's offset is calculated based on the lengths of previously
declared fields. The initial template offset is always 0.

Example

const

F3_OFFSET =

64

const

F3_LEN =

8

# Declare the packet template 'SomeTemplate'.

Packet

SomeTemplate

{
F1 :

16

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

F2 :

32

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

F3 :

F3_OFFSET,

F3_LEN

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

F4 :

16

# Declare the 16-bit field 'F4' at offset 64+8.

}