35 #ifndef ARM_TRC_PKT_DECODE_BASE_H_INCLUDED 36 #define ARM_TRC_PKT_DECODE_BASE_H_INCLUDED 82 virtual ocsd_datapath_resp_t
onEOT() = 0;
83 virtual ocsd_datapath_resp_t
onReset() = 0;
84 virtual ocsd_datapath_resp_t
onFlush() = 0;
95 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);
98 ocsd_err_t
instrDecode(ocsd_instr_info *instr_info);
143 init_err_msg =
"No element output interface attached and enabled";
145 init_err_msg =
"No memory access interface attached and enabled";
147 init_err_msg =
"No instruction decoder interface attached and enabled";
168 return OCSD_ERR_DCD_INTERFACE_UNUSED;
171 inline ocsd_err_t
TrcPktDecodeI::accessMemory(
const ocsd_vaddr_t address,
const ocsd_mem_space_acc_t mem_space, uint32_t *num_bytes, uint8_t *p_buffer)
175 return OCSD_ERR_DCD_INTERFACE_UNUSED;
179 template <
class P,
class Pc>
187 virtual ocsd_datapath_resp_t PacketDataIn(
const ocsd_datapath_op_t op,
188 const ocsd_trc_index_t index_sop,
189 const P *p_packet_in);
193 ocsd_err_t setProtocolConfig(
const Pc *config);
197 void ClearConfigObj();
225 const ocsd_trc_index_t index_sop,
226 const P *p_packet_in)
228 ocsd_datapath_resp_t resp = OCSD_RESP_CONT;
232 return OCSD_RESP_FATAL_NOT_INIT;
241 resp = OCSD_RESP_FATAL_INVALID_PARAM;
265 resp = OCSD_RESP_FATAL_INVALID_OP;
274 ocsd_err_t err = OCSD_ERR_INVALID_PARAM_VAL;
278 m_config =
new (std::nothrow) Pc(*config);
301 #endif // ARM_TRC_PKT_DECODE_BASE_H_INCLUDED
virtual ocsd_datapath_resp_t TraceElemIn(const ocsd_trc_index_t index_sop, const uint8_t trc_chan_id, const OcsdTraceElement &elem)=0
virtual ocsd_datapath_resp_t onEOT()=0
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)
virtual ~TrcPktDecodeBase()
virtual const uint8_t getCoreSightTraceID()=0
componentAttachPt< ITargetMemAccess > m_mem_access
ocsd_datapath_resp_t outputTraceElement(const OcsdTraceElement &elem)
const Pc * getProtocolConfig() const
componentAttachPt< IInstrDecode > m_instr_decode
void setUsesIDecode(bool bUsesIDecode)
virtual ocsd_datapath_resp_t processPacket()=0
componentAttachPt< ITrcGenElemIn > * getTraceElemOutAttachPt()
virtual ocsd_datapath_resp_t onFlush()=0
virtual ocsd_err_t onProtocolConfig()=0
Base class for all decode components in the library.
ocsd_err_t setProtocolConfig(const Pc *config)
virtual ocsd_datapath_resp_t onReset()=0
const bool getUsesMemAccess() const
void setUsesMemAccess(bool bUsesMemaccess)
TrcPktDecodeI(const char *component_name)
ocsd_err_t instrDecode(ocsd_instr_info *instr_info)
TrcPktDecodeBase(const char *component_name)
virtual ocsd_err_t DecodeInstruction(ocsd_instr_info *instr_info)=0
void LogError(const ocsdError &Error)
const bool getUsesIDecode() const
Generic trace element class.
componentAttachPt< IInstrDecode > * getInstrDecodeAttachPt()
virtual ocsd_datapath_resp_t PacketDataIn(const ocsd_datapath_op_t op, const ocsd_trc_index_t index_sop, const P *p_packet_in)
bool m_config_init_ok
set true if config set.
bool m_decode_init_ok
set true if all attachments in place for decode. (remove checks in main throughput paths) ...
const bool hasAttachedAndEnabled() const
ocsd_datapath_resp_t outputTraceElementIdx(ocsd_trc_index_t idx, const OcsdTraceElement &elem)
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
std::string init_err_msg
error message for init error
OpenCSD : Base trace decode component.
Interface class providing an input for discrete protocol packets.
const P * m_curr_packet_in
ocsd_trc_index_t m_index_curr_pkt
componentAttachPt< ITargetMemAccess > * getMemoryAccessAttachPt()
OpenCSD : Component attachment point interface class.
componentAttachPt< ITrcGenElemIn > m_trace_elem_out