Cross-Triggering
Cross-triggering is supported by the embedded cross-triggering (ECT) module supplied by Arm. ECT provides a mechanism for multiple subsystems in an SoC to interact with each other by exchanging debug triggers. ECT consists of two modules:
- Cross Trigger Interface (CTI) - CTI combines and maps the trigger requests, and broadcasts them to all other interfaces on the ECT as channel events. When the CTI receives a channel event, it maps this onto a trigger output. This enables subsystems to cross trigger with each other.
- Cross Trigger Matrix (CTM) - CTM controls the distribution of channel events. It provides Channel Interfaces for connection to either a CTI or CTM. This enables multiple ECTs to be connected to each other.
The figure below shows how CTIs and CTM are used in a generic setup.
CTM forms an event broadcasting network with multiple channels. A CTI listens to one or more channels for an event, maps a received event into a trigger, and sends the trigger to one or more CoreSight components connected to the CTI. A CTI also combines and maps the triggers from the connected CoreSight components and broadcasts them as events on one or more channels. Through its register interface, each CTI can be configured to listen to specific channels for events or broadcast triggers as events to specific channels.
In the above example, there are four channels. The CTI at the top is configured to propagate the trigger event on Trigger Input 0 to Channel 0. Other CTIs can be configured to listen to this channel for events and broadcast the events through trigger outputs, to the debug components connected to these CTIs. CTIs also support channel gating such that selected channels can be turned off, without having to disable the channel to trigger I/O mapping.
Enable Cross-Triggering
You can now create/edit/remove cross-trigger breakpoints and apply the breakpoints on the target using the Debug Configurations dialog box. To enable cross-triggering, do the following:
- Launch the Vitis software platform.
- Create a standalone application project. Alternatively, you can also select an existing project.
- Right-click on the application and select .
- Double-click Launch on Hardware (Single Application Debug) to create a new configuration.
- On the Target Setup tab page, select Enable Cross-Triggering.
- Click the button next to the Enable
Cross-Triggering check box. The Cross Trigger
Breakpoints dialog box appears. You can create new breakpoints and edit or remove existing breakpoints using the Cross Trigger Breakpoints dialog box. The options available on the dialog box are described below.
- Create
- Click to create a new cross trigger breakpoint. The New Cross Trigger Breakpoint dialog box appears. You need to select a cross trigger signal, which can be a source or destination of a cross-triggering breakpoint. The OK button enables only when you select at least one input and one output signal.
- Edit
- Click to edit an existing breakpoint. The Edit Cross Trigger Breakpoint dialog box appears that allows you to edit the selected input and output signals.
- Remove
- Click to remove the selected breakpoint.
Cross-Triggering in Zynq Devices
In Zynq devices, ECT is configured with four broadcast channels, four CTIs, and a CTM. One CTI is connected to ETB/TPIU, one to FTM and one to each Cortex-A9 core. The following table shows the trigger input and trigger output connections of each CTI.
CTI Trigger Port | Signal |
---|---|
CTI connected to ETB, TPIU | |
Trigger Input 2 | ETB full |
Trigger Input 3 | ETB acquisition complete |
Trigger Input 4 | ITM trigger |
Trigger Output 0 | ETB flush |
Trigger Output 1 | ETB trigger |
Trigger Output 2 | TPIU flush |
Trigger Output 3 | TPIU trigger |
FTM CTI | |
Trigger Input 0 | FTM trigger |
Trigger Input 1 | FTM trigger |
Trigger Input 2 | FTM trigger |
Trigger Input 3 | FTM trigger |
Trigger Output 0 | FTM trigger |
Trigger Output 1 | FTM trigger |
Trigger Output 2 | FTM trigger |
Trigger Output 3 | FTM trigger |
CPU0/1 CTIs | |
Trigger Input 0 | CPU DBGACK |
Trigger Input 1 | CPU PMU IRQ |
Trigger Input 2 | PTM EXT |
Trigger Input 3 | PTM EXT |
Trigger Input 4 | CPU COMMTX |
Trigger Input 5 | CPU COMMTX |
Trigger Input 6 | PTM TRIGGER |
Trigger Output 0 | CPU debug request |
Trigger Output 1 | PTM EXT |
Trigger Output 2 | PTM EXT |
Trigger Output 3 | PTM EXT |
Trigger Output 4 | PTM EXT |
Trigger Output 7 | CPU restart request |
Cross-Triggering in Zynq UltraScale+ MPSoCs
In Zynq UltraScale+ MPSoCs, ECT is configured with four broadcast channels, nine CTIs, and a CTM. The table below shows the trigger input and trigger output connections of each CTI. These are hard-wired connections. For more details, refer to Zynq UltraScale+ Device Technical Reference Manual (UG1085).
CTI Trigger Port | Signal |
---|---|
CTI 0 (soc_debug_fpd) | |
IN 0 | ETF 1 FULL |
IN 1 | ETF 1 ACQCOMP |
IN 2 | ETF 2 FULL |
IN 3 | ETF 2 ACQCOMP |
IN 4 | ETR FULL |
IN 5 | ETR ACQCOMP |
IN 6 | - |
IN 7 | - |
OUT 0 | ETF 1 FLUSHIN |
OUT 1 | ETF 1 TRIGIN |
OUT 2 | ETF 2 FLUSHIN |
OUT 3 | ETF 2 TRIGIN |
OUT 4 | ETR FLUSHIN |
OUT 5 | ETR TRIGIN |
OUT 6 | TPIU FLUSHIN |
OUT 7 | TPIU TRIGIN |
CTI 1 (soc_debug_fpd) | |
IN 0 | FTM |
IN 1 | FTM |
IN 2 | FTM |
IN 3 | FTM |
IN 4 | STM TRIGOUTSPTE |
IN 5 | STM TRIGOUTSW |
IN 6 | STM TRIGOUTHETE |
IN 7 | STM ASYNCOUT |
OUT 0 | FTM |
OUT 1 | FTM |
OUT 2 | FTM |
OUT 3 | FTM |
OUT 4 | STM HWEVENTS |
OUT 5 | STM HWEVENTS |
OUT 6 | - |
OUT 7 | HALT SYSTEM TIMER |
CTI 2 (soc_debug_fpd) | |
IN 0 | ATM 0 |
IN 1 | ATM 1 |
IN 2 | - |
IN 3 | - |
IN 4 | - |
IN 5 | - |
IN 6 | - |
IN 7 | - |
OUT 0 | ATM 0 |
OUT 1 | ATM 1 |
OUT 2 | - |
OUT 3 | - |
OUT 4 | - |
OUT 5 | - |
OUT 6 | - |
OUT 7 | picture debug start |
CTI 0, 1 (RPU) | |
IN 0 | DBGTRIGGER |
IN 1 | PMUIRQ |
IN 2 | ETMEXTOUT[0] |
IN 3 | ETMEXTOUT[1] |
IN 4 | COMMRX |
IN 5 | COMMTX |
IN 6 | ETM TRIGGER |
IN 7 | - |
OUT 0 | EDBGRQ |
OUT 1 | ETMEXTIN[0] |
OUT 2 | ETMEXTIN[1] |
OUT 3 | -(CTIIRQ, not connected) |
OUT 4 | - |
OUT 5 | - |
OUT 6 | - |
OUT 7 | DBGRESTART |
CTI 0, 1, 2, 3 (APU) | |
IN 0 | DBGTRIGGER |
IN 1 | PMUIRQ |
IN 2 | - |
IN 3 | - |
IN 4 | ETMEXTOUT[0] |
IN 5 | ETMEXTOUT[1] |
IN 6 | ETMEXTOUT[2] |
IN 7 | ETMEXTOUT[3] |
OUT 0 | EDBGRQ |
OUT 1 | DBGRESTART |
OUT 2 | CTIIRQ |
OUT 3 | - |
OUT 4 | ETMEXTIN[0] |
OUT 5 | ETMEXTIN[1] |
OUT 6 | ETMEXTIN[2] |
OUT 7 | ETMEXTIN[3] |
Use Cases
FPGA to CPU Triggering
This is one of the most common use cases of cross-triggering in Zynq. There are four trigger inputs on FPGA CTI, which can be configured to halt (EDBGRQ) any of the two CPUs. Similarly, the four FPGA CTI trigger outputs can be triggered when a CPU is halted (DBGACK). The FPGA trigger inputs and outputs can be connected to ILA cores such that an ILA trigger can halt the CPU(s) and the ILA can be triggered to capture the signals it’s monitoring, when any of the two CPUs is halted. For more details about setting up cross-triggering to the FTM in Vivado Design Suite, refer to the Cross Trigger Design section in Vivado Design Suite Tutorial: Embedded Processor Hardware Design (UG940).
PTM to CPU Triggering
Synchronize trace capture with the processor state. For example, an ETB full event can be used as a trigger to halt the CPU(s).
CPU to CPU Triggering
Cross-triggering can be used to synchronize the entry and exit from debug state between the CPUs. For example, when CPU0 is halted, the event can be used to trigger a CPU1 debug request, which can halt CPU1.
XSCT Cross-Triggering Commands
The XSCT breakpoint add command (bpadd) has been enhanced to enable cross triggering between different components.
For example, use the following command to set a cross trigger to stop Zynq core 1 when core 0 stops.
bpadd -ct-input 0 -ct-output 8
For Zynq, -ct-input
0
refers to CTI CPU0 TrigIn0 (trigger input 0 of the
CTI connected to CPU0), which is connected to DBGACK (asserted when the core is halted). -ct-output 8
refers to CTI CPU1
TrigOut0, which is connected to CPU debug request (asserting this pin halts the core).
hw_server
uses an available channel to set up a cross trigger
path between these pins. When core 0
is halted, the event is
broadcast to core 1
over the selected channel, causing core 1
to halt.
Use the following command for the Zynq UltraScale+ MPSoC to halt the A53 core 1 when A53 core 0 stops.
bpadd -ct-input 16 -ct-output 24