35 #ifndef ARM_TRC_PKT_DECODE_BASE_H_INCLUDED
36 #define ARM_TRC_PKT_DECODE_BASE_H_INCLUDED
123 m_decode_init_ok(false),
124 m_config_init_ok(false),
125 m_uses_memaccess(true),
133 m_decode_init_ok(false),
134 m_config_init_ok(false),
135 m_uses_memaccess(true),
147 init_err_msg =
"No element output interface attached and enabled";
149 init_err_msg =
"No memory access interface attached and enabled";
151 init_err_msg =
"No instruction decoder interface attached and enabled";
193 template <
class P,
class Pc>
203 const P *p_packet_in);
240 const P *p_packet_in)
259 m_curr_packet_in = p_packet_in;
260 m_index_curr_pkt = index_sop;
261 resp = processPacket();
292 m_config =
new (std::nothrow) Pc(*config);
295 err = onProtocolConfig();
297 m_config_init_ok =
true;
virtual ocsd_err_t DecodeInstruction(ocsd_instr_info *instr_info)=0
Interface class providing an input for discrete protocol packets.
virtual ocsd_err_t ReadTargetMemory(const ocsd_vaddr_t address, const uint8_t cs_trace_id, const ocsd_mem_space_acc_t mem_space, uint32_t *num_bytes, uint8_t *p_buffer)=0
virtual void InvalidateMemAccCache(const uint8_t cs_trace_id)=0
virtual ocsd_datapath_resp_t TraceElemIn(const ocsd_trc_index_t index_sop, const uint8_t trc_chan_id, const OcsdTraceElement &elem)=0
Generic trace element class.
Base class for all decode components in the library.
const P * m_curr_packet_in
const Pc * getProtocolConfig() const
componentAttachPt< ITargetMemAccess > m_mem_access
virtual void onFirstInitOK()
virtual ocsd_datapath_resp_t processPacket()=0
componentAttachPt< ITrcGenElemIn > m_trace_elem_out
componentAttachPt< IInstrDecode > * getInstrDecodeAttachPt()
componentAttachPt< IInstrDecode > m_instr_decode
const bool getUsesIDecode() const
ocsd_trc_index_t m_index_curr_pkt
void setUsesMemAccess(bool bUsesMemaccess)
const bool getUsesMemAccess() const
componentAttachPt< ITrcGenElemIn > * getTraceElemOutAttachPt()
void setUsesIDecode(bool bUsesIDecode)
virtual ocsd_err_t onProtocolConfig()=0
std::string init_err_msg
error message for init error
componentAttachPt< ITargetMemAccess > * getMemoryAccessAttachPt()
virtual ocsd_datapath_resp_t onFlush()=0
virtual const uint8_t getCoreSightTraceID()=0
virtual ocsd_datapath_resp_t onReset()=0
bool m_decode_init_ok
set true if all attachments in place for decode. (remove checks in main throughput paths)
virtual ocsd_datapath_resp_t onEOT()=0
bool m_config_init_ok
set true if config set.
const bool hasAttachedAndEnabled() const
OpenCSD : Component attachment point interface class.
uint32_t ocsd_trc_index_t
enum _ocsd_datapath_resp_t ocsd_datapath_resp_t
enum _ocsd_mem_space_acc_t ocsd_mem_space_acc_t
enum _ocsd_datapath_op_t ocsd_datapath_op_t
enum _ocsd_err_t ocsd_err_t
@ OCSD_ERR_DCD_INTERFACE_UNUSED
@ OCSD_ERR_INVALID_PARAM_VAL
@ OCSD_RESP_FATAL_NOT_INIT
@ OCSD_RESP_FATAL_INVALID_PARAM
@ OCSD_RESP_FATAL_INVALID_OP
ocsd_err_t accessMemory(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, uint32_t *num_bytes, uint8_t *p_buffer)
TrcPktDecodeBase(const char *component_name)
virtual ocsd_datapath_resp_t PacketDataIn(const ocsd_datapath_op_t op, const ocsd_trc_index_t index_sop, const P *p_packet_in)
TrcPktDecodeI(const char *component_name)
ocsd_datapath_resp_t outputTraceElement(const OcsdTraceElement &elem)
TrcPktDecodeBase(const char *component_name, int instIDNum)
ocsd_err_t instrDecode(ocsd_instr_info *instr_info)
ocsd_err_t setProtocolConfig(const Pc *config)
ocsd_datapath_resp_t outputTraceElementIdx(ocsd_trc_index_t idx, const OcsdTraceElement &elem)
ocsd_err_t invalidateMemAccCache()
virtual ~TrcPktDecodeBase()
OpenCSD : Base trace decode component.