beautypg.com

3 expression on variables, 4 if/while in logical expressions – Teledyne LeCroy Sierra M6-2 SAS_SATA Protocol Analyzer User Manual User Manual

Page 430

background image

Teledyne LeCroy

Trainer Script Enhancements

428

 

 

Sierra M6‐2 SAS/SATA Protocol Analyzer User Manual

where offsets are bit based

Example:

SendSSPFrameCommand_Initiator

{Data = LRF[startBitOffset:endBitOffset] )

Tag = 0x101}

The constraints are 1) Length bigger than 64 bit is not supported and 2) Offsets
(StartBitOffset and EndBitOffset) should be in same DWORD, except for length bigger
than 32.

Random values: @varName1 = Random

5.13.3

Expression on Variables

Mathematical expressions, such as sum, subtract, and shift:

@varName1 + @varName2

@varName1 - @ varName2

@varName1 & @varName2

@varName1 | @varName2

@varName1 << 2

Logical expressions, such as compare, equal, not, and, and or:

@varName1 > @varName2

@varName1 < @ varName2

@varName1 == @varName2

@varName1 != @ varName2

(logical expression1) && (logical expression2)

(logical expression1) || (logical expression2)

Complex expressions (combination of different operators) with prioritizing supported:

(@varName1 + @varName2) > @varName3

5.13.4

If/While in Logical Expressions

Like programming languages, scripts allow conditional statements. 
The if/while syntaxes are:

If (expression)then

{

….

}

else

{

….

}

While(@VarName)

{

…….

}

Example for if, then else: