A.8.19 CADI::CADIRegRead()

This function reads register values from the target.

virtual CADIReturn_t CADI::CADIRegRead(uint32_t regCount,
                                       CADIReg_t *reg,
                                       uint32_t *numRegsRead,
                                       uint8_t doSideEffects) = 0;
regCount
is the number of requested registers and so the size of the reg array.
reg
is an array of CADIReg_t structs, each holding some attributes and an array of bytes containing the contents of an individual register. The number of required bytes for each register is available from the CADIInfo_t struct. The CADIRegGetMap() call returns the number of registers.
numRegsRead
on return, is the number of registers read. If the value is less than regCount, the function returns an error code. Any value set on input is ignored.
doSideEffects

if this parameter is set to true, it informs the target that it must perform side effects on a read access. Such side effects might be, for example, a clear-on-read.

If the parameter is set to false, the target must always omit side effects. This state is the common use case where a debug read of a register must not interfere with the target execution.

Note:

If an error occurs, CADIRegRead() must return the error position in numRegsRead. Data is assumed valid up to this position.
CADI register access, showing how to set up the CADI access functions and test reading a register value
CADI *cadi1 = s1->getCADI(); // cadi1 is a valid CADI interface.
uint32_t actual = 0;
CADIRegGroup_t regGroups [2];
cadi1->CADIRegGetGroups(0, 2, &actual, regGroups);
CADIRegInfo_t regs [2];
actual = 0;
cadi1->CADIRegGetMap(regGroups [0].groupID, 0, 2, &actual, regs);
CADIReg_t reg;
reg.regNumber = regs [1].regNumber;
actual = 0;
cadi1->CADIRegRead(1, &reg, &actual, 0);
printf("CADI reg 0x%x\n", reg.bytes [0]);
Non-ConfidentialPDF file icon PDF version100963_0200_03_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.