beautypg.com

16 rand token, 17 randstream( n ) primitive, Rand token – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 123: Randstream( n ) primitive, Randstream_p

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

114

10.16 RAND Token

You can use a RAND token in places where numeric literals are used to insert pseudo-random

numbers in the range 0 to 0x7fff.

Note: By default, RAND uses a different integer seed value every time the script is compiled. You
can set the seed using the RandSeed setting. Ffor the RandSeed setting description, see the

Generation Setting

topic.

Example

Main

{

# The packet template 'SOME_PKT_TEMPLATE' is declared later.

Send

SOME_PKT_TEMPLATE

{
Field0 = {

00

RAND

RAND RAND RAND

00

}

# Set random hex

# stream.

}

x =

RAND

# Assign a random value to the numeric variable.

}

10.17 RandStream( n ) Primitive

The RandStream( n ) primitive is a utility, based on the RAND token, that produces a random
byte stream, where n is the number of bytes in the stream.


Note: For a description of random seeding, see the Note in the

Rand Token

section.

Example

Main

{

# The packet template 'SOME_PKT_TEMPLATE' is declared later.

Send

SOME_PKT_TEMPLATE

{
Fieldof32bytes = RandStream(32)

# Set a random 32-byte stream.

}
}