beautypg.com

Add/ insert an instruction in initiator – Teledyne LeCroy Sierra SAS_SATA Protocol Analyzer STX API Reference Manual User Manual

Page 83

background image


Sierra SAS/SATA Protocol Suite, STX Software API Reference Manual

Using Initiator/Host Emulator API Functions 83

Add/ Insert an Instruction in Initiator

To add/insert instructions (for Control Structures) in initiator, call the InsertInstruction ()

function of Exerciser Engine with Packet Index and Event/Instruction type as parameters.

int nRetVal = m_pExerciserEngine-
>InsertInstruction(nIndex,nEventType);


Function Prototypes and Descriptions:

(Refer to

Section 2.5.5.1

for prototype, usage, and description of InsertInstruction method.)


List of Instruction types include:
Loop Start, Loop End, Go To, IF Last Received Frame, IF Last Handshake, IF Device Type, IF

Payload, IF Last Command Status, IF Aborted NCQ Command, IF Host Queue Count, IF PS

Request (SAS Only), IF PM Request (SATA Only), Wait For any Frame, Delay, Stop.
(Refer to CEIStorageConstants.h, CEIEngineLibConstants.h to view their respective IDs.)
Example
To use InsertInstruction functionality according to the above mentioned Instruction types:

int nEventType = INSTRUCTION_TYPE_END_LOOP

// For End Loop

int nRetVal = m_pExerciserEngine->InsertInstruction(nIndex,nEventType);

// Loop Start

- INSTRUCTION_TYPE_SATRT_LOOP

// Loop End

- INSTRUCTION_TYPE_END_LOOP

// Go To

- INSTRUCTION_TYPE_GO_TO

// IF

- INSTRUCTION_TYPE_IF

//

Last Received Frame

- INSTRUCTION_TYPE_IF_LAST_FRMAE

//

Last Handshake

- INSTRUCTION_TYPE_IF_LAST_HANDSHAKE

//

Device Type

- INSTRUCTION_TYPE_IF_DEVICE_TYPE

//

Payload

- INSTRUCTION_TYPE_IF_PAYLOAD_BUFFER

//

Last Command Status

- INSTRUCTION_TYPE_IF

//

Aborted NCQ Command

- INSTRUCTION_TYPE_IF_ABORT_NCQ_COMMAND

//

Host Queue Count

- INSTRUCTION_TYPE_IF_HOST_QUEUE_COUNT

//

PS Request (SAS)

- INSTRUCTION_TYPE_SATA_IF_PM_REQUEST

//

PM Request (SATA)

- INSTRUCTION_TYPE_SATA_IF_PM_REQUEST

// Wait For Any Frame

- INSTRUCTION_TYPE_WAIT_FOR_FRAME

// Delay

- INSTRUCTION_TYPE_DELAY

// Stop

- INSTRUCTION_TYPE_STOP