• No results found

TAPOp API Reference

2.4 TAPOp inter-client communication flags

This section describes the flags that are maintained on the Multi-ICE server for the benefit of the Multi-ICE clients. It contains the following sections:

Private flags

Flags used by TAPOp_SetControlMacros on page 2-24

Flags returned by TAPOp_ReadMICEFlags on page 2-25.

2.4.1 Private flags

These flags are private to each TAP controller (processor).

Declaration

#define TAPOp_ProcRunning 0x1

#define TAPOp_ProcHasStopped 0x2

#define TAPOp_ProcStoppedByServer 0x4

#define TAPOp_DownloadingCode 0x8

#define TAPOp_ProcStartREQ 0x10

#define TAPOp_ProcStartACK 0x20

#define TAPOp_UserWantsSyncStart 0x40

#define TAPOp_UserWantsSyncStop 0x80

#define TAPOp_AcknowledgeReset 0x100

#define TAPOp_PendingServerStop 0x200

#define TAPOp_PendingServerACK 0x400

#define TAPOp_TestLogicReset 0x800

#define TAPOp_TestLogicResetACK 0x1000

where:

TAPOp_ProcRunning

A TAPOp client must set this flag when the processor starts executing code. It must be cleared when the processor halts. This can be used by the Multi-ICE server to indicate whether or not other processors must be stopped, according to your requirements. Setting this bit causes the processor state display to change to R. This is a write-only flag for the TAPOp client.

TAPOp_ProcHasStopped, TAPOp_ProcStoppedByServer

These two flags are used to determine if and why a processor has stopped.

A client must poll the TAPOp_ProcHasStopped flag when the processor is running. If it is set, then if:

TAPOp_ProcStoppedByServer is set

The Multi-ICE server has stopped the processor because another processor has stopped and a synchronized stop condition was set up.

TAPOp_ProcStoppedByServer is not set

The processor has stopped of its own accord, for example, because it hit a breakpoint.

While TAPOp_ProcHasStopped is not set, then the value of TAPOp_ProcStoppedByServer is not defined.

These flags are read-only for a client.

TAPOp_DownloadingCode

A debugger must set this flag immediately before starting to download code to the target processor. This enables you to set an output bit when this occurs. This can be useful on a system that can switch between very slow and very fast clocks, because fast clocking speeds up download considerably. Similarly, when the download has completed, this bit must be cleared.

Setting this bit causes the processor state display to change to D. If the checkbox Set on Download has been checked for user output bit 1, setting the downloading code flag also asserts user output bit 1. This flag is read-only for the server.

TAPOp_ProcStartREQ, TAPOp_ProcStartACK

These two flags control synchronized starting of processors. If TAPOp_UserWantsSyncStart is set, the debugger must set TAPOp_ProcStartREQ to request the server to start the processor.

When all the debuggers have set their TAPOp_ProcStartREQ flags, the server starts all processors together, and sets the TAPOp_ProcStartACK flag.

TAPOp_ProcStartREQ is read-only for the server. TAPOp_ProcStartACK is read-only for a client.

TAPOp_UserWantsSyncStart, TAPOp_UserWantsSyncStop

These two flags are read-only, and are set by the server if you have selected synchronous start or stop from the dialog. These flags are

TAPOp_PendingServerStop, TAPOp_PendingServerACK

These flags are never looked at by the client. They allow the server to keep track of synchronous stop events that occur during the synchronous start acknowledgement sequence.

TAPOp_TestLogicReset, TAPOp_TestLogicResetACK

These two flags signal and acknowledge a Test Logic Reset occurring on a connection as a result of the actions of another connection. If a connection to a TAP controller causes the TAP controllers to leave Test-Logic Reset, the Multi-ICE server sets the TAPOp_TestLogicReset flag for every other connection. Most TAPOp calls made to these other connections fail, returning TAPOp_InBadTAPState until the

TAPOp_TestLogicResetACK is set for that connection.

2.4.2 Flags used by TAPOp_SetControlMacros

These flags are used by TAPOp_SetControlMacros: Declaration

#define TAPOp_SyncStopSupported 0x1

#define TAPOp_SyncStartSupported 0x2

#define TAPOp_PreExecMacroUsed 0x4

#define TAPOp_PostExecMacroUsed 0x8

where:

TAPOp_SyncStopSupported

Set this flag to indicate that the client supports synchronized stopping.

The server then runs the event macro periodically, and events cause the stop macros to be run as described in TAPOp_SetControlMacros on page 2-120.

Only set this flag if the client has defined a suitable event macro, stop macro, eventMask, and eventXOR.

TAPOp_SyncStartSupported

Set this flag to indicate that the client supports synchronized starting. The server then waits for the TAPOp_ProcStartREQ private flag to be asserted before starting the processor using the execute macro.

Only set this flag if the client has defined a suitable execute macro.

TAPOp_PostExecMacroUsed

Set this flag if a PostExec macro is required.

2.4.3 Flags returned by TAPOp_ReadMICEFlags

These flags are returned by TAPOp_ReadMICEFlags. Declaration

#define TAPOp_FL_TargetPowerHasBeenOff 0x1

#define TAPOp_FL_TargetPowerOffNow 0x2

#define TAPOp_FL_UserOut1 0x4

#define TAPOp_FL_UserIn1 0x8

#define TAPOp_FL_UserIn2 0x10

#define TAPOp_FL_TargetHasBeenReset 0x20

#define TAPOp_FL_InResetNow 0x40

#define TAPOp_FL_UserOut2 0x80

TAPOp_FL_TargetPowerOffNow

The target power is off. This is an error condition.

TAPOp_FL_TargetPowerHasBeenOff

The target power has been off since the last TAPOp_OpenConnection call was made.

TAPOp_FL_InResetNow

The target reset signal is currently asserted. This is an error condition.

TAPOp_FL_TargetHasBeenReset

The target has been reset since the last TAPOp_OpenConnection call was made. This is usually an error condition.

TAPOp_FL_UserIn1

The state of the user-defined input signal 1 from Multi-ICE.

TAPOp_FL_UserIn2

The state of the user-defined input signal 2 from Multi-ICE.

TAPOp_FL_UserOut1

Current state of user-defined output 1 from Multi-ICE.

TAPOp_FL_UserOut2

Current state of user-defined output 2 from Multi-ICE.