beautypg.com

13 preprocessor if operator, Preprocessor if operator – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 120

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

111

10.13 Preprocessor If Operator

A special preprocessor If directive includes/excludes different parts of generation code depending
on some condition.

Examples

Main

{
x = 180
y = 30

# Short if operator with only a 'then' clause

if

( x > y )

{

# This block is parsed the usual way and all instructions
# are added to the current instruction block.

Send TX_PACKET
Send TX_PACKET ( Delay =

2000

)

}

if

( x < y )

{

# This block is parsed in a special way:
# Only the "{" "}" are taken into account.
# All other stuff is ignored.

Send DATA_PACKET
{
DevAddr =

0x02

Endp =

0

Data = { AA BB CC DD 12 34 56 78 [PATTERN_2] }
}
( Delay =

1000

)

}

# Full if operator with both 'then' and 'else' clauses.

if

( x > y )

{

# This block is parsed the usual way and all instructions
# are added to the current instruction block.

Send MY_USB3_PKT
Send MY_DATA_PACKET ( Delay =

2000

)

}

else

{

# This block is parsed in a special way.
# Only "{" "}" are taken into account.
# All other stuff is ignored.

Send MY_USB3_PKT
}
}