B.1.7. CADITargetFeatures_t structure

The CADITargetFeatures_t structure is used by the CADIXfaceGetFeatures() call. The structure has the constructor as listed in Example B.7:

Example B.7. CADITargetFeatures_t structure

CADITargetFeatures_t(const char *targetName_par = "",
                     const char *targetVersion_par = "",
                     uint32_t nrBreakpointsAvailable_par = 0,
                     uint8_t fOverlaySupportAvailable_par = 0,
                     uint8_t fProfilingAvailable_par = 0, 
                     uint32_t nrResetLevels_par = 0,
                     uint32_t nrExecModes_par = 0,
                     uint32_t nrExceptions_par = 0,  
                     uint32_t nrMemSpaces_par = 0,
                     uint32_t nrRegisterGroups_par = 0,
                     uint32_t nrPipeStages_par = 0,
                     uint32_t nPCRegNum_par = CADI_INVALID_REGISTER_ID,
                     uint16_t handledBreakpoints_par = 0,
                     uint32_t nrOfHWThreads_par = 0,
                     uint32_t nExtendedTargetFeaturesRegNum_par = CADI_INVALID_REGISTER_ID,
                     char const* canonicalRegisterDescription_par = "",
                     char const* canonicalMemoryDescription_par = "",
                     uint8_t canCompleteMultipleInstructionsPerCycle_par = 0
      ) :
      nrBreakpointsAvailable(nrBreakpointsAvailable_par),
      fOverlaySupportAvailable(fOverlaySupportAvailable_par),
      fProfilingAvailable(fProfilingAvailable_par),
      nrResetLevels(nrResetLevels_par),
      nrExecModes(nrExecModes_par),
      nrExceptions(nrExceptions_par),
      nrMemSpaces(nrMemSpaces_par),
      nrRegisterGroups(nrRegisterGroups_par),
      nrPipeStages(nrPipeStages_par),
      nPCRegNum(nPCRegNum_par),
      handledBreakpoints(handledBreakpoints_par),
      nrOfHWThreads(nrOfHWThreads_par),
      nExtendedTargetFeaturesRegNumValid(nExtendedTargetFeaturesRegNum_par !=CADI_INVALID_REGISTER_ID),
      nExtendedTargetFeaturesRegNum(nExtendedTargetFeaturesRegNum_par),
      canCompleteMultipleInstructionsPerCycle(canCompleteMultipleInstructionsPerCycle_par)
      {
            AssignString(targetName, targetName_par, sizeof(targetName));
            AssignString(targetVersion, targetVersion_par, sizeof(targetVersion));
            AssignString(canonicalRegisterDescription,  canonicalRegisterDescription_par,
                         sizeof(canonicalRegisterDescription));
            AssignString(canonicalMemoryDescription, canonicalMemoryDescription_par,
                         sizeof(canonicalMemoryDescription));
      }

The data members are:

targetName

is the target name.

targetVersion

is the target version.

nrBreakpointsAvailable

is the number of breakpoints available for the interface.

fOverlaySupportAvailable

indicates whether overlays are supported.

fProfilingAvailable

indicates whether profiling is supported for this interface.

nrResetLevels

is the number of reset levels (for example, hard or soft reset). This value must be greater than zero. If it is greater than one, the debugger must obtain a complete list of supported reset levels from the target through CADIExecGetResetLevels().

nrExecModes

is the number of execution modes. If the number of execution modes is greater than two, the debugger must call CADIExecGetModes() to obtain a complete list.

nrExceptions

is the number of exceptions.

nrMemSpaces

is the number of memory spaces.

nrRegisterGroups

is the number of register groups.

nrPipeStages

is the number of pipeline stages exposed to the debugger. The value can be greater than one only for cycle-accurate models. The value must be one for all other types of model.

nPCRegNum

is the number of the register that is used for the program counter. If there is no program counter available for the target, this value must be set to CADI_INVALID_REGISTER_ID.

handledBreakpoints

indicates the supported breakpoint types. If no breakpoints are supported this is set to 0. Otherwise, this value can be a disjunction of the following values:

  • CADI_TARGET_FEATURE_BPT_PROGRAM

  • CADI_TARGET_FEATURE_BPT_MEMORY

  • CADI_TARGET_FEATURE_BPT_REGISTER

  • CADI_TARGET_FEATURE_BPT_INST_STEP

  • CADI_TARGET_FEATURE_BPT_PROGRAM_RANGE

  • CADI_TARGET_FEATURE_BPT_EXCEPTION.

nrOfHWThreads

is the number of hardware threads.

nExtendedTargetFeaturesRegNumValid

indicates whether the extended target features register is supported for registers.

nExtendedTargetFeaturesRegNum

is the register ID of a string register that contains a static string consisting of colon separated tokens or arbitrary non colon-ASCII char such as FOO:BAR:ANSWER=42:STARTUP=0xe000.

The set and semantics of supported tokens are out of scope of the CADI interface itself. There is no length restriction on this feature string. Having such a string register is optional. Models that do not provide it must set nExtendedTargetFeaturesRegNumValid to false. In this case, the value of this field must be ignored. Having no such register and having a string register that provides an empty string is equivalent. The following tokens (where n denotes a decimal unsigned 32 bit integer) are defined for CADI 2.0:

PC_MEMSPACE_REGNUM=n

The ID of the register that contains the current memory space that the program counter points to.

SP_REGNUM=n:

The ID of the register used as a stack pointer for the target architecture (or of a register with similar semantics).

LR_REGNUM=n:

The ID of the register used as a link register for the target architecture (or of a register with similar semantics).

STATUS_REGNUM=n:

The ID of the register used as a status register for the target architecture (or of a register with similar semantics).

STACK_MEMSPACE_REGNUM=n:

The ID of the register holding the ID of the memory space currently containing the stack memory.

LOCALVAR_MEMSPACE_REGNUM=n:

CADI memory space ID used for local variables. Statically bound to a register that contains the appropriate memspace ID.

GLOBALVAR_MEMSPACE_REGNUM=n:

CADI memory space ID used for global vars. Statically bound to a register that contains the appropriate memspace ID.

STACK_MEMSPACE_ID=n:

The ID of the register that holds the memory space ID currently containing the stack memory.

LOCALVAR_MEMSPACE_ID=n:

The ID of the memory space that is used for storing local variables.

GLOBALVAR_MEMSPACE_ID=n:

The ID of the memory space used for storing global vars.

threadID=s:

If present, this specifies the name of an implementation-specific mechanism for matching thread-aware breakpoint IDs. One possible value is CONTEXTIDR, which works as described in Thread-aware breakpoints using CONTEXTIDR.

HALT_CORE=n:

The ID of the register used to halt/unclock the current core. When this register contains 0, the core executes normally. If a non-zero value is in this register, then the core is halted and does not execute/step.

If a target does not support one of these features, it does not expose the corresponding token.

canonicalRegisterDescription

is a string that describes the contents of the canonicalRegisterNumber field of CADIRegInfo_t. Canonical register numbers are intended to be target-specific numbers to identify registers in the device by some scheme other than the DWARF index. The format of this field is domain_name/string. The domain_name is that of the organization specifying the scheme. The string part is left to the organization to specify. An example would be arm.com/my/reg/numbers.

canonicalMemoryDescription

is a string that describes the contents of the canonical MemoryNumber field of CADIMemSpaceInfo_t. Canonical memory numbers are intended to be target-specific numbers to identify memory spaces in the device by some scheme other than the DWARF index. The format of this field is 'domain_name/string'. The domain_name is that of the organization specifying the scheme. The string part is specified by the organization such as, for example, arm.com/my/mem/numbers.

canCompleteMultipleInstructionsPerCycle

is true if the target can complete multiple instructions in a single simulation cycle.

Copyright © 2008-2011 ARM. All rights reserved.ARM DUI 0444H
Non-ConfidentialID010512