Cycle Accurate Debug Interface v2.0 Developer Guide


Table of Contents

Preface
About this document
Intended audience
Using this book
Conventions
Additional reading
Feedback
Feedback on this product
Feedback on content
1. Introduction
1.1. About the Cycle Accurate Debug Interface
1.2. The class hierarchy
1.3. CADI classes used to connect to a simulation
1.3.1. CADI classes used to control the simulation target
1.3.2. Optional implementation
2. The Target Connection Mechanism
2.1. Introduction to the target connection mechanism
2.2. Implementing the target connection mechanism
2.2.1. CADIBroker
2.2.2. CADISimulationFactory
2.2.3. CADISimulation
2.2.4. ObtainInterface()
2.2.5. Callback objects
2.3. Connecting to a simulation
2.3.1. Opening the model library
2.3.2. Creating the CADIBroker
2.4. Using GetSimulationFactories()
2.5. Getting existing CADI simulations
2.6. Getting a target interface
2.7. Disconnecting from a target
2.7.1. Deleting pointers to registered callbacks
2.7.2. Releasing the objects of the target connection mechanism
2.7.3. Typical shutdown scenarios
3. Using the CADI Interface Methods from a Debugger
3.1. Overview of CADI accesses from a debugger
3.1.1. CADI and threads
3.2. CADIReturn_t return values
3.3. Target connection and configuration
3.3.1. Obtaining an interface pointer to the target
3.3.2. Target interface setup
3.3.3. Setting runtime parameters
3.3.4. CADI target characteristics
3.3.5. Querying the hardware resource for register information
3.3.6. Querying the hardware resource for memory information
3.4. Accessing registers
3.4.1. Accessing string registers
3.5. Accessing memory
3.6. Controlling execution
3.6.1. Breakpoints
3.6.2. Controlling the execution mode
3.7. Application loading
3.8. CADI Disassembler
3.8.1. Obtaining a CADI Disassembler
3.8.2. CADI Disassembler callbacks
3.8.3. Disassembly Modes
3.8.4. CADIDisassemblerStatus
3.8.5. Acquiring Disassembly
3.9. Using the semihosting API
3.10. Profiling
4. The CADI Extension Mechanism
4.1. Overview of the extension mechanism
4.2. Implementation example for extending the target-side
4.3. Obtaining a custom interface
A. Class Reference
A.1. The CAInterface class
A.1.1. About the CAInterface class
A.1.2. CAInterface class declaration
A.1.3. CAInterface::IFNAME()
A.1.4. CAInterface::IFREVISION()
A.1.5. CAInterface::ObtainInterface()
A.2. The CADIBroker class
A.2.1. CADIBroker class definition
A.2.2. Creating the CADIBroker
A.2.3. CADIBroker::GetSimulationFactories()
A.2.4. CADIBroker::GetSimulationInfos()
A.2.5. CADIBroker::SelectSimulation()
A.2.6. CADIBroker::Release()
A.3. The CADISimulationFactory class
A.3.1. CADISimulationFactory class definition
A.3.2. CADISimulationFactory::Release()
A.3.3. CADISimulationFactory::GetName()
A.3.4. CADISimulationFactory::GetDescription()
A.3.5. CADISimulationFactory::GetParameterInfos()
A.3.6. CADISimulationFactory::Instantiate()
A.4. The CADIErrorCallback class
A.4.1. CADIErrorCallback::Error()
A.5. The CADISimulationCallback class
A.5.1. CADISimulationCallback::simMessage()
A.5.2. CADISimulationCallback::simShutdown()
A.5.3. CADISimulationCallback::simKilled()
A.6. The CADISimulation class
A.6.1. CADISimulation class definition
A.6.2. CADISimulation::IFNAME()
A.6.3. CADISimulation::IFREVISION()
A.6.4. CADISimulation::Release()
A.6.5. CADISimulation::AddCallbackObject()
A.6.6. CADISimulation::RemoveCallbackObject()
A.6.7. CADISimulation::GetTargetInfos()
A.6.8. CADISimulation::GetTarget()
A.7. The CADICallbackObj class
A.7.1. CADICallbackObj class declaration
A.7.2. CADICallbackObj::appliOpen()
A.7.3. CADICallbackObj::appliInput()
A.7.4. CADICallbackObj::appliOutput()
A.7.5. CADICallbackObj::appliClose()
A.7.6. CADICallbackObj::doString()
A.7.7. CADICallbackObj::modeChange()
A.7.8. CADICallbackObj::reset()
A.7.9. CADICallbackObj::cycleTick()
A.7.10. CADICallbackObj::killInterface()
A.7.11. CADICallbackObj::bypass()
A.7.12. CADICallbackObj::lookupSymbol()
A.7.13. CADICallbackObj::refresh()
A.8. The CADI class
A.8.1. Overview of the methods in the CADI class
A.8.2. The component CADI class declaration
A.8.3. The CADI class constructor
A.8.4. CADI::CADIXfaceGetFeatures()
A.8.5. CADI::CADIXfaceGetError()
A.8.6. CADI::CADIGetDisassembler()
A.8.7. CADI::CADIXfaceAddCallback()
A.8.8. CADI::CADIXfaceRemoveCallback()
A.8.9. CADI::CADIXfaceBypass()
A.8.10. CADI::CADIGetTargetInfo()
A.8.11. CADI::CADIGetParameterInfo()
A.8.12. CADI::CADIGetParameterValues()
A.8.13. CADI::CADIGetParameters()
A.8.14. CADI::CADISetParameters()
A.8.15. CADI::CADIRegGetGroups()
A.8.16. CADI::CADIRegGetMap()
A.8.17. CADI::CADIRegGetCompound()
A.8.18. CADI::CADIRegWrite()
A.8.19. CADI::CADIRegRead()
A.8.20. CADI::CADIGetPC()
A.8.21. CADI::CADIGetCommittedPCs()
A.8.22. CADI::CADIMemGetSpaces()
A.8.23. CADI::CADIMemGetBlocks()
A.8.24. CADI::CADIMemRead()
A.8.25. CADI::CADIMemWrite()
A.8.26. CADI::CADIMemGetOverlays()
A.8.27. CADI::VirtualToPhysical()
A.8.28. CADI::PhysicalToVirtual()
A.8.29. CADI::CADIGetCacheInfo()
A.8.30. CADI::CADICacheRead()
A.8.31. CADI::CADICacheWrite()
A.8.32. About the CADI execution modes
A.8.33. CADI::CADIExecGetModes()
A.8.34. CADI::CADIExecGetResetLevels()
A.8.35. CADI::CADIExecSetMode()
A.8.36. CADI::CADIExecGetMode()
A.8.37. CADI::CADIExecSingleStep()
A.8.38. CADI::CADIExecReset()
A.8.39. CADI::CADIExecContinue()
A.8.40. CADI::CADIExecStop()
A.8.41. CADI::CADIExecGetExceptions()
A.8.42. CADI::CADIExecAssertException()
A.8.43. CADI::CADIExecGetPipeStages()
A.8.44. CADI::CADIExecGetPipeStageFields()
A.8.45. CADI::CADIExecLoadApplication()
A.8.46. CADI::CADIExecUnLoadApplication()
A.8.47. CADI::CADIExecGetLoadedApplication()
A.8.48. CADI::CADIGetInstructionCount()
A.8.49. CADI::CADIGetCycleCount()
A.8.50. CADI::CADIBptGetList()
A.8.51. CADI::CADIBptRead()
A.8.52. CADI::CADIBptSet()
A.8.53. CADI::CADIBptClear()
A.8.54. CADI::CADIBptConfigure()
A.9. The CADIDisassemblerCB class
A.9.1. CADIDisassemblerCB class definition
A.9.2. CADIDisassemblerCB::IFNAME()
A.9.3. CADIDisassemblerCB::IFREVISION()
A.9.4. CADIDisassemblerCB::ReceiveModeName()
A.9.5. CADIDisassemblerCB::ReceiveSourceReference()
A.9.6. CADIDisassemblerCB::ReceiveDissassembly()
A.10. The CADIDisassembler class
A.10.1. CADIDisassembler class definition
A.10.2. CADIDisassembler::GetType()
A.10.3. CADIDisassembler::GetModeCount()
A.10.4. CADIDisassembler::GetModeNames()
A.10.5. CADIDisassembler::GetCurrentMode()
A.10.6. CADIDisassembler::GetSourceReferenceForAddress()
A.10.7. CADIDisassembler::GetAddressForSourceReference()
A.10.8. CADIDisassembler::GetDisassembly()
A.10.9. CADIDisassembler::GetInstructionType()
A.10.10. CADIDisassembler::ObtainInterface()
A.11. The CADIProfilingCallbacks class
A.11.1. CADIProfilingCallbacks class definition
A.11.2. CADIProfilingCallbacks::profileResourceAccess()
A.11.3. CADIProfilingCallbacks::profileRegisterHazard()
A.12. The CADIProfiling class
A.12.1. CADIProfiling class definition
A.12.2. CADIProfiling::CADIProfileSetup()
A.12.3. CADIProfiling::CADIProfileControl()
A.12.4. CADIProfiling::CADIProfileTraceControl()
A.12.5. CADIProfiling::CADIProfileGetExecution()
A.12.6. CADIProfiling::CADIProfileGetMemory()
A.12.7. CADIProfiling::CADIProfileGetTrace()
A.12.8. CADIProfiling::CADIProfileGetRegAccesses()
A.12.9. CADIProfiling::CADIProfileSetRegAccesses()
A.12.10. CADIProfiling::CADIProfileGetMemAccesses()
A.12.11. CADIProfiling::CADIProfileSetMemAccesses()
A.12.12. CADIProfiling::CADIProfileGetAddrExecutionFrequency()
A.12.13. CADIProfiling::CADIProfileSetAddrExecutionFrequency()
A.12.14. CADIProfiling::CADIGetNumberOfInstructions()
A.12.15. CADIProfiling::CADIProfileInitInstructionResultArray()
A.12.16. CADIProfiling::CADIProfileGetInstructionExecutionFrequency()
A.12.17. CADIProfiling::CADIProfileSetInstructionExecutionFrequency()
A.12.18. CADIProfiling::CADIRegisterProfileResourceAccess()
A.12.19. CADIProfiling::CADIUnregisterProfileResourceAccess()
A.12.20. CADIProfiling::CADIProfileRegisterCallBack()
A.12.21. CADIProfiling::CADIProfileUnregisterCallBack()
B. Data Structures Used by the CADI Interface
B.1. Factory simulation startup and configuration
B.1.1. CADIReturn_t
B.1.2. CADIFactoryErrorCode_t
B.1.3. CADIFactorySeverityCode_t
B.1.4. CADISimulationInfo_t
B.1.5. CADIParameterInfo_t
B.1.6. CADIParameterValue_t
B.1.7. CADITargetFeatures_t structure
B.1.8. CADICallbackType_t
B.1.9. CADIRefreshReason_t
B.2. Registers and memory
B.2.1. CADIReg_t
B.2.2. CADIRegInfo_t
B.2.3. CADIRegDisplay_t
B.2.4. CADIRegSymbols_t
B.2.5. CADIRegAccessAttribute_t
B.2.6. CADIRegType_t
B.2.7. CADIRegDetails_t
B.2.8. CADIRegGroup_t
B.2.9. CADIMemSpaceInfo_t
B.2.10. CADIMemBlockInfo_t
B.2.11. CADIAddr_t
B.2.12. CADIMemReadWrite_t
B.2.13. CADIAddrComplete_t
B.2.14. CADICacheInfo_t
B.3. Breakpoints and execution control
B.3.1. CADIBptRequest_t
B.3.2. CADIBptCondition_t and CADIBptConditionOperator_t
B.3.3. CADIBptDescription_t
B.3.4. CADIBptConfigure_t
B.3.5. CADIExecMode_t structure
B.3.6. CADI_EXECMODE_t enumeration
B.3.7. CADIResetLevel_t
B.3.8. CADIException_t
B.3.9. CADIExceptionAction_t
B.4. Pipelines
B.4.1. CADIPipeStage_t
B.4.2. CADIPipeStageContentInfo_t
B.5. Disassembly
B.5.1. CADIDisassemblerStatus
B.5.2. CADIDisassemblerType
B.5.3. CADIDisassemblerInstructionType
B.6. Semihosting and message output
B.6.1. CADISemiHostingInputChannelType_t
B.6.2. CADISemiHostingInputChannel_t
B.6.3. CADIConsoleChannel_t
B.6.4. CADIStreamId
B.7. Profiling and tracing
B.7.1. CADIProfileResultType_t
B.7.2. CADIProfileResults_t
B.7.3. CADIProfileRegion_t
B.7.4. CADIProfileType_t
B.7.5. CADIProfileControl_t
B.7.6. CADIRegProfileResults_t
B.7.7. CADIMemProfileResults_t
B.7.8. CADIInstructionProfileResults_t
B.7.9. CADIProfileResourceAccessType_t
B.7.10. CADIProfileHazardTypes_t
B.7.11. CADIProfileHazardDescription_t
B.7.12. CADITraceControl_t
B.7.13. CADITraceBufferControl_t
B.7.14. CADITraceOverlayControl_t
B.7.15. CADITraceBlockType_t
B.7.16. CADITraceBlock_t

Proprietary Notice

Words and logos marked with™ or ® are registered trademarks or trademarks owned by ARM, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Unrestricted Access is an ARM internal classification.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision AJune 20, 2008New document. Based on CADI section of ESL API guide. Additional information provided on extending a debugger to support CADI.
Revision BFebruary 2009Added implementation details for CADI object.
Revision CApril 2009Update CADI object.
Revision DJuly 2009Update for CCIK and CADI 2.0.
Copyright © 2008-2009 ARM. All rights reserved.ARM DUI 0444E
Non-Confidential