beautypg.com

Teledyne LeCroy PETrainer Scripting Language Reference Manual User Manual

Page 71

background image

Teledyne LeCroy

PETrainer Scripting Language

66

Example 2:

The following example shows the usage of the counters in nested repeats.
The counter qqq is used for the outer repeat.
The counter www is used for the inner repeat.
Packet = TLP in the inner repeat uses both counters to construct the AddressHi parameter.

Repeat = Begin { Count = 3 Counter = qqq }

Packet = DLLP {

DLLPType = Ack
AckNak_SeqNum = ( qqq + 1 )

}


Packet = DLLP {

DLLPType = Ack

AckNak_SeqNum = ( 0xf & ~qqq )

}


Repeat = Begin { Count=4 Counter = www }

Packet = TLP {

TLPType = MRd64

AddressHi = ( 0x400000 + www * 4 + qqq ) )

}

Repeat = End

Repeat = End

Example 3:

The following example shows the usage of the counter in Payload. When arithmetic expressions with
counter are used inside the Payload field, square brackets [] are used to separate each DWORD of the
payload.

Config=Definitions
{
MY_CONSTANT = 10
}
repeat = Begin { Count = 10 Counter = i }
; one TLP with variable fields is sent
packet = TLP
{
TLPType = MWr32

LastDwBe = 0xF
FirstDwBe = 0xF
Address = ( i << 24 )
Length = 2
Payload = ( [ ( ( ( i + MY_CONSTANT ) * 2 ) << 16 ) | ( i*2 ) ] [ 0xAB <<
i ] ) ; Two DWORDs of the Payload are defined using arithmetic expressions
with counter and constant

Tag = ( i & 0xFF )
}