Coresight Mtb-M0+: Technical Reference Manual
Coresight Mtb-M0+: Technical Reference Manual
Coresight Mtb-M0+: Technical Reference Manual
Revision: r0p1
Change history
Proprietary Notice
Words and logos marked with® or ™ are registered trademarks or trademarks of ARM® in the EU and other countries,
except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the
trademarks of their respective owners.
Neither the whole nor any part of the information contained in, or the product described in, this document may be
adapted or reproduced in any material form except with the prior written permission of the copyright holder.
The product described in this document is subject to continuous developments and improvements. All particulars of the
product and its use contained in this document are given by ARM in good faith. However, all warranties implied or
expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.
This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any loss or
damage arising from the use of any information in this document, or any error or omission in such information, or any
incorrect use of the product.
Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.
Confidentiality Status
This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license
restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this
document to.
Product Status
Web Address
http://www.arm.com
Preface
About this book ........................................................................................................... vi
Feedback .................................................................................................................... ix
Chapter 1 Introduction
1.1 About the CoreSight MTB-M0+ ............................................................................... 1-2
1.2 Compliance .............................................................................................................. 1-3
1.3 Features ................................................................................................................... 1-4
1.4 Interfaces ................................................................................................................. 1-5
1.5 Configurable options ................................................................................................ 1-6
1.6 Test features ............................................................................................................ 1-7
1.7 Product documentation and design flow .................................................................. 1-8
1.8 Product revisions ................................................................................................... 1-10
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. iii
ID011213 Non-Confidential
Contents
Appendix C Revisions
This preface introduces the CoreSight MTB-M0+Technical Reference Manual. It contains the
following sections:
• About this book on page vi.
• Feedback on page ix.
The rnpn identifier indicates the revision status of the product described in this book, where:
rn Identifies the major revision of the product.
pn Identifies the minor revision or modification status of the product.
Intended audience
Chapter 1 Introduction
Read this chapter for an introduction to the MTB and its features.
Appendix C Revisions
Read this for a description of the technical changes between released issues of this
book.
Glossary
The ARM Glossary is a list of terms used in ARM documentation, together with definitions for
those terms. The ARM Glossary does not contain terms that are industry standard unless the
ARM meaning differs from the generally accepted meaning.
Conventions
• Signals.
Typographical conventions
Style Purpose
bold Highlights interface elements, such as menu names. Denotes signal names. Also used for terms in descriptive
lists, where appropriate.
monospace Denotes text that you can enter at the keyboard, such as commands, file and program names, and source code.
monospace Denotes a permitted abbreviation for a command or option. You can enter the underlined text instead of the full
command or option name.
monospace italic Denotes arguments to monospace text where the argument is to be replaced by a specific value.
monospace bold Denotes language keywords when used outside example code.
<and> Encloses replaceable terms for assembler syntax where they appear in code or code fragments. For example:
MRC p15, 0 <Rd>, <CRn>, <CRm>, <Opcode_2>
SMALL CAPITALS Used in body text for a few terms that have specific technical meanings, that are defined in the ARM glossary.
For example, IMPLEMENTATION DEFINED, IMPLEMENTATION SPECIFIC, UNKNOWN, and UNPREDICTABLE.
Timing diagrams
The figure named Key to timing diagram conventions explains the components used in timing
diagrams. Variations, when they occur, have clear labels. You must not assume any timing
information that is not explicit in the diagrams.
Shaded bus and signal areas are UNDEFINED, so the bus or signal can assume any value within
the shaded area at that time. The actual level is unimportant and does not affect normal
operation.
Clock
HIGH to LOW
Transient
HIGH/LOW to HIGH
Bus stable
Bus change
Signals
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. vii
ID011213 Non-Confidential
Preface
Signal level The level of an asserted signal depends on whether the signal is
active-HIGH or active-LOW. Asserted means:
• HIGH for active-HIGH signals.
• LOW for active-LOW signals.
Additional reading
ARM publications
This book contains information that is specific to this product. See the following documents for
other relevant information:
• CoreSight MTB-M0+ Implementation and Integration Manual (ARM DIT 0031).
• Cortex-M0+ Technical Reference Manual (ARM DDI 0484).
• AMBA® 3 AHB-Lite™ Protocol Specification (ARM IHI 0033).
• CoreSight Architecture Specification (ARM IHI 0029).
• ARM v6-M Architecture Reference Manual (ARM DDI 0419).
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. viii
ID011213 Non-Confidential
Preface
Feedback
ARM welcomes feedback on this product and its documentation.
If you have any comments or suggestions about this product, contact your supplier and give:
• The product name.
• The product revision or version.
• An explanation with as much information as you can provide. Include symptoms and
diagnostic procedures if appropriate.
Feedback on content
Note
ARM tests the PDF only in Adobe Acrobat and Acrobat Reader, and cannot guarantee the
quality of the represented document when used with any other PDF reader.
This chapter introduces the CoreSight MTB-M0+ and its features. It contains the following
sections:
• About the CoreSight MTB-M0+ on page 1-2.
• Compliance on page 1-3.
• Features on page 1-4.
• Interfaces on page 1-5.
• Configurable options on page 1-6.
• Test features on page 1-7.
• Product documentation and design flow on page 1-8.
• Product revisions on page 1-10.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-1
ID011213 Non-Confidential
Introduction
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-2
ID011213 Non-Confidential
Introduction
1.2 Compliance
The MTB complies with, or implements, the specifications described in:
• Advanced Microcontroller Bus Architecture.
• Debug authentication interface.
This MTB complies with the AMBA 3 AHB-Lite protocol. See the AMBA 3 AHB-Lite Protocol.
This MTB complies with the CoreSight authentication interface. See the CoreSight Architecture
Specification.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-3
ID011213 Non-Confidential
Introduction
1.3 Features
The MTB features and benefits are:
• Provision of program flow tracing for the Cortex-M0+ processor.
• Very small area.
• Power reduction features.
• MTB SRAM can be used for both trace and general purpose storage by the processor.
• MTB SRAM size is configurable at implementation time.
• The position and size of the trace buffer in SRAM is configurable by software.
• External hardware can control trace start/stop.
• CoreSight compliant.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-4
ID011213 Non-Confidential
Introduction
1.4 Interfaces
The three main interfaces on the MTB are:
• AHB-Lite slave interface.
• Processor execution trace interface.
• Synchronous SRAM master interface.
The MTB AHB-Lite interface provides access to two memory regions for:
• The Special Function Registers (SFRs).
• The SRAM.
HSELSFR selects the address space for the Special Function Registers and HSELRAM selects
the address space for the SRAM. See AMBA AHB-Lite interface on page A-4 for more
information.
The processor execution trace interface transfers the execution information from the processor
to the MTB. See Execution trace interface on page A-7 for more information. The MTB formats
information, received from this interface, into trace packets and writes it into the MTB SRAM.
The SRAM interface connects to the MTB SRAM, that is used to store the trace packet
information formatted by the MTB.
The MTB also operates as a simple AHB-Lite SRAM bridge. The processor has read and write
access to the entire MTBSRAM address space using the AHB-Lite interface. This enables the
processor to access the trace packet information and also to store program and data information
in the SRAM.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-5
ID011213 Non-Confidential
Introduction
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-6
ID011213 Non-Confidential
Introduction
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-7
ID011213 Non-Confidential
Introduction
See Additional reading on page viii for more information about the books described in this
section. For information on the relevant protocols, see Compliance on page 1-3.
1.7.1 Documentation
The MTB is delivered as synthesizable RTL. Before it can be used in a product, it must go
through the following processes:
Implementation
The implementer configures and synthesizes the RTL to produce a netlist.
Integration The integrator connects the implemented design into a SoC. This includes
connecting it to a memory, processor and AHB-Lite bus.
Programming
This is the last process. The tools developer creates the software required to
configure and initialize the MTB, and tests the required debug software.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-8
ID011213 Non-Confidential
Introduction
Each process:
• Can include implementation and integration choices affect the behavior and features of
the MTB.
Typically, a single design team integrates the MTB into a SoC before synthesizing the complete
design. Alternatively, the team can synthesise the MTB on its own or partially integrated, to
produce a macrocell that is then integrated, possibly by a separate team.
Build configuration
The implementer chooses the options that affect how the RTL source files are
pre-processed. These options usually include or exclude logic that affects one or
more of the area, maximum frequency, and features of the resulting macrocell.
Configuration inputs
The integrator configures some features of the MTB by tying inputs to specific
values. These configurations affect the start-up behavior before any software
configuration is made. They can also limit the options available to the software.
Software configuration
The programmer configures the MTB by programming particular values into
registers. This affects the behavior of the MTB.
Note
This manual refers to implementation-defined features that are applicable to build configuration
options. Reference to a feature that is included means that the appropriate build and pin
configuration options are selected. Reference to an enabled feature means one that has also been
configured by software.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-9
ID011213 Non-Confidential
Introduction
r0p1 ECOREVNUM is in the Peripheral ID3 register instead of the Peripheral ID2
register.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 1-10
ID011213 Non-Confidential
Chapter 2
Functional description
This chapter describes the functionality of the MTB. It contains the following sections:
• About the functions on page 2-2.
• Interfaces on page 2-3.
• Operation on page 2-6.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-1
ID011213 Non-Confidential
Functional description
Cortex-M0+
Processor
When enabled, the MTB records changes in program flow, reported by the Cortex-M0+
processor over the execution trace interface. This information is stored as trace packets in the
SRAM. An off-chip debugger can extract the trace information using the DAP to read the trace
information from the SRAM, over the AHB-Lite interface. The debugger can then reconstruct
the program flow from this information.
The processor accesses the SRAM using the AHB-Lite interface. The MTB simultaneously
stores trace information into the SRAM, and gives the processor access to the SRAM. The MTB
ensures that trace write accesses have priority over processor accesses.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-2
ID011213 Non-Confidential
Functional description
2.2 Interfaces
This section describes the MTB interfaces. it contains:
• Clock and reset interface on page 2-4.
• AHB-Lite interface on page 2-4.
• Execution trace interface on page 2-4.
• External trace enable interface on page 2-5.
• SRAM interface on page 2-5.
• Debug authentication interface on page 2-5.
HCLK RAMAD[AWIDTH-3:0]
Clock & Reset RESETn RAMWD[31:0]
IDLE RAMCS SRAM
Interface
RAMWE[3:0]
HADDR[31:0]
RAMRD[31:0]
HBURST[2:0]
HMASTLOCK
HPROT[3:0]
HSIZE[2:0]
HTRANS[1:0]
AMBA HWDATA[31:0]
AHB-Lite
Interface HWRITE
HSELRAM
HSELSFR
CoreSight
HREADY MTB-M0+
HRDATA[31:0]
HREADYOUT
HRESP
DBGEN Debug
authentication
IAEXSEQ NIDEN interface
IAEXEN
Execution Trace IAEX[30:0]
Interface
ATOMIC
SRAM base
EDBGRQ SRAMBASEADDR[31:0]
address
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-3
ID011213 Non-Confidential
Functional description
The clock and reset interface consists of the HCLK, RESETn and IDLE signals. The IDLE
signal can be used to gate HCLK outside the MTB to save power. See Clock, reset, and control
signals on page A-3 for additional information.
The following sections describe the AHB-Lite interface used by the MTB:
• Wait state behavior.
• Buffering.
The MTB AHB-Lite interface provides access to two memory regions, one for the Special
Function Registers and the other for the SRAM. The memory regions are selected by the
HSELSFR and HSELRAM inputs respectively. Only one of these select inputs can be HIGH
at a time. If they are both HIGH at the same time the behavior is UNPREDICTABLE.
SFR accesses must be word accesses. SRAM accesses can be either byte, halfword or word
accesses.
SRAM accesses from the AHB-Lite interface occur with zero wait states when there is no trace
data being written to the SRAM.
Trace packet write access to the SRAM take priority over access from the AHB-Lite interface.
Therefore, one or more wait states can be inserted into the AHB-Lite accesses if trace
information is simultaneously written to the SRAM.
Special Function Register, SFR, accesses always occur with zero wait states.
Buffering
The MTB AHB-Lite interface can buffer two address phases and one data write phase for
SRAM accesses. This enables:
• AHB-Lite accesses to the SRAM to occur at the same time as a trace packet is written to
the SRAM.
• AHB-Lite read access to the SRAM to follow an AHB-Lite write access without inserting
wait states.
The execution trace interface consists of the IAXEN, IAEXSEQ, IAEX[30:0], ATOMIC, and
EDBGRQ signals.
Optionally, you can program the MTB to use the EDBGRQ output to request the processor to
enter the halt state when the trace buffer is full. This avoids loss of trace information. See FLOW
Register on page 3-11.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-4
ID011213 Non-Confidential
Functional description
This interface enables external control over when tracing starts and stops. It consists of the
TSTART and TSTOP signals. See Trace start and stop on page 2-7 and External trace control
interface on page A-8.
This is a synchronous interface to the SRAM. The MTB uses this interface for trace and
AHB-Lite accesses to the SRAM. See MTB execution trace packet format on page 2-6 and
SRAM memory interface on page A-6.
This interface permits trace to be disabled for security purposes. See also Debug authentication
interface on page A-9 for signal information.
0 0 No Yes Yes 0
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-5
ID011213 Non-Confidential
Functional description
2.3 Operation
This section describes the operation of the MTB. It contains the following sections:
• MTB execution trace packet format.
• Trace start and stop on page 2-7.
The execution trace packet consists of a pair of 32-bit words that the MTB generates when it
detects the processor PC value changes non-sequentially. A non-sequential PC change can occur
during branch instructions or during exception entry.
Note
The processor can cause a trace packet to be generated for any instruction.
Figure 2-3 shows the signal combination that detects a non-sequential PC change.
IAEXEN
NONSEQ_PC
IAEXSEQ
Figure 2-4 shows how the execution trace information is stored in memory as a sequence of
packets.
31 1 0
Nth Destination Address S Odd word address
Nth Source Address A Even word address
Incrementing
SRAM Memory 31 1 0
Addresses
2nd Destination Address S Start bit
2nd Source Address A
1st Destination Address S Odd word address
1st Source Address A Even word address
Atomic bit
The first, lower addressed, word contains the source of the branch, the address it branched from.
The value stored only records bits[31:1] of the source address, because Thumb instructions are
at least halfword aligned. The least significant bit of the value is the A-bit. The A-bit indicates
the atomic state of the processor at the time of the branch, and can differentiate whether the
branch originated from an instruction in a program, an exception, or a PC update in Debug state.
When it is zero the branch originated from an instruction, when it is one the branch originated
from an exception or PC update in Debug state. This word is always stored at an even word
location.
The second, higher addressed word contains the destination of the branch, the address it
branched to. The value stored only records bits[31:1] of the branch address. The least significant
bit of the value is the S-bit. The S-bit indicates where the trace started. An S-bit value of 1
indicates where the first packet after the trace started and a value of 0 is used for other packets.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-6
ID011213 Non-Confidential
Functional description
Because it is possible to start and stop tracing multiple times in a trace session, the memory
might contain several packets with the S-bit set to 1. This word is always stored in the next
higher word in memory, an odd word address.
When the A-bit is set to 1, the source address field contains the architecturally-preferred return
address for the exception. For example, if an exception was caused by an SVC instruction, then
the source address field contains the address of the following instruction. This is different from
the case where the A-bit is set to 0. In this case, the source address contains the address of the
branch instruction.
Tracing is enabled when the MASTER.EN bit in the Master Trace Control Register is 1. There
are various ways to set the bit to 1 to start tracing, or to 0 to stop tracing. See MASTER Register
on page 3-9.
You can control trace externally using the TSTART and TSTOP signals or using the Master
Trace Control Register, see TSTART and TSTOP signals on page 2-8. You can program the MTB
to stop tracing automatically when the memory fills to a specified watermark level or you can
start or stop tracing by writing directly to the MASTER.EN bit, see MASTER Register on
page 3-9. If you do not use the watermark mechanism, and the trace buffer overflows, then the
buffer wraps around overwriting previous trace packets.
If more than one source attempts to modify the MASTER.EN bit value in the same cycle then
the following priority order is used to determine which value is accepted. The lowest number is
the higher priority.
1. Watermark stop.
2. Software write to the MASTER.EN bit.
3. TSTART and TSTOP signals.
Note
• If you use the watermark auto stop feature to stop trace, you cannot restart trace until
software clears the watermark auto stop. You can achieve this in one of the following
ways:
— By setting the POSITION.POINTER field to point to the beginning of the trace
buffer. See POSITION Register on page 3-8.
— By setting the FLOW.AUTOSTOP bit to 0. See FLOW Register on page 3-11.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-7
ID011213 Non-Confidential
Functional description
• If tracing is stopped while a trace packet is being written into memory, the MTB ensures
that the packet write is completed.
• The DBGEN or NIDEN signal must be HIGH for tracing to occur. See Debug
authentication interface on page 1-3. After tracing has started the MTB stops tracing
when both of these signals are LOW. The value of the MASTER.EN bit is not affected by
these signals. If DBGEN or NIDEN signal is HIGH again, then tracing continues and the
S-bit is set to 1 in the first trace packet when tracing resumes. There is no restriction on
which methods are used to start and stop tracing and they can be combined in any way.
For example, the TSTART signal can start the trace and the MASTER.EN bit can stop the
trace.
When the TSTART signal is HIGH for one or more clock cycles and the MASTER.TSTARTEN
bit is 1, then the MASTER.EN bit is set to 1 and tracing starts from the memory location
indicated by the POSITION.POINTER field in the Position Trace Control Register. See
MASTER Register on page 3-9 and POSITION Register on page 3-8. Tracing continues when
the TSTART signal is LOW, until stopped.
When the TSTOP signal is HIGH for one or more cycles and the MASTER.EN bit is 1, then the
MASTER.EN bit is set to 0 and the trace stops.
Note
If TSTART and TSTOP signals are both HIGH, in the same cycle, TSTART takes priority.
You can use the control registers to start or stop trace as follows:
• Tracing can be stopped automatically using the FLOW Trace Control Register. See FLOW
Register on page 3-11.
• Tracing can also be stopped under software control by setting the MASTER.EN bit to 0
in the MASTER Trace Control Register, see MASTER Register on page 3-9
Trace efficiency
To achieve low area and low power, the MTB trace format is less efficient than the ARM ETM
or PTM solutions. Each branch requires eight bytes, resulting in128 branches per kilobyte of
RAM. Based on Dhrystone 2.1, this is approximately 875 instructions per kilobyte, or using a
zero-wait state memory system, approximately 1600 HCLK cycles per kilobyte, or
approximately 2.5 loops of Dhrystone2.1.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 2-8
ID011213 Non-Confidential
Chapter 3
Programmers model
This chapter describes the MTB registers and provides information for programming the MTB.
It contains the following sections:
• About the programmers model on page 3-2
• Memory model on page 3-3
• Register summary on page 3-4
• Register descriptions on page 3-8
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-1
ID011213 Non-Confidential
Programmers model
• The base address is not fixed, and can be different for any particular system
implementation. The offset of each register from the base address is fixed.
• Do not attempt to access reserved or unused address locations. Attempting to access these
locations can result in UNPREDICTABLE behavior.
• The behavior of the MTB is UNPREDICTABLE if the registers with UNKNOWN reset values
are not programmed prior to enabling trace.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-2
ID011213 Non-Confidential
Programmers model
The base address of the MTB SFR region, in the processor memory map, must be present in a
CoreSight ROM table to permit a debug agent to determine the location of the CoreSight
registers.
Figure 3-1 shows the SFR memory map with the address offsets for each set of registers.
0xFFC
CoreSight
Registers
0xF00
0xEFC
Reserved
UKN/SBZP
0x010
0x00C Trace
Control
Registers
0x000
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-3
ID011213 Non-Confidential
Programmers model
The MTB has programmable registers to control the behavior of the trace features, POSITION,
MASTER, FLOW, and BASE.
Table 3-1 shows the registers in offset order from the base memory address.
Note
The behavior of the trace functionality is UNPREDICTABLE if the POSITION and FLOW
registers are not programmed prior to enabling trace, that is when software writes a 1 to either
the MASTER.EN or MASTER.TSTART bit. See Trace start and stop on page 2-7.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-4
ID011213 Non-Confidential
Programmers model
Table 3-2 on page 3-6 shows the CoreSight registers and their values.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-5
ID011213 Non-Confidential
Programmers model
Address
Register Value Description
offset
0XFF0 Component ID0 0x0000000D See the CoreSight Architecture Specification for
more information about the registers and access
0XFF4 Component ID1 0x00000090 types.
0XFF8 Component ID2 0x00000005
Reserved[31:8] 0x000000
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-6
ID011213 Non-Confidential
Programmers model
Note
If you modify the MTB or incorporate parts of it into another module, then the Peripheral ID
fields must be changed from the ARM values to partner specific values. These fields are:
• JEP106 Identity (PID2[2:0], PID[7:4]).
• JEP Continuation Code (PID4[3:0]).
• Part Number (PID1[3:0], PID0[7:0]).
• Revision (PID2[7:4]).
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-7
ID011213 Non-Confidential
Programmers model
Table 3-1 on page 3-4 provides cross references to individual trace control registers.
Purpose Contains the trace write pointer and the wrap bit.
31 3 2 1 0
POINTER
WRAP
Reserved
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-8
ID011213 Non-Confidential
Programmers model
[31:3] POINTER UNKNOWN Trace packet location pointer. Because a packet consists of two words, the POINTER field is the
location of the first word of a packet. This field contains bits [31:3] of the address, in the SRAM,
where the next trace packet will be written. The field points to an unused location and is
automatically incremented.
A debug agent can calculate the system address, on the AHB-Lite bus, of the SRAM location
pointed to by the POSITION register using the following equation:
system address = BASE + ((P + (2AWIDTH - (BASE MOD 2AWIDTH))) MOD 2AWIDTH).
Note
• The size of the SRAM is parameterized and the most significant bits of the POINTER field
can be RAZ/WI, depending on the AWIDTH parameter value. See Configurable options
on page 1-6.
• POSITION register bits greater than or equal to AWIDTH are RAZ/WI, therefore, the
active POINTER field bits are [AWIDTH-4:0].
• The POINTER field value is relative to the base address of the SRAM in the system
memory map.
[2] WRAP UNKNOWN This bit is set to 1 automatically when the POINTER value wraps as determined by the
MASTER.MASK field in the MASTER Trace Control Register.
[1:0] Reserved UNKNOWN These bits are reserved for future use and must be treated as UNK/SBZP.
A debug agent might use the WRAP bit to determine whether the trace information above and
below the pointer address is valid.
Purpose Contains:
• The main trace enable bit.
• Other trace control fields.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-9
ID011213 Non-Confidential
Programmers model
31 30 10 9 8 7 6 5 4 0
EN Reserved MASK
HALTREQ TSTARTEN
RAMPRIV TSTOPEN
SFRWPRIV
[30:10] Reserved UNKNOWN These bits are reserved for future use and must be treated as UNK/SBZP.
[9] HALTREQ 0 Halt request bit. This bit is connected to the halt request signal of the trace logic, EDBGRQ.
When HALTREQ is set to 1, EDBGRQ is asserted if DBGEN is also HIGH.
The HALTREQ bit can be automatically set to 1 using the FLOW.WATERMARK field. See
FLOW Register on page 3-11 for more information.
[8] RAMPRIV 0 SRAM Privilege bit. If this bit is 0, then User or Privileged AHB-Lite read and write accesses
to the SRAM are permitted. If this bit is 1, then only Privileged AHB-Lite read and write
accesses to the SRAM are permitted and User accesses are RAZ/WI. The HPROT[1] signal
determines if an access is User or Privileged. See AMBA 3 AHB-Lite Protocol Specification
or AMBA AHB-Lite interface signals on page A-4 for more information.
Note
This bit is implemented only if User/Privilege support is present in the MTB configuration. If
User/Privilege support is absent, then the behavior of this bit is RAZ/WI and the value of the
HPROT[1] signal is ignored. See Configurable options on page 1-6.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-10
ID011213 Non-Confidential
Programmers model
[7] SFRWPRIV 1 Special Function Register Write Privilege bit. If this bit is 0, then User or Privileged AHB-Lite
read and write accesses to the Special Function Registers are permitted. If this bit is 1, then
only Privileged write accesses are permitted and User write accesses are ignored. The
HPROT[1] signal determines if an access is User or Privileged. See AMBA 3 AHB-Lite
Protocol Specification or AMBA AHB-Lite interface signals on page A-4 for more
information.
Note
• SFR read accesses are not controlled by this bit and are always permitted.
• This bit is implemented only if User/Privilege support is present in the MTB
configuration. If User/Privilege support is absent, then the behavior of this bit is
RAZ/WI and the value of the HPROT[1] signal is ignored. See Configurable options
on page 1-6.
[6] TSTOPEN 0 Trace stop input enable. If this bit is 1 and the TSTOP signal is HIGH, then the EN bit is set
to 0. If a trace packet is being written to memory, the write is completed before tracing is
stopped.
[5] TSTARTEN 0 Trace start input enable. If this bit is 1 and the TSTART signal is HIGH, then the EN bit is
set to 1. Tracing continues until a stop condition occurs.
[4:0] MASK UNKNOWN This value determines the maximum size of the trace buffer in SRAM. It specifies the
most-significant bit of the POSITION.POINTER field that can be updated by automatic
increment. If the trace tries to advance past this power of two, the POSITION.WRAP bit is
set to 1, the POSITION.POINTER[MASK:0] bits are set to zero, and the
POSITION.POINTER[AWIDTH-4:MASK+1] bits remain unchanged.
This field causes the trace packet information to be stored in a circular buffer of size 2(MASK+4)
bytes, that can be positioned in memory at multiples of this size.
Valid values of this field are zero to AWIDTH-4. Values greater than the maximum have the
same effect as the maximum.
Table 3-5 shows some example MASK and POINTER values to illustrate the effect of the
MASK field on the POINTER.
Purpose Contains:
• The WATERMARK address.
• The AUTOSTOP and AUTOHALT control bits.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-11
ID011213 Non-Confidential
Programmers model
31 3 2 1 0
WATERMARK
Reserved
AUTOHALT
AUTOSTOP
[31:3] WATERMARK UNKNOWN WATERMARK value. This field contains an address in the same format as the
POSITION.POINTER field. When the POSITION.POINTER matches the WATERMARK
field value, actions defined by the AUTOHALT and AUTOSTOP bits are performed.
[2] Reserved UNKNOWN This bit is reserved for future use and must be treated as UNK/SBZP.
[1] AUTOHALT 0 If this bit is 1 and WATERMARK is equal to POSITION.POINTER, then the
MASTER.HALTREQ bit is automatically set to 1. If the DBGEN signal is HIGH, the MTB
asserts this halt request to the Cortex-M0+ processor by asserting the EDBGRQ signal.
[0] AUTOSTOP 0 If this bit is 1 and WATERMARK is equal to POSITION.POINTER, then the MASTER.EN
bit is automatically set to 0. This stops tracing.
Note
• If you stop tracing, using the watermark auto stop feature, you cannot restart tracing until
software clears the watermark auto stop. You can achieved this in one of the following
ways:
— Changing the POSITION.POINTER field value to point to the beginning of the
trace buffer.
— Setting the FLOW.AUTOSTOP bit to 0.
• A debug agent can use the AUTOSTOP bit to fill the trace buffer once only without
halting the processor.
• A debug agent can use the AUTOHALT bit to fill the trace buffer once before causing the
Cortex-M0+ processor to enter the Debug state. To enter Debug state, the Cortex-M0+
processor might have to perform additional branch type operations. Therefore you must
set the WATERMARK field below the final entry in the trace buffer region.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-12
ID011213 Non-Confidential
Programmers model
Purpose Indicates where the SRAM is located in the processor memory map. This
register is provided to enable auto discovery of the MTB SRAM location,
by a debug agent.
[31:0] BASE SRAMBASE The value provided is the value of the SRAMBASEADDR[31:0] signal. See Miscellaneous
signals on page A-10 for more information.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. 3-13
ID011213 Non-Confidential
Appendix A
Signal descriptions
This appendix describes the MTB signals. It contains the following sections:
• About the signal descriptions on page A-2.
• Clock, reset, and control signals on page A-3.
• AMBA AHB-Lite interface on page A-4.
• SRAM memory interface on page A-6.
• Execution trace interface on page A-7.
• External trace control interface on page A-8.
• Debug authentication interface on page A-9.
• Miscellaneous signals on page A-10.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-1
ID011213 Non-Confidential
Signal descriptions
Note
All input and output signals are synchronous to HCLK.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-2
ID011213 Non-Confidential
Signal descriptions
HCLK Input AHB-Lite interface and processor clock. All signals in or out of the MTB are processed on the positive, rising
edge, of this clock.
RESETn Input Active-LOW reset signal. The reset can be asserted asynchronously, but must be deasserted synchronously to
HCLK. RESETn must be asserted for at least two HCLK cycles. If trace is required during a local processor
reset, then RESETn must be connected to the SoC power-on reset signal, otherwise connect RESETn to the
HRESETn signal.
IDLE Output Indicates that there are no pending operations, therefore HCLK can be externally gated to save power.
Note
There are combinatorial paths from signals in the AHB-Lite and execution trace interfaces to the IDLE output
signal.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-3
ID011213 Non-Confidential
Signal descriptions
HADDR[31:0] Input 32-bit address used to identify the memory or device being accessed by a transaction. The value
on the bus is only valid for the following signal combinations:
• HTRANS[1], HREADY, and HSELRAM are HIGH.
• HTRANS[1], HREADY, and HSELSFR are HIGH.
HPROT[3] Input Indicates a cacheable information transaction. HPROT[3] is HIGH for a cacheable transfer and
LOW for a non-cacheable transfer.
Note
The MTB does not use HPROT[3].
HPROT[2] Input Indicates a bufferable information transaction. HPROT[2] is HIGH for a bufferable transfer and
LOW for a non-bufferable transfer.
Note
The MTB does not use HPROT[2].
HPROT[1] Input Indicates a Privilege information access. HPROT[1] is HIGH for a Privileged access and LOW
for a User access. The value on the bus is only valid for the following signal combinations:
• HTRANS[1], HREADY, and HSELRAM are HIGH.
• HTRANS[1], HREADY, and HSELSFR are HIGH.
Note
• The MTB ignores HPROT[1] if User/Privilege support is absent in its configuration.
• The MTB uses HPROT[1] only if User/Privilege support is present in its configuration. See
Configurable options on page 1-6 and the SFRWPRIV and RAMPRIV bits in the MASTER
Register on page 3-9.
HPROT[0] Input Indicates a data versus opcode operation. HPROT[0] is HIGH for data access and LOW for an
opcode fetch.
Note
The MTB does not use HPROT[0].
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-4
ID011213 Non-Confidential
Signal descriptions
HSIZE[2:0] Input Indicates the size of a transfer. b000 indicates a byte transfer, b001 indicates a halfword transfer,
and b010 indicates a word transfer. The value on the bus is only valid for the following signal
combinations:
• HTRANS[1], HREADY, and HSELRAM are HIGH.
• HTRANS[1], HREADY, and HSELSFR are HIGH.
Note
The MTB does not use HSIZE[2].
HTRANS[1:0] Input Indicates the transfer type. All transfers are issued as non-sequential transfers so there is no
guaranteed relationship to any previous transfer address. b00 indicates an IDLE cycle and b10
indicates a NONSEQUENTIAL transfer.
Note
The MTB does not use HTRANS[0].
HWDATA[31:0] Input The write data associated with the address of an AHB-Lite write cycle. The destination of the write
data is dependent on the values of HADDR[1:0]. The value on the bus is only valid during a write
transfer. The value is only accepted by the MTB when HREADYOUT is HIGH.
HWRITE Input Indicates the data transfer direction. HWRITE is HIGH for a write transfer, and LOW for a read
transfer. The value on this signal is only valid for the following signal combinations:
• HTRANS[1], HREADY, and HSELRAM are HIGH.
• HTRANS[1], HREADY, and HSELSFR are HIGH.
HSELRAM Input SRAM address space select. Indicates the transfer destination is the MTB SRAM.
HSELSFR Input Special function registers address space select. Indicates the transfer is the MTB special function
registers.
HREADY Input When HIGH, the HREADY input indicates to the MTB that the previous transfer is complete.
Note
The HREADY input value in the address-phase of a transfer to or from the MTB is equal to the
MTB HREADYOUT output value, if it is also the data-phase of MTB transfer. In other words, the
previous transfer was also to or from the MTB.
HRDATA[31:0] Output The read data associated with the address of an AHB-Lite read cycle. The destination of the read
data is dependent on the values of HADDR[1:0] and HSIZE[1:0]. The value on the bus is only
valid when HREADYOUT is HIGH and HRESP is LOW during a read transfer.
HREADYOUT Output When HIGH, the HREADYOUT signal indicates that a transfer has finished and the MTB can
accept the next transfer. This signal can be driven LOW to extend the transfer.
HRESP Output The transfer response that provides the AHB-Lite master with additional information on the status
of the transfer. When LOW, HRESP indicates the transfer status is OK. When HIGH, HRESP
indicates the transfer status is ERROR.
Note
HRESP is continuously driven LOW because the MTB does not generate any errors.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-5
ID011213 Non-Confidential
Signal descriptions
RAMRD[31:0] Input Read data associated with the SRAM memory location addressed by RAMAD.
RAMAD[AWIDTH-3:0] Output Address for the SRAM memory location accessed in a transaction.
RAMWD[31:0] Output Write data associated with the SRAM memory location addressed by RAMAD.
RAMWE[3:0] Output SRAM byte write enables. When HIGH the requested byte of the word addressed by
RAMAD is written. When LOW the requested byte of the word addressed by RAMAD is
read. The write enable bit to data byte association is:
• RAMWE[0] accesses RAMWD[7:0].
• RAMWE[1] accesses RAMWD[15:8].
• RAMWE[2] accesses RAMWD[23:16].
• RAMWE[3] accesses RAMWD[31:24].
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-6
ID011213 Non-Confidential
Signal descriptions
IAESEQ Input Indicates the next instruction address in execute, IAEX, is sequential, that is non-branching.
IAEX[30:0] Input Registered address of the instruction in the execution stage, shifted right by one bit.
EDBGRQ Output Request for the processor to enter the Debug state, if enabled, and halt.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-7
ID011213 Non-Confidential
Signal descriptions
TSTART Input Trace start. This is the external trace start input. See TSTART and TSTOP signals on page 2-8.
TSTOP Input Trace stop. This is the external trace stop input. See TSTART and TSTOP signals on page 2-8.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-8
ID011213 Non-Confidential
Signal descriptions
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-9
ID011213 Non-Confidential
Signal descriptions
ECOREVNUM[3:0] Input ECO revision number. This value can be read directly from the CoreSight Peripheral
ID3 register. See Table 3-2 on page 3-6.
SRAMBASEADDR[31:0] Input MTB SRAM base address in the processor memory map.
Note
SRAMBASEADDR[31:0] must match the base address of the memory region
indicated by HSELRAM.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. A-10
ID011213 Non-Confidential
Appendix B
Example Programming Sequences
This appendix describes some example programming sequences for the MTB. It contains the
following sections:
• Discovery on page B-2.
• Trace Enable Programming Sequence on page B-3.
• Trace Disable Programming Sequence on page B-4.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. B-1
ID011213 Non-Confidential
Example Programming Sequences
B.1 Discovery
The MTB occupies two separate regions of the processor memory map:
SFR Trace control and CoreSight registers.
SRAM Contains the trace packets, and can be used as general purpose memory.
The MTB is CoreSight compliant. You can discover its presence in a system in the following
way:
1. The system ROM Table contains an entry that points to the base address of the SFR
region.
2. The SFR region contains the CoreSight Peripheral ID registers that identify the MTB
component. See CoreSight registers on page 3-5.
3. Read the base address of the SRAM region from the SFR BASE register.
If required, you can determine the MTB SRAM size in the following way:
4. Determine the maximum SRAM size supported by the MTB implementation using the
equation:
maximum SRAM size = 2AWIDTH bytes.
An implementation might have less SRAM than this and the unimplemented locations might be
an alias of the implemented locations. In this case, you can determine the actual SRAM size in
the following way:
1. Write a different value to all locations in the MTB SRAM region. That is from location
SRAMBASEADDR to location SRAMBASEADDR + (2AWIDTH) – 4, using word size
accesses
2. Read back the memory locations and compare with the original values.
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. B-2
ID011213 Non-Confidential
Example Programming Sequences
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. B-3
ID011213 Non-Confidential
Example Programming Sequences
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. B-4
ID011213 Non-Confidential
Appendix C
Revisions
This appendix describes the technical changes between released issues of this book.
First release. - -
Updated debug authentication interface behavior table headings. Table 2-1 on page 2-5 All revisions
Updated PeripheralID 2 and 3 definitions. Table 3-2 on page 3-6 All revisions
Updated note on modifications you must make to PeripheralID, if you modify the MTB. Table 3-2 on page 3-6 All revisions
Updated POSITION.POINTER address calculation. Table 3-3 on page 3-9 All revisions
Changed how the ECO revision number is generated from ECOREVNUM[3:0]. Table A-7 on page A-10 r0p1
Changed discovery algorithm description to add improvements. Discovery on page B-2 All revisions
ARM DDI 0486B Copyright © 2012 ARM. All rights reserved. C-1
ID011213 Non-Confidential