beautypg.com

Teledyne LeCroy Sierra M122 User Manual User Manual

Page 321

background image

    

Sierra M122 SAS/SATA Protocol Analyzer User Manual

319

Sierra Trainer Generation Language

Teledyne LeCroy

While(@VarName)

{

…….

}

Example for if, then else:      

@HT_RxFISType = LRF[0:7]

#LRF_SATA_FIS_TYPE_START_BIT:LRF_SATA_FIS_TYPE_END_BIT

if (@HT_RxFISType == SATA_FIS_TYPE_DMA_ACTIVATE) then {…}

else { if (@HT_RxFISType == SATA_FIS_TYPE_DATA) then {…}

else { if (@HT_RxFISType == SATA_FIS_TYPE_RD2H) then {…}

} }

Example for while: 

while (@NCQ_Temp0) {

@NCQ_Temp1= @NCQ_Temp1 >> 1

If (@NCQ_Temp1 != 0) then { … }

@NCQ_Temp0 = @NCQ_Temp1 & 0x00000001 }

Note:

In this release, while condition is limited to simple variable values only. Combining operators is 

not allowed in while expressions. You should move such expressions inside while block. 

Note:

Nested while and if are supported.

Wait/When/Do in Logical Expressions

The wait/when/do syntaxes are:

wait (time)

{when

{exp}do

{

….

}

elsewhen

{

{exp}do

{

….

}

on_timeout

{

….

}}

Example:        

wait { #no timeout use global WaitTimeout value default 1000 useconds

(1 ms)

when {WF_OPEN_ACCEPT} do { … }

elsewhen {WF_OPEN_REJECT} do { … }

on_timeout { … } }