A new branch of OpenCSD is now available:- ocsd-consistency-checks-1.5.4-rc1
This adds in a number of consistency tests to try to detect when clients provide incorrect program images used for decode. Correct decode is dependent on getting the correct program image to walk looking for waypoints (branch instructions etc) to associate with the E/N atoms in the trace.
Checks are enabled using operation flags in decoder creation:-
OCSD_C_API ocsd_err_t ocsd_dt_create_decoder(const dcd_tree_handle_t handle, const char *decoder_name, const int create_flags, const void *decoder_cfg, unsigned char *pCSID );
Added flags for the create_flags parameter:
OCSD_OPFLG_N_UNCOND_DIR_BR_CHK Check for N atom on unconditional direct branches - unconditional branches should always have associated E atoms. This option will generate an error and reset and resync the decoder if the target of the direct branch is not the next instruction. Some ETM IP will incorrectly trace taken branches to the next instruction as not taken branches - so this allows for these cases
OCSD_OPFLG_STRICT_N_UNCOND_BR_CHK Check for N atom on all unconditional branches. This includes any direct and indirect unconditional branches. This check may be used if it is known the ETM IP does not have the issue mentioned above.
OCSD_OPFLG_CHK_RANGE_CONTINUE Inconsistent range continuity on not taken branches. If a range has been output the ends on a non taken branch, it is expected that the next range will start at the end address of the previous range.
If any of these checks fail then a OCSD_GEN_TRC_ELEM_NO_SYNC packet with a reason of UNSYNC_BAD_IMAGE will be output.
Clients can choose which flags to use. By default all checks are off - to minimise possible performance hit.
Regards
Mike
-- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK