aboutsummaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorMike Leach <mike.leach@linaro.org>2019-08-01 13:51:27 +0100
committerMike Leach <mike.leach@linaro.org>2021-01-08 17:05:25 +0000
commitd5a3f0db0bba5d029c91c59c6d1303647a1ff19a (patch)
tree2f348c4a82022b348e987cc459900886df909390 /decoder
parent63fad2051660f183f42a60cc83aed87a9d34d637 (diff)
downloadOpenCSD-d5a3f0db0bba5d029c91c59c6d1303647a1ff19a.tar.gz
opencsd: ete: Add ETE support to OpenCSD library.
ARM AArch64 PEs may implement a feature FEAT_ETE. This is an architectural instruction trace feature for A profile processors with the control registers built into the PE, accessed using system instructions. This ETE trace is a superset of the ETMv4.x protocol, and introduces some additional protocol elements to handle new architectural features. Adds in initial ETE decoder files and adjusts project build to use them. Adds ETE protocol type as an extension to ETMv4.x. Signed-off-by: Mike Leach <mike.leach@linaro.org>
Diffstat (limited to 'decoder')
-rw-r--r--decoder/build/linux/ref_trace_decode_lib/makefile4
-rw-r--r--decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj6
-rw-r--r--decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters24
-rw-r--r--decoder/include/common/ocsd_dcd_mngr.h43
-rw-r--r--decoder/include/opencsd.h1
-rw-r--r--decoder/include/opencsd/ete/ete_decoder.h47
-rw-r--r--decoder/include/opencsd/ete/trc_cmp_cfg_ete.h81
-rw-r--r--decoder/include/opencsd/ete/trc_dcd_mngr_ete.h58
-rw-r--r--decoder/include/opencsd/ete/trc_pkt_types_ete.h66
-rw-r--r--decoder/include/opencsd/ocsd_if_types.h2
-rw-r--r--decoder/source/ete/trc_cmp_cfg_ete.cpp98
-rw-r--r--decoder/source/ocsd_dcd_tree.cpp1
-rw-r--r--decoder/source/ocsd_lib_dcd_register.cpp5
-rw-r--r--decoder/source/pkt_printers/trc_print_fact.cpp3
14 files changed, 435 insertions, 4 deletions
diff --git a/decoder/build/linux/ref_trace_decode_lib/makefile b/decoder/build/linux/ref_trace_decode_lib/makefile
index 7087036..58d5c6e 100644
--- a/decoder/build/linux/ref_trace_decode_lib/makefile
+++ b/decoder/build/linux/ref_trace_decode_lib/makefile
@@ -41,6 +41,7 @@ BUILD_DIR=./$(PLAT_DIR)
VPATH= $(OCSD_SOURCE) \
$(OCSD_SOURCE)/etmv3 \
$(OCSD_SOURCE)/etmv4 \
+ $(OCSD_SOURCE)/ete \
$(OCSD_SOURCE)/ptm \
$(OCSD_SOURCE)/i_dec \
$(OCSD_SOURCE)/mem_acc \
@@ -59,10 +60,11 @@ ETMV3OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv3.o \
$(BUILD_DIR)/trc_pkt_proc_etmv3_impl.o
ETMV4OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv4.o \
+ $(BUILD_DIR)/trc_etmv4_stack_elem.o \
$(BUILD_DIR)/trc_pkt_proc_etmv4i.o \
$(BUILD_DIR)/trc_pkt_decode_etmv4i.o \
$(BUILD_DIR)/trc_pkt_elem_etmv4i.o \
- $(BUILD_DIR)/trc_etmv4_stack_elem.o
+ $(BUILD_DIR)/trc_cmp_cfg_ete.o
PTMOBJ= $(BUILD_DIR)/trc_cmp_cfg_ptm.o \
$(BUILD_DIR)/trc_pkt_elem_ptm.o \
diff --git a/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj b/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj
index f1aaece..2fdf880 100644
--- a/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj
+++ b/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj
@@ -339,6 +339,10 @@
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h" />
+ <ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h" />
+ <ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h" />
+ <ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h" />
+ <ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h" />
@@ -354,6 +358,7 @@
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h" />
+ <ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h" />
@@ -404,6 +409,7 @@
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp" />
diff --git a/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters b/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters
index cdb6f84..fd78087 100644
--- a/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters
+++ b/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters
@@ -64,6 +64,12 @@
<Filter Include="Source Files\pkt_printers">
<UniqueIdentifier>{baf047d0-0ff7-4502-b42b-4f1fda94d54b}</UniqueIdentifier>
</Filter>
+ <Filter Include="Header Files\ete">
+ <UniqueIdentifier>{3d119e90-c89b-4f27-8163-305924453e1f}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\ete">
+ <UniqueIdentifier>{8cfdb19c-28fc-4e79-b8d5-4e54907b1f82}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\LICENSE">
@@ -356,6 +362,21 @@
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h">
+ <Filter>Header Files\ete</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h">
+ <Filter>Header Files\ete</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h">
+ <Filter>Header Files\ete</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h">
+ <Filter>Header Files\ete</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h">
+ <Filter>Header Files\etmv4</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\trc_component.cpp">
@@ -484,5 +505,8 @@
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp">
+ <Filter>Source Files\ete</Filter>
+ </ClCompile>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/decoder/include/common/ocsd_dcd_mngr.h b/decoder/include/common/ocsd_dcd_mngr.h
index 3342eac..3b9ba97 100644
--- a/decoder/include/common/ocsd_dcd_mngr.h
+++ b/decoder/include/common/ocsd_dcd_mngr.h
@@ -362,6 +362,49 @@ public:
}
};
+/* full decode - extended config object - base + derived. */
+template< class P, // Packet class.
+ class Pt, // Packet enum type ID.
+ class Pc, // Processor config base class.
+ class PcEx, // Processor config derived class
+ class PcSt, // Processor config struct type
+ class PktProc, // Packet processor class.
+ class PktDcd> // Packet decoder class.
+ class DecodeMngrFullDcdExCfg : public DecoderMngrBase<P, Pt, Pc>
+{
+public:
+ DecodeMngrFullDcdExCfg(const std::string &name, ocsd_trace_protocol_t builtInProtocol)
+ : DecoderMngrBase<P, Pt, Pc>(name, builtInProtocol) {};
+
+ virtual ~DecodeMngrFullDcdExCfg() {};
+
+ virtual TraceComponent *createPktProc(const bool useInstID, const int instID)
+ {
+ TraceComponent *pComp;
+ if (useInstID)
+ pComp = new (std::nothrow) PktProc(instID);
+ else
+ pComp = new (std::nothrow) PktProc();
+ return pComp;
+ }
+
+ virtual TraceComponent *createPktDecode(const bool useInstID, const int instID)
+ {
+ TraceComponent *pComp;
+ if (useInstID)
+ pComp = new (std::nothrow)PktDcd(instID);
+ else
+ pComp = new (std::nothrow)PktDcd();
+ return pComp;
+ }
+
+ virtual CSConfig *createConfig(const void *pDataStruct)
+ {
+ return new (std::nothrow) PcEx((PcSt *)pDataStruct);
+ }
+};
+
+
/****************************************************************************************************/
/* Packet processor only, templated base for creating decoder objects */
/****************************************************************************************************/
diff --git a/decoder/include/opencsd.h b/decoder/include/opencsd.h
index 615bbca..8af4fd0 100644
--- a/decoder/include/opencsd.h
+++ b/decoder/include/opencsd.h
@@ -63,6 +63,7 @@
#include "opencsd/etmv4/etmv4_decoder.h"
#include "opencsd/ptm/ptm_decoder.h"
#include "opencsd/stm/stm_decoder.h"
+#include "opencsd/ete/ete_decoder.h"
/** C++ library object types */
#include "common/ocsd_error_logger.h"
diff --git a/decoder/include/opencsd/ete/ete_decoder.h b/decoder/include/opencsd/ete/ete_decoder.h
new file mode 100644
index 0000000..ba0d718
--- /dev/null
+++ b/decoder/include/opencsd/ete/ete_decoder.h
@@ -0,0 +1,47 @@
+/*
+* \file ete_decoder.h
+* \brief OpenCSD : Top level header file for ETE decoder.
+*
+* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
+*/
+
+/*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its contributors
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ARM_ETE_DECODER_H_INCLUDED
+#define ARM_ETE_DECODER_H_INCLUDED
+
+// ETE actually uses extended ETMv4 packet processor and decode
+// ETE specifics limited to configuration
+//
+#include "trc_cmp_cfg_ete.h"
+#include "trc_pkt_types_ete.h"
+
+#endif // ARM_ETE_DECODER_H_INCLUDED
+
+/* End of File ete_decoder.h */
+
diff --git a/decoder/include/opencsd/ete/trc_cmp_cfg_ete.h b/decoder/include/opencsd/ete/trc_cmp_cfg_ete.h
new file mode 100644
index 0000000..8365ffa
--- /dev/null
+++ b/decoder/include/opencsd/ete/trc_cmp_cfg_ete.h
@@ -0,0 +1,81 @@
+/*
+* \file trc_cmp_cfg_ete.h
+* \brief OpenCSD : ETE configuration
+*
+* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
+*/
+
+/*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its contributors
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ARM_TRC_CMP_CFG_ETE_H_INCLUDED
+#define ARM_TRC_CMP_CFG_ETE_H_INCLUDED
+
+#include "trc_pkt_types_ete.h"
+#include "opencsd/etmv4/trc_cmp_cfg_etmv4.h"
+
+/** @addtogroup ocsd_protocol_cfg
+@{*/
+
+/** @name ETE configuration
+@{*/
+
+/*!
+ * @class ETEConfig
+ * @brief Interpreter class for ETE config structure
+ *
+ * ETE trace and config are a superset of ETMv4 trace and config - hence
+ * use the EtmV4Config class as a base.
+ */
+class ETEConfig : public EtmV4Config
+{
+public:
+ ETEConfig();
+ ETEConfig(const ocsd_ete_cfg *cfg_regs);
+ ~ETEConfig();
+
+ //! copy assignment operator for base structure into class.
+ ETEConfig & operator=(const ocsd_ete_cfg *p_cfg);
+
+ //! cast operator returning struct const reference
+ operator const ocsd_ete_cfg &() const { return m_ete_cfg; };
+ //! cast operator returning struct const pointer
+ operator const ocsd_ete_cfg *() const { return &m_ete_cfg; };
+
+private:
+ void copyV4(); // copy relevent config to underlying structure.
+
+ ocsd_ete_cfg m_ete_cfg;
+};
+
+
+/** @}*/
+/** @}*/
+
+#endif // ARM_TRC_CMP_CFG_ETE_H_INCLUDED
+
+/* End of File trc_cmp_cfg_ete.h */
diff --git a/decoder/include/opencsd/ete/trc_dcd_mngr_ete.h b/decoder/include/opencsd/ete/trc_dcd_mngr_ete.h
new file mode 100644
index 0000000..7b0c134
--- /dev/null
+++ b/decoder/include/opencsd/ete/trc_dcd_mngr_ete.h
@@ -0,0 +1,58 @@
+/*
+* \file trc_dcd_mngr_ete.h
+* \brief OpenCSD : ETE decoder creation.
+*
+* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
+*/
+
+/*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its contributors
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
+#define ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
+
+#include "common/ocsd_dcd_mngr.h"
+#include "trc_cmp_cfg_ete.h"
+#include "opencsd/etmv4/trc_pkt_decode_etmv4i.h"
+#include "opencsd/etmv4/trc_pkt_proc_etmv4.h"
+
+class DecoderMngrETE : public DecodeMngrFullDcdExCfg< EtmV4ITrcPacket,
+ ocsd_etmv4_i_pkt_type,
+ EtmV4Config,
+ ETEConfig,
+ ocsd_ete_cfg,
+ TrcPktProcEtmV4I,
+ TrcPktDecodeEtmV4I>
+{
+public:
+ DecoderMngrETE(const std::string &name) : DecodeMngrFullDcdExCfg(name, OCSD_PROTOCOL_ETE) {};
+ virtual ~DecoderMngrETE() {};
+};
+
+#endif // ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
+
+/* End of File trc_dcd_mngr_ete.h */
diff --git a/decoder/include/opencsd/ete/trc_pkt_types_ete.h b/decoder/include/opencsd/ete/trc_pkt_types_ete.h
new file mode 100644
index 0000000..f87d454
--- /dev/null
+++ b/decoder/include/opencsd/ete/trc_pkt_types_ete.h
@@ -0,0 +1,66 @@
+/*
+ * \file trc_pkt_types_ete.h
+ * \brief OpenCSD : ETE types
+ *
+ * \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
+ */
+
+/*
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
+#define ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
+
+#include "opencsd/trc_pkt_types.h"
+#include "opencsd/etmv4/trc_pkt_types_etmv4.h"
+ /** @addtogroup trc_pkts
+ @{*/
+
+ /** @name ETE config Types
+ @{*/
+
+
+typedef struct _ocsd_ete_cfg
+{
+ uint32_t reg_idr0; /**< ID0 register */
+ uint32_t reg_idr1; /**< ID1 register */
+ uint32_t reg_idr2; /**< ID2 register */
+ uint32_t reg_idr8; /**< ID8 - maxspec */
+ uint32_t reg_devarch; /**< DevArch register */
+ uint32_t reg_configr; /**< Config Register */
+ uint32_t reg_traceidr; /**< Trace Stream ID register */
+ ocsd_arch_version_t arch_ver; /**< Architecture version */
+ ocsd_core_profile_t core_prof; /**< Core Profile */
+} ocsd_ete_cfg;
+
+
+/** @}*/
+/** @}*/
+
+#endif // ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
+
+/* End of File trc_pkt_types_ete.h */
diff --git a/decoder/include/opencsd/ocsd_if_types.h b/decoder/include/opencsd/ocsd_if_types.h
index cfde781..e98db37 100644
--- a/decoder/include/opencsd/ocsd_if_types.h
+++ b/decoder/include/opencsd/ocsd_if_types.h
@@ -549,6 +549,7 @@ typedef struct _ocsd_file_mem_region {
#define OCSD_BUILTIN_DCD_ETMV4I "ETMV4I" /**< ETMv4 instruction decoder */
#define OCSD_BUILTIN_DCD_ETMV4D "ETMV4D" /**< ETMv4 data decoder */
#define OCSD_BUILTIN_DCD_PTM "PTM" /**< PTM decoder */
+#define OCSD_BUILTIN_DCD_ETE "ETE" /**< ETE decoder */
/*! Trace Protocol Builtin Types + extern
*/
@@ -561,6 +562,7 @@ typedef enum _ocsd_trace_protocol_t {
OCSD_PROTOCOL_ETMV4D, /**< ETMV4 data trace protocol decoder. */
OCSD_PROTOCOL_PTM, /**< PTM program flow instruction trace protocol decoder. */
OCSD_PROTOCOL_STM, /**< STM system trace protocol decoder. */
+ OCSD_PROTOCOL_ETE, /**< ETE trace protocol decoder */
/* others to be added here */
OCSD_PROTOCOL_BUILTIN_END, /**< Invalid protocol - built-in protocol types end marker */
diff --git a/decoder/source/ete/trc_cmp_cfg_ete.cpp b/decoder/source/ete/trc_cmp_cfg_ete.cpp
new file mode 100644
index 0000000..474cb2f
--- /dev/null
+++ b/decoder/source/ete/trc_cmp_cfg_ete.cpp
@@ -0,0 +1,98 @@
+/*
+* \file trc_cmp_cfg_ete.cpp
+* \brief OpenCSD : ETE config class
+*
+* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
+*/
+
+/*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* 3. Neither the name of the copyright holder nor the names of its contributors
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "opencsd/ete/trc_cmp_cfg_ete.h"
+
+ETEConfig::ETEConfig() : EtmV4Config()
+{
+ m_ete_cfg.reg_idr0 = 0x28000EA1;
+ m_ete_cfg.reg_idr1 = 0x4100FFF3;
+ m_ete_cfg.reg_idr2 = 0x00000488;
+ m_ete_cfg.reg_idr8 = 0;
+ m_ete_cfg.reg_configr = 0xC1;
+ m_ete_cfg.reg_traceidr = 0;
+ m_ete_cfg.arch_ver = ARCH_AA64;
+ m_ete_cfg.core_prof = profile_CortexA;
+ m_ete_cfg.reg_devarch = 0x47705A13;
+ copyV4();
+}
+
+ETEConfig::ETEConfig(const ocsd_ete_cfg *cfg_regs) : EtmV4Config()
+{
+ m_ete_cfg = *cfg_regs;
+ copyV4();
+}
+
+ETEConfig::~ETEConfig()
+{
+
+}
+
+//! copy assignment operator for base structure into class.
+ETEConfig & ETEConfig::operator=(const ocsd_ete_cfg *p_cfg)
+{
+ m_ete_cfg = *p_cfg;
+ copyV4();
+ return *this;
+}
+
+//! cast operator returning struct const reference
+//operator const ocsd_ete_cfg &() const { return m_ete_cfg; };
+//! cast operator returning struct const pointer
+//operator const ocsd_ete_cfg *() const { return &m_ete_cfg; };
+
+// ete superset of etmv4 - move info to underlying structure.
+void ETEConfig::copyV4()
+{
+ // copy over 1:1 regs
+ m_cfg.reg_idr0 = m_ete_cfg.reg_idr0;
+ m_cfg.reg_idr1 = m_ete_cfg.reg_idr1;
+ m_cfg.reg_idr2 = m_ete_cfg.reg_idr2;
+ m_cfg.reg_idr8 = m_ete_cfg.reg_idr8;
+ m_cfg.reg_idr9 = 0;
+ m_cfg.reg_idr10 = 0;
+ m_cfg.reg_idr11 = 0;
+ m_cfg.reg_idr12 = 0;
+ m_cfg.reg_idr13 = 0;
+ m_cfg.reg_configr = m_ete_cfg.reg_configr;
+ m_cfg.reg_traceidr = m_ete_cfg.reg_traceidr;
+ m_cfg.core_prof = m_ete_cfg.core_prof;
+ m_cfg.arch_ver = m_ete_cfg.arch_ver;
+
+ // override major / minor version as part of devarch
+ m_MajVer = (uint8_t)((m_ete_cfg.reg_devarch & 0xF000) >> 12);
+ m_MinVer = (uint8_t)((m_ete_cfg.reg_devarch & 0xF0000) >> 16);
+}
+
+/* End of File trc_cmp_cfg_ete.cpp */
diff --git a/decoder/source/ocsd_dcd_tree.cpp b/decoder/source/ocsd_dcd_tree.cpp
index be15e36..5dafba9 100644
--- a/decoder/source/ocsd_dcd_tree.cpp
+++ b/decoder/source/ocsd_dcd_tree.cpp
@@ -621,6 +621,7 @@ ocsd_err_t DecodeTree::addPacketPrinter(uint8_t CSID, bool bMonitor, ItemPrinter
switch (protocol)
{
case OCSD_PROTOCOL_ETMV4I:
+ case OCSD_PROTOCOL_ETE:
{
PacketPrinter<EtmV4ITrcPacket> *pTPrinter = dynamic_cast<PacketPrinter<EtmV4ITrcPacket> *>(pPrinter);
if (bMonitor)
diff --git a/decoder/source/ocsd_lib_dcd_register.cpp b/decoder/source/ocsd_lib_dcd_register.cpp
index adb042d..0233c89 100644
--- a/decoder/source/ocsd_lib_dcd_register.cpp
+++ b/decoder/source/ocsd_lib_dcd_register.cpp
@@ -39,13 +39,15 @@
#include "opencsd/etmv3/trc_dcd_mngr_etmv3.h"
#include "opencsd/ptm/trc_dcd_mngr_ptm.h"
#include "opencsd/stm/trc_dcd_mngr_stm.h"
+#include "opencsd/ete/trc_dcd_mngr_ete.h"
// create array of built-in decoders to register with library
static built_in_decoder_info_t sBuiltInArray[] = {
CREATE_BUILTIN_ENTRY(DecoderMngrEtmV4I,OCSD_BUILTIN_DCD_ETMV4I),
CREATE_BUILTIN_ENTRY(DecoderMngrEtmV3, OCSD_BUILTIN_DCD_ETMV3),
CREATE_BUILTIN_ENTRY(DecoderMngrPtm, OCSD_BUILTIN_DCD_PTM),
- CREATE_BUILTIN_ENTRY(DecoderMngrStm, OCSD_BUILTIN_DCD_STM)
+ CREATE_BUILTIN_ENTRY(DecoderMngrStm, OCSD_BUILTIN_DCD_STM),
+ CREATE_BUILTIN_ENTRY(DecoderMngrETE, OCSD_BUILTIN_DCD_ETE)
//{ 0, 0, 0}
};
@@ -90,7 +92,6 @@ OcsdLibDcdRegister::~OcsdLibDcdRegister()
m_pLastTypedDecoderMngr = 0;
}
-
const ocsd_err_t OcsdLibDcdRegister::registerDecoderTypeByName(const std::string &name, IDecoderMngr *p_decoder_fact)
{
if(isRegisteredDecoder(name))
diff --git a/decoder/source/pkt_printers/trc_print_fact.cpp b/decoder/source/pkt_printers/trc_print_fact.cpp
index 52dcb6b..6b5df1f 100644
--- a/decoder/source/pkt_printers/trc_print_fact.cpp
+++ b/decoder/source/pkt_printers/trc_print_fact.cpp
@@ -55,8 +55,9 @@ ItemPrinter *PktPrinterFact::createProtocolPrinter(std::vector<ItemPrinter *> &p
{
ItemPrinter *pPrinter = 0;
switch (protocol)
- {
+ {
case OCSD_PROTOCOL_ETMV4I:
+ case OCSD_PROTOCOL_ETE:
pPrinter = new (std::nothrow) PacketPrinter<EtmV4ITrcPacket>(CSID);
break;
case OCSD_PROTOCOL_ETMV3: