Expression on variables, If/while in logical expressions – Teledyne LeCroy Sierra M6-4 SAS_SATA Protocol Analyzer User Manual User Manual
Page 432
Teledyne LeCroy
Sierra Trainer Generation Language
428
Sierra M6‐4 SAS/SATA Protocol Analyzer User Manual
Fields of last received frame:
@varName1 = (SSPFrame)LRF::FrameType,
where LRF is Last Received Frame
Note:
Specifying packet type (SSPFrame) before LRF causes last received frame to be this packet type,
and field start‐bit position is calculated according to the packet‐type definition.
Part of last received frame:
@varName1 = LRF[stratBitOffset:endBitOffset],
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
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
If/While in Logical Expressions
Like programming languages, scripts allow conditional statements.
The if/while syntaxes are:
If (expression)then
{
….
}