1

I am trying to write a practice script to debug a multi core system in Trace32. As per the docs, I started the scrpit as follows

SYStem.CPU CortexA55
SYStem.CONFIG CoreNumber 3
Core.Number 3

I can choose to single step in a single core by using the data list window buttons for that core. But I am not sure how to do that using the commands. In their docs they mention

Where the target is configured for Symmetric Multi-Processing (SMP), a single instance of TRACE32 PowerView is used to control all cores. In this case many PRACTICE commands add an option /CORE option to indicate that the command should be run with reference to a particular core or cores. But I tried to execute these commands

Go.Backover
Step
Print Register(pc)

but none of them does have this /Core option.

Merolla
  • 315
  • 2
  • 10

1 Answers1

4

All commands used without the option /CORE are for the currently selected logical core. You can indicate the currently selected core by checking the status bar: Left to the system state (probably showing "stopped"), you'll see a digit, indicating the active logical core.

You can change the active logical core with the command CORE.select. Note, that after any Step or Go command the active logical core can change, because when the SoC goes in a running-state and the enters halt-state, the active logical core is the core which caused the SoC to halt.

So in you case the following should be safe.

CORE.select 0   
Step.Over
CORE.select 0
Step
CORE.select 0
ECHO Register(PP)

Instead of CORE.select 0 you can use of course also CORE.select 1 or CORE.select 2.

I think there is no command called Go.Backover. So I am not sure if you are referring to Step.BackOver, Step.Over, Step.Back, or Go.Back.

By the way: You have used SYStem.CPU CortexA55. That is not wrong, but probably not optimal: Selecting as base-core like CortexA55 is indented for self-made SoCs and requires usually a lot of additional SYStem.CONFIG commands to tell the Debugger the location of the CoreSight components. If you have not created your own SoC try to find the exact chip name in the window SYStem.CPU.

Holger
  • 3,920
  • 1
  • 13
  • 35
  • Hi Holger, thanks for your answer! Just to make sure because my teammate is telling me different information from what I got from your answer and their documentation. Stepping is expected to affect the active core only but Go should affect them all, is that correct? – Merolla Jan 01 '23 at 12:22
  • 1
    `Go` will affect all cores (but `Go /SingleCORE` will start only the acitve core). Stepping an assembler line (e.g. with `Step.Asm` or with Step after `Mode.Mix`) will step one assembler instruction on the active core only. (In this case the active code is told to do perform exactly one instruction). However when stepping an HLL line (e.g. with `Step.Hll` or with Step after `Mode.Hll`) (or asm-stepping over a branch-and-link instruction (BL)) all cores will run until the next line on the active core is reached (where the debugger set a breakpoint) - or any other breakpoint hits in between. – Holger Jan 04 '23 at 01:07