5.23.5.2. JTAG Power Analysis Tool with Trace32 PowerView¶
This document provides instructions for running JTAG Power Analysis Tool with Trace32 PowerView
5.23.5.2.1. Requirements¶
Trace32 PowerView for ARM version N.2025.01.xx or above with openOCD 0.12.0 or above
Node v22.17.0
5.23.5.2.2. Assumptions¶
If using Trace32 as the debugger, and no instance of trace32 is running (i.e. no Trace32 live debug session is running), then no assumtions are made.
If using Trace32 as debugger and a live Trace32 debug session is running (i.e. user is already using Trace32 for other debugging purposes), then the following assumptions apply
openOCD (if being used) is configured using the same OpenOCD config file as passed in the command line parameters as –arg1 (use usage options).
Trace32 is connected to the target.
Trace32 Remote API is enabled. Run
SETUP.API.RCL.Enable /Port /RemoteHost ALLOW /Interface UDPin Trace32 CLI to enable remote API.
Please refer to the usage options section to view the valid arguments that can be passed.
5.23.5.2.3. Usage¶
The JTAG Power Analysis Tool operates in two steps:
Step 1:
A debugger script is executed to read the MMRs and generate a list of key-value pairs.
Step 2:
The tool utilizes the list of key-value pairs to generate comprehensive outputs.
5.23.5.2.3.1. Step 1 - Generating Memory Mapped Registers (MMRs) Key-Value data¶
In this step, user needs to generate memory key-value pairs using Trace32+OpenOCD. The memory addresses that is required to read is present in tools/jtag_power_analysis_tool/soc_data/<soc>/mem_addr. After following the below step, key-value pair will be generated in tools/jtag_power_analysis_tool/memory_values_csv/<soc>.
Connect to the SoC using the JTAG interface
Make sure the core is not connected through any other debugger, as it will prevent OpenOCD from connecting to the target.
Run the execute_t32.js JS file with options as per [usage options](#usage-options-t32)
node <path to execute_t32.js>/execute_t32.js --soc <soc> --selector <selector> --arg1 <path to openocd config file> --arg2 <path to trace32 startup script>
Example:
node /home/user/mcu_plus_sdk/source/pdm_utils/tools/jtag_power_analysis_tool/src/execute_t32.js --soc j722s --selector all --arg1 /usr/local/share/openocd/scripts/board/ti_j722sevm.cfg --arg2 /home/user/Desktop/j722s.cmm
5.23.5.2.3.1.1. Usage Options¶
Args |
Description |
|---|---|
soc |
The SoC to be used |
selector |
all : runs all tools (default) pll : runs pll tool psc : runs psc tool pet : print PET tool IP clock_tree: runs clk_tree tool |
arg1 |
arg1 is the path to openOCD config file |
arg2 |
arg2 is the path to Trace32 startup script |
5.23.5.2.3.2. Step 2 - Tool Generates Output Files¶
Run
node <path to main_pm_data_processor.js> --soc <soc> --selector <all/pll/psc/clock_tree> --level <0/1/2> [--mmrKeyValue <path to folder containing mmr key-value pair csv files>]
The –mmrKeyValue option is optional and it specifies the path to the folder containing the MMR key-value pair CSV files. If not provided, the tool will use the default values from the tools/jtag_power_analysis_tool/memory_values_csv/<soc> folder, which is generated by the debugger script.
View the output in the console or saved json file in the output directory
- Sample run:
node /home/cgt/ti/pdm_utils/tools/jtag_power_analysis_tool/src/main_pm_data_processor.js --soc j722s --selector pet --level 0 --mmrKeyVal /home/cgt/ti/pdm_utils/tools/jtag_power_analysis_tool/memory_values_csv/j722s/
5.23.5.2.3.2.1. Usage Options¶
Args |
Description |
|---|---|
soc |
The SoC to be used |
selector |
all : runs all tools (default) pll : runs pll tool psc : runs psc tool pet : print PET tool IP clock_tree: runs clk_tree tool |
level |
print level <0-2> |
mmrKeyValue |
Optional path to mmrKeyVal dir generated by debugger script |