ARM Technical Support Knowledge Articles

How to trace MTI events on my model

Applies to: Fast Models

Answer

In the Fast Models, you can use an MTI plugin to get information about events occurring in your model.

You can use the pre-built Tarmac plug-in to get some information about the core events.

If you need to have access to more MTI events than the one displayed by Tarmac (for example a non core component), you can use an example provided in the FastModelsPortolio called GenericTrace.

Running GenericTrace plugin to trace instructions

For a cadi library, you would use:

model_shell -m cadi_system_<Configuration>.so --plugin $PVLIB_HOME/plugins/<OS/Compiler>/GenericTrace.so

For a SystemC EVS, assuming it is calling scx_parse_and_configure, you can use this command line:

./EVS_Dhrystone_Cortex-A15x1.x --plugin $PVLIB_HOME/plugins/<OS/Compiler>/GenericTrace.so

You can also hard-code the path to the plugin in your SystemC code (before calling sc_start) with:

scx::scx_load_plugin("$PVLIB_HOME/plugins/<OS/Compiler>/GenericTrace.so");

Running GenericTrace plugin to trace other trace sources

First you need to know which Trace Source you want to trace. You can use the ListTraceSources plugin to see them and choose the one you are interested in.

Then specify the Trace source as a parameter to the plugin:

model_shell -m cadi_system_<Configuration>.so --plugin $PVLIB_HOME/plugins/<OS/Compiler>/GenericTrace.so -C TRACE.GenericTrace.trace-sources=EXCEPTION,EXCEPTION_RETURN

You can specify the path to a specific component to trace only from it (for example only from one CPU in your system):

TRACE.GenericTrace.trace-sources=FVP_VE_Cortex_A15x1_A7x1_MMU500_DMA330.coretile.cluster1.cpu0.*

You can also use wildcards to add all the trace sources matching a pattern:

TRACE.GenericTrace.trace-sources=CACHE_*

Advanced usage

You can see all the parameters the plugin define by launching the model with the plugin and the --list-params option.

You can

- Specify a file as output with TRACE.GenericTrace.trace-file="log.txt"

- Start/stop tracing after a number of instructions* with TRACE.GenericTrace.start-icount=0x10000  and TRACE.GenericTrace.stop-icount=0x7FFFFF

Be aware that the instruction number is only compared on quantum boundaries, so it will not be perfectly accurate.
- The plugin also contains an enable parameter to turn the tracing on and off. You can change it at runtime from ModelDebugger -> Debug -> Set Parameters and tick/untick the enable parameter.
- By default, the path to the component producing the trace is shortened, if you need to get the full path (to make the difference between 2 cores with the same name for example), you can use TRACE.GenericTrace.shorten-paths=0

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