8 using multipliers to assign field values, Using multipliers to assign field values, Multiplier – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 113

Advertising
background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

104

10.8 Using Multipliers to Assign Field Values

You can use a "multiplier" to assign repeated data and create complex assignments. This
multiplier only works on structure variables when assigning fields.

Note: Though this multiplier uses the symbol

*

, this multiplier is not the arithmetic multiplier.

Examples

Generic $X
Generic $Y

Main

{

# Use multipliers to assign field values.
# Declare a packet variable of 'structure' instance Generic with
# data FB 01 02.

$TestIE = Generic { Data = {

FB 01 02

} }


# Declare a 'structure' instance based on the template S2
# and change the default value for the S16 field.

$S2_Var = S2 { S16 =

2

}


Send

TX_PACKET

{
Data =

10

*$TestIE

# Data field contains the sequence of $TestIE

# repeated 10 times:

# { FB 01 02 FB 01 02

FB 01 02 FB 01 02 FB 01

# 02 FB 01 02 FB 01 02 FB 01 02 FB 01 02 }

}

# Declare Packet Variable $X of structure Generic with data FF.

$X = Generic { Data =

0xFF

}


# Packet Variable $Y contains the sequence of $TestIE repeated
# three times and $X repeated two times:
# { FB 01 02 FB 01 02 FB 01 02 FF FF }

$Y { Data =

3

*$TestIE +

2

*$X }

Num_of_Y =

5

# Local Numeric Variable

Send

TX_PACKET

{

# Example of concatenation and multiplication of structures.
# Data field contains combined payload of:
#

$S2_Var + $S2_Var + $X + $X + $X + $X + $X + $X + $X + $X +

$X + $X

#

+ $X + $X + $X + $X + $Y + $Y + $Y + $Y + $Y

Data = $S2_Var*

2

+

16

*$X + Num_of_Y*$Y

}
}

Advertising