beautypg.com

2 another example, Another example – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 59

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

50

8.5.2 Another Example

Example

struct

UsbReq {LSB}

# Using LSB attribute for integer field assignments

# instructs that all short fields have

# LSB to MSB byte order when assigned values.

{

bmType :

8

bReq :

8

wValue :

16

wIndex :

16

wLen :

16

Data :

*

# variable length field

}

Note: The Byte Order attribute applies only for fields defined inside a template and does not
affect fields specified in inherited or inserted templates.

Examples

Packet

Base_0 (MSB)

{
F1 :

16

}

Packet

Base_1

# LSB to MSB byte order by default

{
F2 :

32

}

Packet

Combined : Base0, Base_1 (MSB)

# The attribute goes after the template ancestor list.

{
Cmb_Fld :

32

}

# Combined template has the fields:
# F1 : 16 (MSB)
# F2 : 32 (LSB)
# Cmb_Fld : 32 (MSB)