A.8.2. The component CADI class declaration

The class declaration can typically be left as in Example A.10 with the exception of:


If your component is a processor, see also the functions that are available in CADIDisassembler and CADIProfiler classes for controlling and monitoring application execution. For more information, see:

Example A.10. Header file for a typical CADI component class

class CADIMyComponent : public CADI 
    CADIMyComponent(MyComponentClass *c); // Change names accordingly
    virtual ~CADIMyComponent();
// The declaration/implementation of CAInterface() methods is missing 
// and must be added at this point. 
// These are essential for properly obtaining a CADI 2.0 interface
    // Register access functions
    CADIReturn_t   CADIRegGetGroups(uint32_t groupIndex
        , uint32_t desiredNumOfRegGroups, uint32_t *actualNumOfRegGroups
        , CADIRegGroup_t *reg);
    CADIReturn_t   CADIRegGetMap( uint32_t groupID, uint32_t regIndex
        , uint32_t registerSlots, uint32_t *registerCount, CADIRegInfo_t *reg);
    CADIReturn_t   CADIRegWrite( uint32_t regCount, CADIReg_t *reg
        , uint32_t *numRegsWritten, uint8_t doSideEffects);
    CADIReturn_t   CADIRegRead(uint32_t regCount, CADIReg_t *reg
        , uint32_t *numRegsRead, uint8_t doSideEffects);
    // Memory access functions
    CADIReturn_t   CADIMemGetSpaces( uint32_t spaceIndex, uint32_t memSpaceSlots
        , uint32_t *memSpaceCount, CADIMemSpaceInfo_t *memSpace);
    CADIReturn_t   CADIMemGetBlocks( uint32_t memorySpace, uint32_t blockIndex
        , uint32_t memBlockSlots, uint32_t *memBlockCount
        , CADIMemBlockInfo_t *memBlock);
    CADIReturn_t   CADIMemWrite( CADIAddrComplete_t startAddress
        , uint32_t unitsToWrite, uint32_t unitSizeInBytes, const uint8_t *data
        , uint32_t *actualNumOfUnitsWritten, uint8_t doSideEffects);    
    CADIReturn_t   CADIMemRead( CADIAddrComplete_t startAddress
        , uint32_t unitsToRead, uint32_t unitSizeInBytes, uint8_t *data
        , uint32_t *actualNumOfUnitsRead, uint8_t doSideEffects);    
    // Access to disassembly class (if available)
    CADIDisassembler *CADIGetDisassembler(void);
    // Pointer to your own component class, see constructor
    MyComponentClass *target;
    // Register related info
    CADIRegInfo_t *regInfo;
    CADIRegGroup_t *regGroup;
    // Memory related info
    CADIMemSpaceInfo_t *memSpaceInfo;    
    CADIMemBlockInfo_t *memBlockInfo; 

Copyright © 2014 ARM. All rights reserved.ARM DUI 0842B