TRACE32 Training... Training ICE Emulator... Training ICE Basics... 1

Similar documents
TRACE32 Training... Training FIRE Emulator... Training FIRE Basics... 1

TRACE32 Training...! Training ICD In-Circuit Debugger...! Training ICD Basics... 1

TRACE32 Debugger Getting Started... ICD Tutorial About the Tutorial... 2

Debugger Basics - SMP Training

Training Simulator and Demo Software

NEW CEIBO DEBUGGER. Menus and Commands

Debugger Basics - Training

General Commands Reference Guide M

Integration for CodeBlocks

FIRE Emulator for H8S and H8/300H

EPROM/FLASH Simulator

_ V Intel 8085 Family In-Circuit Emulation. Contents. Technical Notes

TRACE32 Documents... ICE In-Circuit Emulator... ICE User's Guide... 1

TRACE32 Documents... TRACE32 Instruction Set Simulators... Simulator for Z TRACE32 Simulator License Quick Start of the Simulator...

Simulator for H8/300, H8/300H and H8S

Development Tools. 8-Bit Development Tools. Development Tools. AVR Development Tools

FR Family MB Emulator System Getting Started Guide

M16C R8C PC7501 Emulator Debugger V Release Notes

Programming in the MAXQ environment

ICE Emulator for MC68000 and MC6830X

Renesas 78K/78K0R/RL78 Family In-Circuit Emulation

Simulator for HC08/MSC08

H8 C-SPY. User Guide WINDOWS WORKBENCH VERSION

8086 Interrupts and Interrupt Responses:

ICE/FIRE Analyzer Programming Dialog

This chapter introduces how to use the emulator of TOPICE quickly.

Contents. Cortex M On-Chip Emulation. Technical Notes V

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

USER MANUAL NATHANIEL THWAITES-MCGOWAN

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... NS NS32000 Monitor... 1

Changing the Embedded World TM. Module 3: Getting Started Debugging

ICE Emulator for MC6833X

PICMICRO C-SPY. User Guide

API for TRACE32 Instruction Set Simulator

ICE Emulator for 386/486

EMUL251 TM -PC Windows. User Guide. Copyright ICE Technology

EMUL-AVR-PC. User Guide

HI-WAVE. Serial Debug Interface SDI target. Copyright 1997 HIWARE HI-WAVE

TRACE32 Getting Started... ICD In-Circuit Debugger Getting Started... ICD Introduction... 1

)8-,768'HY.LW 2YHUYLHZ. )XMLWVX0LNURHOHNWURQLN*PE+ Am Siebenstein Dreieich-Buchschlag, Germany

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... MCS08... MCS08 Debugger... 1

EB-51 Low-Cost Emulator

EMULATOR SETUP MB BIT COMPACT-ICE

Chapter 7 Central Processor Unit (S08CPUV2)

_ V1.3. Motorola 68HC11 AE/AS POD rev. F. POD Hardware Reference

TRACE32 Training... Training Menu... 1

Freescale Semiconductor, Inc. Debugger. Serial Debug Interface SDI target. Copyright Metrowerks Debugger

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

ZAP Cross Debuggers for Motorola Microcontrollers

DEVELOPMENT OF A DEBUG MODULE FOR A FPGA-BASED MICROCONTROLLER. Rainer Bermbach, Martin Kupfer

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

_ V Renesas R8C In-Circuit Emulation. Contents. Technical Notes

MCUez MMDS or MMEVS for HC05/08 ezstart GUIDE

Megawin 8051 OCD ICE

DS-51 Microprocessor Development System

ECE 437 Computer Architecture and Organization Lab 6: Programming RAM and ROM Due: Thursday, November 3

API for Auxiliary Processing Unit

HandsOn Technology -- HT-MC-02 MODEL: HT-MC-02

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... TriCore... TriCore Monitor... 1

HI-WAVE. ICD Target Interface. Copyright 1998 HIWARE HI-WAVE

DOMAIN TECHNOLOGIES INC. Users Guide Version 2.0 SB-USB2. Emulator

Small Computer Monitor User Guide

Trio Motion Technology 4-2. Motion Perfect v3

Assembly Language programming (1)

CS+ for CA,CX V

DS-XA In-Circuit Emulator

HCS12 BDM Getting Started V4.3

Small Computer Monitor User Guide

Section 1 AVR Studio User Guide

IAR C-SPY Hardware Debugger Systems User Guide. for Renesas E30A/E30 Emulators

Description of the Simulator

History and Basic Processor Architecture

POD 51EH C541U 12 EA ALE PSEN XH0 XH1 XH2 XH3 XH4 XH5 XH6 XH7 XL7 XL6 XL5 XL4 XL3 XL2 XL1 XL0. Figure 1. POD 51EH C541U 12

8051 Microcontroller

EE 390 Lab Manual, EE Department, KFUPM. Experiment #7. Introduction to Flight86 Microprocessor Trainer and Application Board

Sophisticated Debugging Features for Motorola s HCS12 Family are available on Nohau s Full-Featured Emulator By: Doron Fael Nohau

ECE3120: Computer Systems Hardware & Software Development Tools

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

PCI-4IPM Revision C. Second Generation Intelligent IP Carrier for PCI Systems Up to Four IndustryPack Modules Dual Ported SRAM, Bus Master DMA

8051 Microcontrollers

CEIBO FE-51RD2 Development System

Application Note for the SNOOPer Trace

An Introduction to Komodo

EMUL296 -PC. User Guide

Fredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт.

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING. Principles of Computer Operation

ICE Performance Analyzer User s Guide

Lecture V Toy Hardware and Operating System

ARM Application Note for MXC Chips

COMMAND REFERENCE MANUAL

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING

TEMIC 51T (Temic) EMULATION

DoCD IP Core. DCD on Chip Debug System v. 6.02

Hello, and welcome to this presentation of the STM32L4 System Configuration Controller.

TMS320VC5503/5507/5509/5510 DSP Direct Memory Access (DMA) Controller Reference Guide

EUROScope lite 16FX Reference Manual

April 4, 2001: Debugging Your C24x DSP Design Using Code Composer Studio Real-Time Monitor

Transcription:

Training ICE Basics TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Training... Training ICE Emulator... Training ICE Basics... 1 System Architecture TRACE32-ICE... 4 Module Structure 4 SCU32 - System Controller Unit 5 ECU32 - Emulation Controller Unit 6 HA120 - High Speed State Analyzer 7 ICE Base 7 CPU Pod 7 Block Diagram of TRACE32 Hardware 8 TRACE32 Software 9 Setup the TRACE32 Software... 10 The Properties Window (Windows only) 10 The Configuration File 12 Starting-up the Emulator... 17 System Settings 17 Select the System Mode 18 Dual-Port Access 20 Mapper 21 Mapper Configuration 22 Memory Attributes 26 Examples 27 Download the Program 28 Initialize the Registers 28 Start-Up File 29 TRACE32 GUI... 32 Main Menu Bar and Accelerators 33 Main Tool Bar 34 Window Area 35 Command Line 38 Command Structure 38 Command Examples 39 The Online Help for a specific Command 40 Training ICE Basics 1

Standard Parameter Syntax 41 Message Line 42 Softkeys 43 State Line 44 Registers... 45 Display the CPU Registers 45 Colored Display of changed Registers 46 Modify the Contents of a CPU Register 47 Display the Special Function Registers 48 Tree Display 48 Full Display 49 Details about a Single SFR 50 The PER Definition File 51 Modify a Special Function Register 52 Data and Program Memory... 54 Dualport Access 54 Display a Hex Dump 56 Data Dump Dialog Box 60 Dump Window 62 Indirect Dump 65 Modify Memory 66 Display a Source Listing 67 Changing Code Lines 69 Breakpoints... 70 Implementation 70 Synchronous/Asynchronous Breakpoints 72 Program Breakpoint (Synchronous) 72 HLL Breakpoints (Synchronous) 73 Read Breakpoint (Asynchronous) 74 Write Breakpoint (Asynchronous) 76 Spot Breakpoints (Synchronous/Asynchronous) 77 Permanent/Temporary Breakpoints 79 Breakpoint Handling 80 Set Breakpoints 80 Set any breakpoint using the Break.Set Dialog Box 82 Single Address HLL-Range HLL Expression Display Breakpoints 85 Delete Breakpoints 86 Deletes all Breakpoints except the hll Breakpoints Store Breakpoint Settings 87 Training ICE Basics 2

Breakpoint Control... 89 Emulator Main Trigger Unit 89 Trigger Sources 90 Trigger Modes 93 Spot System 93 Debugging... 94 Basic Debug Control 94 Flag Memory... 97 Display Flag Information 98 Code Coverage 99 Checking Variables 100 Unused Variables 100 Uninitialized Variables 101 Stack Depth Analysis 103 Document your Results... 104 Print your Results 104 Save your Results to a File 106 Training ICE Basics 3

Training ICE Basics Version 06-Nov-2017 System Architecture TRACE32-ICE TRACE32 product idea: Modularity Allows to configure TRACE32-ICE to fit your project requirements (host interface, size of the emulation memory, adaptation etc.) Universality Most of the system is universal for all CPUs supported by TRACE32-ICE moving to another CPU or an other architecture requires only a few changes in the hardware configuration Module Structure ICE-Base (ICE xxx) High Speed State Analyzer (HA120) CPU independent modules Static Emulation Memory (SRAM) Emulation Controller Unit (ECU32) Pod System Controller Unit (SCU32) Training ICE Basics 4

SCU32 - System Controller Unit Processing Unit The SCU32 contains a 32-bit CPU that runs the TRACE32-ICE system software. All operations are performed in the emulator. The debug information is also downloaded to the emulator and is maintained there. SCU memory The SCU has its own memory. Default size is 64 MByte and the memory can be upgraded up to 128 MByte. SETUP.MEMory Total memory Free memory Connection to host SYNC Connector USB Interface LPT Interface Twisted Pair Interface AUI Connector ERROR LEDs Download Times Parallel Interface (LPT) USB Ethernet Interface for 10 BaseT ethernet (Twisted Pair Interface, AUI Connector) 100-500 KByte/s up to 900 KByte/s up to 900 KByte/s The download time also includes the time to build up the internal symbol data base. Power Supply Training ICE Basics 5

ECU32 - Emulation Controller Unit The Emulation Controller Unit contains all parts of an emulator which are not CPU specific: Mapper Emulator Trigger Unit Universal Counter VCO etc. The Emulation Controller can also contain the Emulation Memory Card (SDIL). Probe connectors: ECU32 BANK EXTERNAL STROBE PODBUS Probe Connectors BANK Input Input for external banking. If your target is using specific ports or addresses for bank selection, these signals have to be fed back into the emulator especially for the use of breakpoints and tracing. EXTERNAL Input The EXTERNAL probe allows you to combine asynchronous or synchronous events and to synchronize these events with the trigger units of TRACE32-ICE. The EXTERNAL input can be configured by the TrIn command. STROBE Output The STROBE outputs provides information on the internal state of TRACE32-ICE and on the occurrence of trigger events. PODBUS Connector to add additional devices to TRACE32-ICE like Stimuli Generator, BDM Debugger etc. Training ICE Basics 6

HA120 - High Speed State Analyzer The HA120 consists of 3 parts: 1. Trace Memory Up to 376 CPU lines can be recorded on each CPU cycle smallest cycle time is 50ns trace depth is 32k frames each entry to the trace buffer is marked by a timestamp with a resolution of 25 ns 2. Programmable Trigger Unit Trigger programs can be used to do selective tracing or to generate an event depending on the current state of the system 3. Performance Analyzer For performance analysis based on programs, functions or modules. The resolution of the performance analyzer is 1 s. Probe connectors: HA120 TRIGGER A TRIGGER B TRACEBUS OUT Probe Connectors TRIGGER A/ TRIGGER B Input 16 external trigger inputs TRACEBUS Not used OUT Output Trigger outputs (C and D) ICE Base The ICE-Base usually supports a complete CPU family. It includes all parts of the emulator, that are specific for the supported CPU family Exception handler Dual-port controller etc. CPU Pod Training ICE Basics 7

Block Diagram of TRACE32 Hardware dual port logic CPU emulation ram M A P address data T A R G E T flag ram break ram M A P M A P R/W MAP internal/external TRIGGER system trigger signals TRACE memory extension address data strobes events... Training ICE Basics 8

TRACE32 Software Display: - User programs: ASM and HLL mode, different program languages - Data: different formats, structures - Register: CPU register, periphery register (bits and sense) Program control: - Step and Go: MIX and HLL mode - Break: program (synchronous) and data (asynchronous) break Analyzer: - Program flow - Selectiv trace Performance Analyzer: - Performance analysis - Statistic information using analyzer memory and trigger unit Code Coverage using flag ram - Controling of read and write access: HLL lines, variables and data areas Training ICE Basics 9

Setup the TRACE32 Software The Properties Window (Windows only) The properties window of your application allows some basic setting for the ICE. Training ICE Basics 10

1. Definition of a user specific configuration file. The configuration file defines how the TRACE32 software works together with the other components of the host system. By default the configuration file config.t32 in the system directory is used. The option -c allows you to define your own location and name for the configuration file. Example: C:\T32_ICE68020\t32win.exe -cg:\and\config_usb.t32 REM former C:\T32_ICE68020\t32w95.exe -cg:\and\config_usb.t32 Definition of a start-up script. It is also possible to define a.cmm script, that should automatically be executed when the TRACE32 software is started. Example: C:\T32_ICE68020\t32win.exe -cg:\and\config_usb.t32, G:\and\start.cmm REM former C:\T32_ICE68020\t32w95.exe -cg:\and\config_usb.t32, G:\and\start.cmm 2. Definition of a working directory. It is recommended not to work in the system directory. 3. Definition of the start-up size of the application program. 1 2 3 Training ICE Basics 11

The Configuration File The configuration file config.t32 is automatically generated by the installation software and stored to the system directory. The configuration file defines which hardware drivers are loaded and how they are configured. OS= SYS=c:\t32 TMP=c:\tmp LINK=USB PRINTER=WINDOWS ; system directory ; tmp directory ; printer configuration Drivers are defined block wise in the config file The first line/headline defines the driver type Each definition ends with an empty line If no driver is defined, the default driver will be loaded Required Hardware Drivers Host Interface Environment Printer LINK= OS= ID=<id> TMP=<temp directory> SYS=<system directory> PRINTER= Training ICE Basics 12

Configuration File for Parallel Interface Configuration file for standard mode: ; Host interface LINK=PAR LPT1 ; Environment variables OS= ID=T32 TMP=C:\temp SYS=d:\t32\par ; Printer settings PRINTER=WINDOWS ; or optional LPT2/LPT3 ; temp directory for TRACE32 ; system directory for TRACE32 ; all standard windows printer can be ; used from the TRACE32 user interface Configuration file for ECP mode: ; Host interface LINK=PAR LPT1 ECP ; Environment variables OS= ID=T32 TMP=C:\temp SYS=d:\t32\par ; Printer settings PRINTER=WINDOWS ; 2-5 times faster then standard mode ; temp directory for TRACE32 ; system directory for TRACE32 ; all standard windows printer can be ; used from the TRACE32 user interface Training ICE Basics 13

Configuration File for USB Standard configuration file: ; Host interface LINK=USB ; Environment variables OS= ID=T32 TMP=C:\temp SYS=d:\t32\usb ; Printer settings PRINTER=WINDOWS ; temp directory for TRACE32 ; system directory for TRACE32 ; all standard windows printer can be ; used from the TRACE32 user ; interface Training ICE Basics 14

Configuration File for PODETH Standard configuration file: ; Host interface LINK=NET NODE=t32 PACKLEN=1024 ; Environment variables OS= ID=T32 TMP=C:\temp SYS=d:\t32\eth ; Printer settings PRINTER=WINDOWS ; temp directory for TRACE32 ; system directory for TRACE32 ; all standard windows printer can be ; used from the TRACE32 user ; interface Training ICE Basics 15

Additional Hardware Drivers Display SCREEN= FONT=SMALL HEADER=<name> ; Use smaller fonts ; Define header text for window Training ICE Basics 16

Starting-up the Emulator Starting up the emulator is done in the following steps: 1. Set the system settings and activate the emulator 2. Configure the mapper 3. Download the program 4. (Set PC and SP) System Settings Reset the emulator Clock select System is Down (emulator in reset) or Up (emulator is active). Triggers the CPU reset command, which initializes the peripherals (not available on all CPUs) Display the type and the max. frequency of the emulation CPU Training ICE Basics 17

Select the System Mode StandBy Emulator is in StandBy mode and waits for target power and clock. As soon as the target power and clock is available, the EmulExt mode is activated. This is useful, if there are several CPUs on the target, which should be started synchronously. Not available on all CPUs. AloneInt Emulator is working in stand-alone mode. The internal (emulator) clock is used and all lines to the target are blocked. AloneExt EmulInt EmulExt The emulator is working in stand-alone mode. The external (target) clock is used and all lines to the target are blocked. The emulator works with access to the target system and uses the internal (emulator) clock. The emulator works with access to the target system and uses the external (target) clock. Training ICE Basics 18

If the internal clock is used (AloneInt and EmulInt mode) you can select the clock here. VCO Clock is set using the VCO. The frequency range for the VCO is 2 70MHz Up and Down in 50 khz steps Low Mid High 2.5 MHz 5MHz 10 MHz The external clock can be checked by using: Training ICE Basics 19

Dual-Port Access Via the Emulator Controller Unit the memories within the ICE can be read or written to while the CPU is executing the program. This means for the user: Emulator Controller Unit access C Debug Monitor synchronous breakpoints Break Memory Flag Memory access E CPU/ MCU Target Emulation Memory Dual-port Controller Mapper Read and write access to the emulation memory Trigger programming Read access to the flag memory is supported while the program execution is running. There is no effect on the realtime behavior or the effect is very small. Timeout for the dualport access and for the access to the target memory TimeOut TimeRequest Timeout for access to the target memory. When an access to the target memory is not terminated within this time, the emulator will terminate the bus cycle. Timeout error message is then displayed in the emulator state line. Timeout for the dualport access. After the specified time the attempt to do a dualport access will be aborted and an error message will be displayed. Training ICE Basics 20

Mapper The mapper is used to simulate the target memory configuration within the emulator and to set memory attributes. The emulator has 3 different memories: Emulation memory Emulation memory has to be allocated and assigned. Flag memory Flag memory has to be allocated. Break memory Break memory is automatically allocated, when a breakpoint is set. The memories can be mapped independently. MAP.state State of mapper Training ICE Basics 21

Mapper Configuration The configuration of the mapper is done in 3 steps: 1. Select the mapper mode 2. Define the memory organization 3. Activate the memory Select the Mapper Mode The emulator supports 2 mapper modes: Map.Mode Slow Map.Mode Fast For some CPUs the CPU can not reach high frequencies in this mode. But memory mapping is done in 4 KByte blocks. The CPU can work up to a higher speed, but memory mapping is done in 512 KByte blocks. For information which mapper mode you should use, please refer in the ICE Target Guide to the section Emulation Frequency. For some CPUs the dualport access has also influence on the max. cpu speed. Mapper Mode SLOW: A23 A10 M A P P E R R A M A0 Training ICE Basics 22

Mapper Mode FAST: A23 A19 M A P P E R R A M A0 Define the Memory Organization During this step the emulator gets information on how the target memory is organized. If the target is using different memory areas, use the command MAP.SPlit. 0ffff 0 Program memory Data memory If the target contains address mirrors, use the command MAP.MIrror. Training ICE Basics 23

If you are using a 32-bit CPU use MAP.PRE to define the workbenches. A31 P R E M A P 4 P E A23 R A19 M A P P E R R A M A0 The basic mapper of TRACE32 uses an address area of 16 MByte. The CPU however supplies 32 address lines, which means an address range up to 4 GByte. TRACE32 solves this problem by a 2-stage mapping system. The first system, named premapper, allows to define 16 different 1 MByte areas named workbenches. Within this areas it is possible to set breakpoints on a byte by byte level. Outside this area breakpoints may only be set on ranges limited by 1 MByte. All settings done within the first 2 steps are locked and can only be changed after MAP.RESet. Training ICE Basics 24

Activate the Memory By default (no mapping is done) the emulator always sees the target memory. During this step the memories are allocated and you have to define, for which memory range the emulator should use emulation/overlay memory. Commands for Memory Allocation: MAP.Data [<range>] MAP.Break [<range>] MAP.Flag [<range>] MAP.Ram [<range>] MAP.NoBreak [<range>] Map data memory Map break memory Map flag memory Map RAM Release break memory Training ICE Basics 25

After the memory allocation you have to decide where you want to use emulation memory and where you want to use target memory. MAP.Intern [<range>] MAP.Extern [<range>] Internal memory External memory If emulation memory is mapped, the emulation memory will be located parallel to the target memory. Emulation CPU Emulation Memory Target Memory Memory Write Cycles Emulation CPU At memory read cycles the mapper decides which data are used by the CPU Emulation Memory Target Memory Memory Read Cycles MAP.DEFault [<range>] [/<option>] Standard memory mapping Memory Attributes MAP.Wait <waitcycles> [<range>] MAP.Protect [<range>] MAP.BUS8 [<range>] Processor Specific Memory Attributes [<range>] Wait cycles Write protection Bus width mapping Bus width mapping The protect attribute is used to simulate a ROM using the emulation memory. The protection is only active, when the realtime emulation is running (write cycles are ignored). Training ICE Basics 26

Examples Example for 80386 map.reset map.mode fast map.pre c:0000000--00fffff map.pre c:3f00000--3ffffff map.ram ap:0000000--00fffff map.intern ap:0000000--00fffff ; reset mapper (all external) ; use fast mode ; premapper: use low 1MB ; use top 1MB ; use overlay/emulation memory ; for the low 1MB Example for 80535 map.reset map.split p:0--0ffff map.ram p:0--0ffff map.intern p:0--0ffff ; reset mapper (all external) ; separate the 64K code area ; use overlay/emulation memory for ; the code area Training ICE Basics 27

Download the Program Data.LOAD <filename> </option> Load file Compiler-specific load command can be found in the ICE Target Guide. Menu: Help ICE Target Guide, section Compilers. Initialize the Registers Register.Set <register> <value> Data.Set [<address> <range>] %<format> /<option> Modify register contents Modify memory Training ICE Basics 28

Start-Up File It is recommended to write a batch job to setup the emulator to guarantee an proper start-up sequence. Default extension for a batch job is.cmm. Example for 68HC12: SYStem.RESet SYStem.CPU M68HC12BC SYStem.CPU SpSingle SYStem.Option v33 on SYStem.Option A16 OFF SYStem.Option CSP0 OFF SYStem.Access DUMMY map.reset map.mode fast map.ram 0x08000--0x0FFFF map.intern 0x08000--0x0FFFF MAP.OPFetch 0x0C000--0x0FFFF vco.clock 16. system.mode emulint ; reset system settings ; define the used CPU ; selects bus operation mode ; 3.3 V target ; off: A16 is used as general I/O pin ; on: A16 is used as address line ; off: Chip select program 0 is used as ; general I/O pin ; on: Chip select program 0 is used ; as address line ; the emulator uses dummy cycles for ; hidden access ; reset mapper ; use fast mode ; emulation RAM ; memory accesses in the range from ; 08000--0ffff are done to internal ; emulation RAM ; define the area 0C000--0FFFF as code ; area -> the area from 0--0BFFF is ; treated as data area ; frequency: set to 16 MHz ; (necessary if internal clock used) ; system up: emulation external ; (target, ext. clock) ; or: system.mode aloneint ; (stand alone, int. clock) Training ICE Basics 29

Data.Set d:0x038 0x0F Data.Set d:0x03c 0x030 Data.Set d:0x037 0x0C0 Data.Load.COSMIC file.cos12 /verify ; specify which lines of Port G are used ; as general purpose I/O and which are ; used as address lines by writing MXAR ; activate used chip selects by writing ; CSCTL registers ; activate used windows by writing ; WINDEF registers ; load application file and verify if it ; is written correct to memory ENDDO A first example for a start up batch job can be found in the ICE Target Guide. Menu: Help ICE Target Guide, section Quick Start. Training ICE Basics 30

Run the Start-up File DO <filename> [<parlist>] Start PRACTICE program Training ICE Basics 31

TRACE32 GUI Main Menu Bar + Accelerators Main Tool Bar Local Buttons Local Popup Menu The structure and functionality of the GUI is defined by the file t32.men in the TRACE32 system directory. TRACE32 allows you to modify the GUI so it will better fit to your requirements. Training ICE Basics 32

Main Menu Bar and Accelerators The main menu bar provides all important TRACE32 functions sorted by groups. For often used commands accelerators are defined. Accelerators A user specific menu can be defined very easily: MENU.AddMenu <name> <command> MENU.RESet Add a user menu Reset menu to default Menu.AddMenu "Set PC to main" "Register.Set pc main" Menu.AddMenu "Set PC to main, ALT+F10" "Register.Set pc main" ; User menu with accelerator User Menu For more complex changes to the main menu bar refer to the training section: Menu Programming Training ICE Basics 33

Main Tool Bar The main tool bar provides fast access to often used commands. The user can add his own buttons very easily: MENU.AddTool <tooltip text> <tool image> <command> MENU.RESet Add a button to the toolbar Reset menu to default MENU.AddTool "Set PC to main" "PM,X" "Register.Set PC main" User specific button Information on the <tool image> can be found in Help -> TRACE32 Documents -> IDE User Interface -> -> IDE Reference Guide -> MENU -> Programming Commands -> TOOLITEM. For more complex changes to the main tool bar refer to the training section: Menu Programming Training ICE Basics 34

Window Area Save Page Layout No information about the page layout is saved when you exit TRACE32. To save the window layout use the Store Window to command in the Window menu. Store Windows to generates a batchfile, that allows you to reactivate the current page- and window-configuration at any time. Batchfile for page- and window-configuration: ; And Mon Jan 19 13:06:32 1998 B:: TOOLBAR ON STATUSBAR ON WINPAGE.RESET WINPAGE.CREATE P000 WINCLEAR WINPOS 0.0 0.0 91. 8. 13. 1. W000 B::d.l WINPOS 0.0 12.5 43. 8. 5. 0. W001 B::v.f /l /c WINPOS 47.5 12.5 43. 8. 0. 0. W002 B::v.l %m %r %t WINPAGE.CREATE P001 WINCLEAR WINPOS 16.0 13.3125 77. 18. 10. 2. W005 B::A.T d.0--7 WINPOS 0.0 0.0 77. 18. 8. 1. W004 B::T.L WINPAGE.SELECT P000 ENDDO Training ICE Basics 35

Training ICE Basics 36 Run the batchfile to reactivate the stored page- and window-configuration

Modify Window The Window Header displays the command which was executed to open the window By clicking with the right mouse button to the window header, the command which was executed to open the window is re-displayed in the command line and can be modified there Training ICE Basics 37

Command Line Command line Command Structure Device Prompt Selects the command set used by the TRAC32: no device prompt E:: B:: F:: TRACE32-IDE command set for TRACE32-ICE command set for TRACE32-ICD (Debugger) command set for TRACE32-FIRE (RISC Emulator) Training ICE Basics 38

Command Examples Data Data.dump Data.List Data.LOAD Command group to display, modify memory Displays a hex dump Displays a source listing Loads code to the target memory Break Break.Set Break.List Break.Delete Command group to set, list, delete breakpoints Sets a breakpoint Lists all set breakpoint Deletes a breakpoint Each command can be abbreviated. The significant letters are always written in upper case letters. Data.dump 0x1000--0x2000 /Byte Option Subcommand Command group Parameter Training ICE Basics 39

The Online Help for a specific Command Enter the command to the command line. Add one blank. Push F1 to get the on-line help for the specified command. Training ICE Basics 40

Standard Parameter Syntax RADIX.<mode> Define parameter syntax The RADIX defines the input format for numeric values. RADIX.Decimal RADIX.Hex Number base is decimal and C-like operators are used Number base is hex and C-like operators are used (default) Examples: Decimal Hex Data.dump 100 100d 100h Data.dump 100. 100d 100d Data.dump 0x100 100h 100h To see the currently used parameter syntax, enter RADIX. to the command line. Training ICE Basics 41

Message Line Message Area Message Line Message line for system and error messages Message Area window for the display of the last system and error messages Training ICE Basics 42

Softkeys The softkey line allows to enter a specific command step by step. Select the command group Select the subcommand Angle brackets request an entry from the user. Here e.g. the entry of an <address> or a <range>. Get a display of all options Select an option Training ICE Basics 43

State Line Symbolic and absolute address at the blue cursor State of the system Debug mode Training ICE Basics 44

Registers Display the CPU Registers Training ICE Basics 45

Colored Display of changed Registers Register.view /SpotLight The registers changed by the last step are marked in dark red. The registers changed by the step before the last step are marked a little bit lighter. This works up to a level of 4. If SpotLight is ON, the SpotLight feature is automatically on for: 1.) all Variable windows 2.) the Register window this includes also register bits 3.) the Peripheral window 4.) the hll stack frame 5.) all Data.dump windows The SpotLight feature will be only valid for windows, which will be opend after activating this feature. Register.view [/<option>] SETUP.Var %SpotLight Display CPU registers Switch the option SpotLight on for all Variable windows, the Register window, the Peripheral window, the HLL Stack Frame window and all Data.dump windows Training ICE Basics 46

Modify the Contents of a CPU Register By double clicking to the register contents a Register.Set command is automatically displayed in the command line. Enter the new value and press Return to modify the register contents. Register.Set <register> <value> Modify CPU register Training ICE Basics 47

Display the Special Function Registers TRACE32 supports a free configurable window to display/manipulate configuration registers and the on-chip peripheral registers at a logical level. Predefined peripheral windows are available for most standard CPUs. Tree Display The individual configuration registers/on-chip peripherals are organized by TRACE32 in a tree structure. On demand, details about a selected register can be displayed. Training ICE Basics 48

Full Display Sometimes it might be useful to expand the tree structure from the start. Use the right mouse and select Show all PER.View, "Clocks and Power Control" PER.View, "*" ; Display the functional unit ; "Clocks and Power Control" in ; expanded mode ; Display all functional units in ; expanded mode The following command sequence can be used to save the contents of all configuration registers/on-chip peripheral registers to a file. PRinTer.FileType ASCIIE PRinTer.FILE Per.lst WinPrint.Per.view, "*" ; Select ASCII ENHANCED as output ; format ; Define Per.lst as output file ; Save contents of all ; configuration registers/on-chip ; periperal registers to the ; specified file Training ICE Basics 49

Details about a Single SFR The address, bit position and the full name of the selected item are displayed in the state line; the full name of the selected item is taken from the CPU manual. Training ICE Basics 50

The PER Definition File The layout of the PER window is described by a PER definition file. The definition can be changed to fit to your requirements using the PER command group. The path and the version of the actual PER definition file can be displayed by using: VERSION.SOFTWARE PER.view <filename> [<tree-search-item>] Display the configuration registers/on-chip peripherals PER.view C:\T32\perarm9t.per Use the peripheral file perarm9t.per instead of the default PER definition file Training ICE Basics 51

Modify a Special Function Register You can modify the contents of a configuration/on-chip peripheral register: By pressing the right mouse button and selecting one of the predefined values from the pulldown menu. By a double-click to a numeric value. A PER.Set command to change the contents of the selected register is displayed in the command line. Enter the new value and confirm it with return. PER.Set.simple <address> <range> [<%format>] <string> Data.Set <address> <range> [<%format>] <string> Modify configuration register/onchip peripheral Modify memory PER.Set.simple D:0xF87FFF10 %Long 0x00000b02 Training ICE Basics 52

Training ICE Basics 53

Data and Program Memory Depending on the setting of the mapper target memory or emulation memory is displayed and can be modified. Dualport Access The default memory access is done by the Emulation CPU. Depending on the mapper settings target memory or emulation/overlay memory is accessed. Using the default access it is not possible to display or modify memory by the TRACE32 user interface while the Emulation CPU is executing the application program. Emulation Controller Unit Debug Monitor Emulation Memory Emulation CPU Target Dualport Controller Internal/External Mapping Using the Dualport access, the memory access is done via the Emulation Controller Unit. Using this memory access it is possible to display and modify the emulation/overlay memory while the system in running in real-time. Emulation Controller Unit Debug Monitor Emulation Memory Emulation CPU Target Dualport Controller Internal/External Mapping Training ICE Basics 54

Training ICE Basics 55

Display a Hex Dump Address Training ICE Basics 56

Address Range If you enter an address range, only the specified address range will be displayed. This is useful if a memory area close to an I/O area should be displayed and you do not want the development tool to generate read cycles for the I/O area. Conventions for address ranges: <start address>--<end address> <start address>..<end address> <start address>++<offset_in_byte> Training ICE Basics 57

Symbol or Label Use i to select any symbol name or label from the internal symbol data base. By default an oriented display is used (line break at 2 x ). A small arrow indicates, where the selected dump area starts. Training ICE Basics 58

HLL Expression If HLL is ON and the entered variable is a pointer the address range where the pointer is pointing to is displayed Training ICE Basics 59

Data Dump Dialog Box Display Width Default is the data bus width of the CPU Run-time Update default: the Dump window is only updated, when the program execution is stopped Other Options Other options Track: (see section Indirect dump) Training ICE Basics 60

Oriented: By default an oriented display is used (line break at 2 x ). If Orient is OFF, the Dump window starts at the given address. Oriented display No oriented display Ascii: By default ASCII characters are displayed together with the hex. memory contents. Spotlight: The option Spotlight can be used to highlight the memory locations that changed while single stepping. The memory location changed by the last step is marked in dark red. The memory location changed by the step before the last step is marked a little bit lighter. This works up to a level of 4. Training ICE Basics 61

Dump Window Find With the Find button a Find in Memory Dialog Box is opened, that allows to search a specific data in a specified memory range. Training ICE Basics 62

Modify With the Modify Button a Modify Memory Dialog Box is opened, that provides a number of operations to modify or test memory. Operation Fill Pattern Test Copy Compare Sum Fill the specified memory range with the user defined data (see also Data.Set command). Fill the specified memory range with a predefined pattern (see also Data.PATTERN command). Test the specified memory range (see also Data.Test command). Copy data from one memory range to another (see also Data.COPY command). Compare the specified memory ranges (see also Data.ComPare command). Build the checksum over the specified memory range (see also Data.SUM command). Training ICE Basics 63

Display Width Check Boxes Switch ON/OFF the run-time memory access Switch ON/OFF the track option Switch the hex display ON/OFF Switch the ASCII display ON/OFF Training ICE Basics 64

Indirect Dump Indirect dump indexed by register R1 With the track option the address indexed by the current contents of register R1/SP is always displayed in the middle of the window and is highlighted Data.dump [<address> <range>] [/<option> ] Data.View %<format> [<address> <range>] [/<option>] Display a memory dump Display a detailed dump Training ICE Basics 65

Modify Memory By double clicking to a data field a Data.Set command is automatically displayed in the command line, you can enter the new value and confirm it with return. Data.Set [<address> <range>] %<format> /<option> Modify memory Training ICE Basics 66

Display a Source Listing Displays Source listing around the PC If the debug mode Mixed is active a mixed source listing is displayed. If the HLL mode is active only the hll lines are displayed. Training ICE Basics 67

Displays Source listing of the selected Function Select the function you want to display Data.List [<address>] [/<option>] Data.ListAsm [<address>] [/<option>] Data.ListHll [<address>] [/<option>] Data.ListMix [<address>] [/<option>] Display source listing Display source listing in assembler Display source listing in hll Display source listing in assembler and hll Training ICE Basics 68

Changing Code Lines TRACE32 provides its own assembler. Use Assemble here to enter new assembler code Use Modify here to modify the current assembler code Data.Assemble [<address>] <mnemonic> Assemble code line Training ICE Basics 69

Breakpoints Implementation TRACE32-ICE has a memory based breakpoint system. 1 byte of break memory can be assigned to each address. That means 8 different breakpoints can be set for each address. C B A W R S H P Program breakpoint HLL breakpoint Spot breakpoint Read breakpoint Write breakpoint Alpha breakpoint Beta breakpoint Charly breakpoint Training ICE Basics 70

8 different breakpoints can be set for each address The break memory can be activated independent from the other TRACE32-ICE memories. It is not necessary to explicitly map break memory. Break memory is automatically mapped, when a breakpoint is set. There is always the same amount of emulation memory and break memory available on the system. Training ICE Basics 71

Synchronous/Asynchronous Breakpoints Program Breakpoint (Synchronous) If a synchronous breakpoint is set for an instruction, the realtime emulation stops before the marked instruction is executed. PC Set program breakpoint by double clicking with the left mouse button to the instruction The realtime emulation is stopped before the instruction marked by a program breakpoint is executed Training ICE Basics 72

HLL Breakpoints (Synchronous) High level language debugging is implemented by Hll breakpoints. All hll lines are marked with an Hll breakpoint, when debug information is loaded with the file. Mode is used to toggle between MIXed and HLL debugging mode If you switch to HLL mode, debugging is done on hll level. Training ICE Basics 73

Read Breakpoint (Asynchronous) Read breakpoints are used to break on read access to variables/data. Select a variable and press the right mouse button to set a Read Breakpoint The reason why the system stops is displayed in the message line Training ICE Basics 74

A Read breakpoint is an asynchronous breakpoint, because the realtime emulation is stopped shortly after the address is read. A T marks the trigger event in the trace buffer Training ICE Basics 75

Write Breakpoint (Asynchronous) Write breakpoints are used to break on write access to variables/data. Select a variable and press the right mouse button to set a Write Breakpoint The reason why the system stops is displayed in the message line A Write breakpoint is an asynchronous breakpoint, because the realtime emulation is stopped shortly after the write access to the address. A T marks the trigger event in the trace buffer Training ICE Basics 76

Spot Breakpoints (Synchronous/Asynchronous) Spot breakpoints are synchronous in the program range. They are used as watchpoints. So whenever the program reaches a spot breakpoint, the realtime emulation is interrupted shortly to update the information displayed on the screen. This will usually take 100 500 s. The information on the screen is updated, whenever the program reaches the Spot Breakpoint An red S in the state line indicates that there is a spot point and the system is no longer running in realtime Training ICE Basics 77

Spot breakpoints are asynchronous in the data range. The information on the screen is updated, whenever the program reaches the Spot Breakpoint (access to data address) Training ICE Basics 78

Permanent/Temporary Breakpoints Permanent Breakpoints Permanent breakpoints remain set until they are deleted (default). Temporary Breakpoints Temporary Breakpoints remain set until the realtime emulation is stopped the next time. Start emulation Breakpoints are no longer set when the realtime emulation stops Training ICE Basics 79

Breakpoint Handling Set Breakpoints Set a program breakpoint to a selected line Double clicking to a code line toggles the Program breakpoint Set any breakpoint to a selected line (pull-down menu) Press the right mouse button to set a breakpoint on a selected line Training ICE Basics 80

Set any breakpoint to a selected line Click here to set a breakpoint Training ICE Basics 81

Set any breakpoint using the Break.Set Dialog Box Single Address HLL-Range Training ICE Basics 82

HLL Expression Break.Set <address> <range> [/<breakpoint_type>] Sets permanent breakpoint on assembler level Break.Set 1788 /Program Break.Set flags /Write Break.Set 1788--17ff /Beta Var.Break.Set <hll-expression> [/<breakpoint_type>] Sets permanent breakpoint on HLL level Var.Break.Set flags /Write Var.Break.Set ast->left /Read Var.Break.Set sieve /Program Break<address> <range> [/<breakpoint_type>] Sets temporary breakpoint on assembler level Break sieve Var.Break <address> <range> [/<breakpoint_type>] Sets temporary breakpoint on HLL level Training ICE Basics 83

Var.Break flags[4] /read Training ICE Basics 84

Display Breakpoints Break.List [<address> <range>] [/<breakpoint_type>] Display breakpoints Training ICE Basics 85

Delete Breakpoints Push the right mouse button to delete all breakpoints in the selected line Deletes all Breakpoints except the hll Breakpoints Break.Delete [<address> <range>] [/<breakpoint_type>] Var.Break.Delete <hll-expression> [/<breakpoint_type>] Delete breakpoints Delete breakpoint on variable Be careful when using Break.Delete /ALL. This will also delete the HLL breakpoints. So HLL-debugging will no longer be possible. Training ICE Basics 86

Store Breakpoint Settings STOre <filename> Break BreakANH BreakAll Store a setting Store b1 break ; Store the default breakpoint (P, R, W) E:: MAP.NOBREAK BREAK.RESET MODE.MIX BREAK.ENABLE FORE OFF BREAK.ENABLE BACK ON BREAK.ENABLE PROGRAM ON BREAK.SET C:17A6 /PROGRAM BREAK.SET C:2540--0002553 /PROGRAM BREAK.SET C:2540--0002553 /READ BREAK.SET C:2540--0002553 /WRITE BREAK.SET C:2774--0002786 /WRITE ENDDO The STOre command generates a batchfile, that allows you to reactivate the current breakpoint settings at any time. Run the batchfile to reactivate the stored breakpoint settings Training ICE Basics 87

STOre <filename> Symbolic Break BreakANH BreakAll Store a setting Example (store breakpoint settings on hll level): E:: MAP.NOBREAK BREAK.RESET MODE.MIX BREAK.ENABLE FORE OFF BREAK.ENABLE BACK ON BREAK.ENABLE PROGRAM ON BREAK.SET (\\mcc\mcc\sieve+1e) /PROGRAM BREAK.SET (\\mcc\global\ast)--(\\mcc\global\ast+13) /PROGRAM BREAK.SET (\\mcc\global\ast)--(\\mcc\global\ast+13) /READ BREAK.SET (\\mcc\global\ast)--(\\mcc\global\ast+13) /WRITE BREAK.SET (\\mcc\global\flags)--(\\mcc\global\flags+12) /WRITE ENDDO Training ICE Basics 88

Breakpoint Control Break Point System C B A W R S H P Emulator Controller Unit Emulator Main Trigger Unit Spot System Emulator Main Trigger Unit Training ICE Basics 89

Trigger Sources The Emulator Main Trigger Unit accepts only trigger events, that are enabled in the Emulator Main Trigger Window. Trigger Sources Breakpoints Alpha, Beta, Charly breakpoints If you want to use an Alpha, Beta, Charly breakpoint, they have to be enabled here ReadData (Default Setting is enabled) Data Read Signal Read Breakpoint & Opfetch cycles to an address are ignored. WriteData (Default Setting is enabled) Data Write Signal Write Breakpoint & Training ICE Basics 90

Exception Allows an exception to break the realtime emulation Select an exception in the Trigger Field Enable exception Training ICE Basics 91

TimeOut Defines TimeOut for external bus accesses Enables TimeOut AnalyzerA Read Before Write Allows the trigger unit of the analyzer to activate a trigger event. Allows the accesses to uninitialized variables as a trigger event. Training ICE Basics 92

Trigger Modes Trigger Modes Trigger Events Emulator Trigger Unit Break realtime emulation (Emulator) Emulator Controller Unit Stop analyzer (Trace) Trace/Analyzer Freeze emulation memory (Memory) Emulation Memory Spot System SPot.state State display Training ICE Basics 93

Debugging Basic Debug Control There are local buttons in the Data.List window for all basic debug commands Step Single stepping e.g. Step 10. Over Next The Call is executed in real time but for the user it seems to be only one step over the call. Next sets a temporary breakpoint to the next assembler or hll line and starts then the program execution. This command is useful to overstep a subroutine call or to leave a loop. Program Counter With Next a temporary breakpoint is set to the next written code line, here e.g. to leave the loop Training ICE Basics 94

Return Return sets a temporary breakpoint to the last instruction of a function and then starts the program execution. After pressing Return the program execution is stopped at the last instruction of the function Up This command is used to return to the function that called the current function. For this a temporary breakpoint is set at the instruction directly after the function call. Press Up to return to the function that called the current function Display the hll stack to see the function nesting Training ICE Basics 95

Step <count> Step.Over Step.Change <expression> Step.Till <boolean _expression> Var.Step.Change <hll_expression> Var.Step.Till <boolean _hll_expression> Single step Step over call Step until <expression> changes Step until <boolean _expression> becomes true Step until <hll_expression> changes Step until <boolean _hll_expression> becomes true Go [<address> <label>] Go.Next Go.Return Go.Up [<level> <address>] Start program execution Run program until the next code line is reached Run program until the end of the hll function is reached Run program until it returns to the caller function Training ICE Basics 96

Flag Memory TRACE32-ICE has a third memory, called Flag Memory that can be used for software analysis. It is a 2 bit memory. Flag memory has always to be allocated (MAP.Flag). When there is a read or opfetch to an address, the ReadFlag is set. If there is a write access to an address, the Write Flags is set. A read bit is set for all fetched instructions Read Flag and Write Flags are set corresponding to the access to a variable/data The Flag memory can be used for: Code coverage Checking variables Stack depth analysis The Flag system can not decide, if a prefetched instruction is executed or not. Short skips are not detected as not executed code. Prefetches at the end of a functions sets some flag bits in the next function The analyzer base code coverage can do this without problems. Training ICE Basics 97

Display Flag Information FLAG.List <address> <range> [/<option>] Display flags FLAG.List /Read /NoWrite Training ICE Basics 98

Code Coverage Double click to the function to get detailed information Fetched code lines are bold printed on a colored background FLAG.ListFunc <address> <range> [/<option>] Code-coverage functions Training ICE Basics 99

Checking Variables Double click to the variable to get detailed information Address which were read are bold printed on a colored background Unused Variables Variables which are never read are unused variables. Training ICE Basics 100

Uninitialized Variables Variables which are read before there initialization value is written to them, are uninitialized variables. 1. Set up the Emulator Main Trigger Unit to stop the program on a ReadBeforeWrite access. The Emulator Main Trigger Unit allows to trigger on ReadBeforeWrite to an address 2. Pre-set write flags to the program area and to the initialized data area of your application. Usually the section information is provided by the compiler. symbol.list.section [<address>] Display physical sections Training ICE Basics 101

If the section information is provided by the compiler, use the Flag.SetSec to preset write flags to the code area and initialized data area, to prevent RBW triggering on these areas. FLAG.SetSec Mark sections If now an access to an not-initialized variable happens, the realtime emulation will be stopped. Training ICE Basics 102

Stack Depth Analysis Set up an indirect dump to the stack pointer, where all addresses marked with a write flag are bold printed on colored background Data.dump Register(SP) /Flag Write /Track /DIALOG Memory dump of stack Training ICE Basics 103

Document your Results Print your Results Requires a printer configuration in the file config.t32. E.g. for Windows PRINTER=WINDOWS For other host platform refer to the host platform specific section of the Installation Guide. Print a Hardcopy of the TRACE32 Application Window Training ICE Basics 104

Print the Contents of a Specific Window Select the Print item in the window manager menu to print the window contents. Print any Result To print more complex results e.g over several pages: WinPrint.<command> Pre-command for complex outputs WinPrint.Data.dump 0x1000--0x1fff WinPrint.Trace.List (-1000.)--(-500.) Training ICE Basics 105

Save your Results to a File Select the Output Format for the File Switch the File radio button to ON PRinTer.FileType <format> Select file format Training ICE Basics 106

Open the File for Printing Print 1 output to 1 file WinPrint.Data.dump 0x1000++0xfff Training ICE Basics 107

Print n outputs to n files If the file name includes a number, this number is automatically incremented after each output. WinPrint.Data.dump 0x1000++0xfff Go Break WinPrint.Data.dump 0x1000++0xfff The number within the file name is automatically incremented Training ICE Basics 108

Print n outputs to 1 file PRinTer.OPEN [<filename>] PRinTer.CLOSE Open permanent output file for results Close permanent output file for results PRinTer.OPEN outpd WinPrint.Data.dump 0x1000++0xfff Go Break WinPrint.Data.dump 0x1000++0xfff PRinTer.CLOSE Training ICE Basics 109

Reset Output to Printer Switch the Printer radio button to ON Training ICE Basics 110