ARM Technical Support Knowledge Articles

How to list all the MTI trace sources in your system?

Applies to: Fast Models

Answer

In the Fast Models, you can use the Model Trace Interface (MTI) to get information about events happening in your system.

MTI is a self describing API, this means you can use a standard MTI plugin to find about all the trace sources in any system without prior knowledge about it. 

Build and run the ListTraceSources plugin

This is how you can get a list of all the trace sources present in your system:

  1. Build your system, it can be CADI library, an isim or a SystemC executable (provided it calls scx::scx_parse_and_configure)
  2. Go into the FastModelsPortfolio_<X.Y>/examples/MTI/ListTraceSources/source/ folder
  3. Build the plugin. It will be a shared library loaded by the model so it will need to be built with the same bitness and compiler version.
    - In Linux

    make

    - In Windows, load the project and build it in Visual Studio
  4. Load the plugin

    model_shell -m cadi_system_<Configuration>.so --plugin FastModelsPortfolio_<X.Y>/examples/MTI/ListTraceSources/source/ListTraceSources.so

Understanding the output

The plugin will generate a text output similar to below and make the simulation exits.


Component (0) providing trace: FVP_VE_Cortex_A15x2 (FVP_VE_Cortex_A15x2, )
=============================================================================
Component is of type "FVP_VE_Cortex_A15x2"
Version is ""
#Sources: 0

Component (1) providing trace: FVP_VE_Cortex_A15x2.cluster.cpu0 (ARM_Cortex-A15, 8.2.72)
=============================================================================
Component is of type "ARM_Cortex-A15"
Version is "8.2.72"
#Sources: 60
...
Source INST (Every instruction executed.)
    Field PC type:MTI_UNSIGNED_INT size:4 (The address of the instruction.)
    Field OPCODE type:MTI_UNSIGNED_INT size:4 (The opcode of the instruction.)
    Field SIZE type:MTI_UNSIGNED_INT size:1 (The size of the instruction in bytes.)
    Field MODE type:MTI_ENUM size:1 (The mode the core is in.)
        0x10 = usr
        0x11 = fiq
        0x12 = irq
        0x13 = svc
        0x16 = mon
        0x17 = abt
        0x1a = hyp
        0x1b = und
        0x1f = sys
    Field ISET type:MTI_ENUM size:1 (The current instruction set.)
        0x0 = ARM
        0x1 = Thumb
        0x2 = Jazelle
        0x3 = Thumb2EE
    Field PADDR type:MTI_UNSIGNED_INT size:8 (The physical address of the instruction.)
    Field NSDESC type:MTI_UNSIGNED_INT size:1 (The physical address non-secure bit.)
    Field PADDR2 type:MTI_UNSIGNED_INT size:8 (If different from PADDR, the physical address of the second page of the instruction.)
    Field NSDESC2 type:MTI_UNSIGNED_INT size:1 (The second page physical address non-secure bit.)
    Field NS type:MTI_UNSIGNED_INT size:1 (The core's non-secure bit.)
    Field ITSTATE type:MTI_UNSIGNED_INT size:1 (The current ITSTATE.)
    Field INST_COUNT type:MTI_UNSIGNED_INT size:8 (The core's instruction counter.)
    Field CORE_NUM type:MTI_UNSIGNED_INT size:1 (Core number in a multi processor.)
    Field DISASS type:MTI_STRING size:0 max_size:128 (Disassembly of instruction)

Each component from the FastModelsPortfolio will provide an MTI interface that can be probed from the plugin.

The following diagram represent the MTI architecture which the ListTraceSources plugin will traverse to find all the tracing information of the system:

A Trace source provides information about a specific event that occurs in this component. In a core component, this can be an instruction executed, a branch taken or not taken, an MMU translation, it can also be model specific events like the PERIODIC event which will be called at every quantum boundary.

Each Trace source contains fields that gives more information about the event, including a text description. When the field is of type MTI_ENUM , the values for this field are also listed.

Going further

Reading the ListTraceSources.cpp file will show you how to iterate over the components, the trace sources and the fields.

You can find more details about all the functions in FastmodelsPortfolio/Docs/ModelTraceInterface-ReferenceManual.pdf.

From the output of the ListTraceSources, you can use the GenericTraceExample plugin to trace your application with the MTI events of your choice.

Attachments

MTI.png

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential