Fujitsu SOFTUNE F2 MC-16 User Manual

Software for developing programs for the f2 mc-16 family of microprocessors / microcontrollers
Hide thumbs Also See for SOFTUNE F2 MC-16:
Table of Contents
FUJITSU SEMICONDUCTOR
CM41-00313-6E
CONTROLLER MANUAL
2
F
MC-16 FAMILY
TM
SOFTUNE
Workbench
USER'S MANUAL
Table of Contents
loading

Summary of Contents for Fujitsu SOFTUNE F2 MC-16

  • Page 1 FUJITSU SEMICONDUCTOR CM41-00313-6E CONTROLLER MANUAL MC-16 FAMILY SOFTUNE Workbench USER'S MANUAL...
  • Page 3 MC-16 FAMILY SOFTUNE Workbench USER'S MANUAL FUJITSU SEMICONDUCTOR LIMITED...
  • Page 5 Other company names and products names are trademarks or registered trademarks of their respective companies. ■ Trademarks REALOS, SOFTUNE are trademark of Fujitsu Semiconductor Limited, Japan. Note: F MC is the abbreviation of FUJITSU Flexible Microcontroller. Microsoft, Windows and Windows Media are either registered trademarks of Microsoft Corporation in the United States and/or other countries.
  • Page 6 Any information in this document, including descriptions of function and schematic diagrams, shall not be construed as license of the use or exercise of any intellectual property right, such as patent right or copyright, or any other right of FUJITSU SEMICONDUCTOR or any third party or does FUJITSU SEMICONDUCTOR warrant non-infringement of any third-party's intellectual property right or other right by using such information.
  • Page 7 READING THIS MANUAL ■ Configuration of Page In each section of this manual, the summary about the section is described certainly, so you can grasp an outline of this manual if only you read these summaries. And the title of upper section is described in lower section, so you can grasp the position where you are reading now.
  • Page 9: Table Of Contents

    CONTENTS CHAPTER 1 BASIC FUNCTIONS ... 1 Workspace Management Function ... 2 Project Management Function ... 3 Project Dependence ... 5 Make/Build Function ... 6 1.4.1 Customize Build Function ... 7 Include Dependencies Analysis Function ... 9 Functions of Setting Tool Options ... 10 Error Jump Function ...
  • Page 10 2.1.11.3 Searching Trace Data ... 55 2.1.11.4 Saving Trace Data ... 56 2.1.12 Measuring Coverage ... 57 2.1.12.1 Coverage Measurement Procedures ... 58 2.1.13 Checking Debugger Information ... 61 Emulator Debugger (MB2141) ... 63 2.2.1 Setting Operating Environment ... 64 2.2.1.1 MCU Operation Mode ...
  • Page 11 2.2.10.1 Coverage Measurement Procedures ... 127 2.2.11 Execution Time Measurement ... 131 2.2.12 Sampling by External Probe ... 133 2.2.13 Checking Debugger Information ... 135 Emulator Debugger (MB2147-01) ... 137 2.3.1 Setting Operating Environment ... 138 2.3.1.1 Monitoring Program Automatic Loading ... 139 2.3.1.2 MCU Operation Mode ...
  • Page 12 2.4.1 Setting Operating Environment ... 203 2.4.1.1 Monitoring Program Automatic Loading ... 204 2.4.1.2 MCU Operation Mode ... 205 2.4.1.3 Debug Area ... 206 2.4.1.4 Memory Area Types ... 207 2.4.1.5 Memory Mapping ... 209 2.4.2 Notes on Commands for Executing Program ... 211 2.4.3 Commands Available during Execution of User Program ...
  • Page 13 2.5.7 Measuring Performance ... 266 2.5.7.1 Performance Measurement Procedures ... 267 2.5.7.2 Display Performance Measurement Data ... 268 2.5.8 Execution Time Measurement ... 269 2.5.9 Power-On Debugging ... 271 Emulator Debugger (MB2100-01) ... 272 2.6.1 Starting debugging ... 273 2.6.1.1 Operating Environments of the Target ...
  • Page 15: Chapter 1 Basic Functions

    CHAPTER 1 BASIC FUNCTIONS This chapter describes the basic functions on the SOFTUNE Workbench. 1.1 Workspace Management Function 1.2 Project Management Function 1.3 Project Dependence 1.4 Make/Build Function 1.5 Include Dependencies Analysis Function 1.6 Functions of Setting Tool Options 1.7 Error Jump Function 1.8 Editor Functions 1.9 Storing External Editors 1.10 Storing External Tools...
  • Page 16: Workspace Management Function

    CHAPTER 1 BASIC FUNCTIONS Workspace Management Function This section explains the workspace management function of SOFTUNE Workbench. ■ Workspace SOFTUNE Workbench uses workspace as a container to manage two or more projects including subprojects. For example, a project that creates a library and a project that creates a target file using the project can be stored in one workspace.
  • Page 17: Project Management Function

    Project Management Function This section explains the project management function of SOFTUNE Workbench. ■ Project Management Function The project manages all information necessary for development of a microcontroller system. Especially, its major purpose is to manage information necessary for creation of a target file. The project manages the following information: - Project configuration - Active project configuration...
  • Page 18: Active Project Configuration

    CHAPTER 1 BASIC FUNCTIONS level of a compiler and MCU setting, can be created within one project. In the project configuration, the following information is managed: - Name and directory of target file - Information on options of language tools to create target file by compiling, assembling and linking source files - Information on whether to build file or not - Information on setting of debugger to debug target file...
  • Page 19: Project Dependence

    Project Dependence This section explains the project dependence of SOFTUNE Workbench. ■ Project Dependence If target files output by other projects must be linked, a subproject is defined in the project required in [Project] - [Project Dependence] menu. The subproject is a project on which other projects depend. By defining project dependence, a subproject can be made and built to link its target file before making and building the parent project.
  • Page 20: Make/Build Function

    CHAPTER 1 BASIC FUNCTIONS Make/Build Function This section explains the make/build function of SOFTUNE Workbench. ■ Make Function Make function generates a target file by compiling/assembling only updated source files from all source files registered in a project, and then joining all required object files. This function allows compiling/assembling only the minimum of required files.
  • Page 21: Customize Build Function

    1.4.1 Customize Build Function This section describes the SOFTUNE Workbench to set the Customize Build function. ■ Customize Build function In SOFTUNE Workbench, different tools can be operated automatically before and after executing the Assembler, Compiler, Linker, Librarian, Converter, or Configurator started at Compile, Assemble, Make, or Build.
  • Page 22 CHAPTER 1 BASIC FUNCTIONS Note: When checking [Use the Output window], note the following: • Once a tool is activated, Make/Build is suspended until the tool is terminated. • The Output window must not be used with a tool using a wait state for user input while the tool is executing.
  • Page 23: Include Dependencies Analysis Function

    Include Dependencies Analysis Function This section describes the function of the Include Dependencies Analysis of SOFTUNE Workbench. ■ Analyzing Include Dependencies A source file usually includes some include files. When only an include file has been modified leaving a source file unchanged, SOFTUNE Workbench cannot execute the Make function unless it has accurate and updated information about which source file includes which include files.
  • Page 24: Functions Of Setting Tool Options

    CHAPTER 1 BASIC FUNCTIONS Functions of Setting Tool Options This section describes the functions to set options for the language tools activated from SOFTUNE Workbench. ■ Function of Setting Tool Options To create a desired target file, it is necessary to specify options for the language tools such as a compiler, assembler, and linker.
  • Page 25: Error Jump Function

    An error message format can be added to an existing one or modified into an new one. However, the modify error message formats for pre-installed Fujitsu language tools are defined as part of the system, these can not be modified.
  • Page 26 CHAPTER 1 BASIC FUNCTIONS [Example] %f(%l) The first four characters are "*** ", followed by the file name and parenthesized page number, and then the keyword for help continues after one blank character. This represents the following message: ***C :\Sample\sample.c(100) ■...
  • Page 27: Editor Functions

    Editor Functions This section describes the functions of the SOFTUNE Workbench built-in standard editor. ■ Standard Editor SOFTUNE Workbench has a built-in editor called the standard editor. The standard editor is activated as the Edit window in SOFTUNE Workbench. As many Edit windows as are required can be opened at one time. The standard editor has the following functions in addition to regular editing functions.
  • Page 28: Storing External Editors

    CHAPTER 1 BASIC FUNCTIONS Storing External Editors This section describes the function to set an external editor to SOFTUNE Workbench. ■ External Editor SOFTUNE Workbench has a built-in standard editor, and use of this standard editor is recommended. However, another accustomed editor can be used, with setting it, instead of an edit window. There is no particular limit on which editor can be set, but some precautions (below) may be necessary.
  • Page 29: Example Of Optional Settings

    Table 1.9-1 List of Special Characters for Analyzing Error Message Parameter ■ Example of Optional Settings Table 1.9-2 Example of Optional Settings Editor name WZ Editor V4.0 MIFES V1.0 UltraEdit32 TextPad32 PowerEDITOR Codewright32 Hidemaru for Win3.1/95 ViVi ■ Reference Section Editor Setup Note: Regarding execution of error jump in Hidemaru:...
  • Page 30: Storing External Tools

    CHAPTER 1 BASIC FUNCTIONS 1.10 Storing External Tools This section describes the function to set an external tool to SOFTUNE Workbench. ■ External Tools A non-standard tool not attached to SOFTUNE Workbench can be used by setting it as an external tool and by calling it from SOFTUNE Workbench.
  • Page 31: Macro Descriptions Usable In Manager

    1.11 Macro Descriptions Usable in Manager This section explains the macro descriptions that can be used in the manager of SOFTUNE Workbench. ■ Macros SOFTUNE Workbench has special parameters indicating that any file name and tool-specific options are specified as options. The use of these parameters as tool options eliminates the need for options specified each time each tool is started.
  • Page 32 CHAPTER 1 BASIC FUNCTIONS Table 1.11-1 List of Macros That Can Be Specified 1 Parameter Table 1.11-2 List of Macros That Can Be Specified 2 Parameter %(FILE) %(LOADMODULEFILE) %(PRJFILE) %(WSPFILE) %(PRJPATH) %(ABSPATH) %(OBJPATH) %(LSTPATH) %(PRJCONFIG) %(ENV [Environment variable]) %(TEMPFILE) The macros in (*1) are determined as follows: - Customize build 1.
  • Page 33: Examples Of Macro Expansion

    - Tool options • Null character - Others 1. File as focus is on the SRC tab of project window and valid file name is selected 2. File on which focus is in internal editor as no valid file name can be obtained in 1 3.
  • Page 34 CHAPTER 1 BASIC FUNCTIONS [Example] Macro expansion in external tools Focus is on Subprj project file in the SRC tab of project window. %(FILE[FOLDER]) %(PRJFILE) Focus is not in the SRC tab of project window. %(PRJFILE) [Example] Macro expansion in customize build Release configuration of Subprj project is built.
  • Page 35: Setting Operating Environment

    1.12 Setting Operating Environment This section describes the functions for setting the SOFTUNE Workbench operating environment. ■ Operating Environment Set the environment variables for SOFTUNE Workbench and some basic setting for the Project. To set the operating environment, use the [Setup]-[Setup Development Environment] menu. ●...
  • Page 36: Debugger Types

    CHAPTER 1 BASIC FUNCTIONS 1.13 Debugger Types This section describes the types of SOFTUNE Workbench debuggers. ■ Type of Debugger SOFTUNE Workbench integrates three types of debugger: a simulator debugger, emulator debugger, and monitor debugger. Any one can be selected depending on the requirement. ■...
  • Page 37: Memory Operation Functions

    1.14 Memory Operation Functions This section describes the memory operation functions. ■ Functions for Memory Operations - Display/Modify memory data Memory data can be display in the Memory window and modified. - Fill The specified memory area can be filled with the specified data. - Copy The data in the specified memory area can be copied to another area.
  • Page 38: Register Operations

    CHAPTER 1 BASIC FUNCTIONS 1.15 Register Operations This section describes the register operations. ■ Register Operations The Register window is opened when the [View] - [Register] menu is executed. The register and flag values can be displayed in the Register window. For further details about modifying the register value and the flag value, refer to "4.4.4 Register"...
  • Page 39: Line Assembly And Disassembly

    1.16 Line Assembly and Disassembly This section describes line assembly and disassembly. ■ Line Assembly To perform line-by-line assembly (line assembly), right-click anywhere in the Disassembly window to display the short-cut menu, and select [Line Assembly]. For further details about assembly operation, refer to "4.4.3 Assembly"...
  • Page 40: Symbolic Debugging

    CHAPTER 1 BASIC FUNCTIONS 1.17 Symbolic Debugging The symbols defined in a source program can be used for command parameters (address). There are three types of symbols as follows: • Global Symbol • Static Symbol within Module (Local Symbol within Module) •...
  • Page 41: Line Number Information

    CHAPTER 1 BASIC FUNCTIONS ■ Line Number Information Line number information is set with the line number information table in SOFTUNE Workbench when a debug information file is loaded. Once registered, such information can be used at anytime thereafter. Line number is defined as follows: [Source File Name] $Line Number...
  • Page 42: Referring To Local Symbols

    CHAPTER 1 BASIC FUNCTIONS 1.17.1 Referring to Local Symbols This section describes referring to local symbols and Scope. ■ Scope When a local symbol is referred to, Scope is used to indicate the module and function to which the local symbol to be referred belongs.
  • Page 43: Referring To Variable Of C Language

    1.17.2 Referring to Variable of C Language C language variables can be specified using the same descriptions as in the source program written in C language. ■ Specifying C Language Variables C language variables can be specified using the same descriptions as in the source program. The address of C language variables should be preceded by the ampersand symbol "&".
  • Page 44: Notes On C Language Symbols

    CHAPTER 1 BASIC FUNCTIONS ■ Notes on C Language Symbols The C compiler outputs symbol information with "_" prefixed to global symbols. For example, the symbol main outputs symbol information _main. However, SOFTUNE Workbench permits access using the symbol name described in the source to make the debug of program described by C language easier. Consequently, a symbol name described in C language and a symbol name described in assembler, which should both be unique, may be identical.
  • Page 45: Chapter 2 Dependence Functions

    CHAPTER 2 DEPENDENCE FUNCTIONS This chapter describes the functions dependent on each Debugger. 2.1 Simulator Debugger 2.2 Emulator Debugger (MB2141) 2.3 Emulator Debugger (MB2147-01) 2.4 Emulator Debugger (MB2147-05) 2.5 Emulator Debugger (MB2198) 2.6 Emulator Debugger (MB2100-01) 2.7 Monitor Debugger...
  • Page 46: Simulator Debugger

    CHAPTER 2 DEPENDENCE FUNCTIONS Simulator Debugger This section describes the functions of the simulator debugger for the F ■ Simulator Debugger The simulator debugger simulates the MCU operations (executing instructions, memory space, I/O ports, interrupts, reset, etc.) with software to evaluate a program. It is used to evaluate an uncompleted system, the operation of single units, etc.
  • Page 47: Simulation Range

    ■ Simulation Range The simulator debugger simulates the MCU operations (instruction operations, memory space, I/O ports, interrupts, reset, power-save consumption mode, etc.) Peripheral I/Os, such as a timer, DMAC and serial I/O, other than the CPU core of the actual chip are not supported as peripheral resources. I/O space to which peripheral I/Os are connected is treated as memory space.
  • Page 48: Setting Operating Environment

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the simulator debugger for F predefined default settings are enabled at startup. Therefore, setup is not required when using the default settings.
  • Page 49: Boot Rom File Automatic Execution

    2.1.1.1 Boot ROM File Automatic Execution The simulator debugger for F file at the start of debugging. ■ Boot ROM File Automatic Execution When the simulator debugger for F then executed at the start of debugging. The Boot ROM file is stored in Lib\907\BootROM under the directory where Workbench is installed.
  • Page 50: Instruction Simulation

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.2 Instruction Simulation This section describes the instruction simulation executed by SOFTUNE Workbench. ■ Instruction Simulation This simulates the operations of all instructions supported by the F simulates the changes in memory and register values due to such instructions. MC-16/16L/16LX/16H/16F.
  • Page 51: Memory Simulation

    2.1.3 Memory Simulation This section describes the memory simulation executed by SOFTUNE Workbench. ■ Memory Simulation The simulator debugger must first secure memory space to simulate instructions because it simulates the memory space secured in the host PC memory. The following operation is required. - To secure the memory area, either use the [Setup] - [Memory Map] menu, or the SET MAP command in the Command window.
  • Page 52: I/O Port Simulation

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.4 I/O Port Simulation This section describes I/O port simulation executed by SOFTUNE Workbench. ■ I/O Port Simulation (Input Port) There are two types of simulations in I/O port simulation: input port simulation, and output port simulation. Input port simulation has the following types: - Whenever a program reads the specified port, data is input from the pre-defined data input source.
  • Page 53: Interrupt Simulation

    2.1.5 Interrupt Simulation This section describes the interrupt simulation executed by SOFTUNE Workbench. ■ Interrupt Simulation Simulate the operation of the MCU (including intelligent I/O service Note that intelligent I/O service does not support any end request from the resource. Provisions for the causes of interrupts and interrupt control registers are made by referencing data in the install file read at simulator start up.
  • Page 54: Reset Simulation

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.6 Reset Simulation This section describes the reset simulation executed by SOFTUNE Workbench. ■ Reset Simulation The simulator debugger simulates the operation when a reset signal is input to the MCU using the [Debug]- [Reset MCU] menu and initializes the registers. The function for performing reset processing by operation of MCU instructions (writing to RST bit in standby control register) is also supported.
  • Page 55: Low-Power Consumption Mode Simulation

    2.1.7 Low-Power Consumption Mode Simulation This section describes the low-power consumption SOFTUNE Workbench mode simulation executed by SOFTUNE Workbench. ■ Low-Power Consumption Mode Simulation The MCU enters the low-power consumption mode in accordance with the MCU instruction operation (Write to SLEEP bit or STOP bit of standby control register). Once in the sleep mode or stop mode, a message ("sleep"...
  • Page 56: Stub Function

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.8 STUB Function This section describes the STUB function which executes commands automatically when the breakpoint hit occurs. ■ STUB Function The STUB function is supported so that a series of commands in the command list can automatically be executed when a specified breakpoint is hit.
  • Page 57: Break

    2.1.9 Break In the simulator debugger, five types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this simulator debugger, the following five types of break functions are supported. •...
  • Page 58: Code Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.1 Code Break It is a function that the simulator debugger aborts the program execution when the code access specified while executing the program is done. ■ Flow of Code Break When the program reaches the breakpoint (Immediately before an instruction memory positional is executed), the simulator debugger does the following processing.
  • Page 59 ● Dangerous BreakPoints • Never set a breakpoint at an address other than the instruction starting address. • If a breakpoint is the last 1 byte of an instruction longer than 2 bytes length, and if such an address is even, the following abnormal operation will result: - If instruction executed by STEP command, instruction execution not aborted.
  • Page 60: Data Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.2 Data Break It is a function that the simulator debugger aborts the program execution when the data access (read and write) specified while executing the program is done. ■ Flow of Data Break The simulator debugger does the following processing when the program writes in the breakpoint or it reads 1) After the execution of the instruction is completed, the execution of the program is aborted.
  • Page 61: Trace-Buffer-Full Break

    2.1.9.3 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■...
  • Page 62: Guarded Access Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.4 Guarded Access Break It is a function to abort the program execution when the violation to the access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed. ■ Guarded Access Break It is a function to abort the program execution when the violation to the access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed.
  • Page 63: Forced Break

    2.1.9.5 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request CHAPTER 2 DEPENDENCE FUNCTIONS...
  • Page 64: Measuring Execution Cycle Count

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.10 Measuring Execution Cycle Count This function measures the program execution cycle count. ■ Measurement Items Measures program execution cycle count and step counts. ● Execution Cycle Count This is calculated based on the basic cycle count of each instruction described in the Programming Manual. A compensation value (a, b), which is described in the list of an instruction in Programming Manual, is calculated as 1.
  • Page 65 ■ Clearing Measurement Results Either of the following methods can be used to clear the measurement results. ● Operation by dialog Click the [Clear] button in the time measurement dialog, which can be displayed by selecting [Debug] – [Time Measurement] menu. For details, refer to Section "4.6.8 Time Measurement"...
  • Page 66: Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11 Trace The address and status information can be sampled during program execution to record it in a trace buffer. This function is called a trace. ■ Trace The address and status information can be sampled during program execution to record it in a trace buffer. This function is called a trace.
  • Page 67: Setting Trace

    2.1.11.1 Setting Trace You must set the following two items to perform a trace. After that, trace data will be sampled with the execution of the program. ■ Setting Trace 1. Enable the trace function. This program will startup and will be enabled. •...
  • Page 68: Displaying Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11.2 Displaying Trace Data Data recorded in the trace buffer can be displayed. ■ Displaying Trace Data The trace window or command window displays how much trace data is stored in the trace buffer. • Trace window Select [Refresh] in the trace window shortcut menu.
  • Page 69: Searching Trace Data

    2.1.11.3 Searching Trace Data The trace buffer can be searched to locate target data. ■ Searching Trace Data The trace buffer has 1000 frames, so the target data may not be found immediately. Therefore the trace data can be searched from data in the trace buffer by specifying an address. ■...
  • Page 70: Saving Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11.4 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command.
  • Page 71: Measuring Coverage

    2.1.12 Measuring Coverage In the high-speed version simulator debugger, the C0 coverage measurement function is provided. Use this function to find what percentage of an entire program has been executed. ■ Coverage Measurement Function When testing a program, the program is executed with various test data input and the results are checked for correctness.
  • Page 72: Coverage Measurement Procedures

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.12.1 Coverage Measurement Procedures The procedure for coverage measurement is as follows: • Set range for coverage measurement:SET COVERAGE • Measure coverage:GO, STEP, CALL • Display measurement result:SHOW COVERAGE ■ Setting Range for Coverage Measurement Use the SET COVERAGE command to set the measurement range. Up to 32 ranges can be specified. By specifying /AUTOMATIC for the command qualifier, the code area for the loaded module is set automatically.
  • Page 73 ● Summary (Specify /GENERAL for command qualifier) >SHOW COVERAGE/GENERAL (HEX)0X0 +---------------+---------------+------ address 0123456789ABCDEF0123456789ABCDEF0123456 FF0000 **3*F*... Display the access status of every 16 addresses : No access 1 to F : Display the number accessed in 16 addresses by the hexadecimal number. : Access all of the 16 addresses.
  • Page 74 CHAPTER 2 DEPENDENCE FUNCTIONS ● Displays per source line (specify /SOURCE for the command qualifier) >SHOW COVERAGE/SOURCE main Displays execution status of each source line. ● Displays per machine instruction (specify /INSTRUCTION for the command qualifier) >SHOW COVERAGE/INSTRUCTION F9028F sample.c$70 { * F9028F * F9028F 0822 * F90291 4F01...
  • Page 75: Checking Debugger Information

    F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED, COPYRIGHT(C) FUJITSU SEMICONDUCTOR LIMITED 1997 LICENCED MATERIAL - PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version =======================================================...
  • Page 76 CHAPTER 2 DEPENDENCE FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - Language Tools - F2MC-16 Family SOFTUNE C Compiler version File Path: fcc907s.exe path - F2MC-16 Family SOFTUNE Assembler version File Path: fasm907s.exe path...
  • Page 77: Emulator Debugger (Mb2141)

    Emulator Debugger (MB2141) This section explains the functions of the emulator debuggers for the MB2141. ■ Emulator Debugger When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2141 has been selected. MB2141 MB2147-01 MB2147-05...
  • Page 78: Setting Operating Environment

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2141, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings.
  • Page 79: Mcu Operation Mode

    2.2.1.1 MCU Operation Mode There are two MCU operation modes as follows: • Debugging Mode • Native Mode ■ Setting MCU Operation Mode Set the MCU operation mode. There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET RUNMODE command.
  • Page 80: Mcu Operation Speed

    CHAPTER 2 DEPENDENCE FUNCTIONS ■ MCU Operation Speed To support a broader range of MCU operation speeds, the emulator adjusts control of the MCU according to the MCU operation speed. Normally, set the low-speed operation mode. If the F malfunctions occur, change the setting to the high-speed operation mode. Also, to start at low speed and then change to high speed because of the gear setting, etc., use the SET RUNMODE command to change the setting.
  • Page 81: Debug Area

    2.2.1.2 Debug Area Set the intensive debugging area out of the whole memory space. The area functions are enhanced. ■ Setting Debug Area There are two debug areas: DEBUG1, and DEBUG2. A continuous 512KB area (8 banks) is set for each area.
  • Page 82: Memory Area Types

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1.3 Memory Area Types A unit in which memory is allocated is called an area. There are seven different area types. ■ Memory Area Types A unit to allocate memory is allocated is called an area. There are seven different area types as follows: - User Memory Area Memory space in the user system is called the user memory area and this memory is called the user memory.
  • Page 83 Note: When the F MC-16/16H is used, mirror area setup can be performed only in the debugging mode. - Internal ROM Area The area where the emulator internal memory is substituted for internal ROM is called the internal ROM area, and this memory is called the internal ROM memory. Only one internal ROM area with a size up to 128 KB can be specified.
  • Page 84 CHAPTER 2 DEPENDENCE FUNCTIONS Note: The F MC-16/16H only allows this setup in the debugging mode.
  • Page 85: Memory Mapping

    2.2.1.4 Memory Mapping Memory space can be allocated to the user memory, the emulation memory, etc., and the attributes of these areas can be specified. However, the MCU internal resources are not dependent on this mapping setup and access is always made to the internal resources. ■...
  • Page 86 CHAPTER 2 DEPENDENCE FUNCTIONS [Example] >SHOW MAP address 000000 .. FFFFFF The rest of setting area numbers user = 8 >SET MAP/USER H'0..H'1FF >SET MAP/READ/CODE/EMULATION H'FF0000..H'FFFFFF >SET MAP/USER H'8000..H'8FFF >SET MAP/MIRROR/COPY H'8000..H'8FFF >SET MAP/GUARD >SHOW MAP address 000000 .. 0001FF 000200 ..
  • Page 87: Timer Minimum Measurement Unit

    2.2.1.5 Timer Minimum Measurement Unit The timer minimum measurement unit affects the sequencer, the emulation timer and the performance measurement timer. ■ Setting Timer Minimum Measurement Unit Choose either 1 μs or 100 ns as the timer minimum measurement unit for the emulator for measuring time. The minimum measurement unit for the following timers is changed depending on this setup.
  • Page 88: Notes On Commands For Executing Program

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, it is required to be careful in setting these breakpoints.
  • Page 89 - Abnormal Breakpoint Setting a breakpoint at the instruction immediately after string instructions listed below, may cause a break in the middle of the string instruction without executing the instruction to the end. MC-16L/16LX/16/16H MC-16F ■ Notes on STEP Command - Exceptional Step Execution When executing the instructions listed in the notes on the GO command as invalid breakpoints and abnormal breakpoints, such instructions and the next instruction are executed as a single instruction.
  • Page 90: Commands Available During Execution Of User Program

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■...
  • Page 91: On-The-Fly Memory Access

    2.2.4 On-the-fly Memory Access While on-the-fly, the area mapped to the emulation memory is Read/Write enabled, but the area mapped to the user memory area is Read-only enabled. ■ Read/Write Memory while On-the-fly The user memory cannot be accessed while on-the-fly (when execute the MCU). However, the emulation memory can be accessed.
  • Page 92 CHAPTER 2 DEPENDENCE FUNCTIONS The following commands access memory. - Memory operation commands SET MEMORY, SHOW MEMORY, EXAMINE, ENTER, COMPARE, FILL, MOVE, SEARCH MEMORY, DUMP, COPY, VERIFY - Data load/save commands LOAD, SAVE Figure 2.2-1 Access to Mirror Area while MCU Suspended Executing command operation...
  • Page 93: Break

    2.2.5 Break In this emulator debugger, seven types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this emulator debugger, the following seven types of break functions are supported. •...
  • Page 94: Code Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.1 Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed. ■ Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed.
  • Page 95 ● Abnormal Breakpoint • Setting a breakpoint at the instruction immediately after string instructions listed below, may cause a break in the middle of the string instruction without executing the instruction to the end. MC-16/16L/16LX/16H: • MOVS MC-16F: Here are some additional points about the effects on other commands. ●...
  • Page 96: Data Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.2 Data Break The data break is a function to abort the program execution when the data access (read or write) is done to the address specified while executing the program. ■ Data Break The data break is a function to abort the program execution when MCU accesses data as for a specified address.
  • Page 97: Sequential Break

    2.2.5.3 Sequential Break A sequential break is a function to abort a executing program, when the sequential condition is met by event sequential control. ■ Sequential Break It is a function to discontinue the program execution when the sequential condition consists by the sequential control of the event.
  • Page 98: Guarded Access Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.4 Guarded Access Break The guarded access break is an abortion of the program execution that happens when the violation to the set access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed. ■...
  • Page 99: Trace-Buffer-Full Break

    2.2.5.5 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■...
  • Page 100: Performance-Buffer-Full Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.6 Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. ■ Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
  • Page 101: Forced Break

    2.2.5.7 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
  • Page 102: Events

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6 Events The emulator can monitor the MCU bus operation, and generate a trigger at a specified condition called an event. In this emulator, event triggers are used in order to determine which function event triggers are used accounting to event modes for the following functions; •...
  • Page 103: Event Modes

    [Example] >SET EVENT >SET EVENT/WRITE 2,data[2],!d=h'10 >SET EVENT/MODIFY 3,102 An event can be set in the Event window as well. ■ Event Modes There are three event modes as listed below. To determine which function event triggers are used for, select one using the SET MODE command.
  • Page 104: Operation In Normal Mode

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6.1 Operation in Normal Mode As shown in the figure below, the event trigger set in the normal mode performs input to the sequencer. In the sequencer, either branching to any level, or terminating the sequencer, can be specified as an operation at event trigger occurrence. This enables debugging (breaks, limiting trace, measuring time) while monitoring program flow.
  • Page 105: Event-Related Commands In Normal Mode

    ■ Event-related Commands in Normal Mode Since the real-time trace function in the normal mode is actually the single trace function, the commands can be used to control. Table 2.2-6 shows the event-related commands that can be used in the normal mode. Table 2.2-6 Event-related Commands in Normal Mode Mode Normal Mode...
  • Page 106: Operation In Multi Trace Mode

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6.2 Operation in Multi Trace Mode When the multi trace mode is selected as the event mode, the real-time trace function becomes the multi trace function, and events are used as triggers for multitracing. ■ Operation in Multi Trace Mode Multitracing is a trace function that samples data before and after an event trigger occurrence.
  • Page 107: Event-Related Commands In Multi Trace Mode

    ■ Event-related Commands in Multi Trace Mode Table 2.2-7 shows the event-related commands that can be used in the multi-race mode. Table 2.2-7 Event-related Commands in Multi Trace Mode Mode Multi Trace Mode CHAPTER 2 DEPENDENCE FUNCTIONS Usable Command SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT...
  • Page 108: Operation In Performance Mode

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6.3 Operation in Performance Mode Event triggers set in the performance mode are used to measure performance. The time duration between two event occurrences can be measured and the event occurrences can be counted. ■ Operation in Performance Mode The event triggers that are set in the performance mode are used to measure performance.
  • Page 109: Event-Related Commands In Performance Mode

    ■ Event-related Commands in Performance Mode Table 2.2-8 shows the event-related commands that can be used in the performance mode. Table 2.2-8 Event-related Commands in Performance Mode Mode Performance Mode Usable Command SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT DISABLE EVENT SET PERFORMANCE SHOW PERFORMANCE...
  • Page 110: Control By Sequencer

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7 Control by Sequencer This emulator has a sequencer to control events. By using this sequencer, sampling of breaks, time measurement and tracing can be controlled while monitoring program flow (sequence). A break caused by this function is called a sequential break. To use this function, set the event mode to normal mode using the SET MODE command.
  • Page 111: Setting Sequencer

    2.2.7.1 Setting Sequencer The sequencer operates in the following order: (1) The sequencer starts from level 1 simultaneously with the start of program executing. (2) Depending on the setting at each level, branching to the required level is performed when the condition is met. (3) When sequencer termination is specified, the sequencer terminates when the condition is met.
  • Page 112 CHAPTER 2 DEPENDENCE FUNCTIONS [Setup Examples] - Terminate sequencer when event 1 occurs. >SET SEQUENCE/EVENT 1,1,J=0 - Terminate sequencer when event 2 occurs 16 times. >SET SEQUENCE/EVENT 1,2,16,J=0 - Terminate sequencer when event 2 occurs after event 1 occurred. However, do not terminate sequencer if event 3 occurs between event 1 and event 2.
  • Page 113: Break By Sequencer

    2.2.7.2 Break by Sequencer A program can suspend program execution when the sequencer terminates. This break is called a sequential break. ■ Break by Sequencer A program can suspend program execution when the sequencer terminates. This break is called a sequential break.
  • Page 114: Trace Sampling Control By Sequencer

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.3 Trace Sampling Control by Sequencer When the event mode is in the normal mode, real-time trace executing tracing called single trace. If the trace function is enabled, single trace samples all the data from the start of executing a program until the program is suspended.
  • Page 115 [Setup Example] Suspend trace sampling when event 1 occurs, and then resume at event 2 and keep sampling data until event 3 occurs. Level 1 Level 2 Level 3 >SET SEQUENCE/EVENT/DISABLETRACE 1,1,J=2 >SET SEQUENCE/EVENT/ENABLETRACE 2,2,J=3 >SET SEQUENCE/EVENT/DISABLETRACE 3,3,J=2 CHAPTER 2 DEPENDENCE FUNCTIONS Start Event 1 occurs...
  • Page 116: Time Measurement By Sequencer

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.4 Time Measurement by Sequencer Time can be measured using the sequencer. A time measurement timer called the emulation timer is used for this purpose. When branching is made from a specified level to another specified level, a timer value is specified. Up to two emulation timer values can be fetched.
  • Page 117: Sample Flow Of Time Measurement By Sequencer

    2.2.7.5 Sample Flow of Time Measurement by Sequencer In the following sample, when events are executed in the order of Event 1, Event 2 and Event 3, the execution time from the Event 1 to the Event 3 is measured. However, no measurement is made if Event 4 occurs anywhere between Event 1 and Event 3.
  • Page 118 CHAPTER 2 DEPENDENCE FUNCTIONS Indicates that, if event 1 occurs at level 1, move to level 2 and let the timer latched. >SET SEQUENCE/EVENT 1,1,J=2 >SET SEQUENCE/EVENT 2,4,J=1 >SET SEQUENCE/EVENT 2,2,J=3 >SET SEQUENCE/EVENT 3,4,J=1 >SET SEQUENCE/EVENT 3,2,J=0 >SET SEQUENCE/LATCH 1,1,2 >SET SEQUENCE/LATCH 2,3,0 >SHOW SEQUENCE...
  • Page 119: Real-Time Trace

    2.2.8 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace.
  • Page 120: Single Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.1 Single Trace The single trace traces all data from the start of executing a program until the program is aborted. ■ Function of Single Trace The single trace is enabled by setting the event mode to normal mode using the SET MODE command. The single trace traces all data from the start of executing a program until the program is suspended.
  • Page 121: Frame Number And Step Number In Single Trace

    ■ Frame Number and Step Number in Single Trace The sampled trace data is numbered in frame units. This number is called the frame number. When displaying trace data, the starting location in the trace buffer can be specified using the frame number. The trace data at the point where the sequencer termination trigger occurs is numbered 0;...
  • Page 122: Setting Single Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.2 Setting Single Trace The following settings (1) to (4) are required before executing single trace. Once these settings have been made, trace data is sampled when a program is executed. (1) Set event mode to normal mode. (2) Enable trace function.
  • Page 123 (4) Set trace-buffer-full break. The program can be allowed to break when the trace buffer becomes full. Use the SET TRACE command for this setting. The default is Not Break. Display the setup status using the SHOW TRACE/STATUS command. Table 2.2-10 lists trace-related commands that can be used in the single trace function. Table 2.2-10 Trace-related Commands That Can Be Used in The Single Trace Function Usable Command SET EVENT...
  • Page 124: Multi Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.3 Multi trace The multi trace samples data where an event trigger occurs for 8 frames before and after the event trigger. ■ Multi Trace Function Execute multi trace by setting the event mode to the multi trace mode using the SET MODE command. The multi trace samples data where an event trigger occurs for 8 frames before and after the event trigger.
  • Page 125 Figure 2.2-13 Frame Number in Multi Trace Block number Trace buffer 2048 CHAPTER 2 DEPENDENCE FUNCTIONS Frame number Global number Local number –6 Event trigger –7 –6 Event trigger 32752 32753 Event trigger 32759 32767 32768...
  • Page 126: Setting Multi Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.4 Setting Multi Trace Before executing the multi trace, the following settings must be made. After these settings, trace data is sampled when a program is executed. (1) Set event mode to multi trace mode. (2) Enable trace function. (3) Set event.
  • Page 127: Displaying Trace Data Storage Status

    2.2.8.5 Displaying Trace Data Storage Status It is possible to Displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command in the single trace mode, and to the SHOW MULTITRACE command in the multi trace mode. ■...
  • Page 128: Specify Displaying Trace Data Start

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.6 Specify Displaying Trace Data Start It is possible to specify from which data in the trace buffer to display. To do so, specify a frame number with the SHOW TRACE command in the single trace mode, or specify either a global number, or a block number and local number with the SHOW MULTITRACE command in the multi trace mode.
  • Page 129: Display Format Of Trace Data

    2.2.8.7 Display Format of Trace Data A display format can be chosen by specifying a command identifier with the SHOW TRACE command in the single trace, and with the SHOW MULTITRACE command in the multi trace. The source line is also displayed if "Add source line" is selected using the SET SOURCE command.
  • Page 130 CHAPTER 2 DEPENDENCE FUNCTIONS Step Number Decimal, signed Data access internal read access : Read access to internal write access : Write access to external read access : Read access to external write access : Write access to ■ Displaying All Machine Cycles (Specify /CYCLE.) Detailed information at all sampled machine cycles can be displayed.
  • Page 131 [Example] >>SHOW TRACE/CYCLE -587 frame no. address data -00587 :FF0106 0106 -00586 :FF0106 0008 -00585 :FF0106 0106 -00584 :1010E8 10E8 -00583 :1010E8 0102 -00582 :1010E8 0102 -00581 :000186 0186 -00580 :000186 10F2 -00579 :1010E6 10E6 -00578 :1010E6 10F2 -00577 :1010E6 10F2 -00576 :000186...
  • Page 132 CHAPTER 2 DEPENDENCE FUNCTIONS (7):valid flag @:valid frame for this data (8):sequencer level (9):external probe data ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. This mode is enabled only in the single trace mode while in the debugging mode.
  • Page 133: Reading Trace Data On-The-Fly

    2.2.8.8 Reading Trace Data On-the-fly Trace data can be read while executing a program. However, this is not possible during sampling. Disable the trace function or terminate tracing before attempting to read trace data. ■ Reading Trace Data On-the-fly in Single Trace To disable the trace function, use the DISABLE TRACE command.
  • Page 134: Reading Trace Data On-The-Fly In The Multi Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS ■ Reading Trace Data On-the-fly in the Multi Trace Use the DISABLE MULTITRACE command to disable the trace function before reading trace data. Check whether or not the trace function is currently enabled by executing the SHOW MULTITRACE command with /STATUS specified, or by using the built-in variable %TRCSTAT.
  • Page 135: Saving Trace Data

    2.2.8.9 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command.
  • Page 136: Measuring Performance

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.9 Measuring Performance It is possible to measure the time and pass count between two events. Repetitive measurement can be performed while executing a program in real-time, and when done, the data can be totaled and displayed. Using this function enables the performance of a program to be measured.
  • Page 137: Performance Measurement Procedures

    2.2.9.1 Performance Measurement Procedures Performance can be measured by the following procedure: • Setting event mode. • Setting minimum measurement unit for timer. • Specify performance-buffer-full break. • Setting events. • Execute program. • Display measurement result. • Clear measurement result. ■...
  • Page 138: Executing Program

    CHAPTER 2 DEPENDENCE FUNCTIONS ■ Setting Events Set events using the SET EVENT command. The starting/ending point of time measurement and points to measure pass count are specified by events. Events at 8 points (1 to 8) can be set. However, in the performance measurement, the intervals, starting event number and ending event number are fixed in the following combination.
  • Page 139: Display Performance Measurement Data

    2.2.9.2 Display Performance Measurement Data Display the measured time and measuring count by using the SHOW PERFORMANCE command. ■ Displaying Measured Time To display the time measured, specify the starting event number or the ending event number. Event number >SHOW PERFORMANCE/TIME 1,9000,18999,1000 Minimum execution t ime event...
  • Page 140: Measuring Coverage

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.10 Measuring Coverage This emulator has the C0 coverage measurement function. Use this function to find what percentage of an entire program has been executed. ■ Coverage Measurement Function When testing a program, the program is executed with various test data input and the results are checked for correctness.
  • Page 141: Coverage Measurement Procedures

    2.2.10.1 Coverage Measurement Procedures The procedure for coverage measurement is as follows: • Set range for coverage measurement : SET COVERAGE • Measure coverage • Display measurement result ■ Setting Range for Coverage Measurement Use the SET COVERAGE command to set the measurement range. The measurement range can be set only within the area defined as the debug area.
  • Page 142 CHAPTER 2 DEPENDENCE FUNCTIONS ● Displaying coverage rate of load module (specify /MODULE for the command qualifier) >SHOW COVERAGE/MODULE sample.abs ....(84.03%) + - startup.asm ... (90.43%) + - sample.c .
  • Page 143 ● Displays per source line (specify /SOURCE for the command qualifier) >SHOW COVERAGE/SOURCE main 70: { struct table *value[16]; for (i=0; i<16; i++) value[i] = &target[i]; sort_val(value, 16L); 78: } Displays execution status of each source line. No executing Executing Blank : Line which the code had not been generated or is outside the scope of the coverage measurement ●...
  • Page 144 CHAPTER 2 DEPENDENCE FUNCTIONS Note: With MB2141 emulator, the code coverage measurement is affected by a prefetch. Note when analyzing.
  • Page 145: Execution Time Measurement

    2.2.11 Execution Time Measurement This function measures the program execution time. ■ Measurement Items Measures time between the start and stop of program execution. The timer for measuring time is called the emulation timer. The measurement time depends on as follows by the minimum measurement unit for the emulation timer. When the minimum measurement unit is 1 μs: the maximum is about 70 minutes When the minimum measurement unit is 100 ns: the maximum is about 7 minutes The minimum measurement unit at startup is 1 μs.
  • Page 146 CHAPTER 2 DEPENDENCE FUNCTIONS • Clearing by dialog Click the [Clear] button in the time measurement dialog, which can be displayed by selecting [Debug] - [Time Measurement] menu. For details, refer to Section "4.6.8 Time Measurement" in "SOFTUNE Workbench Operation Manual". •...
  • Page 147: Sampling By External Probe

    2.2.12 Sampling by External Probe An external probe can be used to sample (input) data. There are two sampling types: sampling the trace buffer as trace data, and sampling using the SHOW SAMPLING command. ■ Sampling by External Probe There are two sampling types to sample data using an external probe: sampling the trace buffer as trace data, and sampling using the SHOW SAMPLING command.
  • Page 148: Displaying And Setting External Probe Data

    CHAPTER 2 DEPENDENCE FUNCTIONS ■ Displaying and Setting External Probe Data When a command that can use external probe data is executed, external probe data is displayed in 8-digit binary or 2-digit hexadecimal format. The displayed bit order is in the order of the IC clip cable color code order (Table 2.2-12).
  • Page 149: Checking Debugger Information

    F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED, COPYRIGHT(C) FUJITSU SEMICONDUCTOR LIMITED 1997 LICENCED MATERIAL - PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version =======================================================...
  • Page 150 CHAPTER 2 DEPENDENCE FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - Language Tools - F2MC-16 Family SOFTUNE C Compiler version File Path: fcc907s.exe path - F2MC-16 Family SOFTUNE Assembler version File Path: fasm907s.exe path...
  • Page 151: Emulator Debugger (Mb2147-01)

    Emulator Debugger (MB2147-01) This section explains the functions of the emulator debuggers for the MB2147-01. ■ Emulator When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2147-01 has been selected. MB2141 MB2147-01 MB2147-05...
  • Page 152: Setting Operating Environment

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2147-01, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings.
  • Page 153: Monitoring Program Automatic Loading

    2.3.1.1 Monitoring Program Automatic Loading The MB2147-01 emulator can automatically update the monitoring program at emulator startup. ■ Setting Monitoring Program Automatic Loading When the MB2147-01 emulator is specified, data in the emulator can be checked at the beginning of debugging to load an appropriate monitoring program and configuration binary data automatically into the emulator.
  • Page 154: Mcu Operation Mode

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.2 MCU Operation Mode There are two MCU operation modes as follows: • Debugging Mode • Native Mode ■ Setting MCU Operation Mode Set the MCU operation mode. There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET RUNMODE command.
  • Page 155: Debug Area

    2.3.1.3 Debug Area Set the intensive debugging area out of the whole memory space. The area functions are enhanced. ■ Setting Debug Area There are two debug areas: DEBUG3, and DEBUG4. A continuous 1 MB area (16 banks) is set for each area. Set the debug area using the SET DEBUG command.
  • Page 156: Memory Area Types

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.4 Memory Area Types A unit in which memory is allocated is called an area. There are five different area types. ■ Memory Area Types A unit to allocate memory is allocated is called an area. There are five different area types as follows: - User Memory Area Memory space in the user system is called the user memory area and this memory is called the user memory.
  • Page 157 Note: The internal memory area, it is set a suitable area automatically by the selected MCU. - Internal ROM Image Area Some types of MCUs have data in a specific area of internal ROM appearing to 00 bank. This specific area is called the internal ROM image area.
  • Page 158: Memory Mapping

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.5 Memory Mapping Memory space can be allocated to the user memory and the emulation memory, etc., and the attributes of these areas can be specified. However, the MCU internal resources are not dependent on this mapping setup and access is always made to the internal resources.
  • Page 159 ■ Creating and Viewing Memory Map Use the following commands for memory mapping. SET MAP: SHOW MAP: CANCEL MAP: [Example] >SHOW MAP address 000000 .. FFFFFF The rest of setting area numbers user = 8 >SET MAP/USER H'0..H'1FF >SET MAP/READ/CODE/EMULATION H'FF0000..H'FFFFFF >SET MAP/USER H'8000..H'8FFF >SET MAP/MIRROR/COPY H'8000..H'8FFF >SET MAP/GUARD...
  • Page 160: Debug Function

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.6 Debug Function The debug function has the following two types. Only the function of the selected mode can be used. The selectable debug mode depends on the emulator or its connection form. • RAM Checker mode •...
  • Page 161: Event Mode

    2.3.1.7 Event Mode There are three event modes as listed below. • Normal mode • Multi trace mode • Performance mode ■ Event Mode Event mode is used to determine which function the event triggers are used for. To set the mode, use [Event] tab on [Setup] - [Debug Environment] - [Debug Environment] menu or the SET MODE command on the command window.
  • Page 162: Notes On Commands For Executing Program

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
  • Page 163 ■ Notes on STEP Command - Exceptional Step Execution When executing the instructions listed in the notes on the GO command as invalid breakpoints and abnormal breakpoints, such instructions and the next instruction are executed as a single instruction. Furthermore, if such instructions are continuous, then all these continuous instructions and the next instruction are executed as a single instruction.
  • Page 164: Commands Available During Execution Of User Program

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■...
  • Page 165 Table 2.3-3 Commands Available during Execution of User Program (2 / 2) Function Set trace delay Displaying execution cycle measurement value (Timer) Memory operation (Read/Write) Line assembly, Disassembly Breakpoint Settings *1: For detail, refer to Section "2.3.6 Real-time Trace". *2: For detail, refer to Section "2.3.1.6 Debug Function". *3: For detail, refer to Section "2.2.1.4 Memory Mapping".
  • Page 166: Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4 Break In this emulator debugger, nine types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■...
  • Page 167: Code Break

    2.3.4.1 Code Break It is a function to abort the program by observing the specified address. The break is done before an instruction the specified address is executed. ■ Code Break It is a function to abort the program by observing the specified address. The break is done before an instruction the specified address is executed.
  • Page 168 CHAPTER 2 DEPENDENCE FUNCTIONS ● Abnormal Breakpoint • Setting a breakpoint at the instruction immediately after string instructions listed below, may cause a break in the middle of the string instruction without executing the instruction to the end. MC-16/16L/16LX/16H: • MOVS MC-16F: Here are some additional points about the effects on other commands.
  • Page 169: Data Break

    2.3.4.2 Data Break The data break is a function to abort the program execution when the data access (read or write) is done to the address specified while executing the program. ■ Data Break The data break is a function to abort the program execution when MCU accesses data as for a specified address.
  • Page 170: Monitoring Data Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.3 Monitoring Data Break It is a special break function to abort execution while it is corresponding to specified data when the program reaches a specified address. ■ Monitoring Data Break It is a special break function to abort execution while it is corresponding to specified data when the program reaches a specified address.
  • Page 171: Sequential Break

    2.3.4.4 Sequential Break A sequential break is a function to abort a executing program, when the sequential condition is met by event sequential control. ■ Sequential Break It is a function to discontinue the program execution when the sequential condition consists by the sequential control of the event.
  • Page 172: Guarded Access Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.5 Guarded Access Break The guarded access break is an abortion of the program execution that happens when the violation to the set access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed. ■...
  • Page 173: Trace-Buffer-Full Break

    2.3.4.6 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■...
  • Page 174: Performance-Buffer-Full Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.7 Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. ■ Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
  • Page 175: External Trigger Break

    2.3.4.8 External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has. ■ External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has.
  • Page 176: Forced Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.9 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
  • Page 177: Control By Sequencer

    2.3.5 Control by Sequencer This emulator has a sequencer to control events. By using this sequencer, sampling of breaks or traces can be controlled while monitoring program flow (sequence). A break caused by this function is called a sequential break. ■...
  • Page 178 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Setting Events The emulator can monitor the MCU bus operation, and generate a trigger for a sequencer at a specified condition. This function is called an event. In the event, code (/CODE) and data access (/READ/WRITE) can be specified. Up to eight events can be set.
  • Page 179: Setting Sequencer

    2.3.5.1 Setting Sequencer The sequencer operates in the following order: 1) The sequencer starts after the program execution. 2) Depending on the setting at each level (1 & 2), branching to the next level is performed when the condition is met. 3) The sequencer is restarted when the restart condition is met.
  • Page 180 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Setting Sequencer The sequencer can be set by the dialog or the command. ● Setting by dialog Select [Debug] - [Sequence] menu. For details, refer to "4.6.6 Sequence" in "SOFTUNE Workbench Operation Manual". ● Setting by Command 1.
  • Page 181: Real-Time Trace

    2.3.6 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace.
  • Page 182 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Trace Filter To make effective use of the limited trace buffer capacity, in addition to the code fetch function, a trace filter function is incorporated to provide a means of acquiring information about data accesses to a specific region. The data trace filter function allows the following values to be specified for two regions: - Address - Address mask...
  • Page 183: Setting Data Monitoring Trace Trigger

    Figure 2.3-3 Trace Sampling Operation (Trace Trigger) Resume Start ■ Setting Data Monitoring Trace Trigger When the debug function on MB2147-01 is set to Trace Enhancement mode, it is possible to set a trace trigger by a data monitoring condition. For the data monitoring condition, see the data monitoring break in Section "2.3.4 Break".
  • Page 184: Setting Single Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.1 Setting Single Trace To perform a single trace, follow steps 1 through 4 below. When a program is executed after completion of the following steps, trace data is sampled. 1) Set an event mode to single trace mode. 2) Enable the trace function.
  • Page 185: Multi Trace

    2.3.6.2 Multi Trace Only when an event trigger occurred, the multi trace samples data before and after the event trigger. ■ Multi Trace To use the multi trace function, the SET MODE command is set to the following mode. Debug function: "Trace Enhancement" mode Event mode: "Multi trace"...
  • Page 186: Trace Delay

    CHAPTER 2 DEPENDENCE FUNCTIONS Block number ■ Trace Delay The trace data which is acquired after one event occurrence is called a trace delay. There are two types of trace delay depending on the event hit. When the trace end trigger (event) hit occurs, the delay can be set within the scope of the block size (128 to 1024 frames).
  • Page 187 CHAPTER 2 DEPENDENCE FUNCTIONS Note: The multi trace function in MB2147-01 is exclusive with the RAM Checker function. For more details, refer to Section "2.3.1.6 Debug Function".
  • Page 188: Setting Methods Of Multi Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.3 Setting Methods of Multi Trace Before executing the multi trace, the following settings must be made. After these settings, trace data is sampled when a program is executed. 1. Set the debug function to "Trace Enhancement" mode. 2.
  • Page 189 Table 2.3-7 shows the list of trace-related commands that can be used in multi trace mode. Table 2.3-7 Trace-related Commands That Can Be Used in Multi Trace Mode Mode Usable Command SET TRACETRIGGER SHOW TRACETRIGGER CANCEL TRACETRIGGER ENABLE TRACETRIGGER DISABLE TRACETRIGGER SET MULTITRACE Multi trace SHOW MULTITRACE...
  • Page 190: Displaying Trace Data Storage Status

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.4 Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command. ■ Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer.
  • Page 191: Specify Displaying Trace Data Storage Status

    2.3.6.5 Specify Displaying Trace Data Storage Status The data display start position in the trace buffer can be specified by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified. ■...
  • Page 192: Display Format Of Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.6 Display Format of Trace Data The trace data display format can be selected by running the SHOW TRACE command with a command modifier specified. If setup is completed with the SET SOURCE command so as to select a source line addition mode, a source line is attached to the displayed trace data.
  • Page 193 Step Number Decimal, signed Data Access internal read access : Read access to internal write access : Write access to external read access : Read access to external write access : Write access to ■ Displaying All Machine Cycles (Specify /CYCLE) Detailed information at all sampled machine cycles can be displayed.
  • Page 194 CHAPTER 2 DEPENDENCE FUNCTIONS How to read trace data frame no. address (1):frame number (Decimal number) (2):executed instruction address, and data access address (Hexadecimal number) (3):data (Hexadecimal number) (4):access information (a-status) (5):device status (d-status) STANDBY THOLD UHOLD WAIT SLEEP STOP EXECUTE RESET -------...
  • Page 195 ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. This mode is enabled only in the debugging mode. [Example] >SHOW TRACE/SOURCE -1010..-86 step no. source -01007 -00905 -00803 -00698 -00655 -00594 -00185 -00149 -00088 Note: The following operation may be subjected to trace sampling immediately after the MCU operation is stopped (tool hold).
  • Page 196: Reading Trace Data On-The-Fly

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.7 Reading Trace Data On-the-fly Trace data can be read while executing a program. However, this is not possible during sampling. Disable the trace function or terminate tracing before attempting to read trace data. ■ Reading Trace Data On-the-fly To disable the trace function, use the DISABLE TRACE command.
  • Page 197: Saving Trace Data

    2.3.6.8 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command.
  • Page 198: Measuring Performance

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.7 Measuring Performance It is possible to measure the time and pass count between two events. Repetitive measurement can be performed while executing a program in real-time, and when done, the data can be totaled and displayed. Using this function enables the performance of a program to be measured.
  • Page 199: Performance Measurement Procedures

    2.3.7.1 Performance Measurement Procedures Performance can be measured by the following procedure: • Setting event mode. • Setting minimum measurement unit for timer. • Specify performance-buffer-full break. • Setting events. • Execute program. • Display measurement result. • Clear measurement result. ■...
  • Page 200 CHAPTER 2 DEPENDENCE FUNCTIONS Interval ● Measuring Count The specified events become performance measurement points automatically. ■ Executing Program Start measuring when executing a program by using the GO or CALL command. If a break occurs during interval time measurement, the data for this specific interval is discarded. ■...
  • Page 201: Display Performance Measurement Data

    2.3.7.2 Display Performance Measurement Data Display the measured time and measuring count by using the SHOW PERFORMANCE command. ■ Displaying Measured Time To display the time measured, specify the starting event number or the ending event number. Event number Minimum execution time Maximum execution time...
  • Page 202: Measuring Coverage

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.8 Measuring Coverage This emulator has the C0 coverage measurement function. Use this function to find what percentage of an entire program has been executed. ■ Coverage Measurement Function When testing a program, the program is executed with various test data input and the results are checked for correctness.
  • Page 203: Coverage Measurement Procedures

    2.3.8.1 Coverage Measurement Procedures The procedure for coverage measurement is as follows: • Set range for coverage measurement : • Measure coverage • Display measurement result ■ Setting Range for Coverage Measurement Use the SET COVERAGE command to set the measurement range. The measurement range can be set only within the area defined as the debug area.
  • Page 204 CHAPTER 2 DEPENDENCE FUNCTIONS ● Summary (Specify /GENERAL for command qualifier) >SHOW COVERAGE/GENERAL (HEX)0X0 +---------------+---------------+------ address 0123456789ABCDEF0123456789ABCDEF0123456 FF0000 **3*F*... Display the access status of every 16 addresses 1 to F : Display the number accessed in 16 addresses by the hexadecimal number. ●...
  • Page 205 ● Displays per source line (Specify /SOURCE for the command qualifier) >SHOW COVERAGE/SOURCE main 70: { 78: } Displays access status of each source line. Blank: Line which the code had not been generated or is outside ● Displays per machine instruction (Specify /INSTRUCTION for the command qualifier) >SHOW COVERAGE/INSTRUCTION F9028F sample.c$70 { * F9028F...
  • Page 206: Real-Time Monitoring

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.9 Real-time Monitoring The real-time monitoring function is used to display the memory contents during program execution. ■ Real-time Monitoring The emulator can use the real-time monitoring function when the evaluation chip has the external trace bus interface.
  • Page 207: Execution Time Measurement

    2.3.10 Execution Time Measurement This function measures the program execution time. ■ Measurement Items Measures time between the start and stop of program execution. In this emulator debugger, the measurement is performed by the emulation timer or cycle counter. The following shows the features.
  • Page 208 CHAPTER 2 DEPENDENCE FUNCTIONS • Clearing by command Enter the CLEAR TIMER command in the command window. For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual". Note: The measured execution time is added about ten extra cycles per execution. If the execution cycle is measured, execute many instructions continuously in order to minimize the effect of error.
  • Page 209: Power-On Debugging

    2.3.11 Power-on Debugging This section explains power-on debugging by the emulators for the MB2147-01. ■ Power-on Debugging Power-ON debugging refers to the operation to debug the operating sequence that begins when the power to the target is switched on. For products with a dedicated power-on debugging terminal, the MB2147-01 emulator can debug the sequence performed immediately after power-on.
  • Page 210: Ram Checker

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.12 RAM Checker This section describes the functions of the RAM Checker. ■ Overview The RAM checker obtains history logs of accessing the monitoring addresses on SOFTUNE Workbench and graphically displays log files using the accessory tool, "RAM Checker Viewer". SOFTUNE Workbench has the following functions - Sets monitoring addresses at 16 points - Logs data access history of monitoring addresses at intervals of 1 ms...
  • Page 211: Specifications List

    ■ Specifications List Monitoring Point Count Size Event Functions Sampling Time Update Intervals Log File Formats • SOFTUNE format - To display in the RAM Checker viewer (recommended) - Default extension is ".SRL". • CSV format - To display in other applications than the RAM Checker viewer - Default extension is ".CSV".
  • Page 212: About Log File

    CHAPTER 2 DEPENDENCE FUNCTIONS For details about settings of the RAM Checker viewer, refer to Section "3.21 RAM Checker Window" of "SOFTUNE Workbench Operation Manual". and "4.47 SET RAMCHECK" to "4.51 DISABLE RAMCHECK" of "SOFTUNE Workbench Command Reference Manual". Note: Execution state for MCU such as stop mode or sleep mode cannot be displayed at status bar during logging.
  • Page 213: Ram Checker Viewer

    ■ RAM Checker Viewer The RAM Checker Viewer is a tool for graphically displaying changes in data values with the passage of time. There are the following three types of data display formats: - Bit display (Logic Analyzer image) - Data value display (bent line graph) - Bit/data value display (simultaneous display bit and data values) It displays halting CPU, trigger points and the Data Lost as other information.
  • Page 214: Checking Debugger Information

    F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED, COPYRIGHT(C) FUJITSU SEMICONDUCTOR LIMITED 1997 LICENCED MATERIAL - PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version =======================================================...
  • Page 215 - F2MC-16 Family SOFTUNE Linker version File Path: flnk907s.exe path - F2MC-16 Family SOFTUNE Librarian version File Path: flib907s.exe path - SOFTUNE FJ-OMF to S-FORMAT Converter version File Path: f2ms.exe path - SOFTUNE FJ-OMF to INTEL-HEX Converter version File Path: f2is.exe path - SOFTUNE FJ-OMF to INTEL-EXT-HEX Converter version File Path: f2es.exe path - SOFTUNE FJ-OMF to HEX Converter version...
  • Page 216: Emulator Debugger (Mb2147-05)

    CHAPTER 2 DEPENDENCE FUNCTIONS Emulator Debugger (MB2147-05) This section explains the functions of the emulator debuggers for the MB2147-05. ■ Emulator When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2147-05 has been selected. MB2141 MB2147-01 MB2147-05...
  • Page 217: Setting Operating Environment

    2.4.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2147-05, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings.
  • Page 218: Monitoring Program Automatic Loading

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.1 Monitoring Program Automatic Loading Emulators for MB2147-05 can automatically update the monitoring program at emulator startup. ■ Monitoring Program Automatic Loading When the emulators for MB2147-05 is specified, data in the emulator can be checked at the beginning of debugging to load an appropriate monitoring program and configuration binary data automatically into the emulator.
  • Page 219: Mcu Operation Mode

    2.4.1.2 MCU Operation Mode There are two MCU operation modes as follows: • Debugging Mode • Native Mode ■ Setting MCU Operation Mode Set the MCU operation mode. There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET RUNMODE command.
  • Page 220: Debug Area

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.3 Debug Area Set the intensive debugging area out of the whole memory space. The area functions are enhanced. ■ Setting Debug Area There are two debug areas: DEBUG3, and DEBUG4. A continuous 1 MB area (16 banks) is set for each area. Set the debug area using the SET DEBUG command.
  • Page 221: Memory Area Types

    2.4.1.4 Memory Area Types A unit in which memory is allocated is called an area. There are five different area types. ■ Memory Area Types A unit to allocate memory is allocated is called an area. There are five different area types as follows: - User Memory Area Memory space in the user system is called the user memory area and this memory is called the user memory.
  • Page 222 CHAPTER 2 DEPENDENCE FUNCTIONS Note: The internal memory area, it is set a suitable area automatically by the selected MCU. - Internal ROM Image Area Some types of MCUs have data in a specific area of internal ROM appearing to 00 bank. This specific area is called the internal ROM image area.
  • Page 223: Memory Mapping

    2.4.1.5 Memory Mapping Memory space can be allocated to the user memory and the emulation memory, etc., and the attributes of these areas can be specified. However, the MCU internal resources are not dependent on this mapping setup and access is always made to the internal resources. ■...
  • Page 224 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Creating and Viewing Memory Map Use the following commands for memory mapping. SET MAP: SHOW MAP: CANCEL MAP: [Example] >SHOW MAP address 000000 .. FFFFFF The rest of setting area numbers user = 8 >SET MAP/USER H'0..H'1FF >SET MAP/READ/CODE/EMULATION H'FF0000..H'FFFFFF >SET MAP/USER H'8000..H'8FFF >SET MAP/MIRROR/COPY H'8000..H'8FFF...
  • Page 225: Notes On Commands For Executing Program

    2.4.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
  • Page 226 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Notes on STEP Command ● Exceptional Step Execution When executing the instructions listed in the notes on the GO command as invalid breakpoints and abnormal breakpoints, such instructions and the next instruction are executed as a single instruction. Furthermore, if such instructions are continuous, then all these continuous instructions and the next instruction are executed as a single instruction.
  • Page 227: Commands Available During Execution Of User Program

    2.4.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■...
  • Page 228: Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4 Break In this emulator debugger, five kinds of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■...
  • Page 229: Code Break

    2.4.4.1 Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed. ■ Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed.
  • Page 230 CHAPTER 2 DEPENDENCE FUNCTIONS ● Abnormal Breakpoint • Setting a breakpoint at the instruction immediately after string instructions listed below, may cause a break in the middle of the string instruction without executing the instruction to the end. MC-16/16L/16LX/16H: • MOVS MC-16F: Here are some additional points about the effects on other commands.
  • Page 231: Data Break

    2.4.4.2 Data Break The data break is a function to abort the program execution when the data access (read or write) is done to the address specified while executing the program. ■ Data Break The data break is a function to abort the program execution when MCU accesses data as for a specified address.
  • Page 232: Guarded Access Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.3 Guarded Access Break The guarded access break is an abortion of the program execution that happens when the violation to the set access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed. ■...
  • Page 233: Trace-Buffer-Full Break

    2.4.4.4 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■...
  • Page 234: Forced Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.5 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
  • Page 235: Real-Time Trace

    2.4.5 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace.
  • Page 236 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Trace Filter To make effective use of the limited trace buffer capacity, in addition to the code fetch function, a trace filter function is incorporated to provide a means of acquiring information about data accesses to a specific region. The data trace filter function allows the following values to be specified for two regions: - Address - Address mask...
  • Page 237: Setting Trace

    2.4.5.1 Setting Trace To perform a trace, follow steps (1), (2) below. When a program is executed after completion of the following steps, trace data is sampled. (1) Enable the trace function. (2) Perform trace-buffer-full break setup. ■ Setting Trace To perform a trace, complete the following setup steps.
  • Page 238: Displaying Trace Data Storage Status

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.2 Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command. ■ Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer.
  • Page 239: Specifying Displaying Trace Data Start

    2.4.5.3 Specifying Displaying Trace Data Start The data display start position in the trace buffer can be specified by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified. ■ Specifying Displaying Trace Data Start Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command.
  • Page 240: Display Format Of Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.4 Display Format of Trace Data The trace data display format can be selected by running the SHOW TRACE command with a command modifier specified. If setup is completed with the SET SOURCE command so as to select a source line addition mode, a source line is attached to the displayed trace data.
  • Page 241: Displaying All Machine Cycles

    Step Number Decimal number, signed Data Access internal read access : Read access to internal write access : Write access to external read access : Read access to external write access : Write access to ■ Displaying All Machine Cycles Detailed information at all sampled machine cycles can be displayed.
  • Page 242 CHAPTER 2 DEPENDENCE FUNCTIONS How to read trace data frame no. address (1):frame number (Decimal, signed) (2):executed instruction address, and data access address (Hexadecimal number) (3):data (Hexadecimal number) (4):access information (a-status) WA:write access to internal memory EWA:write access to external memory IRA:read access to internal memory ERA:read access to external memory ICF:code fetch to internal memory...
  • Page 243 ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. This mode is enabled only in the debugging mode. [Example] >SHOW TRACE/SOURCE -194 step no. -00194 -00190 -00168 -00164 -00161 -00157 -00145 -00133 -00121 -00116 -00111 -00099 Note:...
  • Page 244: Reading Trace Data On-The-Fly

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.5 Reading Trace Data On-the-fly Trace data can be read while executing a program. However, this is not possible during sampling. Disable the trace function or terminate tracing before attempting to read trace data. ■ Reading Trace Data On-the-fly To disable the trace function, use the DISABLE TRACE command.
  • Page 245: Saving Trace Data

    2.4.5.6 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command.
  • Page 246: Measuring Execution Cycle Count

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.6 Measuring Execution Cycle Count This function measures the program execution cycle count. ■ Measurement Items Measures cycle count between the start and stop of program execution. In this emulator debugger, the measurement is performed by the cycle counter. The following shows the features of the cycle counter.
  • Page 247: Emulator Debugger (Mb2198)

    Emulator Debugger (MB2198) This section explains the functions of the emulator debuggers for the MB2198. ■ Emulator Debugger When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2198 has been selected. •...
  • Page 248: Setting Operating Environment

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2198, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings.
  • Page 249: Monitoring Program Automatic Loading

    2.5.1.1 Monitoring Program Automatic Loading The MB2198 emulator can automatically update the monitoring program at emulator startup. ■ Monitoring Program Automatic Loading When the MB2198 emulator is specified, data in the emulator can be checked at the starting of debugging to load an appropriate monitoring program and configuration binary data automatically into the emulator.
  • Page 250: Boot Rom File Automatic Execution

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1.2 Boot ROM File Automatic Execution The MB2198 emulator automatically loads and executes the Boot ROM file during startup of the debug. ■ Boot ROM File Automatic Execution When the MB2198 emulator is specified, at the starting of debugging the Boot ROM file is automatically loaded and then executed.
  • Page 251: Mcu Operation Mode

    2.5.1.3 MCU Operation Mode There are two MCU operation modes as follows: • Full Trace Mode • Real-Time Mode ■ Setting MCU Operation Mode There are two operation modes: the full trace mode, and the real-time mode. These modes are set using the [Setup] - [Debug environment] - [Debug environment] menu or the SET RUNMODE command of the instruction window.
  • Page 252: Operation Frequency Control

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1.4 Operation Frequency Control This section describes the operation frequency setup. ■ Operation frequency Set the operation frequency of MCU. Set the operation frequency using a value between 1 and 266MHz, inclusive. This setting optimizes the communication speed between MCU and emulator. This function can be set using the [Setup] - [Debugging Environment] - [Debugging Environment] - [Frequency] menu or the SET FREQUENCY command.
  • Page 253: Notes On Commands For Executing Program

    2.5.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
  • Page 254: Commands Available During Execution Of User Program

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■...
  • Page 255 Notes: • The conditions which allow you to use the commands in Table 2.5-1 are limited to the following cases when a user program is executed. - [Debug] - [Run] - [Go] menu - [Go] button on the debug toolbar The commands in Table 2.5-1 cannot be used when the GO command is entered in the command window.
  • Page 256: Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4 Break In this emulator debugger, seven kinds of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■...
  • Page 257: Code Break

    2.5.4.1 Code Break This function aborts a program by monitoring the specified address using hardware or software. Break occurs prior to execution of the instruction of the specified address. ■ Code Break This function aborts a program by monitoring the specified address using hardware or software. Break occurs prior to execution of the instruction of the specified address.
  • Page 258 CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • Hardware There are the following considerations for the hardware break. - Due to combination use with the sequencer or the trace trigger, the maximum setting number varies. - Do not set the hardware break to the instruction located in the delay slot. If such a setting is performed, branching will not be performed in spite of re-execution after break.
  • Page 259: Data Break

    2.5.4.2 Data Break It is a function to abort the program execution when the data access (read and write) is done to a specified address. ■ Data Break It is a function to abort the program execution when the data access (read and write) is done to a specified address.
  • Page 260: Guarded Access Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.3 Guarded Access Break This function aborts the program execution when access has been performed using the specified attribute for the specified area. ■ Guarded Access Break For the specified area, when the specified access attribute is found during execution of a user program, guarded access break will occur.
  • Page 261: Sequential Break

    2.5.4.4 Sequential Break A sequential break is a function to abort an executing program as event sequential control, when the sequential conditions are established. ■ Sequential Break It is a function to abort the program execution by the sequential control of the event, when the sequential conditions are established.
  • Page 262: Trace-Buffer-Full Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.5 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar.
  • Page 263: Performance-Buffer-Full Break

    2.5.4.6 Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. ■ Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
  • Page 264: External Trigger Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.7 External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has. ■ External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has.
  • Page 265: Forced Break

    2.5.4.8 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
  • Page 266: Control By Sequencer

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.5 Control by Sequencer This emulator has a sequencer to control events. By using this sequencer, sampling of breaks or traces can be controlled while monitoring program flow (sequence). A break caused by this function is called a sequential break. ■...
  • Page 267 The sequence event is setting by the following command. • SET SEQUENCE :Sets sequence event • SHOW SEQUENCE :Displays sequence event status • CANCEL SEQUENCE :Deletes event Notes: • In instruction execution (/CODE), an event trigger is generated only when an instruction is executed. This cannot be specified concurrently with other status (/READ or /WRITE).
  • Page 268: Operating Of Sequencer

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.5.1 Operating of sequencer The sequencer works in the following order. 1) The sequencer starts when the program execution begins. 2) It diverges to the level the shift ahead when the condition consists by setting each level. 3) When the restart condition consists, the sequencer is begun again.
  • Page 269 Figure 2.5-1 Operation of Sequencer START LEVEL1 EVENT 1 EVENT 4 LEVEL2 EVENT 2 LEVEL3 LEVEL4 LEVEL5 EVENT 3 LEVEL6 EVENT 6 CHAPTER 2 DEPENDENCE FUNCTIONS EVENT 8 EVENT 7 EVENT 5...
  • Page 270: Real-Time Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace.
  • Page 271 ■ Trace Filter To make effective use of the limited trace buffer capacity, in addition to the code fetch function, a trace filter function is incorporated to provide a means of acquiring information about data accesses to a specific region. The following value can be specified in the data trace filter function.
  • Page 272: Setting Trace

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.1 Setting Trace To perform a trace, follow steps (1) to (3) below. When a program is executed after completion of the following steps, trace data is sampled. (1) Enable the trace function. (2) The event and the sequencer are set. (3) Perform trace buffer full break setup.
  • Page 273 CHAPTER 2 DEPENDENCE FUNCTIONS Note: In the case of the data trace trigger, word access from an odd address (in terms of bus access) is performed using a byte access for twice. Note that this is the reason why there will not be any hits even when word access is specified from an odd address.
  • Page 274: Displaying Trace Data Storage Status

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.2 Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command. ■ Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer.
  • Page 275: Specifying Displaying Trace Data Start

    2.5.6.3 Specifying Displaying Trace Data Start The data display start position in the trace buffer can be specified by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified. ■ Specifying Displaying Trace Data Start Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command.
  • Page 276: Display Format Of Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.4 Display Format of Trace Data The trace data display format can be selected by running the SHOW TRACE command with a command modifier specified. If setup is completed with the SET SOURCE command so as to select a source line addition mode, a source line is attached to the displayed trace data.
  • Page 277 Reset: Loop Count "Number of times": Displays number of times which loop count occurs. Extended time stamp frame: Data Lost Error: ■ Display in Instruction Execution Order (Specify /INSTRUCTION.) It is a form that is pulled out the divergence frame from the RAW data display, and supplemented between frames with the reverse-assembly display.
  • Page 278 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. [Example] >SHOW TRACE/SOURCE -1010..-86 step no. -01007 -00905 -00803 -00698 -00655 -00594 -00185 -00149 -00088 source : sample.c$68 : sample.c$68 : sample.c$68 : sample.c$70 sort_val(value, 16L);...
  • Page 279: Saving Trace Data

    2.5.6.5 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command.
  • Page 280: Measuring Performance

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.7 Measuring Performance It is possible to measure the time and pass count between two events. Repetitive measurement can be performed while executing a program in real-time, and when done, the data can be totaled and displayed. Using this function enables the performance of a program to be measured.
  • Page 281: Performance Measurement Procedures

    2.5.7.1 Performance Measurement Procedures Performance can be measured by the following procedure: 1. Setting minimum measurement unit for timer. 2. Specify performance-buffer-full break. 3. Setting events. 4. Executing program. 5. Displaying performance measurement data. 6. Clearing performance measurement data. ■ Setting Minimum Measurement Unit for Timer It is 1ns as the minimum measurement unit for the timer used to measure performance.
  • Page 282: Display Performance Measurement Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.7.2 Display Performance Measurement Data Display the measured time and measuring count by using the SHOW PERFORMANCE command. ■ Displaying Measured Time To display the time measured, specify the starting event number or the ending event number. Event number Minimum execution time Maximum execution time...
  • Page 283: Execution Time Measurement

    2.5.8 Execution Time Measurement This function measures the program execution time. ■ Measurement Items Measures time between the start and stop of program execution. In this emulator debugger, the measurement is performed by the emulation timer or cycle counter. The following shows the features.
  • Page 284 CHAPTER 2 DEPENDENCE FUNCTIONS Note: The measured execution time is added about ten extra cycles per execution. If the execution cycle is measured, execute many instructions continuously in order to minimize the effect of error.
  • Page 285: Power-On Debugging

    2.5.9 Power-On Debugging This section explains power-on debugging by the emulators for the MB2198. ■ Power-on Debugging Power-ON debugging refers to the operation to debug the operating sequence that begins when the power to the target is switched on. For products with a dedicated power-on debugging terminal, the MB2198 emulator can debug the sequence performed immediately after power-on.
  • Page 286: Emulator Debugger (Mb2100-01)

    CHAPTER 2 DEPENDENCE FUNCTIONS Emulator Debugger (MB2100-01) This section describes the emulator debugger functions that are available when the MB2100-01 is specified. ■ Features of Emulator Debugger for MB2100-01 The emulator debugger for MB2100-01 has the following features: ● Real-time control The following operations can be controlled during the execution of the user program: •...
  • Page 287: Starting Debugging

    2.6.1 Starting debugging This section describes the method of starting debugging by with the use the MB2100-01 emulator debugger. ■ Starting Debugging When starting debugging, select the [Debug] - [Start debug] menu. When debugging is started by a new project, the setup wizard for performing initial setting is activated. For details, refer to "4.7.2.5 Setup Wizard"...
  • Page 288: Operating Environments Of The Target

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.1.1 Operating Environments of the Target This section describes the setting of the target operating environments of the MB2100-01 emulator debugger. ■ Operating Environments of the Target In this emulator debugger, it is necessary to set the following items according to the operating environments of the target.
  • Page 289 Notes: • When the operating environment set by the setup wizard is different from the actual operating environment, the debugger cannot be activated. • For details on the DEBUG I/F (interface), refer to "EMBEDDED EMULATOR MB2100-01-E OPERATION MANUAL". CHAPTER 2 DEPENDENCE FUNCTIONS...
  • Page 290: Security

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.1.2 Security This section describes the security of the MB2100-01 emulator debugger. ■ Security When beginning to debug it when the security function of target MCU is effective, it is necessary to enter the password in this emulator debugger. For the security function, refer to the hardware manual of model to be used.
  • Page 291: Ending Debugging

    2.6.2 Ending debugging This section describes the method of ending debugging being executed with the use of the MB2100-01 emulator debugger. ■ Ending debugging When ending debugging, select the [Debug] - [End debug] menu. Turn off the power supply of the target after selecting the [End debug] menu. ■...
  • Page 292: Efficiently Executing Debugging

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.3 Efficiently Executing Debugging This section describes setting for efficient debugging. ■ Setting Operating Environment In order to enable the user to even more comfortably execute debugging, the emulator debugger provides the following items required to be set correspondingly to, for example, the operating environment and the usage. •...
  • Page 293: Increasing Communication Speed During Debugging

    2.6.3.1 Increasing Communication Speed during Debugging This section describes setting for increasing the communication speed during debugging. ■ Standard Clock Frequency for High-speed Communication In the case of this emulator debugger, when the standard clock frequency for high-speed communication is set to the optimal value, the phase modulation mode is enabled, and high-speed communication can be performed between the target and adapter.
  • Page 294: Switching Debug Function

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.3.2 Switching Debug Function This section describes the method of switching the debug function correspondingly to the usage. ■ Debug Functions The emulator debugger allows the debug functions to be selectively used by effecting mode switching correspondingly to the usage.
  • Page 295: Executing Program

    2.6.4 Executing Program This section describes the method of executing a user program with the MB2100-01 emulator debugger. ■ Executing a program A user program is executed in a procedure described below. 1. Open a project (workspace). Select the [File] - [Open workspace file] menu. 2.
  • Page 296: Setting/Release Of Debug Functions

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4.1 Setting/Release of Debug Functions The debug function can be set or released while executing the user program. ■ Commands Available during Execution of User Program A specific debug feature can be set/released while executing the user program in this emulator debugger. Either the dialog or the command can be set/released.
  • Page 297 CHAPTER 2 DEPENDENCE FUNCTIONS Note: An error message appears if you enter a command that cannot be used during the execution of a user program. "E4404S Command error (MCU is busy)."...
  • Page 298: Monitoring

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4.2 Monitoring This section describes the monitoring function in the MB2100-01 emulator debugger. ■ Monitoring The monitoring function is capable of real-time referencing a variation in the value of a specific address during user program execution. The function is capable of a variation in the value of a specified watch variable, in addition to the value of a specific address.
  • Page 299: Power-On Debug

    2.6.4.3 Power-on Debug This section describes power-on debug function in the MB2100-01 emulator debugger. ■ Power-on Debug Power-on debug is a function to debug the sequence immediately after turning on of the power supply of the target system. ■ How to use The use procedure of power-on debug is as follows: ●...
  • Page 300 CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • Other debug features cannot be used while debugging power-on at all. • When security is enabled, power on debug is not available. • Selecting the power-on debug menu, the following functions cleared. - Performance measurement - Execution cycle measurement •...
  • Page 301: Notes On Commands For Executing Program

    2.6.4.4 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
  • Page 302 CHAPTER 2 DEPENDENCE FUNCTIONS Because "POP PS" (1) is an instruction as invalid breakpoint shown in "Notes on GO Command", no break occurs at three instructions following "POP PS". And because instruction (3) is the instruction shown in above-mentioned note among three instructions (2), (3) and (4) following "POP PS", three instructions (4), (5) and (6) following instruction (3) are executed continuously.
  • Page 303: To Access The Flash Memory

    2.6.5 To Access the Flash Memory This section describes the access method to the flash memory in the MB2100-01 emulator debugger. ■ Access to Flash Memory In this emulator debugger, the direct operation of the content of the flash memory can be done as well as RAM area.
  • Page 304 CHAPTER 2 DEPENDENCE FUNCTIONS - View the following dialogs. Line Assembly dialog (Disassembly window) Break setting dialog [Software] ● Flash memory synchronization [Debbuger -> Flash] • Manual flash memory synchronization Select the [Environment] - [Flash area control] menu. For details, refer to "4.7.4 Flash area control" in "SOFTUNE Workbench Operation Manual".
  • Page 305: Examples Of Flash Memory Synchronization

    ■ Examples of flash memory synchronization ● In the case of [Debugger -> Flash] An image in the case where the flash memory synchronization [Debugger -> Flash] has been performed is shown below. Variations in the values of the debugger and flash memory in the case of the flash memory synchronization [Debugger ->...
  • Page 306 CHAPTER 2 DEPENDENCE FUNCTIONS ● In the case of [Flash -> Debugger] An image in the case where the flash memory synchronization [Flash -> Debugger] has been performed is shown below. Variations in the values of the debugger and flash memory in the case of the flash memory synchronization [Flash ->...
  • Page 307: To Interrupt The Program Execution [Break]

    2.6.6 To Interrupt the Program Execution [Break] This section describes the method of interrupting the execution of the user program in the MB2100-01 emulator debugger. ■ Break Functions The function to interrupt the execution of the user program is called a break function. This Emulator debugger provides the following seven types of break functions;...
  • Page 308: Code Break (Hardware)

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.1 Code Break (Hardware) This function suspends program execution by monitoring a specified address by hardware. A break occurs before an instruction at the specified address is executed. ■ Code Break (Hardware) This function suspends program execution by monitoring a specified address by hardware. A break occurs before an instruction at the specified address is executed.
  • Page 309 - When the break operation is generated while the instruction where the user interrupt is generated and the next one instruction or less are executed - When the break operation is generated while either of the following instructions and the next one instruction or less are executed - INT addr16 - INTP addr24...
  • Page 310: Code Break (Software)

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.2 Code Break (Software) This function suspends program execution by monitoring a specified address by software. A break occurs before executing an instruction at the specified address. ■ Code Break (Software) This function suspends program execution by monitoring a specified address by software. Setting area The break conditions The maximum number of points: 4096 points...
  • Page 311: Data Break

    2.6.6.3 Data Break This function suspends program execution when data access (read/write) is made to a specified address. ■ Data Break This function suspends program execution when data access (read/write) is made to a specified address. Up to 8 points can be set. When the data break occurs, the following message appears in the status bar.
  • Page 312: Forced Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.4 Forced Break This function forcibly suspends program execution. ■ Forced Break This function forcibly suspends program execution. When the forced break occurs, the following message appears in the status bar. Break at [Address] by command abort request ■...
  • Page 313: Data Watch Break

    2.6.6.5 Data Watch Break This special break function suspends program execution when the program reaches a specified instruction address while the value in the specified data address matches with specified data. ■ Data Watch Break This special break function suspends program execution when the program reaches a specified instruction address while the value in the specified data address matches with specified data.
  • Page 314 CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • A data watch break shares points with the following functions. The maximum number varies depending on how those functions are used. - Code break - Data break - Sequence • The data watch break may stop if it hits a specified address after a few instructions following the instruction with data detection access are executed.
  • Page 315: Sequencer

    2.6.6.6 Sequencer A sequencer is a function to abort the program execution to the specified event condition when program passes the event following a certain flow (sequence). ■ Control by Sequencer Table 2.6-2 shows the specifications of the sequencer function for this emulator debugger. 2 events are set and the level is passed through level 1 to level 2 in this order.
  • Page 316: Specifications Of Sequencer

    CHAPTER 2 DEPENDENCE FUNCTIONS ■ Specifications of Sequencer Table 2.6-2 shows the specifications of the sequencer for this emulator debugger. Table 2.6-2 Specifications of Sequencer Function No. of levels Restart function Conditions of each event (Code/data) Operation when conditions are met ■...
  • Page 317 Notes: • When the pass count mode is a passing count break mode, this function cannot be used. For details, refer to "2.6.3.2 Switching Debug Function". • Depending on the output timing of external trace data, the actual order of code execution may change places with the order of data hit information.
  • Page 318: Measuring The Program Execution Cycle Count

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.7 Measuring the Program Execution Cycle Count This section explains the function of measuring the number of program execution cycles. ■ Measurement Items This function measures the number of program execution cycles. The measurement is performed whenever a program is executed, and the measurement result displays the following two values: - The number of execution cycles for the previous program execution The maximum number of cycles that can be measured is "2 to the power of 58 - 1", in other words, up...
  • Page 319 CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • The number of cycles measured normally includes an error of about 10 cycles. However, it may be even more, depending on the bus state. • If a chip reset is issued during debugging, the measurement cycle count is cleared.
  • Page 320: Measuring Event-To-Event Execution Cycle Count [Performance Measurement]

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.8 Measuring Event-to-Event Execution Cycle Count [Performance Measurement] This section explains how to measure the execution cycle count between two events in the MB2100-01 emulator debugger. ■ Performance Measurement This emulator debugger measures the execution cycle count between two events, which the system has passed while a user program is running.
  • Page 321 Notes: • This function is not available when the execution time mode is set to the time measuring mode. For details, refer to Section "2.6.3.2 Switching Debug Function". • If two triggers (start and end) specified as a measuring interval have occurred at the same time, performance measuring is not performed.
  • Page 322: Measuring Performance

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.8.1 Measuring Performance This section explains how to measure the event-to-event execution cycle count in the MB2100-01 emulator debugger. ■ Measuring Procedure Use the following steps to measure the performance. 1. Specify the performance measuring interval. 2.
  • Page 323: Ending The Measurement

    ● Using Command for Measuring 1. Specify performance events. - Execute the SET EVENT command. For details, refer to Section "3.22 SET EVENT(type 2)" in "SOFTUNE Workbench Command Reference Manual". 2. Specify the performance measuring interval. - Execute the SET PERFORMANCE command. For details, refer to Section "4.9 SET PERFORMANCE (type 3)"...
  • Page 324: Viewing Program Execution History [Trace]

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9 Viewing Program Execution History [Trace] This section describes the trace function of this emulator debugger. ■ What is Trace The function that records the program execution history is called "trace". Trace data contains address information before and after branch, which is available for the analysis of the program execution history.
  • Page 325 CHAPTER 2 DEPENDENCE FUNCTIONS ● When break halts program execution Figure 2.6-5 Acquiring Trace Data When a break occurred during execution of a program Start execution Stop execution Start execution Stop execution Program flow Trace Buffer | --------------- ---------------| Max. 1,024 frames Note: Executing the forced start will clear the trace data that was stored until then.
  • Page 326: Displaying Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.1 Displaying Trace Data This section explains how to display trace data. ■ Display Formats of Trace Data The following three formats can be used to display trace data. RAW data: Instruction: Source: ■ Trace Data Display Position Sampled trace data is numbered by frame.
  • Page 327 ● Using command window 1. Display trace data for each display mode. RAW data: SHOW TRACE Instruction: SHOW TRACE Source: SHOW TRACE For details, refer to Section "4.32 SHOW TRACE (type 2)" in "SOFTUNE Workbench Command Reference Manual". Note: In the disassembly format, data is read from memory to be displayed. If an instruction is rewritten after code fetching, data will not be displayed correctly.
  • Page 328: Trace Data Display Examples (Raw Data)

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.2 Trace Data Display Examples (RAW Data) This section describes trace data that is displayed in the RAW data mode. ■ RAW Data Display This format displays frames that are output from the emulator without analyzing them. Figure 2.6-6 shows a RAW data display example.
  • Page 329: Trace Data Display Example (Instruction)

    2.6.9.3 Trace Data Display Example (Instruction) This section describes trace data that is displayed in the instruction mode. ■ Instruction Display This mode displays the branch addresses of the RAW data display in disassembly format. Figure 2.6-7 shows an instruction display example. Figure 2.6-7 Example of the Instruction Display Frame Number Decimal, signed...
  • Page 330: Trace Data Display Example (Source)

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.4 Trace Data Display Example (Source) This section describes trace data that is displayed in the source line mode. ■ Source Display This mode displays only source lines. Figure 2.6-8 shows a source display example. Figure 2.6-8 Example of the Trace Data Display (Source) >SHOW TRACE/SOURCE -10..-5 frame no.
  • Page 331: Saving Trace Data

    2.6.9.5 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command.
  • Page 332: Searching For Trace Data

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.6 Searching for Trace Data This section explains how to search for trace data. ■ Searching for Trace Data The specified address or frame number in trace data can be displayed. The following two methods are available to search for trace data: using GUI (window or dialog) and using only the command.
  • Page 333: How To Display The Output Message From User Program To The Debugger

    2.6.10 How to Display the Output Message from User Program to the Debugger This section explains the semihosting feature of MB2100-01 emulator debugger. ■ What is Semihosting Feature The semihosting feature is a function to display a message output by the user program on the debugger window.
  • Page 334 CHAPTER 2 DEPENDENCE FUNCTIONS ■ Using Method of Semihosting Feature Use the following procedure to display the content of the output request to MBR on the terminal window. 1. Control MBR in the user program. As shown in Figure 2.6-9, it is necessary to control MBR in the user program. Sample project including the control method of MBR is attached in SOFTUNE Workbench V30L36 or later.
  • Page 335: Checking Debugger Information

    F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED, COPYRIGHT(C) FUJITSU SEMICONDUCTOR LIMITED 1997 LICENCED MATERIAL - PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version =======================================================...
  • Page 336 CHAPTER 2 DEPENDENCE FUNCTIONS - SOFTUNE FJ-OMF to HEX Converter version File Path: ------------------------------------------------------- SiOsM Product name: Softune Workbench File Path: SiOsM907.dll path Version: SiOsM907.dll version ------------------------------------------------------- F2MC-16 Series Debugger DLL Product name: SOFTUNE Workbench File Path: SiD907.dll path Version: SiD907.dll version - - - - - - - - - - - - - - - - - - - - - - - - - - - - Debugger type...
  • Page 337: Monitor Debugger

    Monitor Debugger This section describes the functions of the monitor debugger. ■ Monitor Debugger The monitor debugger performs debugging by putting the target monitor program for debugging into the target system and by communicating with the host. Before using this debugger, the target monitor program must be ported to the target hardware. CHAPTER 2 DEPENDENCE FUNCTIONS...
  • Page 338: Resources Used By Monitor Program

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.7.1 Resources Used by Monitor Program The monitor program of the monitor debugger uses the I/O resources listed below. The target hardware must have these resources available for the monitor program. ■ Required Resources The following resources are required to build the monitor program into the target hardware. Table 2.7-1 Resources Used by Monitor Debugger UART Monitor ROM...
  • Page 339: Break

    2.7.2 Break In the monitor debugger, two types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this monitor debugger, the following two types of break functions are supported. •...
  • Page 340: Software Break

    CHAPTER 2 DEPENDENCE FUNCTIONS 2.7.2.1 Software Break It is a function to bury the instruction for the break under the memory, and to do the break by the instruction execution. The break is done before an instruction the specified address is executed. ■...
  • Page 341: Forced Break

    2.7.2.2 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request CHAPTER 2 DEPENDENCE FUNCTIONS...
  • Page 342 CHAPTER 2 DEPENDENCE FUNCTIONS...
  • Page 343: Index

    INDEX INDEX The index follows on the next page. This is listed in alphabetic order.
  • Page 344 INDEX Index Symbols /CYCLE Displaying All Machine Cycles (Specify /CYCLE.) ... 116 /INSTRUCTION Display in Instruction Execution Order (Specify / INSTRUCTION.)... 115, 178, 226, 263 /RAWDATA Display without Analyzing Trace Data (Specify / RAWDATA.) ... 262 /SOURCE Display in Source Line Units (Specify /SOURCE.) ...
  • Page 345 Project Configuration ... 3 Control Control by Sequencer ... 96, 163, 252 Controlling Watchdog Timer... 75, 149, 212, 239 Coverage Coverage Measurement Function... 57, 126, 188 Coverage Measurement Operation ... 57, 126, 188 Coverage Measurement Procedures ... 57, 126, 188 Displaying Coverage Measurement Result ...
  • Page 346 INDEX Setting Event Mode ... 123, 185 Event-related Commands Event-related Commands in Multi Trace Mode ... 93 Event-related Commands in Normal Mode ... 91 Event-related Commands in Performance Mode ... 95 Example Example of Optional Settings ... 15 Examples of Macro Expansion ... 19 Executing Executing Program ...
  • Page 347 Line Number Line Number Information ... 27 List Macro List... 7, 17 Specifications List... 197 Low-Power Consumption Mode Low-Power Consumption Mode Simulation ... 41 Machine Cycles Displaying All Machine Cycles ... 179 Macro Examples of Macro Expansion ... 19 Macro List... 7, 17 Macros...
  • Page 348 INDEX Multi Trace... 171 Multi Trace Frame Number ... 110, 171 Multi Trace Function ... 110 Operation in Multi Trace Mode ... 92 Setting Methods of Multi Trace ... 174 Setting Multi Trace... 112 Native Mode Native Mode ... 140, 205 Normal Mode Event-related Commands in Normal Mode ...
  • Page 349 Monitoring Program Automatic Loading ... 204, 235 Program stopping conditions ... 298 Setting Monitoring Program Automatic Loading ... 139 Trace Control during Executing User Program ... 169 Project Active Project... 2 Active Project Configuration... 4 Project ... 2 Project Configuration ... 3 Project Dependence...
  • Page 350 INDEX Setting Method... 42, 44, 46, 47, 80, 82, 83, 85, 86, 153, 155, 156, 157, 159, 160, 161, 215, 217, 219, 243, 245, 246, 248, 249, 250, 326 Setting Methods of Multi Trace ... 174 Setting Minimum Measurement Unit for Timer ...
  • Page 351 Display Format of Trace Data ... 54 Display without Analyzing Trace Data (Specify / RAWDATA.) ... 262 Displaying Trace Data ... 54 Displaying Trace Data Storage Status ... 113, 176, 224, 260 Frame Number and Step Number in Single Trace ...
  • Page 352 INDEX...
  • Page 353 Colophon FUJITSU SEMICONDUCTOR • CONTROLLER MANUAL MC-16 FAMILY SOFTUNE Workbench USER’S MANUAL FUJITSU SEMICONDUCTOR LIMITED Published Sales Promotion Dept. Edited CM41-00313-6E April 2011 the 6th edition...

This manual is also suitable for:

Softune workbench

Table of Contents