
CM41-00313-6E
F 2 MC-16 FAMILY
SOFTUNE TM Workbench USER'S MANUAL




SOFTUNE TM Workbench USER'S MANUAL



SOFTUNE Workbench is support software for developing programs for the F2MC-16 family of microprocessors / microcontrollers.
It is a combination of a development manager, simulator debugger, emulator debugger, monitor debugger, and an integrated development environment for efficient development.
This manual explains functions of SOFTUNE Workbench.
This manual is intended for engineers designing several kinds of products using SOFTUNE Workbench.
Other company names and products names are trademarks or registered trademarks of their respective companies.
REALOS, SOFTUNE are trademark of Fujitsu Semiconductor Limited, Japan.
Microsoft, Windows and Windows Media are either registered trademarks of Microsoft Corporation in the United States and/or other countries.
The company names and brand names herein are the trademarks or registered trademarks of their respective owners.
This manual consists of the following 2 chapters.
This chapter describes the basic functions on the SOFTUNE Workbench.
This chapter describes the functions dependent on each Debugger.

Copyrights © 2004-2011 FUJITSU SEMICONDUCTOR LIMITED All rights reserved.

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.



CHAPTER 1 BASIC FUNCTIONS 1 1.1 Workspace Management Function 2 1.2 Project Management Function 3 1.3 Project Dependence 5 1.4 Make/Build Function 6 1.4.1 Customize Build Function 7 1.5 Include Dependencies Analysis Function 9 1.6 Functions of Setting Tool Options 10 1.7 Error Jump Function 11 1.8 Editor Functions 13 1.9 Storing External Editors 14 1.10 Storing External Tools 16 1.11 Macro Descriptions Usable in Manager 17 1.12 Setting Operating Environment 21 1.13 Debugger Types 22 1.14 Memory Operation Functions 23 1.15 Register Operations 24 1.16 Line Assembly and Disassembly 25 1.17 Symbolic Debugging 26 1.17.1 Referring to Local Symbols 28 1.17.2 Referring to Variable of C Language 29
CHAPTER 2 DEPENDENCE FUNCTIONS 31 2.1 Simulator Debugger 32 2.1.1 Setting Operating Environment 34 2.1.1.1 Boot ROM File Automatic Execution 35 2.1.2 Instruction Simulation 36 2.1.3 Memory Simulation 37 2.1.4 I/O Port Simulation 38 2.1.5 Interrupt Simulation 39 2.1.6 Reset Simulation 40 2.1.7 Low-Power Consumption Mode Simulation 41 2.1.8 STUB Function 42 2.1.9 Break 43 2.1.9.1 Code Break 44 2.1.9.2 Data Break 46 2.1.9.3 Trace-Buffer-Full Break 47 2.1.9.4 Guarded Access Break 48 2.1.9.5 Forced Break 49 2.1.10 Measuring Execution Cycle Count 50 2.1.11 Trace 52 2.1.11.1 Setting Trace 53 2.1.11.2 Displaying Trace Data 54

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 2.2 Emulator Debugger (MB2141) 63 2.2.1 Setting Operating Environment 64 2.2.1.1 MCU Operation Mode 65 2.2.1.2 Debug Area 67 2.2.1.3 Memory Area Types 68 2.2.1.4 Memory Mapping 71 2.2.1.5 Timer Minimum Measurement Unit 73 2.2.2 Notes on Commands for Executing Program 74 2.2.3 Commands Available during Execution of User Program 76 2.2.4 On-the-fly Memory Access 77 2.2.5 Break 79 2.2.5.1 Code Break 80 2.2.5.2 Data Break 82 2.2.5.3 Sequential Break 83 2.2.5.4 Guarded Access Break 84 2.2.5.5 Trace-Buffer-Full Break 85 2.2.5.6 Performance-Buffer-Full Break 86 2.2.5.7 Forced Break 87 2.2.6 Events 88 2.2.6.1 Operation in Normal Mode 90 2.2.6.2 Operation in Multi Trace Mode 92 2.2.6.3 Operation in Performance Mode 94 2.2.7 Control by Sequencer 96 2.2.7.1 Setting Sequencer 97 2.2.7.2 Break by Sequencer 99 2.2.7.3 Trace Sampling Control by Sequencer 100 2.2.7.4 Time Measurement by Sequencer 102 2.2.7.5 Sample Flow of Time Measurement by Sequencer 103 2.2.8 Real-time Trace 105 2.2.8.1 Single Trace 106 2.2.8.2 Setting Single Trace 108 2.2.8.3 Multi trace 110 2.2.8.4 Setting Multi Trace 112 2.2.8.5 Displaying Trace Data Storage Status 113 2.2.8.6 Specify Displaying Trace Data Start 114 2.2.8.7 Display Format of Trace Data 115 2.2.8.8 Reading Trace Data On-the-fly 119 2.2.8.9 Saving Trace Data 121 2.2.9 Measuring Performance 122 2.2.9.1 Performance Measurement Procedures 123 2.2.9.2 Display Performance Measurement Data 125 2.2.10 Measuring Coverage 126

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 2.3 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 140 2.3.1.3 Debug Area 141 2.3.1.4 Memory Area Types 142 2.3.1.5 Memory Mapping 144 2.3.1.6 Debug Function 146 2.3.1.7 Event Mode 147 2.3.2 Notes on Commands for Executing Program 148 2.3.3 Commands Available during Execution of User Program 150 2.3.4 Break 152 2.3.4.1 Code Break 153 2.3.4.2 Data Break 155 2.3.4.3 Monitoring Data Break 156 2.3.4.4 Sequential Break 157 2.3.4.5 Guarded Access Break 158 2.3.4.6 Trace-Buffer-Full Break 159 2.3.4.7 Performance-Buffer-Full Break 160 2.3.4.8 External Trigger Break 161 2.3.4.9 Forced Break 162 2.3.5 Control by Sequencer 163 2.3.5.1 Setting Sequencer 165 2.3.6 Real-time Trace 167 2.3.6.1 Setting Single Trace 170 2.3.6.2 Multi Trace 171 2.3.6.3 Setting Methods of Multi Trace 174 2.3.6.4 Displaying Trace Data Storage Status 176 2.3.6.5 Specify Displaying Trace Data Storage Status 177 2.3.6.6 Display Format of Trace Data 178 2.3.6.7 Reading Trace Data On-the-fly 182 2.3.6.8 Saving Trace Data 183 2.3.7 Measuring Performance 184 2.3.7.1 Performance Measurement Procedures 185 2.3.7.2 Display Performance Measurement Data 187 2.3.8 Measuring Coverage 188 2.3.8.1 Coverage Measurement Procedures 189 2.3.9 Real-time Monitoring 192 2.3.10 Execution Time Measurement 193 2.3.11 Power-on Debugging 195 2.3.12 RAM Checker 196 2.3.13 Checking Debugger Information 200 2.4 Emulator Debugger (MB2147-05) 202

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 213 2.4.4 Break 214 2.4.4.1 Code Break 215 2.4.4.2 Data Break 217 2.4.4.3 Guarded Access Break 218 2.4.4.4 Trace-Buffer-Full Break 219 2.4.4.5 Forced Break 220 2.4.5 Real-time Trace 221 2.4.5.1 Setting Trace 223 2.4.5.2 Displaying Trace Data Storage Status 224 2.4.5.3 Specifying Displaying Trace Data Start 225 2.4.5.4 Display Format of Trace Data 226 2.4.5.5 Reading Trace Data On-the-fly 230 2.4.5.6 Saving Trace Data 231 2.4.6 Measuring Execution Cycle Count 232 2.5 Emulator Debugger (MB2198) 233 2.5.1 Setting Operating Environment 234 2.5.1.1 Monitoring Program Automatic Loading 235 2.5.1.2 Boot ROM File Automatic Execution 236 2.5.1.3 MCU Operation Mode 237 2.5.1.4 Operation Frequency Control 238 2.5.2 Notes on Commands for Executing Program 239 2.5.3 Commands Available during Execution of User Program 240 2.5.4 Break 242 2.5.4.1 Code Break 243 2.5.4.2 Data Break 245 2.5.4.3 Guarded Access Break 246 2.5.4.4 Sequential Break 247 2.5.4.5 Trace-Buffer-Full Break 248 2.5.4.6 Performance-Buffer-Full Break 249 2.5.4.7 External Trigger Break 250 2.5.4.8 Forced Break 251 2.5.5 Control by Sequencer 252 2.5.5.1 Operating of sequencer 254 2.5.6 Real-time Trace 256 2.5.6.1 Setting Trace 258 2.5.6.2 Displaying Trace Data Storage Status 260 2.5.6.3 Specifying Displaying Trace Data Start 261 2.5.6.4 Display Format of Trace Data 262 2.5.6.5 Saving Trace Data 265

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 2.6 Emulator Debugger (MB2100-01) 272 2.6.1 Starting debugging 273 2.6.1.1 Operating Environments of the Target 274 2.6.1.2 Security 276 2.6.2 Ending debugging 277 2.6.3 Efficiently Executing Debugging 278 2.6.3.1 Increasing Communication Speed during Debugging 279 2.6.3.2 Switching Debug Function 280 2.6.4 Executing Program 281 2.6.4.1 Setting/Release of Debug Functions 282 2.6.4.2 Monitoring 284 2.6.4.3 Power-on Debug 285 2.6.4.4 Notes on Commands for Executing Program 287 2.6.5 To Access the Flash Memory 289 2.6.6 To Interrupt the Program Execution [Break] 293 2.6.6.1 Code Break (Hardware) 294 2.6.6.2 Code Break (Software) 296 2.6.6.3 Data Break 297 2.6.6.4 Forced Break 298 2.6.6.5 Data Watch Break 299 2.6.6.6 Sequencer 301 2.6.7 Measuring the Program Execution Cycle Count 304 2.6.8 Measuring Event-to-Event Execution Cycle Count [Performance Measurement] 306 2.6.8.1 Measuring Performance 308 2.6.9 Viewing Program Execution History [Trace] 310 2.6.9.1 Displaying Trace Data 312 2.6.9.2 Trace Data Display Examples (RAW Data) 314 2.6.9.3 Trace Data Display Example (Instruction) 315 2.6.9.4 Trace Data Display Example (Source) 316 2.6.9.5 Saving Trace Data 317 2.6.9.6 Searching for Trace Data 318 2.6.10 How to Display the Output Message from User Program to the Debugger 319 2.6.11 Checking Debugger Information 321 2.7 Monitor Debugger 323 2.7.1 Resources Used by Monitor Program 324 2.7.2 Break 325 2.7.2.1 Software Break 326 2.7.2.2 Forced Break 327



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
1.11 Macro Descriptions Usable in Manager
1.12 Setting Operating Environment
1.13 Debugger Types
1.14 Memory Operation Functions
1.15 Register Operations
1.16 Line Assembly and Disassembly
1.17 Symbolic Debugging

1.1 Workspace Management Function
This section explains the workspace management function of SOFTUNE Workbench.
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.
To manage two or more projects, workspace manages the following information:
The operation performed in SOFTUNE Workbench is based on the project. The project is a set of files and procedures necessary for creation of a target file. The project file contains all data managed by the project.
The active project is basic to workspace and undergoes [Make], [Build], [Compile/Assemble], [Start Debug], and [Update Dependence] in the menu. [Make], [Build], [Compile/Assemble], and [Update Dependence] affect the subprojects within the active project.
If workspace contains some project, it always has one active project.
The subproject is a project on which other projects depend. The target file in the subproject is linked with the parent project of the subproject in creating a target file in the parent project.
This dependence consists of sharing target files output by the subproject, so a subproject is first made and built. If making and building of the subproject is unsuccessful, the parent project of the subproject will not be made and built.
The target file in the subproject is however not linked with the parent project when:
Only one REALOS-type project can be stored in one workspace.

1.2 Project Management Function
This section explains the project management function of SOFTUNE Workbench.
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:
- Active project configuration
- Information on source files, include files, other object files, library files
- Information on tools executed before and after executing language tools (customize build function)
The project file supports two formats: a 'workspace project format,' and an 'old project format.'
The differences between the two formats are as follows:
- Supports management of two or more project configurations
- Supports use of all macros usable in manager
- Does not support early Workbench versions(*)
- Supports management of just one project configuration
- Limited number of macros usable in manager
For details, see Section "1.11 Macro Descriptions Usable in Manager".
- Supports early Workbench versions(*)
When a new project is made, the workspace project format is used.
When using an existing project, the corresponding project format is used.
If a project made by an early Workbench version(*) is used, a dialog asking whether to convert the file to the workspace project format is displayed. For details, refer to Section "2.13 Reading SOFTUNE Project Files of Old Versions" of "SOFTUNE Workbench Operation Manual".
To open a project file in the workspace project format with an early Workbench version(*), it is necessary to convert the file to the old project format. For saving the file in other project formats, refer to Section "4.2.7 Save As" of "SOFTUNE Workbench Operation Manual".
*: F2MC-16: V30L26 or earlier
The project configuration is a series of settings for specifying the characteristics of a target file, and making, building, compiling and assembling is performed in project configurations.
Two or more project configurations can be created in a project. The default project configuration name is Debug. A new project configuration is created on the setting of the selected existing project configuration. In the new project configuration, the same files as those in the original project configuration are always used.
By using the project configuration, the settings of programs of different versions, such as the optimization
- Project configuration · Workspace project format · Old project format

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
- Information on whether to build file or not
- Information on setting of debugger to debug target file
The active project configuration at default undergoes [Make], [Build], [Compile/Assemble], [Start Debug], and [Update Dependence].
The setting of the active project configuration is used for the file state displayed in the SRC tab of project window and includes files detected in the Dependencies folder.
If a macro function newly added is used in old project format, the macro description is expanded at the time of saving in old project format. For the macro description newly added, refer to Section "1.11 Macro Descriptions Usable in Manager".
source files

1.3 Project Dependence
This section explains the project dependence of SOFTUNE Workbench.
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.
The use of project dependence enables simultaneous making and building of two or more projects developed in one workspace.
A project configuration in making and building a subproject in [Project] - [Project Configuration] - [Build Configuration] menu can be specified.

1.4 Make/Build Function
This section explains the make/build function of SOFTUNE Workbench.
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. The time required for generating a target file can be sharply reduced, especially, when debugging.
For this function to work fully, the dependence between source files and include files should be accurately grasped. To do this, SOFTUNE Workbench has a function for analyzing include dependence. To perform this function, it is necessary to understand the dependence of a source file and include file. SOFTUNE Workbench has the function for analyzing the include file dependence. For details, see Section "1.5 Include Dependencies Analysis Function".
Build function generates a target file by compiling/assembling all source files registered with a project, regardless of whether they have been updated or not, and then by joining all required object files. Using this function causes all files to be compiled/assembled, resulting in the time required for generating the target file longer. Although the correct target file can be generated from the current source files.
The execution of Build function is recommended after completing debugging at the final stage of program development.
When executing the Make function using a source file restored from backup, the integrity between an object file and a source file may be lost. If this happens, executing the Build function again.

1.4.1 Customize Build Function
This section describes the SOFTUNE Workbench to set the 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.
The following operations can be performed automatically during Make or Build using this function:
- starting the syntax check before executing the Compiler,
- after executing the Converter, starting the S-format binary Converter (m2bs.exe) and converting
Motorola S-format files to binary format files.
An option follows the tool name to start a tool from SOFTUNE Workbench. The options include any file name and tool-specific options. SOFTUNE Workbench has the macros indicating that any file name and tool- specific options are specified as options.
If any character string other than parameters is specified, it is passed directly to the tool. For details about the parameters, see Section "1.11 Macro Descriptions Usable in Manager".
The Setup Customize Build dialog provides a macro list for macro input. The build file, load module file, project file submenus indicate their sub-parameters specified.
The environment variable brackets must have any item; otherwise, resulting in an error.
Table 1.4-1 Macro List
Macro List Macro Name
Load module file %(LOADMODULEFILE)
Target file directory %(ABSPATH)
Object file directory %(OBJPATH)
List file directory %(LSTPATH)
Project construction name %(PRJCONFIG)

When checking [Use the Output window], note the following:

1.5 Include Dependencies Analysis Function
This section describes the function of the Include Dependencies Analysis of SOFTUNE Workbench.
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.
For this reason, SOFTUNE Workbench has a built-in Include Dependencies Analysis function. This function can be activated by selecting the [Project] - [Include Dependencies] menu. By using this function, uses can know the exact dependencies, even if an include file includes another include file.
SOFTUNE Workbench automatically updates the dependencies of the compiled/assembled files.
When executing the [Project] - [Include Dependencies] menu, the Output window is redrawn and replaced by the dependencies analysis result.
If the contents of the current screen are important (error message, etc.), save the contents to a file and then execute the Include Dependencies command.

1.6 Functions of Setting Tool Options
This section describes the functions to set options for the language tools activated from SOFTUNE Workbench.
To create a desired target file, it is necessary to specify options for the language tools such as a compiler, assembler, and linker. SOFTUNE Workbench stores and manages the options specified for each tool in project configurations.
Tool options include the options effective for all source files (common options) and the options effective for specific source files (individual options). For details about the option setting, refer to Section "4.5.5 Setup Project" of "SOFTUNE Workbench Operation Manual".
These options are effective for all source files (excluding those for which individual options are specified) stored in the project.
These options are compile/assemble options effective for specific source files. The common options specified for source files for which individual options are specified become invalid.
SOFTUNE Workbench the macros indicating that any file name and directory name are specified as options.
If any character string other than parameters is specified, it is passed directly to the tool. For details about the parameters, see Section "1.11 Macro Descriptions Usable in Manager". For details about the tool options for each tool, see the manual of each tool.
- Common options · - Individual options

1.7 Error Jump Function
This section describes the error jump function in SOFTUNE Workbench.
When an error, such as a compile error occurs, double-clicking the error message displayed in the Output window, opens the source file where the error occurred, and automatically moves the cursor to the error line. This function permits efficient removal of compile errors, etc.
The SOFTUNE Workbench Error Jump function analyzes the source file names and line number information embedded in the error message displayed in the Output window, opens the matching file, and jumps automatically to the line.
The location where a source file name and line number information are embedded in an error message, varies with the tool outputting the error.
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.
A new error message format should be added when working the Error Jump function with user register. To set Error Jump, execute the [Setup] - [Error Jump Setting] menu.
An error message format can be described in Syntax. SOFTUNE Workbench uses macro descriptions as shown in the Table 1.7-1 to define such formats.
To analyze up to where %f, %h, and %* continue, SOFTUNE Workbench uses the character immediately after the above characters as a delimiter. Therefore, in Syntax, the description until a character that is used as a delimiter re-appears, is interpreted as a file name or a keyword for help, or is skipped over. To use % as a delimiter, describe as %%. The %[char] macro skips over as long as the specified character continues in parentheses. To specify "]" as a skipped character, describe it as "\]". Blank characters in succession can be
specified with a single blank character.
Table 1.7-1 List of Special Characters String for Analyzing Error Message
%f Interpret as source file name and inform editor.
%l Interpret as line number and inform editor.
%h Become keyword when searching help file.
%* Skip any desired character.
%[char] Skip as long as characters in [ ] continues.
Characters Semantics

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) E4062C: Syntax Error: near /int. ■Reference Section
[Example] · Setup Error Jump

1.8 Editor Functions
This section describes the functions of the SOFTUNE Workbench built-in 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.
- Keyword marking function in C/assembler source file
Displays reserved words, such as if and for, in different color
- Error line marking function
The error line can be viewed in a different color, when executing Error Jump.
- Bookmark setup function
A bookmark can be set on any line, and instantaneously jumps to the line. Once a bookmark is set, the line is displayed in a different color.
- Ruler, line number display function
The Ruler is a measure to find the position on a line; it is displayed at the top of the Edit window. A line number is displayed at the left side of the Edit window.
- Automatic indent function
When a line is inserted using the Enter key, the same indent (indentation) as the preceding line is set automatically at the inserted line. If the space or tab key is used on the preceding line, the same use is set at the inserted line as well.
- Function to display, Blank, Line Feed code, and Tab code
When a file includes a Blank, Line Feed code, and Tab code, these codes are displayed with special symbols.
This function cancels the preceding editing action to restore the previous state. When more than one character or line is edited, the whole portion is restored.
- Tab size setup function
Tab stops can be specified by defining how many digits to skip when Tab codes are inserted. The default is 8.
- Font changing function
The font size for character string displayed in the Edit window can be selected.
Edit Window (The Standard Editor)
- Undo function

1.9 Storing External Editors
This section describes the function to set an external editor to SOFTUNE Workbench.
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. Use the [Setup] - [Editor setting] menu to set an external editor.
- Error jump function
The error jump cannot move the cursor to an error line if the external editor does not have a function to specify the cursor location when activated the external editor.
- File save at compiling/assembling
SOFTUNE Workbench cannot control an external editor. Always save the file you are editing before compiling/assembling.
When activating an external editor from SOFTUNE Workbench, options must be added immediately after the editor name. The names of file to be opened by the editor and the initial location of the cursor (the line number). can be specified. SOFTUNE Workbench has a set of special parameters for specifying any file name and line number, as shown in the Table 1.9-1. If any other character string are described by these parameters, such characters string are passed as is to the editor.
%f (File name) is determined as follows:
%x (project path) is determined as follows:
Also file name cannot be given double-quotes in the expansion of %f macros.
Therefore, it is necessary for you to provide double-quotes for %f. Depending on the editor, there are line numbers to which there will be no correct jump if the entire option is not given double-quotes.

Table 1.9-1 List of Special Characters for Analyzing Error Message
%% Means specifying % itself
%f Means specifying file name
%l Means specifying line number
%x Means specifying project path
Table 1.9-2 Example of Optional Settings
WZ Editor V4.0 %f /j%l
MIFES V1.0 %f+%l
Hidemaru for Win3.1/95 /j%l:1 %f
Regarding execution of error jump in Hidemaru: To execute error jump in Hidemaru used as an external editor, use the [Others] - [Operating Environment] - [Exclusive Control] menu, and then set "When opening the same file in Hidemaru" and "Opening two identical files is inhibited".

1.10 Storing External Tools
This section describes the function to set an external tool to SOFTUNE Workbench.
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. Use this function to coordinate with a source file version control tool.
If a tool set as an external tool is designed to output the execution result to the standard output and the standard error output through the console application, the result can be specified to output the SOFTUNE Workbench Output window. In addition, the allow description of additional parameters each time the tool is activated.
To set an external tool, use the [Setup] - [Setting Tool] menu.
To select the title of a set tool, use the [Setup] - [Activating Tool] menu.
When activating an external tool from SOFTUNE Workbench, options must be added immediately after the external tool name. Specify the file names, and unique options, etc.
SOFTUNE Workbench has a set of special parameters for specifying any file name and unique tool options.
If any characters string described other than these parameters, such characters string are passed as is to the external tool.
For details about the parameters, see Section "1.11 Macro Descriptions Usable in Manager".
When checking [Use the Output window], note the following:
Setting Tools · Starting Tools

1.11 Macro Descriptions Usable in Manager
This section explains the macro descriptions that can be used in the manager of SOFTUNE Workbench.
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.
The type of macro that can be specified and macro expansion slightly vary depending on where to describe macros. The macros usable for each function are detailed below. For the macros that can be specified for "Error Jump" and "External Editors" see Sections "1.7 Error Jump Function" and "1.9 Storing External Editors".
The following is a list of macros that can be specified in SOFTUNE Workbench.
The macros usable for each function are listed below.
The directory symbol \ is added to the option directories in Table 1.11-1 but not to the macro directories in Table 1.11-2.
The sub-parameters in Table 1.11-3 can be specified in %(FILE), %(LOADMOUDLEFILE), %(PRJFILE).
The sub-parameter is specified in the form of %(PRJFILE[PATH]).
If the current directory is on the same drive, the relative path is used. The current directory is the workspace directory for %(PRJFILE), and %(WSPFILE), and the project directory for other than them.

Table 1.11-1 List of Macros That Can Be Specified 1
%f Passed as full-path name of file. (*1)
%F Passed as main file name of file. (*1)
%d Passed as directory of file. (*1)
%e Passed as extension of file. (*1)
%a Passed as full-path name of load module file.
%A Passed as main file name of load module file. (*2)
%D Passed as directory of load module file. (*2)
%E Passed as extension of load module file. (*2)
%x Passed as directory of project file. (*2)
%X Passed as main file name of project file. (*2)
%% Passed as %.
Table 1.11-2 List of Macros That Can Be Specified 2
%(FILE) Passed as full-path name of file. (*1)
%(LOADMODULEFILE) Passed as full-path name of load module file. (*2)
%(PRJFILE) Passed as full-path name of project file. (*2)
%(WSPFILE) Passed as full-path name of workspace file. (*3)
%(PRJPATH) Passed as directory of project file. (*2)
%(ABSPATH) Passed as directory of target file. (*2)
%(OBJPATH) Passed as directory of object file. (*2)
%(LSTPATH) Passed as directory of list file. (*2)
%(PRJCONFIG) Passed as project configuration name. (*2) (*3)
Environment variable specified in environment variable brackets is passed.
%(TEMPFILE) Temporary file is created and its full-path name is passed. (*4)
The macros in (*1) are determined as follows:

The macros in (*2) are determined as follows:
- Customize build and tool options
*3: The macro can use only the project of the workspace project format.
*4: The content of a temporary file can be specified only with customize build.
Table 1.11-3 List of Sub parameters 1
[PATH] Directory of file
[RELPATH] Relative Path of file
[NAME] Main file name of file
[EXT] Extension of file
[SHORTFULLNAME] Full path name of short file
[SHORTPATH] Directory of short file
[SHORTNAME] Main file name of short file
[FOLDER] Name of folder in which files are stored in the SRC tab of project window (Can be specified only in %(FILE).)(*)
*: The macro can be used only the project of workspace project format.
If the following workspace is opened, macro expansion is performed as follows:
Active project configuration Debug
Active project configuration Release
![Page 34 of the Fujitsu F2 MC-16 user manual — %(ENV[FETOOL]) : C:\SOFTUNE](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/page-34.webp?w=400)
[Example] Macro expansion in external tools
Focus is on Subprj project file in the SRC tab of project window.
Focus is not in the SRC tab of project window.
[Example] Macro expansion in customize build
Release configuration of Subprj project is built.
%(FILE[RELPATH]) : .
[Example] Macro expansion in tool options
Release configuration of Subprj project is built.

1.12 Setting Operating Environment
This section describes the functions for setting the SOFTUNE Workbench 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.
Environment variables are variables that are referred to mainly using the language tools activated from SOFTUNE Workbench. The semantics of an environment variable are displayed in the lower part of the Setup dialog. However, the semantics are not displayed for environment variables used by tools added later to SOFTUNE Workbench.
When SOFTUNE Workbench and the language tools are installed in a same directory, it is not especially necessary to change the environment variable setups.
The following setups are possible.
- Open the previously worked-on Project at start up
When starting SOFTUNE Workbench, it automatically opens the last worked-on Project.
- Display options while compiling/assembling
Compile options or assemble options can be viewed in the Output window.
- Save dialog before closing Project
Before closing the Project, a dialog asking for confirmation of whether or not to save the Project to the file is displayed. If this setting is not made, SOFTUNE Workbench automatically saves the Project without any confirmation message.
- Save dialog before compiling/assembling
Before compiling/assembling, a dialog asking for confirmation of whether or not to save a source file that has not been saved is displayed. If this setting is not made, the file is saved automatically before compile/assemble/make/build.
- Termination message is highlighted at Make/Build
At Compile, Assemble, Make, or Build, the display color of termination messages (Abort, No Error, Warning, Error, Fatal error, or Failing During start) can be changed freely by the user.
Because the environment variables set here are language tools for the SOFTUNE Workbench, the environment variables set on previous versions of SOFTUNE cannot be used. In particular, add the set values of [User Include Directory] and [Library Search Directory] to [Tool Options Settings].
Development Environment

1.13 Debugger Types
This section describes the types of SOFTUNE Workbench debuggers.
SOFTUNE Workbench integrates three types of debugger: a simulator debugger, emulator debugger, and monitor debugger. Any one can be selected depending on the requirement.
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 for evaluating an uncompleted system and operation of individual units, etc.
The emulator debugger is software to evaluate a program by controlling an emulator from a host through a communications line (RS-232C, LAN, USB).
Before using this debugger, the emulator must be initialized.
The monitor debugger evaluates a program by putting it into an evaluation system and by communicating with a host. An RS-232C interface and an area for the debug program are required within the evaluation system.

1.14 Memory Operation Functions
This section describes the memory operation functions.
- Display/Modify memory data
Memory data can be display in the Memory window and modified.
The specified memory area can be filled with the specified data.
The data in the specified memory area can be copied to another area.
The data in the specified source area can be compared with data in the destination area.
Data in the specified memory area can be searched. For further details of the above functions, refer to "3.11 Memory Window" in "SOFTUNE Workbench Operation Manual".
- Display/Modify C variables
The names of variables in a C source file can be displayed in the Watch window and modified.
- Setting Watch point
By setting a watch point at a specific address, its data can be displayed in the Watch window. For further details of the above functions, refer to "3.13 Watch Window" in "SOFTUNE Workbench Operation Manual".

1.15 Register Operations
This section describes the 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" in "SOFTUNE Workbench Operation Manual".
The name of the register and flag displayed in the Register window varies depending on each MCU in use. For the list of register names and flag names for the MCU in use, refer to "Appendix A Register Name List" of " SOFTUNE Workbench Operational Manual".
Register Window

1.16 Line Assembly and Disassembly
This section describes line assembly and disassembly.
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" in "SOFTUNE Workbench Operation Manual".
To display disassembly, use the [View]-[Disassembly] menu. By default, disassembly can be viewed starting from the address pointed by the current program counter (PC). However, the address can be changed to any desired address at start-up.
Disassembly for an address outside the memory map range cannot be displayed. If this is attempted, "" is displayed as the mnemonic.
Disassembly Window

1.17 Symbolic Debugging
A symbol means the symbol defined while a program is created, and it usually has a type. Symbols become usable by loading the debug information file.
Furthermore, a type of the symbol in C language is recognized and the command is executed.
There are three types of symbols as follows:
A global symbol can be referred to from anywhere within a program. In C language, variables and functions defined outside a function without a static declaration are in this category. In assembler, symbols with a PUBLIC declaration are in this category.
A static symbol within module can be referred to only within the module where the symbol is defined.
In C language, variables and functions defined outside a function with a static declaration are in this category. In assembler, symbols without a PUBLIC declaration are in this category.
A local symbol within a function exists only in C language. A static symbol within a function and an automatic variable are in this category.
- Static symbol within function
Out of the variables defined in function, those with static declaration.
Out of the variables defined in function, those without static declaration and parameters for the function.
Symbol information in the file is set with the symbol information table by loading a debug information file. This symbol information is created for each module.
The module is constructed for each source file to be compiled in C language, in assembler for each source file to be assembled.
The debugger automatically selects the symbol information for the module to which the PC belongs to at abortion of execution (Called "the current module"). A program in C language also has information about which function the PC belongs to.
- Automatic variable

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

1.17.1 Referring to Local Symbols
This section describes referring to local symbols and 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.
SOFTUNE Workbench automatically scopes the current module and function to refer to local symbols in the current module with preference. This is called the Auto-scope function, and the module and function currently being scoped are called the Current Scope.
When specifying a local variable outside the Current Scope, the variable name should be specified by the module and function to which the variable belongs. This method of specifying a variable is called a symbol path name or a Search Scope.
As explained earlier, there are two ways to specify the reference to a variable: by adding a Search Scope when specifying the variable name, and by moving the Current Scope to the function with the symbol to be referred to. The Current Scope can be changed by displaying the Call Stack dialog and selecting the parent function. For further details of this operation, refer to "4.6.7 Stack" in "SOFTUNE Workbench Operation Manual". Changing the Current Scope as described above does not affect the value of the PC.
By moving the current scope in this way, you can search a local symbol in parent function with precedence.
A symbol is specified as follows:
[[Module Name] [\Function Name] \] Symbol Name
When a symbol is specified using the module and function names, the symbol is searched. However, when only the symbol name is specified, the search is made as follows:
If a global symbol has the same name as a local symbol in the Current Scope, specify "\" or "::" at the start of global symbol. By doing so, you can explicitly show that is a global symbol.
An automatic variable can be referred to only when the variable is in memory. Otherwise, specifying an automatic variable causes an error.

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.
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 "&". Some examples are shown in the Table
1.17-1.
Table 1.17-1 Examples of Specifying Variables
Regular Variable int data; data Value of data
Pointer char *p; *p Value pointed to by p
Array char a[5]; a[1] Value of second element of a
Structure struct stag { char c; int i; }; struct stag st; struct stag *stp;
st.c stp- >c
Value of member c of st Value of member c of the structure to which stp points
Union union utag { char c; int i; } uni;
uni.i Value of member i of uni
Address of variable int data; &data Address of data
Reference type int i; int &ri = i;
ri Same as i

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.
In such a case, the symbol name in the Current Scope normally is preferred. To refer to a symbol name outside the Current Scope, specify the symbol with the module name.
If there are duplicated symbols outside the Current Scope, the symbol name searched first becomes valid. To refer to another one, specify the symbol with the module name.

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

This section describes the functions of the simulator debugger for the F2MC-16 Family.
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.
There are 2 types of simulator debuggers.
- Normal simulator debugger (normal)
- High-speed simulator debugger (fast)
This high-speed simulator debugger provides substantial reductions in simulation time due to a dramatic review of normal simulator debugger's processing methods.
The high-speed simulator debugger can be instruction processing performance for 10MIPS when it is operated by PC equipped with Pentium4 2.0GHz.
External I/F for simulator are equipped to high-speed simulator debugger to create peripheral simulation modules.
Please refer to "Appendix I External I/F DLL for Simulator" in "SOFTUNE Workbench Operation Manual".
The high-speed simulator debugger requires much more RAM space on the host PC than that of normal simulator debugger.
The required RAM size depends largely on your program size.
For the required available RAM space, see the table below:
Basic use Fs907s.exe (This product) 20MB
CODE size of target program per 64 KB 6MB
DATA size of target program per 64 KB 1.5MB
Insufficient RAM space will lead to an extreme decrease in simulation speed.
DATA YY(KB)
Required RAM space (MB) = 20 + (XX / 64) × 6 + (YY / 64) × 1.5
However, RAM space larger than the above may be needed depending on program allocation. Consecutive areas should be reserved as much as possible.
Required RAM space (MB) = 20 + (1024 / 64) × 6 + (1024 / 64) × 1.5 = 140MB
Target program size

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. There is a method for simulating interrupts like timer interrupts, and data input to memory like I/O ports. For details, see the sections concerning I/O port simulation and interrupt simulation.
- I/O port simulation (Input port)
- I/O port simulation (Output port)
- Power-save consumption mode simulation

This section explains the operating environment setup.
For the simulator debugger for F2MC-16FX, it is necessary to set the following operating environment. Its predefined default settings are enabled at startup. Therefore, setup is not required when using the default settings. Adjusted settings can be used as new default settings from the next time.

The simulator debugger for F2MC-16FX automatically loads and executes the Boot ROM file at the start of debugging.
When the simulator debugger for F2MC-16FX is specified, the Boot ROM file is automatically loaded and then executed at the start of debugging. The Boot ROM file is stored in Lib\907\BootROM under the directory where Workbench is installed.
The directory containing the Boot ROM file can be displayed using the [Project] - [Setup Project] menu, and can be modified in the setup project dialog. In addition, it is also possible to automatically execute the Boot ROM file during the debugger startup or reset of MCU. For details, see the "SOFTUNE Workbench Operation Manual".

This section describes the instruction simulation executed by SOFTUNE Workbench.
This simulates the operations of all instructions supported by the F2MC-16/16L/16LX/16H/16F. It also simulates the changes in memory and register values due to such instructions.

This section describes the memory simulation executed by SOFTUNE Workbench.
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.
- Load the file output by the Linkage Editor (Load Module File) using either the [Debug] - [Load target
file] menu, or the LOAD/OBJECT command in the Command window.
Memory space access attributes can be specified byte-by-byte using the [Setup] - [Memory Map] menu. The access attribute of unspecified memory space is Undefined using the [Setup] - [Memory Map] menu.
Access attributes for memory area can be specified as shown in Table 2.1-1. A guarded access break occurs if access is attempted against such access attribute while executing a program. When access is made by a program command, such access is allowed regardless of the attribute, CODE, READ or WRITE. However,
access to memory in an undefined area causes an error.
Table 2.1-1 Types of Access Attributes
CODE Instruction operation enabled
READ Data read enabled
WRITE Data write enabled
undefined Attribute undefined (access prohibited)
Attribute Semantics

This section describes I/O port simulation executed by SOFTUNE Workbench.
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.
- Whenever the instruction execution cycle count exceeds the specified cycle count, data is input to the
port.
To set an input port, use the [Setup] - [Debug Environment] - [I/O Port] menu, or the SET INPORT command in the Command window.
Up to 4096 port addresses can be specified for the input port. The data input source can be a file or a terminal. After reading the last data from the file, the data is read again from the beginning of the file. If a terminal is specified, the input terminal is displayed at read access to the set port.
A text file created by an ordinary text editor, or a binary file containing direct code can be used as the data input file. When using a text file, input the input data inside commas (,). When using a binary file, select the binary radio button in the input port dialog.
At output port simulation, whenever a program writes data to the specified port, writing is executed to the data output destination.
To set an output port, either use the [Setup] - [Debug Environment] - [I/O Port] menu, or the SET OUTPORT command in the Command window.
Up to 4096 port addresses can be set as output ports. Select either a file or terminal (Output Terminal window) as the data output destination.
A destination file must be either a text file that can be referred to by regular editors, or a binary file. To output a binary file, select the Binary radio button in the Output Port dialog.
The following method is not supported by high-speed simulator debugger.
Furthermore the setting of memory map is necessary to set I/O port. When deleting memory map, I/O port is also deleted.

This section describes the interrupt simulation executed by SOFTUNE Workbench.
Simulate the operation of the MCU (including intelligent I/O service*) in response to an interrupt request. 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.
*: Automatic data transfer function between I/O and memory is called an intelligent I/O service. This function allows exchange of data between memory and I/O, which was done previously by the interrupt handling program, using DMA (Direct Memory Access). (For details, refer to the user manual for each model.)
The methods of generating interrupts are as follows:
- Execute instructions for the specified number of cycles while the program is running (during execution
of executable commands) to generate interrupts corresponding to the specified interrupt numbers and cancel the interrupt generating conditions.
- Continue to generate interrupts each time the number of instruction execution cycles exceeds the
specified number of cycles.
The method of generating interrupts is set by the [Setup]-[Debug environment]-[Interrupt] menu. If interrupts are masked by the interrupt enable flag when the interrupt generating conditions are established, the interrupts are generated after they are unmasked.
MCU operation in response to an interrupt request is also supported for the following exception handling:
- Execution of undefined instructions
- Address error in program access
(Program access to internal RAM area and internal I/O area)
- Stack area error (only for F2MC-16F)
When an external interrupt is generated while under an interrupt mask at high-speed simulator debugger, that interrupt factor is eliminated.

This section describes the reset simulation executed by SOFTUNE Workbench.
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. In this case, the reset message (Reset) is displayed on the status bar.

This section describes the low-power consumption SOFTUNE Workbench mode simulation executed by SOFTUNE Workbench.
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" for sleep mode, "stop" for stop mode) is displayed on the Status Bar. The loop keeps running until either an interrupt request is generated, or the [Debug] - [Abort] menu is executed. Each cycle of the loop increments the count by 1. During this period, I/O port processing can be operated. Writing to the standby control register using a command is not prohibited.

This section describes the STUB function which executes commands automatically when the breakpoint hit occurs.
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. The use of this function enables spot processing, such as simple I/O simulation, external interrupt generation, and memory reprogramming, without changing the main program. This function is effective only when the simulator debugger is used.

The STUB function can be set by the following commands.
2. SET DATABREAK

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.
In this simulator debugger, the following five types of break functions are supported.

It is a function that the simulator debugger aborts the program execution when the code access specified while executing the program is done.
When the program reaches the breakpoint (Immediately before an instruction memory positional is executed), the simulator debugger does the following processing.
The breakpoint can be set up to 65535 points or less.
When a break occurs due to a code break, the following message is displayed on the Status Bar.
Break at Address by breakpoint ■Setting Method
The code break is controlled by the following method.
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoint Set Dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/Disassembly window
There are several points to note in using code break. First, some points affecting code break are explained.
Here are some additional points about the effects on other commands.

- If instruction executed by STEP command, instruction execution not aborted.
- If breakpoint specified with GO command, set at instruction immediately after such instruction, the
breakpoint does not break.
[High-speed version simulator debugger]

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.
The simulator debugger does the following processing when the program writes in the breakpoint or it reads it.
The breakpoint can be set up to 65535 points or less.
When a break occurs due to a data break, the following message is displayed on the Status Bar.
Break at Address by databreak at Access address ■Setting Method
The data break is controlled by the following method.
Refer to "3.10 SET DATABREAK (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoint Set Dialog [Data] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
[High-speed version simulator debugger]

It is a function to abort the program execution when the trace buffer becomes full.
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 ■Setting Method
The trace-buffer-full break is controlled by the following method.
Refer to "4.29 SET TRACE(type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".

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.
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 functions as follows.
When the instruction execution to the area without the code attribute
When read the area without the read attribute
When writing it in the area without the write attribute
When a break occurs due to a guarded break, the following message is displayed on the Status Bar.
Break at Address by guarded access {code/read/write} at Access address

It is a function to abort the execution of the program compulsorily.
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

This function measures the program execution cycle count.
Measures program execution cycle count and step counts.
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.
The maximum measurable value varies, as shown below, whether the normal or the high-speed simulator debugger is used.
Measures program execution step counts.
For both the normal simulator debugger and the high-speed simulator debugger, the maximum measurable count is "2 to the power of 32 - 1", in other words, up to 4,294,967,295 steps.
The measurement is performed whenever a program is executed, and the measurement result displays the following two values:
Either of the following methods can be used to display the measurement results.
The results appear 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".
Enter the SHOW TIMER command in the command window.
For details, refer to Section "4.27 SHOW TIMER" in "SOFTUNE Workbench Command Reference Manual".

Either of the following methods can be used to clear the measurement results.
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".
Enter the CLEAR TIMER command in the command window.
For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual".
Because no simulation was done on pipeline process or cache operation inside the chip, it may differ from an actual chip for normal simulator debugger and/or high-speed simulator debugger.

The address and status information can be sampled during program execution to record it in a trace buffer. This function is called a 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. Data of the trace buffer can be used to make a detailed analysis of a program execution history.
The trace buffer is in the form of a ring. When it becomes full, it records the next data by automatically overwriting the buffered data at the beginning.
The simulator debugger can sample 1000 frames of trace data for the address of the executed instruction.
While the trace function is enabled, data is always sampled and recorded in the trace buffer during execution of a user program.
The program execution aborts due to a break factor such as a breakpoint, terminating the trace.
Furthermore, when the trace buffer becomes full, a program break can be invoked. This break is called a trace buffer full break.
A number is assigned to each frame of sampled trace data. This number is called a frame number.
The frame number is used to specify the display start position of the trace buffer.
The number 0 is assigned to the last-sampled trace data. Negative values are assigned to trace data that have been sampled before the arrival at the triggering position.
Figure 2.1-1 Frame Numbering at Tracing


You must set the following two items to perform a trace. After that, trace data will be sampled with the execution of the program.
This is done by [Setup] - [Trace] in the trace window shortcut menu.
Enter the ENABLE TRACE command.
This is done using the trace window shortcut menu [Setup] - [Trace].
Enter the SET TRACE/BREAK command.

Data recorded in the trace buffer can be displayed.
The trace window or command window displays how much trace data is stored in the trace buffer.
Select [Refresh] in the trace window shortcut menu.
Enter the SHOW TRACE command. ■Display Format of Trace Data
There are two display formats of the trace data.
Either of the following methods can be used to clear data in the trace buffer.
Select [Clear] in the trace window shortcut menu.
Enter the CLEAR TRACE command.

The trace buffer can be searched to locate target 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.
Either of the following methods can be used to search the trace data.
Select [Find] in the trace window shortcut menu.
Enter the SEARCH TRACE command.

This section explains how to save 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Save] from the shortcut menu. The [Save as] dialog
appears. Specify the file name and where to save trace data. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SHOW TRACE/FILE command.
For details, refer to Section "4.33 SHOW TRACE (type 3)" in "SOFTUNE Workbench Command Reference Manual". When additionally saving trace data in an existing file, execute the SHOW TRACE/FILE/APPEND command.

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.
When testing a program, the program is executed with various test data input and the results are checked for correctness. When the test is finished, every part of the entire program should have been executed. If any part has not been executed, there is a possibility that the test is insufficient.
It can know what percentage of the entire program executed when the coverage function for the high-speed version simulator debugger to have is used.
In addition, details such as which addresses were not accessed can be checked.
In this debugger, the range to measure coverage can be set.
Please set the time base range only to the code area when you do the C0 coverage.
Moreover, the access of the variable can be examined as the variable not used is searched out by setting the time base range to the data area.
The procedure for coverage measurement is as follows:
The following operation can be made in 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. However, the library code area is not set when the C compiler library is linked.
>SET COVERAGE FF0000..FFFFFF ■Measuring Coverage
When preparing for coverage measurement, execute the program.
Measurement starts when the program is executed by using the GO, STEP, or CALL command.
To display the coverage measurement result, use the SHOW COVERAGE command. The following can be displayed:
>SHOW COVERAGE/MODULE sample.abs (84.03%) +- startup.asm (90.43%) +- sample.c (95.17%) +- samp.c (100.00%)
Displays the load modules and the coverage rate of each module.
[Example]

+ + + address 0123456789ABCDEF0123456789ABCDEF0123456 ... ABCDEF C0(%) FF0000 **3*F* 32.0
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.
Display one line of a coverage rate
address +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F C0(%) FF0000 - 100.0 FF0010 - 100.0 FF0020 - - - 18.6 FF0030 - 100.0 FF0040 - . - 93.7 FF0050 - 100.0 FF0060 0.0 FF0070 0.0 FF0080 0.0
Display the access status of every 1 address
. : No access

>SHOW COVERAGE/SOURCE main * 70: { 71: int i; 72: struct table *value[16]; 73: * 74: for (i=0; i
Displays execution status of each source line.
. : No executing
Blank : Line which the code had not been generated or is outside the scope of the coverage measurement
>SHOW COVERAGE/INSTRUCTION F9028F sample.c$70 { * F9028F \main: * F9028F 0822 * F90291 4F01 sample.c$74 for (i=0; i
#22 RW0
MOVN MOVW MOVW CMPW BGE
A,#0 @RW3-02,A A,@RW3-02 A,#0010 F902B5
A,@RW3-02
LSLW MOVW MOVEA ADDW MOV MULUW ADDW
A RW0,A A,@RW3-22 RW0,A A,#14 A,@RW3-02 A,#01A0
Displays execution status of each machine command line. . : No executing

This section explains how to check information about the simulator debugger.
This simulator debugger enables you to check the following information at startup.
If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
Use one of the following methods to check debugger information.
Refer to Section "1.19 SHOW SYSTEM" in "SOFTUNE Workbench Command Reference Manual".
- Version information dialog
Select [Help] - [Version Information] menu. For details, refer to Section "4.9.3 Version Information" in "SOFTUNE Workbench Operation Manual".
F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED,
PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version ======================================================= Add in DLLs
SiCmn Product name: SOFTUNE Workbench File Path: SiC907.dll path Version: SiC907.dll version -

- Language Tools
- F2MC-16 Family SOFTUNE C Compiler version
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 : Current debbuger type MCU type : Currently selected target MCU VCpu dll name : Path and name of the currently used VCpu dll VCpu dll version : Version of the currently used virtual debugger DLL REALOS version : REALOS version
SiIODef Product name: Softune Workbench File Path: SiIODef.dll path Version: SiIODef.dll version ======================================================= Current path: Path of the currently used project Language: Currently used language Help file path: Help file path

This section explains the functions of the emulator debuggers for the MB2141.
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.
MB2147-01
MB2147-05
MB2198
The emulator debugger for the MB2141 is software that controls an emulator from a host computer via a communications line (RS-232C or LAN) to evaluate programs.
The following series can be debugged:
When MB2141-506 pod used
F 2 MC-16F
F 2 MC-16L
F 2 MC-16LX
When MB2141-507 pod used
F 2 MC-16L
F 2 MC-16LX
Before using the emulator, the emulator must be initialized.
For further details, refer to "Appendix B Download Monitor Program", and "Appendix C Setting up LAN Interface" in "SOFTUNE Workbench Operation Manual".

This section explains the operating environment setup.
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. Adjusted settings can be used as new default settings from the next time.
- MCU operation mode
- Timer minimum measurement unit
- Debug area · - Memory mapping

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.
At emulator start-up, the MCU is in the debugging mode.
When the MCU operation mode is changed, all the following are initialized:
- Event condition settings
- Trace measurement settings and trace buffer
- Performance measurement settings and measured result
All the operations of evaluation chips can be analyzed, but their operating speed is slower than that of mass- produced chips.
Evaluation chips have the same timing as mass-produced chips to control the operating speed. Note that the restrictions the shown in Table 2.2-1 are imposed on the debug functions.
Table 2.2-1 Restrictions on Debug Functions in Native Mode
Applicable series Restrictions on debug functions
F2MC-16/16H - Memory mapping setting is disabled and each area is accessed to the MCU
specifications. - Traces cannot be disassembled.
Common to all series - When a data read access occurs on the MCU internal bus, the internal bus
access information is not sampled and stored in the trace buffer. - Even when a data break or event (data access condition) is set for data on the
MCU internal bus, it may not become a break factor or sequencer-triggering factor. - The coverage function may fail to detect an access to data on the MCU
internal bus.
- Data breakpoints · - Sequencer settings

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 F2MC-16H/16F series is operated at high speed and 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.

Set the intensive debugging area out of the whole memory space. The area functions are enhanced.
There are two debug areas: DEBUG1, and DEBUG2. A continuous 512KB area (8 banks) is set for each area.
Set the debug area using the SET DEBUG command.
Setting the debug area enhances the breakpoints/data breakpoints and the coverage measurement function.
- Enhancement of Breakpoints
Up to six breakpoints (not including temporary breakpoints set using GO command) can be set when the debug area has not been set yet.
When setting the debug area as the CODE attribute, up to 65535 breakpoints can be set if they are within the area. At this time, up to six breakpoints can be set for an area other than the debug area, but the total count of breakpoints must not exceed 65535.
- Enhancement of Data Breakpoints
Up to six data breakpoints can be set when the debug area has not been set yet.
When setting the debug area of the data attribute (READ, WRITE), up to 65535 data breakpoints can be set if they are within the area and have the same attribute. At this time, up to six data breakpoints can be set for an area other than the area or for a different attribute, but the total number of data breakpoints must not exceed 65535.
- Enhancement of Coverage Measurement Function
Setting the debug area enables the coverage measurement function. In coverage measurement, the measurement range can be specified only within the area specified as the debug area.
The attributes for the debug area are "Don't care" as long as it is being used for coverage measurement. The coverage measurement attribute can be set, regardless of the debug area attributes.

A unit in which memory is allocated is called an area. There are seven different 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. Up to eight user memory areas can be set with no limit on the size of each area.
Access attributes can be set for each area; for example, CODE, READ, etc., can be set for ROM area, and READ, WRITE, etc. can be set for RAM area. If the MCU attempts access in violation of these attributes, the MCU operation is suspended and an error is displayed (guarded access break).
To set the user memory area, use the SET MAP command. The F2MC-16/16H only allows this setup in the debugging mode.
- Emulation Memory Area
Memory space substituted for emulator memory is called the emulation memory area, and this memory is called emulation memory.
As emulation memory area, Using MB2145-506 emulation pod, up to seven areas (including mirror area and internal ROM area described below) each with a maximum size of 64 KB can be set. An area larger than 64 KB can be set, but the areas are managed internally in 64 KB units.
Using MB2145-507 emulation pod, up to seven areas (including mirror area and internal ROM area described below) each with a maximum size of 512 KB can be set.
The memory operation command can be executed for this area while executing MCU.
To set the emulation memory area, use the SET MAP command. Attributes are set as for user memory area.
Even if the MCU internal resources are set as emulation memory area, access is made to the internal resources. The F2MC-16/16H only allows this setup in the debugging mode.
The mirror area is a region in the emulator memory that makes copies of user memory accesses. The memory in this area is called a mirror region.
The mirror area is used while it overlaps with a user memory area or undefined area. It is implemented by the emulation memory. Up to five mirror areas can be defined including emulation memory areas.
Mirror areas are used to reference the user memory during on-the-fly execution (For further details, refer to Section "2.2.4 On-the-fly Memory Access").
Mirror areas can be set using the SET MAP command. If the memory contents copy option is selected when a mirror area is set, the contents of the mirror area are always the same contents as the user memory.
- Mirror Area

When the F2MC-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. The internal ROM area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map... " from "Setup".
The internal memory area, it is set a suitable area automatically by the selected MCU.
- Internal ROM Image Area (F2MC-16L, F2MC-16LX, F2MC-16F only)
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.
The internal ROM image area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map... " from "Setup". This area attribute is automatically set to READ/CODE. The same data as in the internal ROM area appears in the internal ROM image area.
The internal memory area, it is set a suitable area automatically by the selected MCU.
- Internal Instruction RAM Area (F2MC-16H only)
Some types of MCUs have the internal instruction RAM, and this area is called the internal instruction RAM area.
The internal instruction RAM area, it is capable to set by the "Internal Instruction RAM area" tab in the "Setup CPU Information" dialog (select menu "project"-"setup project...", select the "MCU" tab, and push the "CPU Information..." button). The size must be specified to either H'100, H'200, H'400, H'800, H'1000, H'2000 or H'4000 bytes.
The internal memory area, it is set a suitable area automatically by the selected MCU.
A memory area that does not belong to any of the areas described above is part of the user memory area. This area is specifically called the undefined area.
The undefined area can be set to either NOGUARD area, which can be accessed freely, or GUARD area, which cannot be accessed. Select either setup for the whole undefined area. If the area attribute is set to GUARD, a guarded access error occurs if access to this area is attempted.
- Undefined Area

The F2MC-16/16H only allows this setup in the debugging mode.

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.
The access attributes shown in Table 2.2-2 can be specified for memory areas.
A guarded memory access break occurs if access is attempted in violation of these attributes while executing a program.
When access to the user memory area and the emulation memory area is made using program commands, such access is allowed regardless of the CODE, READ, WRITE attributes. However, access to memory with the GUARD attribute in the undefined area, causes an error.
Table 2.2-2 Types of Access Attributes
User Memory Emulation Memory
CODE Instruction Execution Enabled
READ Data Read Enabled
WRITE Data Write Enabled
Undefined GUARD Access Disabled
NOGUARD No check of access attribute
When access is made to an area without the WRITE attribute by executing a program, a guarded access break occurs after the data has been rewritten if the access target is the user memory. However, if the access target is the emulation memory, the break occurs before rewriting. In other words, write-protection (memory data cannot be overwritten by writing) can be set for the emulation memory area by not specifying the WRITE attribute for the area.
This write-protection is only enabled for access made by executing a program, and is not applicable to access by commands.
Use the following commands for memory mapping.
SET MAP: Set memory map.
SHOW MAP: Display memory map.
CANCEL MAP: Change memory map setting to undefined.
Area Attribute Description

000000 .. FFFFFF noguard
The rest of setting area numbers
user = 8 emulation = 5
>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
000000 .. 0001FF read write user
000200 .. 007FFF guard
008000 .. 008FFF read write user
009000 .. FEFFFF guard
FF0000 .. FFFFFF read write code emulation
008000 .. 008FFF copy
The rest of setting area numbers
user = 6 emulation = 3
> ■Internal ROM Area Setting
The [Setup Map] dialog box is displayed using [Environment] - [Debugger Memory Map] menu. You can set the internal ROM area using the [Internal ROM Area] tab after the [Map Adding] dialog box is displayed by clicking on the [Setting] button. Two areas can be set. Both ones require empty Emulation area to be set. Require empty area is shown below.
(Empty space of the emulation area) × (one area size)
You can specify the size up to the size shown above.
Specify the internal ROM area from the ending address H'FFFFFF (fixed) for area 1. Also, it is possible to delete the internal ROM area.

The timer minimum measurement unit affects the sequencer, the emulation timer and the performance measurement timer.
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.
Table 2.2-3 shows the maximum measurement time length of each timer when 1 μs or 100 ns is selected as the minimum measurement unit.
When the minimum measurement unit is changed, the measurement values of each timer are cleared as well. The default setting is 1 μs.
Table 2.2-3 Maximum Measurement Time Length of Each Timer
1 μs selected 100 ns selected
Sequencer timer About 16 seconds About 1.6 seconds
Emulation timer About 70 minutes About 7 minutes
Performance measurement timer About 70 minutes About 7 minutes
Use the following commands to control timers.
>SHOW TIMERSCALE
[Example] · >

When using commands to execute a program, there are several points to note.
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.
No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
PCB NCC SPB MOV ILM,#imm8 OR CCR,#imm8
DTB ADB CNR AND CCR,#imm8 POPW PS
PCB NCC SPB
DTB ADB CNR
F 2 MC-16F
- No break occurs when breakpoint set at address other than starting address of instruction.
- No break occurs when both following conditions met at one time.
- Instruction for which breakpoint set starts from odd-address,
- Preceding instruction longer than 2 bytes length, and breakpoint already set at last 1-byte address of
preceding instruction (This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction).
- Invalid Breakpoints

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.
MOVS SECQ WBTS MOVSWI SECQWI MOVSD SECQD FILS FILSW
MOVSW SECQW MOVSI SECQI WBTC MOVSWD SECQWD FILSI FILSWI
MOVS SECQ WBTS MOVSWI SECQWI MOVSD SECQD FILS FILSW MOVM
MOVSW SECQW MOVSI SECQI WBTC MOVSWD SECQWD FILSI FILSWI MOVMW
- 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.
- Step Execution that won't Break
- When step instruction longer than 2 bytes and last code ends at even address
- When breakpoint already set at last address (This "already-set" breakpoint is an invalid breakpoint that
won't break, because it has been set at an address other than the starting address of an instruction.)
It is possible to select "No reset generated by watchdog timer counter overflow" while executing a program using the GO, STEP, CALL commands.
Use the ENABLE WATCHDOG, DISABLE WATCHDOG commands to control the watchdog timer.
The start-up default in this program is "Reset generated by watchdog timer counter overflow".
>GO
- Abnormal Breakpoint · [Example]

This section explains the commands available during the execution of a user program.
This emulator debugger allows you to use certain commands during the execution of a user program.
For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual".
The double circle indicates that it is available during the execution of a user program.
Table 2.2-4 shows the commands available during the execution of a user program.
Table 2.2-4 Commands Available during Execution of User Program
Function Restrictions Major Commands
MCU reset - 1.3 RESET
Memory operation (Read/Write) Emulation memory only operable Read only enabled in mirror area
5.1 EXAMINE, 5.2 ENTER, 5.3 SET MEMORY, 5.4 SHOW MEMORY, 5.5 SEARCH MEMORY, 5.8 COMPARE, 5.9 FILL, 5.10 MOVE, 5.11 DUMP
Line assembly, Disassembly Emulation memory only enabled Mirror area, Disassembly only enabled
Displaying coverage measurement data - 4.19 SHOW COVERAGE
Displaying event Disabled in performance mode 3.23 SHOW EVENT
- [Debug] - [Run] - [Go] menu
- [Go] button on the debug toolbar
The commands in Table 2.2-4 cannot be used when the GO command is entered in the command window.
"E4404S Command error (MCU is busy)."

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.
The user memory cannot be accessed while on-the-fly (when execute the MCU). However, the emulation memory can be accessed. (The using cycle-steal algorithm eliminates any negative effect on the MCU speed.)
This emulator allows the user to use part of the emulation memory as a mirror area. The mirror area holds a copy of the user memory. Using this mirror area makes the Read-only enabled function available while on- the-fly.
Each memory area operates as follows:
- User Memory Area
Access to the user memory is permitted only when the operation is suspended by a break.
- Emulation Memory Area
Access to the emulation memory is permitted regardless of whether the MCU is suspended, or while on- the-fly.
The emulation memory with the MIRROR setting can be set up for the user memory area to be referred to while on-the-fly. This area is specifically called the mirror area.
As shown in Figure 2.2-1, the mirror area performs access to the user memory while the MCU is stopped, and such access is reflected simultaneously in the emulation memory specified as the mirror area. (Read access is also reflected in the emulation memory specified as the mirror area).
In addition, as shown in Figure 2.2-2, access to the user memory by the MCU is reflected "as it is" in the emulation memory of the mirror area.
While on-the -fly, the user memory cannot be accessed. However, the emulation memory specified as the mirror area can be read instead. In other words, identical data to that of the user memory can be read by accessing the mirror area.
However, at least one time access must be allowed before the emulation memory of the mirror area has the same data as the user memory. The following copy types allow the emulation memory of the mirror area to have the same data as the user memory.
(1) Copying all data when setting mirror area
When, /COPY is specified with the mirror area set using the SET MAP command, the whole area is specified, as the mirror area is copied.
(2) Copying only required portion using memory access commands
Data in the specified portion can be copied by executing a command that accesses memory.
- Mirror Area

The following commands access memory.
- Memory operation commands
COMPARE, FILL, MOVE, SEARCH MEMORY, DUMP,
COPY, VERIFY
- Data load/save commands
Figure 2.2-1 Access to Mirror Area while MCU Suspended
Figure 2.2-2 On-the-fly Access to Mirror Area
Memory access by a bus master other than the MCU is not reflected in the mirror area.

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.
In this emulator debugger, the following seven types of break functions are supported.

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.
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. It is possible to set it in this 65535 debuggers. However, it is necessary to set the debugging area as a code break area.
When a break occurs due to a code break, the following message is displayed on the Status Bar.
Break at Address by breakpoint ■Setting Method
The code break is controlled by the following method.
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/Disassembly window
There are several points to note in using code break. First, some points affecting code break are explained.
- Instruction for which breakpoint set starts from odd-address
- Preceding instruction longer than 2 bytes length, and breakpoint already set at last 1-byte address of
preceding instruction (This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction.)

Here are some additional points about the effects on other commands.
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.
- If breakpoint specified with GO command, set at instruction immediately after such instruction, the
breakpoint does not break.
When the debugging area is set again, all breakpoints in the area are cleared.

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.
The data break is a function to abort the program execution when MCU accesses data as for a specified address.
When a break occurs due to a data break, the following message is displayed on the Status Bar.
Break at Address by databreak at Access address
The number to which the data break can be set is as follows.
In debugging area of data attribute: 65535 pieces
Other areas:6 pieces ■Setting Method
The data break is controlled by the following method.
Refer to "3.10 SET DATABREAK (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Data] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
When the debugging area is set again, all breakpoints in the area are cleared.

A sequential break is a function to abort a executing program, when the sequential condition is met by event sequential control.
It is a function to discontinue the program execution when the sequential condition consists by the sequential control of the event. Use a sequential break when the event mode is set to normal mode using the SET MODE command.
When a break occurs due to a sequential break, the following message is displayed on the Status Bar.
Break at Address by sequential break (level = Level No.)
For details of the sequential break function, refer to Section "2.2.7 Control by Sequencer".
The sequential break is controlled by the following method.

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.
A guarded access break aborts a executing program when access is made in violation of the access attribute set by using the [Setup] - [Memory Map] menu, and access is attempted to a guarded area (access-disabled area in undefined area).
There are three types of the following in Guarded access break.
When the instruction execution is done to the area without the code attribute, the break is done.
When the area without the read attribute is read, the break is done.
When the area without the write attribute is write, the break is done.
If a guarded access occurs while executing a program, the following message is displayed on the Status Bar and the program is aborted.
Break at Address by guarded access {code/read/write} at Access address
Code Guarded is affected by pre-fetching.
The F2MC-16L/16LX/16/16H family pre-fetch up to 4 bytes. So, when setting the program area mapping, set a little larger area (5 bytes max.) than the program area actually used.
Similarly, the F2MC-16F family pre-fetch up to 8 bytes. So, when setting the program area mapping, set a little larger area (9 bytes max.) than the program area actually used.
Code guarded · Read guarded · Write guarded

It is a function to abort the program execution when the trace buffer becomes full.
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 ■Setting Method
The trace-buffer-full break is controlled by the following method.
Refer to "4.29 SET TRACE (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
When a break occurs due to a performannce-buffer-full break, the following message is displayed on the Status Bar.
Break at Address by performance buffer full ■Setting Method
The performance-buffer-full break is controlled by the following method.
Refer to "4.7 SET PERFORMANCE (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Performance set dialog
Refer to "4.4.13 Performance" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the execution of the program compulsorily.
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
A forced break is not allowed while the MCU is in the low-power consumption mode or hold state. When a forced break is requested by the [Debug] - [Abort] menu while executing a program, the menu is disregarded if the MCU is in the low-power consumption mode or hold state. If a break must occur, then reset the cause at user system side, or reset the cause by using the [Debug] - [Reset MCU] menu, after inputting the [Debug] - [Abort] menu.
When the MCU enters the power-save consumption mode or hold state while executing, the status is displayed on the Status Bar.

Eight events or less can be set.
Table 2.2-5 shows the conditions that can be set for events.
Table 2.2-5 Conditions for Setting Events
Address Memory location (Address bit masking enabled)
Data 8-bit data (data bit masking enable) NOT specified enable
Status Select from among dada read, data write, instruction execution and data modify.
External Probe 8-bit data (bit masking enable)
Use the following commands to set an event.
Condition Description

An event can be set in the Event window as well.
There are three event modes as listed below. To determine which function event triggers are used for, select one using the SET MODE command. The default is normal mode.
The event value setting are made for each mode, so switching the event mode changes the event settings as well.
Event triggers used for sequencer.
Since the sequencer can perform control at 8 levels, it can control sequential breaks, time measurement and trace sampling. Real-time tracing in the normal mode is performed by single trace (tracing function that samples program execution continuously).
- Multi Trace Mode
Event triggers used for multitracing (trace function that samples data before and after event trigger occurrence).
Event triggers are used for performance measurement to measure time duration between two event trigger occurrences and count of event trigger occurrences.

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.
The termination of sequencer triggers the delay counter. When the delay counter reaches the specified count, sampling for the single trace terminates. A break normally occurs at this point, but if necessary, the program can be allowed to run on without a break.
Figure 2.2-3 Operation in Normal Mode
SHOW TRACE/STATUS
ENABLE TRACE
SHOW TRACE/DATA
SET SEQUENCE/NO TRACE
CLEAR TRACE
SET SEQUENCE/ENABLE TRACE
SET SEQUENCE/DISABLE TRACE
SEARCH TRACE
Enable/Disable control Measurement ends
CANCEL EVENT
CANCEL SEQUENCE/TIMER
SET SEQUENCE/TIMER
When each condition at each level met
Timer setup for each condition
Select event number causing trigger at each level, set pass count value.
Instructing MCU to suspend operation
CANCEL SEQUENCE/EVENT
SHOW DELAY DISABLE EVENT
SHOW SEQUENCE/ALL SET DELAY
ENABLE EVENT
SHOW EVENT

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 Usable Command Function
SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT DISABLE EVENT
Set event Displays event setup status Delete event Enables event Disables event
SET SEQUENCE SHOW SEQUENCE CANCEL SEQUENCE ENABLE SEQUENCE DISABLE SEQUENCE
Sets sequencer Displays sequencer setup status Cancels sequencer Enables sequencer Disables sequencer
Sets delay count Displays delay count setup status
SET TRACE SHOW TRACE SEARCH TRACE ENABLE TRACE DISABLE TRACE CLEAR TRACE
Sets trace buffer-full break Displays trace data Searches trace data Enables trace function Disables trace function Clears trace data
Normal 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.
Multitracing is a trace function that samples data before and after an event trigger occurrence. 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.
Figure 2.2-4 Operation 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 Usable Command Function
SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT DISABLE EVENT
Sets event Displays event setup status Deletes event Enables event Disables event
SET MULTITRACE SHOW MULTITRACE SEARCH MULTITRACE ENABLE MULTITRACE DISABLE MULTITRACE CLEAR MULTITRACE
Sets trace buffer-full break Displays trace data Searches trace data Enables trace function Disables trace function Clears trace data
Multi Trace 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.
The event triggers that are 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.
Figure 2.2-5 Operation 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 Usable Command Function
SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT DISABLE EVENT
Sets event Displays event setup status Deletes event Enables event Disables event
Sets performance Displays performance setup status Clears performance measurement data
Performance Mode

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. Use the SET EVENT command to set events.
As shown in Table 2.2-9, controls can be made at 8 different levels.
At each level, 8 events and 1 timer condition (9 conditions in total) can be set.
A timer condition is met when the timer count starts at entering a given level and the specified time is reached.
For each condition, the next operation can be specified when the condition is met. Select any one of the following.
- Move to required level.
- Terminate sequencer.
The conditions set for each level are determined by OR. Therefore, if any one condition is met, the sequencer either moves to the required level, or terminates. In addition, trace sampling abort/resume can be controlled when a condition is met.
Table 2.2-9 Sequencer Specifications
Level count 8 levels
Conditions settable for each level 8 event conditions (1 to 16777216 times pass count can be specified for each condition.) 1 timer condition (Up to 16 s. in 1 μs units or up to 1.6 s. in 100 ns units can be specified.*)
Operation when condition met Branches to required level or terminates sequence. Controls trace sampling.
Other function Timer latch enable at level branching
Operation when sequencer terminates Starts delay counter
*: The minimum measurement unit for Timer value can be set to either 1 μs or 100 ns using the SET TIMERSCALE command.
Function Specifications

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. (4) When the sequencer terminates, the delay counter starts counting.
Figure 2.2-6 shows the sequencer operation.
Figure 2.2-6 Operation of Sequencer
Start executing program. (Start sequencer.)
Set Conditions Operation when Condition Met
[Use event number 1-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 2-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 3-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 4-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 5-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 6-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 7-] [Pass counter]
[Trace control]/ [Branch level number]
[Use event number 8-] [Pass counter]
[Trace control]/ [Branch level number]
Timer condition [Waiting time]
[Trace control]/ [Branch level number]
Terminat sequencer Branch to specified level.
Start delay

- Terminate sequencer when event 1 occurs.
- Terminate sequencer when event 2 occurs 16 times.
- 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.
>SET SEQUENCE/EVENT 2,2,J=0
>SET SEQUENCE/EVENT 2,3,J=1
- Terminate sequencer if and when event 2 occurs less than 300 μs after event 1 occurred.
>SET SEQUENCE/EVENT 2,2,J=0
>SET SEQUENCE/TIMER 2,300,J=1
>SHOW SEQUENCE
level1 level2 level3 level4 level5 level6 level7 level8
1 |1|->2 |
2 | | |2|->end |
3 |
Indicates move to level 2 when event 1 occurs at level 1
4 |
Indicate s terminating sequencer when event 2 occurs at level 2.
5 |
6 |
7 |
8 |
T | | |T|->1 |
Latch 1 ( -> ) = Latch 2 ( -> ) =
level no. = 2
Indicates move to level 1 if and when 300 μs passed before event 2 occurs at level 2
event pass-count trace-cnt1 jmp-level1
2 1 enable end
timer 00:00:000:300:000 enable 1
[Setup Examples] · Sequencer Enable

A program can suspend program execution when the sequencer terminates. This break is called a sequential break.
A program can suspend program execution when the sequencer terminates. This break is called a sequential break.
As shown in Figure 2.2-7, the delay count starts when the sequencer terminates, and after delay count ends, either "break" or "not break but tracing only terminates" is selected as the next operation.
To make a break immediately after the sequencer terminates, set delay count to 0 and specify "Break after delay count terminates". Use the SET DELAY command to set the delay count and the operation after the delay count.
The default is delay count 0, and Break after delay count.
Figure 2.2-7 Operation when sequencer terminates
Delay counter Sequencer terminates
[Examples of Delay Count Setups]
- Break when sequencer terminates.
- Break when 100-bus-cycle tracing done after sequencer terminates.
- Terminate tracing, but do not break when sequencer terminates.
- Terminate tracing, but do not break when 100-bus-cycle tracing done after sequencer terminates.

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.
Sets up suspend/resume trace sampling for each condition at each level of the sequencer. Figure 2.2-8 shows the trace sampling flow.
For example, it is possible to suspend trace sampling when event 1 occurs, and then resume trace sampling when event 2 occurs. Trace data sampling can be restricted.
Figure 2.2-8 Trace Sampling Control (1)

As shown in Figure 2.2-9, trace sampling can be disabled during the period from the start of a program execution until the first condition occurs. For this setup, use the GO command or the SET GO command.
>SET GO/DISABLETRACE
>GO
Figure 2.2-9 Trace Sampling Control (2)

[Example]

Suspend trace sampling when event 1 occurs, and then resume at event 2 and keep sampling data until event 3 occurs.
YES
Suspend trace sampling.
YES
Resume trace sampling.
YES
Suspend trace sampling.
>SET SEQUENCE/EVENT/ENABLETRACE 2,2,J=3
>SET SEQUENCE/EVENT/DISABLETRACE 3,3,J=2

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. This function is called the timer latch function.
The time duration between two given points in a complex program flow can be measured using the timer latch function.
The timing for the timer latch can be set using the SET SEQUENCE command; the latched timer values can be displayed using the SHOW SEQUENCE command.
When a program starts execution, the emulation timer is initialized and then starts counting. Select either 1 μs or 100 ns as the minimum measurement unit for the emulation timer. Set the measurement unit using the SET TIMESCALE command.
When 1 μs is selected, the maximum measured time is about 70 minutes; when 100 ns is selected, the maximum measured time is about 7 minutes. If the timer overflows during measurement, a warning message is displayed when the timer value is displayed using the SHOW SEQUENCE command.

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.
YES
Branch from level 1 to level 2 (Timer latch 1)
NO
YES
YES
NO
YES
Sequencer terminates at level 3 (Timer latch 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
Indicates that, if event 3 occurs at level 3, the sequencer terminates and let the timer latched.
>SET SEQUENCE/LATCH 2,3,0
>SHOW SEQUENCE
level1 level2 level3 level4 level5 level6 level7 level8
1 |1|#>2 |
2 | | |2|->3 |
Indicates that, if event 1 occurs at level 1, move to level 2 and let the timer latched.
3 |3|#end |
4 | | |4|->1 |4|->1 |
5 |
6 |
7 |
8 |
T | | |T|->1 |
Latch 1 (1->2) = 00m02s060ms379.0μs Latch 2 (3->E) = 00m16s040ms650.0μs
Indicate time values of timer latch 1 and timer latch 2. The time value, deducting the value of the timer latch 1 from the value of the timer latch 2, represents the execution time. Time is displayed in the following format.
00 m 00 s 000 ms 000.0 μs
minutes seconds milliseconds microseconds
Sequencer Enable

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. There are two types of trace sampling: single trace, which traces from the start of executing the program until the program is suspended, and multi trace, which starts tracing when an event occurs.
The data recorded by sampling in machine cycle units, is called a frame.
The trace buffer can store 32K frames (32768). Since the trace buffer has a ring structure, when it becomes full, it automatically returns to the start to overwrite existing data.
Data sampled by the trace function is called trace data.
The following data is sampled:
- Access status: Read/Write/Internal access, etc.
- Device status: Instruction execution, Reset, Hold, etc.
- Queue status: Count of remaining bytes of instruction queue, etc.
(Since the data signal is shared with other signals, it does not always output data. Therefore, the trace samples information indicating whether or not the data is valid.)
The following data does not leave access data in the trace buffer.
- Data after tool hold
The F2MC-16/16L/16LX/16H/16F family execute the following operation immediately after a break, etc., lets MCU suspend (a tool hold). This data is not displayed because it is deleted from the trace buffer.
- Access to address 100
- Access to FFFFDC to FFFFFF
- Portion of access data while native mode.
When operating in the native mode, the F2MC-16/16L/16LX/16H/16F family of chips sometime performs simultaneous multiple bus operations internally. However, in this emulator, monitoring of the internal ROM bus takes precedence. Therefore, other bus data being accessed simultaneously may not be sampled (in the debugging mode, all operations are sampled).

The single trace traces all data from the start of executing a program until the program is aborted.
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.
If the real-time trace function is enabled, data sampling continues execution to record the data in the trace buffer while the GO, STEP, CALL commands are being executed.
As shown in Figure 2.2-10, suspend/resume trace sampling can be controlled by the event sequencer. Since the delay can be set between the sequencer terminating the trigger and the end of tracing, the program flow after an given event occurrence can be traced. The delay count is counted in pass cycle units, so it matches the sampled trace data count. However, nothing can be sampled during the delay count if trace sampling is suspended when the sequencer is terminated.
After the delay count ends, a break occurs normally due to the sequential break, but tracing can be terminated without a break.
Furthermore, a program can be allowed to break when the trace buffer becomes full. This break is called a trace-buffer-full break.
Figure 2.2-10 Sampling in Single Trace
Suspend sampling Start program

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; trace data sampled before reaching the trigger point is numbered negatively, and the data sampled after the trigger point is numbered positively (See Figure 2.2-11).
If there is no sequencer termination trigger point available, the trace data sampled last is numbered 0.
Figure 2.2-11 Frame Number in Single Trace

This program can analyze the single trace result and sort the buffer data in execution instruction units (only when the MCU execution mode is the debugging mode).
In this mode, the following information is grouped as one unit, and each information unit is numbered. This number is called the step number.
- Execution instruction mnemonic information
- Data access information
- Device status information
The step number at the sequencer termination trigger is numbered 0; information sampled before reaching the trigger point is numbered negatively, and information sampled after the trigger point is numbered positively.
If there is no sequencer termination trigger point, the information sampled last is numbered 0.

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. (3) Set events, sequencer, and delay count. (4) Set trace-buffer-full break.
The following settings 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.
Use SET MODE command to make this setting.
(2) Enable trace function.
Use the ENABLE TRACE command. To disable the function, use the DISABLE TRACE command. The default is Enable.
(3) Set events, sequencer, and delay count.
Trace sampling can be controlled by setting the sequencer for events. If this function is not needed, there is no need of this setting.
To set events, use the SET EVENT command. To set the sequencer, use the SET SEQUENCE command.
Furthermore, set the delay count between sequencer termination and trace ending, and the break operation (Break or Not Break) when the delay count ends. If the data after event occurrence is not required, there is no need of this setting.
If Not Break is set, the trace terminates but no break occurs. To check trace data on-the-fly, use this setup by executing the SET DELAY command.
When the sequencer termination causes a break (sequential break), the last executed machine cycle is not sampled.

(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
SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT DISABLE EVENT
Sets events Displays event setup status Deletes event Enables event Disables event
SET SEQUENCE SHOW SEQUENCE CANCEL SEQUENCE ENABLE SEQUENCE DISABLE SEQUENCE
Sets sequencer. Displays sequencer setting status Cancels sequencer Enables sequencer Disables sequencer
Sets delay count value, and operation after delay Displays delay count setting status
SET TRACE SHOW TRACE SEARCH TRACE ENABLE TRACE DISABLE TRACE CLEAR TRACE
Sets trace-buffer-full break Displays trace data Searches trace data Enables trace function Disables trace function Clears trace data
Usable Command Function

The multi trace samples data where an event trigger occurs for 8 frames before and after the event trigger.
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.
It can be used for tracing required only when a certain variable access occurs, instead of continuous tracing.
The trace data sampled at one event trigger (16 frames) is called a block. Since the trace buffer can hold 32K frames, up to 2048 blocks can be sampled. Multi trace sampling terminates when the trace buffer becomes full. At this point, a executing program can be allowed to break if necessary.
Figure 2.2-12 Multi Trace Sampling
Sixteen frames of data are sampled each time an event occurs. This data unit is called a block, and each sampled block is numbered starting from 0. This is called the block number.
A block is a collection of 8 frames of sampled data before and after the event trigger occurs. At the event trigger is 0, trace data sampled before reaching the event trigger point is numbered negatively, and trace data sampled after the event trigger point is numbered positively. These frame numbers are called local numbers (See Figure 2.2-13).
In addition to this local number, there is another set of frame numbers starting with the oldest data in the trace buffer. This is called the global number. Since the trace buffer can hold 32K frames, frames are numbered 1 to 32768 (See Figure 2.2-13).
To specify which frame data is displayed, use the global number or block and local numbers.

Figure 2.2-13 Frame Number in Multi Trace

1 -7 2 –6 : 8 0 : 15 +7 16 +8 17 –7 18 –6 : 24 0 : 31 +7 32 +8

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. (4) Set trace-buffer-full break.
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.
Use the SET MODE command for this setting.
(2) Enable trace function.
Use the ENABLE MULTITRACE command. To disable the function, use the DISABLE MULTITRACE command.
(3) Set event.
Set an event that sampling. Use the SET EVENT command for this setting.
(4) Set trace-buffer-full break.
To break when the trace buffer becomes full, set the trace-buffer-full break. Use the SET MULTITRACE command for this setting.
Table 2.2-11 shows the list of trace-related commands that can be used in multi trace mode.
Table 2.2-11 Trace-related Commands That Can Be Used in Multi Trace Mode
SET EVENT SHOW EVENT CANCEL EVENT ENABLE EVENT DISABLE EVENT
Sets events Displays event setup status Deletes event Enables event Disables event
SET MULTITRACE SHOW MULTITRACE SEARCH MULTITRACE ENABLE MULTITRACE DISABLE MULTITRACE CLEAR MULTITRACE
Sets trace-buffer-full break Displays trace data Searches trace data Enables multi trace Disables multi trace Clears trace data
Usable Command Function

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.
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.
Frame numbers displayed in the multi trace mode is the global number.
- In Single Trace
en/dis = enable : Trace function enabled buffer full = nobreak : Buffer full break function disabled sampling = end : Trace sampling terminates frame no. = -00120 to 00050 : Frame -120 to 50 store data step no. = -00091 to 00022 : Step -91 to 22 store data
- In Multi trace
block no. = 1 to 5 : Block 1 to 5 store data
frame no. = 00001 to 00159 : Frame 1 to 159 store data
[Example] · > · (Global number)

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. A range can also be specified.
It is possible to specify from which data in the trace buffer to displays. To do this, specify a frame number with the SHOW TRACE command in the single trace, and specify either a global number, or a block number and local number with the SHOW MULTITRACE command in the multi trace. A range can also be specified.
- In Single Trace Mode
A step number can only be specified when the MCU execution mode is set to the debugging mode.
- In Multi trace
>SHOW MULTITRACE/GLOBAL 500 : Start displaying from frame 500 (Global number) >SHOW MULTITRACE/LOCAL 2 : Displaying block number 2 >SHOW MULTITRACE/LOCAL 2,-5..5 : Display from frame -5 to frame 5 of block number 2
[Example]

Trace sampling is performed at each machine cycle, but the sampling results are difficult to Display because they are influenced by pre-fetch, etc. This is why the emulator has a function to allow it to analyze trace data as much as possible. The resultant data is displayed after processes such as eliminating pre-fetch effects, analyzing execution instructions, and sorting in instruction execution order are performed automatically. However, this function can be specified only in the single trace while in the debugging mode.
In this mode, data can be displayed in the following format.

Display of sequencer level
Hexadecimal Indecates instruction executed
Indicates sequencer level executed when trace sampled.
Indicates 0 if sequencer not in use.
>SHOW TRACE/INSTRUCTION -194 step no. address mnemonic level \sub4: -00194 : FF0106 LINK #00 4 -00193 : 000186 internal read access. 10F2 5 -00192 : 1010E6 external write access. 10F2 5 -00191 : 000186 internal write access. 10E6 5 -00190 : FF0108 ADDSP #F8 5 -00189 : FF010A MOVL A,001A 5 -00188 : 10001A external read access. 0000 5 -00187 : 10001C external read access. 4000 5 -00186 : FF010E MOVL @SP+04,A 5 -00185 : 1010E2 external write access. 0000 5 -00184 : FF0111 MOVL A,0016 5 -00183 : ** RESET ** >
Detailed information at all sampled machine cycles can be displayed. In this mode, both single trace and multi trace data can be displayed in almost identical formats. (In the multi trace mode, the local frame number and block number are added.)
In this mode, data can be displayed in the following format. For further details, see the descriptions of the SHOW TRACE, and SHOW MULTITRACE commands. In this mode, source is not displayed regardless of the setup made using the SET SOURCE command.

>>SHOW TRACE/CYCLE -587 frame no. address data a-status d-status Qst dfg level ext-probe -00587 :FF0106 0106 --- FLH 4 11111111 -00586 :FF0106 0008 ECF EXECUTE --- @ 4 11111111 -00585 :FF0106 0106 --- EXECUTE --- 5 11111111 -00584 :1010E8 10E8 --- --- 5 11111111 -00583 :1010E8 0102 EWA EXECUTE -- @ 5 11111111 -00582 :1010E8 0102 --- EXECUTE --- 5 11111111 -00581 :000186 0186 --- 2by 5 11111111 -00580 :000186 10F2 IRA EXECUTE --- @ 5 11111111 -00579 :1010E6 10E6 --- --- 5 11111111 -00578 :1010E6 10F2 EWA EXECUTE --- @ 5 11111111 -00577 :1010E6 10F2 --- EXECUTE --- 5 11111111 -00576 :000186 0186 --- --- 5 11111111
How to read trace data
frame no. address data a-status d-status Qst dfg level ext-probe
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(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 information (d-status)
(6):instruction queue status
FLH:flush queue
-by:number of remainder code of queue is -byte(-:1 to 8)
[Example]

(7):valid flag
@:valid frame for this data
(8):sequencer level
(9):external probe data
Only the source line can be displayed. This mode is enabled only in the single trace mode while in the debugging mode.
step no. source
[Example]

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.
To disable the trace function, use the DISABLE TRACE command. Check whether or not the trace function is currently enabled by executing the SHOW TRACE command with /STATUS specified, or by using the built-in variable, %TRCSTAT.
Tracing terminates when the delay count ends after the sequencer has terminated. If Not Break is specified here, tracing terminates without a break operation. It is possible to check whether or not tracing has terminated by executing the SHOW TRACE command with /STATUS specified, or by using the built-in variable, %TRCSAMP.
To read trace data, use the SHOW TRACE command; to search trace data, use the SEARCH TRACE command. Use the SET DELAY command to set the delay count and break operation after the delay count.
>>SHOW TRACE/STATUS
buffer full = nobreak
sampling = on
buffer ful = nobreak
sampling = end
frame no. = -00805 to 00000
step no. = -00262 to 00000
step no. address mnemonic level
\sub5:
If the CLEAR TRACE command is executed with the trace ending state, trace data sampling can be re- executed by re-executing the sequencer from the beginning.
[Example] · en/dis = enable · en/dis = enable

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.
To read trace data, use the SHOW MULTITRACE command; to search trace data, use the SEARCH MULTITRACE command.
>GO >>SHOW MULTITRACE/STATUS en/dis = enable buffer full = nobreak sampling = on >>DISABLE MULTITRACE >>SHOW MULTITRACE/STATUS en/dis = disable buffer full = nobreak sampling = end block no. = 1 to 20 frame no. = 00001 to 00639 >>SHOW MULTITRACE 1 frame no. address data a-status d-status Qst dfg level ext-probe block no. = 1 00001 -7 : 10109C 109C --- --- 1 11111111 00002 -6 : 10109C 0000 EWA EXECUTE 2by @ 1 11111111 00003 -5 : 10109C 0000 --- EXECUTE --- 1 11111111 00004 -4 : FF0120 0120 --- --- 1 11111111
[Example]

This section explains how to save 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Save] from the shortcut menu. The [Save as] dialog
appears. Specify the file name and where to save trace data. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SHOW TRACE/FILE command.
For details, refer to Section "4.33 SHOW TRACE (type 3)" in "SOFTUNE Workbench Command Reference Manual". When additionally saving trace data in an existing file, execute the SHOW TRACE/FILE/APPEND command.

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. To measure performance, set the event mode to the performance mode using the SET MODE command.
The performance measurement function allows the time between two event occurrences to be measured and the number of event occurrences to be counted. Up to 32767 event occurrences can be measured.
Measures time interval between two events.
Events can be set at 8 points (1 to 8). However, in the performance measurement mode, the intervals, starting event number and ending event number are combined as follows. Four intervals have the following fixed event number combination:
Interval Starting Event Number Ending Event Number
The specified events become performance measurement points automatically, and occurrences of that particular event are counted.
- Measuring Time · - Measuring Count

Set the event mode to the performance mode using the SET MODE command. This enables the performance measurement function.
> ■Setting Minimum Measurement Unit for Timer
Using the SET TIMESCALE command, choose either 1 μs or 100 ns as the minimum measurement unit for the timer used to measure performance. The default is 1 μs.
When the minimum measurement unit is changed, the performance measurement values are cleared.
>SET TIMERSCALE/1U
> ■Specify Performance-Buffer-Full Break
When the buffer for storing performance measurement data becomes full, a executing program can be broken. This function is called the performance-buffer-full break. The performance buffer becomes full when an event occurs 32767 times.
If the performance-buffer-full break is not specified, the performance measurement ends, but the program does not break.
>SET PERFORMANCE/NOBREAK

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.
Four intervals have the following fixed event number combination.
Interval Starting Event Number Ending Event Number
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.
Display performance measurement data by using the SHOW PERFORMANCE command.
Clear performance measurement data by using the CLEAR PERFORMANCE command.

Display the measured time and measuring count by using the SHOW PERFORMANCE command.
To display the time measured, specify the starting event number or the ending event number.
Count of measuring within given time interval
event = 1 -> 2 time (µs) | count
min time = 11637.0 +
max time = 17745.0 0.0 - 8999.0 | 0
avr time = 14538.0 9000.0 - 9999.0 | 0
10000.0 - 10999.0 | 0
11000.0 - 11999.0 | 2
12000.0 - 12999.0 | 19
13000.0 - 13999.0 | 52
14000.0 - 14999.0 | 283
15000.0 - 15999.0 | 92
16000.0 - 16999.0 | 3
17000.0 - 17999.0 | 1
18000.0 - 18999.0 | 0
19000.0 - | 0
The lower time limit, upper time limit and display interval can be specified. The specified time value is in 1μs, when the minimum measurement unit timer is set to 1 μs by the SET TIMESCALE command, and in 100 ns when the minimum is set to 100 ns.
>SHOW PERFORMANCE/TIME 1,13000,16999,500 event = 1 -> 2 time (μs) | count min time = 11637.0 + max time = 17745.0 0.0 - 12999.0 | 21 avr time = 14538.0 13000.0 - 13499.0 | 13 13500.0 - 13999.0 | 39 14000.0 - 14499.0 | 121 14500.0 - 14999.0 | 162 15000.0 - 15499.0 | 76 15500.0 - 15999.0 | 16 16000.0 - 16499.0 | 2 16500.0 - 16999.0 | 1 17000.0 - 17499.0 | 1 +
Lower time limit for display
Upper time limit for display

This emulator has the C0 coverage measurement function. Use this function to find what percentage of an entire program has been executed.
When testing a program, the program is executed with various test data input and the results are checked for correctness. When the test is finished, every part of the entire program should have been executed. If any part has not been executed, there is a possibility that the test is insufficient.
This emulator coverage function is used to find what percentage of the whole program has been executed. In addition, details such as which addresses were not accessed can be checked.
This enables the measurement coverage range to be set and the access attributes to be measured.
To execute the C0 coverage, set a range within the code area and set the attribute to Code attribute. In addition, specifying the Read/Write attribute and setting a range in the data area, permits checking the access status of variables such as finding unused variables, etc.
Execution of coverage measurement is limited to the address space specified as the debug area.
Therefore, set the debug area in advance. However, the measurement attribute for coverage measurement can be specified regardless of attributes of the debug area.
The procedure for coverage measurement is as follows:
- Set range for coverage measurement: SET COVERAGE
The following operation can be made in coverage measurement:
- Abortion and resume of coverage measurement: ENABLE COVERAGE, DISABLE COVERAGE
With MB2141 emulator, the code coverage is affected by a prefetch by the MCU. Note the prefetch when using the COVERAGE function.

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. Up to 32 ranges can be specified.
In addition, the access attribute for measurement can be specified. This attribute can be specified regardless of the attributes of the debug area.
By specifying /AUTOMATIC for the command qualifier, the code area for the loaded module is set automatically. However, the library code area is not set when the C compiler library is linked.
>SET COVERAGE FF0000 .. FFFFFF ■Measuring Coverage
When preparing for coverage measurement, execute the program.
Measurement starts when the program is executed by using the GO, STEP, or CALL command.
To display the coverage measurement result, use the SHOW COVERAGE command. The following can be displayed:
- Display coverage rate of total measurement area
- Displaying coverage rate of load module
- Summary of 16 addresses as one block
- Details indicating access status of each address
- Displaying coverage measurement result per source line
- Displaying coverage measurement result per machine instruction
[Example]

>SHOW COVERAGE/MODULE sample.abs (84.03%) +- startup.asm (90.43%) +- sample.c (95.17%) +- samp.c (100.00%)
Displays the load modules and the coverage rate of each module.
+ + + address 0123456789ABCDEF0123456789ABCDEF0123456 ... ABCDEF C0(%) FF0000 **3*F* 32.0
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.
Display one line of a coverage rate
address +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F C0(%) FF0000 - 100.0 FF0010 - 100.0 FF0020 - - - 18.6 FF0030 - 100.0 FF0040 - . - 93.7 FF0050 - 100.0 FF0060 0.0 FF0070 0.0 FF0080 0.0
Display the access status of every 1 address
. : No access

>SHOW COVERAGE/SOURCE main * 70: { 71: int i; 72: struct table *value[16]; 73: * 74: for (i=0; i
Displays execution status of each source line.
. : No executing
Blank : Line which the code had not been generated or is outside the scope of the coverage measurement
>SHOW COVERAGE/INSTRUCTION F9028F sample.c$70 { * F9028F \main: * F9028F 0822 * F90291 4F01 sample.c$74 for (i=0; i
#22 RW0
MOVN MOVW MOVW CMPW BGE
A,#0 @RW3-02,A A,@RW3-02 A,#0010 F902B5
A,@RW3-02
LSLW MOVW MOVEA ADDW MOV MULUW ADDW
A RW0,A A,@RW3-22 RW0,A A,#14 A,@RW3-02 A,#01A0
Displays execution status of each machine command line. . : No executing

With MB2141 emulator, the code coverage measurement is affected by a prefetch. Note when analyzing.

This function measures the program execution time.
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.
The measurement is performed whenever a program is executed, and the measurement result displays the following two values:
Either of the following methods can be used to set the minimum measurement unit for the emulation timer.
Select [Setup] - [Debug Environment] - [Debug Environment] menu to set the results in [emulation] tab in the debugging environment set dialog.
For details, refer to Section "4.7.2.3 Setting Debug Environment" in "SOFTUNE Workbench Operation Manual".
Enter the SET TIMERSCALE command in the command window.
For details, refer to Section "1.13 SET TIMERSCALE" in "SOFTUNE Workbench Command Reference Manual". ■Displaying Measurement Results
Either of the following methods can be used to display the measurement results.
The results appear 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".
Enter the SHOW TIMER command in the command window.
For details, refer to Section "4.27 SHOW TIMER" in "SOFTUNE Workbench Command Reference Manual".
Either of the following methods can be used to clear the measurement results.

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".
Enter the CLEAR TIMER command in the command window.
For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual".
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.

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.
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.
When data is sampled as trace data, such data can be displayed by using the SHOW TRACE command or SHOW MULTITRACE command, just as with other trace data. Sampling using the SHOW SAMPLING command, samples data and displays its state.
In addition, by specifying external probe data as events, such events can be used for aborting a program, and as multi trace and performance trigger points.
Events can be set by using the SET EVENT command.
Choose one of the following for the sampling timing while executing a program.
- At rising edge of internal clock (clock supplied by emulator)
- At rising edge of external clock (clock input from target)
- At falling edge of external clock (clock input from target)
Use the SET SAMPLING command to set up; to display the setup status use the SHOW SAMPLING command.
When sampling data using the SHOW SAMPLING command, sampling is performed when the command is executed and has nothing to do with the above settings.
>>SHOW SAMPLING
channel 7 6 5 4 3 2 1 0
1 0 1 1 1
[Example]

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). The MSB is at bit7 (Violet), and the LSB is at bit0 (Black). The bit represented by 1 means HIGH, while the bit represented by 0 means LOW. When data is input as command parameters, these
values are also used for input.
Table 2.2-12 Bit Order of External Probe Data
IC Clip Cable Color Violet Blue Green Yellow Orange Red Brown Black
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Table 2.2-13 shows the commands that can be used to set or display external probe data.
Table 2.2-13 Commands that can be used External Probe Data
Sets sampling timing for external probe Samples external probe data
Enables to specify external probe data as condition for event Displays event setup status
SHOW TRACE Displays external probe trace-sampled (single trace)
SHOW MULTITRACE Displays external probe trace-sampled (multi-trace)
Bit Order · External probe data · Usable Command Function

This section explains how to check information about the MB2141 emulator debugger.
This emulator debugger enables you to check the following information at startup.
If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
Use one of the following methods to check debugger information.
Refer to Section "1.19 SHOW SYSTEM" in "SOFTUNE Workbench Command Reference Manual".
- Version information dialog
Select [Help] - [Version Information] menu. For details, refer to Section "4.9.3 Version Information" in "SOFTUNE Workbench Operation Manual".
F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED,
PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version ======================================================= Add in DLLs
SiCmn Product name: SOFTUNE Workbench File Path: SiC907.dll path Version: SiC907.dll version -

- Language Tools
- F2MC-16 Family SOFTUNE C Compiler version
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 : Current debugger type MCU type : Currently selected target MCU VCpu dll name : Path and name of the currently used VCpu dll VCpu dll version : Version of the currently used virtual debugger DLL DSU type : Currently used DSU type Monitor version : Version of monitor (dependent) Communication device : Device type Baud rate : Baud rate Host name : LAN host name REALOS version : REALOS version
SiIODef Product name: Softune Workbench File Path: SiIODef.dll path Version: SiIODef.dll version ======================================================= Current path: Path of the currently used project Language: Currently used language Help file path: Help file path

This section explains the functions of the emulator debuggers for the MB2147-01.
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.
MB2147-01
MB2147-05
MB2198
The emulator debugger for the MB2147-01 is software that controls an emulator from a host computer via a communications line (RS-232C, LAN or USB) to evaluate programs.
The following series can be debugged:
F 2 MC-16LX
Before using the emulator, the emulator must be initialized. For details, refer to "Appendix B Monitoring Program Download" and "Appendix C LAN Interface Setup" of "SOFTUNE Workbench Operation Manual".

This section explains the operating environment setup.
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. Adjusted settings can be used as new default settings from the next time.
- Monitoring program automatic loading
- MCU operation mode

The MB2147-01 emulator can automatically update the monitoring program at emulator startup.
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.
The monitoring program and configuration binary data to be compared for update are in Lib\907 under the directory where Workbench is installed.
Enable/disable the monitoring program automatic loading function by choosing [Environment] - [Debug Environment Setup] - [Setup Wizard] menu.

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.
At emulator start-up, the MCU is in the debugging mode.
The data access to internal bus may not be detected by emulator in native mode. Therefore, when the MCU operation mode is changed, all the following are initialized:
- Data monitoring break
- Event condition settings
- Trace measurement settings and trace buffer
All the operations of evaluation chips can be analyzed, but their operating speed is slower than that of mass- produced chips.
Evaluation chips have the same timing as mass-produced chips to control the operating speed. Note that the restrictions the shown in Table 2.3-1 are imposed on the debug functions.
Table 2.3-1 Restrictions on Debug Functions in Native Mode
Applicable series Restrictions on debug functions
Common to all series - When a data read access occurs on the MCU internal bus, the internal bus
access information is not sampled and stored in the trace buffer. - Even when a data break or event (data access condition) is set for data on the
MCU internal bus, it may not become a break factor or sequencer-triggering factor. - The coverage function may fail to detect an access to data on the MCU
internal bus.
- Data breakpoints · - Sequencer settings

Set the intensive debugging area out of the whole memory space. The area functions are enhanced.
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.
Setting the debug area enhances the coverage measurement function.
- Enhancement of Coverage Measurement Function
Setting the debug area enables the coverage measurement function. In coverage measurement, the measurement range can be specified only within the area specified as the debug area. In 00 to 0F bank and 0F0 to 0FF bank, a breakpoint can be set without specifying the debug area. (DEBUG1, DEBUG2)

A unit in which memory is allocated is called an area. There are five different 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. Up to four user memory areas can be set with no limit on the size of each area. Define a region on a 256-byte boundary.
Access attributes can be set for each area; for example, CODE, READ, etc., can be set for ROM area, and READ, WRITE, etc. can be set for RAM area. If the MCU attempts access in violation of these attributes, the MCU operation is suspended and an error is displayed (guarded access break).
Memory manipulation commands can be executed in relation to emulation memory areas while MCU execution is in progress.
To set the user memory area, use the SET MAP command.
- Emulation Memory Area
Memory space substituted for emulator memory is called the emulation memory area, and this memory is called emulation memory.
It is possible to set up to four areas of 1 MB maximum (including an internal ROM area described later) as emulation memory area. Define a region on a 256-byte boundary. An area larger than 1 MB can be specified at one time but is divided internally into two or more 1 MB areas for management purposes.
Memory manipulation commands can be executed in relation to emulation memory areas while MCU execution is in progress.
Emulation memory areas can be set using the SET MAP command.
Further, the access attributes can be set as with user memory areas.
Even if the MCU internal resources are set as emulation memory area, access is made to the internal resources. Re-executing this setup may damage data.
- 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.
The internal ROM area with a size up to 1 MB can be specified two areas.
An area larger than 1 MB can be specified at one time but is divided internally into two or more 1 MB areas for management purposes.
Memory manipulation commands can be executed in relation to emulation memory areas while MCU execution is in progress.
The internal ROM area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map" from "Setup".

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.
The internal ROM image area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map" from "Setup". This area attribute is automatically set to READ/CODE. The same data as in the internal ROM area appears in the internal ROM image area.
The internal memory area, it is set a suitable area automatically by the selected MCU.
A memory area that does not belong to any of the areas described above is part of the user memory area. This area is specifically called the undefined area.
The undefined area can be set to either NOGUARD area, which can be accessed freely, or GUARD area, which cannot be accessed. Select either setup for the whole undefined area. If the area attribute is set to GUARD, a guarded access error occurs if access to this area is attempted.
- Undefined Area

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.
The access attributes shown in Table 2.3-2 can be specified for memory areas.
A guarded access break occurs if access is attempted in violation of these attributes while executing a program.
When access to the user memory area and the emulation memory area is made using program commands, such access is allowed regardless of the CODE, READ, WRITE attributes. However, access to memory with the GUARD attribute in the undefined area, causes an error.
Table 2.3-2 Types of Access Attributes
User Memory Emulation Memory
CODE Instruction Execution Enabled
READ Data Read Enabled
WRITE Data Write Enabled
Undefined GUARD Access Disabled
NOGUARD No check of access attribute
When access is made to an area without the WRITE attribute by executing a program, a guarded access break occurs after the data has been rewritten if the access target is the user memory. However, if the access target is the emulation memory, the break occurs before rewriting. In other words, write-protection (memory data cannot be overwritten by writing) can be set for the emulation memory area by not specifying the WRITE attribute for the area.
This write-protection is only enabled for access made by executing a program, and is not applicable to access by commands.
Area Attribute Description

Use the following commands for memory mapping.
SET MAP: Set memory map.
SHOW MAP: Display memory map.
CANCEL MAP: Change memory map setting to undefined.
000000 .. FFFFFF noguard
The rest of setting area numbers
user = 8 emulation = 5
>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
000000 .. 0001FF read write user
000200 .. 007FFF guard
008000 .. 008FFF read write user
009000 .. FEFFFF guard
FF0000 .. FFFFFF read write code emulation
008000 .. 008FFF copy
The rest of setting area numbers
user = 6 emulation = 3
> ■Internal ROM Area Setting
The [Setup Map] dialog box is displayed using [Environment] - [Memory Map] menu. You can set the internal ROM area using the [Internal ROM Area] tab after the [Map Adding] dialog box is displayed by clicking on the [Setting] button. You can set two areas. Both require empty Emulation area to be set. You can set the region size by (Empty space of the emulation area) x (one area size).
Specify the internal ROM area from the ending address H'FFFFFF (fixed) for area 1. Also, it is possible to delete the internal ROM area.

Set the debug function. The debug function has the RAM Checker and the Trace Enhancement mode. The selectable mode depends on the emulator or its connection form. These modes can be set by using [Setup] - [Debug Environment] - [Select Debug Function] menu or the SET MODE command on the command window.
At the emulator activated, this is set to the RAM Checker mode.
When the debug function is changed, all the followings are initialized:
Enables the RAM Checker function. The history of accessing the monitoring addresses can be recorded into the log file.
Enable the trace enhancement.
The following functions become available.

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. The default is normal mode.
There are three event modes as listed below.
Event triggers are used for the single trace.
Event triggers are used for the multi trace (trace function which samples data before and after the event trigger occurred).
Event triggers are used for the performance measurement. It enables to measure time duration between two event trigger occurrence and count of event trigger occurrence.
The multi trace mode can be specified only when the debug function on MB2147-01 is set to Trace Enhancement mode. For more details, see Section "2.3.1.6 Debug Function".

When using commands to execute a program, there are several points to note.
For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
- No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
PCB NCC SPB MOV ILM,#imm8 OR CCR,#imm8
DTB ADB CNR ANDCCR,#imm8 POPW PS
- No break occurs when breakpoint set at address other than starting address of instruction.
- No break occurs when both following conditions met at one time.
- Instruction for which breakpoint set starts from odd-address, - Preceding instruction longer than 2 bytes length, and breakpoint already set at last 1-byte address of preceding instruction (This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction).
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.
MOVS SECQ WBTS MOVSWI SECQWI MOVSD SECQD FILS FILSW
MOVSW SECQW MOVSI SECQI WBTC MOVSWD SECQWD FILSI FILSWI
- Invalid Breakpoints · - Abnormal Breakpoint

- 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.
- Step Execution that won't Break
- When step instruction longer than 2 bytes and last code ends at even address
- When breakpoint already set at last address (This "already-set" breakpoint is an invalid breakpoint that
won't break, because it has been set at an address other than the starting address of an instruction.)
It is possible to select "No reset generated by watchdog timer counter overflow" while executing a program using the GO, STEP, CALL commands.
Use the ENABLE WATCHDOG, DISABLE WATCHDOG commands to control the watchdog timer.
The start-up default in this program is "Reset generated by watchdog timer counter overflow".
>GO
[Example]

This section explains the commands available during the execution of a user program.
This emulator debugger allows you to use certain commands during the execution of a user program.
For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual".
The double circle indicates that it is available during the execution of a user program.
Table 2.3-3 shows the commands available during the execution of a user program.
Table 2.3-3 Commands Available during Execution of User Program (1 / 2)
Function Restrictions Major Commands
MCU reset - 1.3 RESET
4.2 SHOW MULTITRACE, 4.31 SHOW TRACE(type 1)
Set trace acquisition data Enabled only when trace execution ended *1 4.35 ENABLE TRACE, 4.36 DISABLE TRACE
4.42 SET TRACETRIGGER, 4.43 SHOW TRACETRIGGER, 4.44 CANCEL TRACETRIGGER
4.38 SET DATATRACEAREA, 4.40 SHOW DATATRACEAREA, 4.41 CANCEL DATATRACEAREA

Table 2.3-3 Commands Available during Execution of User Program (2 / 2)
Function Restrictions Major Commands
Displaying execution cycle measurement value (Timer) - 4.27 SHOW TIMER
5.1 EXAMINE, 5.2 ENTER, 5.3 SET MEMORY, 5.4 SHOW MEMORY, 5.5 SEARCH MEMORY, 5.8 COMPARE, 5.9 FILL, 5.10 MOVE, 5.11 DUMP
Emulation memory only operable *3
Read only enabled in real-time monitoring area
Emulation memory only enabled *3
Real-time monitoring area, Disassembly only enabled
3.1 SET BREAK, 3.6 CANCEL BREAK, 3.7 ENABLE BREAK, 3.8 DISABLE BREAK, 3.9 SET DATABREAK, 3.12 CANCEL DATABREAK, 3.13 ENABLE DATABREAK, 3.14 DISABLE DATABREAK
Oprable only when "Breakpoint Settings during Execution" is enabled in the execution tab of the debug environment dialog.
*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".
*4: For detail, refer to Section "2.3.4 Break".
- [Debug] - [Run] - [Go] menu
- [Go] button on the debug toolbar
The commands in Table 2.3-3 cannot be used when the GO command is entered in the command window.
"E4404S Command error (MCU is busy)."

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.
In this emulator debugger, nine types of break functions are supported.

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.
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. It is possible to set it in this 65535 debuggers.
When a break occurs due to a code break, the following message is displayed on the Status Bar.
Break at Address by breakpoint ■Setting Method
The code break is controlled by the following method.
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/Disassembly window
There are several points to note in using code break. First, some points affecting code break are explained.
- Instruction for which breakpoint set starts from odd-address
- Preceding instruction longer than 2 bytes length, and breakpoint already set at last 1-byte address of
preceding instruction (This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction.)

Here are some additional points about the effects on other commands.
- If instruction executed by STEP command, instruction execution not aborted.
- If breakpoint specified with GO command, set at instruction immediately after such instruction, the
breakpoint does not break.
When the debugging area is set again, all breakpoints in the area are cleared.

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.
The data break is a function to abort the program execution when MCU accesses data as for a specified address. It is possible to set it in this two debuggers.
When a break occurs due to a data break, the following message is displayed on the Status Bar.
Break at Address by databreak at Access address ■Setting Method
The data break is controlled by the following method.
Refer to "3.9 SET DATABREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Data] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
When the debugging area is set again, all breakpoints in the area are cleared.

It is a special break function to abort execution while it is corresponding to specified data when the program reaches a specified address.
It is a special break function to abort execution while it is corresponding to specified data when the program reaches a specified address.
If the break condition of the data watch break is shown in figure, it becomes as shown in the figure below.

Break does not occur when data is not matching.
The maximum constant and break conditions of monitoring data break vary as follows:
Break conditions are set by address and data. Up to four points can be set. However, the break conditions vary due to combination use with the "Sequencer" or the "Trace trigger". ■Setting Method
The data monitoring break can be set depending on the following command.
- Breakpoints set dialog [code] tab
"Hardware/Monitoring data"

A sequential break is a function to abort a executing program, when the sequential condition is met by event sequential control.
It is a function to discontinue the program execution when the sequential condition consists by the sequential control of the event. Use a sequential break when the event mode is set to normal mode using the SET MODE command.
When a break occurs due to a sequential break, the following message is displayed on the Status Bar.
Break at Address by sequential break
For details of the sequential break function, refer to Section "2.3.5 Control by Sequencer".
The sequential break is controlled by the following method.

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.
A guarded access break aborts a executing program when access is made in violation of the access attribute set by using the [Setup] - [Memory Map] menu, and access is attempted to a guarded area (access-disabled area in undefined area).
There are three types of the following in Guarded access break.
When the instruction execution is done to the area without the code attribute, the break is done.
When the area without the read attribute is read, the break is done.
When the area without the write attribute is write, the break is done.
If a guarded access occurs while executing a program, the following message is displayed on the Status Bar and the program is aborted.
Break at Address by guarded access {code/read/write} at Access address
Code Guarded is affected by pre-fetching.
The F2MC-16L/16LX/16/16H family pre-fetch up to 4 bytes. So, when setting the program area mapping, set a little larger area (5 bytes max.) than the program area actually used.
Similarly, the F2MC-16F family pre-fetch up to 8 bytes. So, when setting the program area mapping, set a little larger area (9 bytes max.) than the program area actually used.
Code guarded · Read guarded · Write guarded

It is a function to abort the program execution when the trace buffer becomes full.
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 ■Setting Method
The trace-buffer-full break is controlled by the following method.
Refer to "4.30 SET TRACE (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
When a break occurs due to a performance-buffer-full break, the following message is displayed on the Status Bar.
Break at Address by performance buffer full ■Setting Method
The performance-buffer-full break is controlled by the following method.
Refer to "4.7 SET PERFORMANCE (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Performance set dialog
Refer to "4.4.13 Performance" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has.
It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has.
When a break occurs due to an external trigger break, the following message is displayed on the Status Bar.
Break at Address by external trigger break ■Setting Method
The external trigger break is controlled by the following method.
Refer to "3.42 SET TRIGGER" in "SOFTUNE Workbench Command Reference Manual".
- Debugging environment set dialog [emulation] tab
Refer to "4.7.2.3 Debug Environment" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the execution of the program compulsorily.
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
A forced break is not allowed while the MCU is in the low-power consumption mode or hold state. When a forced break is requested by the [Debug] - [Abort] menu while executing a program, the menu is disregarded if the MCU is in the low-power consumption mode or hold state. If a break must occur, then reset the cause at user system side, or reset the cause by using the [Debug] - [Reset MCU] menu, after inputting the [Debug] - [Abort] menu.
When the MCU enters the power-save consumption mode or hold state while executing, the status is displayed on the Status Bar.

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.
As shown in Table 2.3-4, controls can be made at 3 different levels.
One event can be set for one level.
The sequencer always moves from Level 1 through Level 2 to Level 3. One event can be specified as a sequencer restart condition.
When the debug function on MB2147-01 is set to Trace Enhancement mode, it is possible to control a trace by a sequencer.
Table 2.3-4 Sequencer Specifications
Level count 3 levels+ restart condition
Conditions settable for each level 1 event conditions (1 to 16777215 times pass count can be specified for each condition.)
Restart conditions 1 event conditions (1 to 16777215 times pass count can be specified.)
Operation when conditions established Branching to another level or terminating sequencer
Function Specifications

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. However, since hardware is shared with trace triggers, the actual numbers is calculated as follows.
Current maximum constant of events = 8 - (current number of trace trigger settings + current number of data monitoring break settings)
Table 2.3-5 shows the conditions that can be set for events.
Table 2.3-5 Conditions for Event and Trace Trigger
Address Memory location (address bit masking disabled)
Data 16-bit data (data bit masking enabled)
Access size Byte, word
Status Select from code, data read or data write
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).
Use the following commands to set an event.

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. 4) The sequencer is terminated and a break occurs when the level 3 condition is met.
The sequencer operates in the following order: The event can be set at each level and as a restart condition.
Use the following commands to set the sequencer.
>SET SEQUENCE 1, 3, 2, r=4
Set event 1, 3, 2 to level 1, 2, 3 respectively, and event 4 for the restart condition.
[Example]

Figure 2.3-1 Operation of Sequencer
YES
YES
NO
NO
YES
YES
NO
NO YES
The sequencer can be set by the dialog or the command.
Select [Debug] - [Sequence] menu.
For details, refer to "4.6.6 Sequence" in "SOFTUNE Workbench Operation Manual".

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.
The data recorded by sampling in machine cycle units, is called a frame.
The trace buffer can store 64K frames (65536). Since the trace buffer has a ring structure, when it becomes full, it automatically returns to the start to overwrite existing data.
Data sampled by the trace function is called trace data.
The following data is sampled:
- Access status: Read/Write/Internal access, etc.
- Device status: Instruction execution, Reset, Hold, etc.
- Queue status: Count of remaining bytes of instruction queue, etc.
(Since the data signal is shared with other signals, it does not always output data. Therefore, the trace samples information indicating whether or not the data is valid.)
The following data does not leave access data in the trace buffer.
- Portion of access data while in native mode.
When operating in the native mode, the F2MC-16L/16LX family of chips sometime performs simultaneous multiple bus operations internally. However, in this emulator, monitoring of the internal ROM bus takes precedence. Therefore, other bus data being accessed simultaneously may not be sampled (in the debugging mode, all operations are sampled). ■Frame number
A number is assigned to each frame of sampled trace data. This number is called a frame number.
The frame number is used to specify the display start position of the trace buffer. The value 0 is assigned to trace data at the triggering position for sequencer termination. Negative values are assigned to trace data that have been sampled before arrival at the triggering position (See Figure 2.3-2).
If there is no triggering position for sequencer termination, the value 0 is assigned to the last-sampled trace data.

Figure 2.3-2 Frame Numbering at Tracing

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:
- Access attribute (read/write)
Another function can be used so that sampling of redundant frames occupying two or more trace frames, such as SLEEP and READY, can be reduced to sampling of one frame.
When preselected conditions are met during MCU bus operation monitoring, a trigger for starting a trace can be generated. This function is called a trace trigger.
For the use of the trace trigger function, specify the code (/CODE) and data access (/READ/WRITE).
Up to 8 trace triggers can be preset each for code attribute and data access attribute. However, actually, the maximum number of trace triggers is determined as indicated below because the common hardware is used with events.
Current trace trigger maximum constant
= 8 - (current data monitoring break count setting + current event count setting)
For the trace trigger setup conditions that can be defined, see Table 2.3-4.
For trace trigger setup, use the following commands:
Figure 2.3-3 shows a trace sampling operation.
- Address · - Address mask

Figure 2.3-3 Trace Sampling Operation (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".
Current maximum constant of data monitoring trace triggers
= 8 - (number of data monitoring break settings + number of trace trigger settings + current number of event settings)
Use the following commands to set the data monitoring trace trigger.
In MB2147-01, the trace control is enabled while the user program is executed. However, it is necessary to end the trace execution.
The parameter that can be controlled is as follows;
*: Only when the debugging is in trace enhancement mode.
- Trace window - Shortcut menu [Forced termination]
- Trace toolbar [Forced termination] button
- SET TRACETRIGGER command
- Trace trigger setting dialog

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. 3) Perform the event and sequencer setup. 4) Perform trace buffer full break setup.
To perform a single trace, complete the following setup steps. When a program is executed after completion of the steps, trace data is sampled.
Use SET MODE command for this setting.
Enable the trace function using the ENABLE TRACE command.
To disable the trace function, use the DISABLE TRACE command.
Use of a trace trigger makes it possible to control trace sampling and make effective use of the limited trace buffer capacity. If there is no such necessity, setup need not be performed.
With a trace trigger, it is possible to specify the start and stop of trace sampling to be performed at a trigger hit.
To use a trace trigger, input the SET TRACE/TRIGGER command and then perform trace trigger setup using the SET TRACETRIGGER command.
A break can be invoked when the trace buffer becomes full.
To perform setup, use the SET TRACE command. This break feature is disabled when the program starts. To view the setting, use SHOW TRACE/STATUS.
Table 2.3-6 lists trace-related commands in the single trace.
Table 2.3-6 Trace-related Commands Available in Single Trace
Sets trace trigger Deletes trace trigger
SET TRACE SHOW TRACE SEARCH TRACE ENABLE TRACE DISABLE TRACE CLEAR TRACE
Sets trace buffer full break Displays trace data Searches for trace data Enables trace function Disables trace function Clears trace function
Available command Function

Only when an event trigger occurred, the multi trace samples data before and after the event trigger.
To use the multi trace function, the SET MODE command is set to the following mode.
The multi trace samples data where an event trigger (trace end trigger) occurs before and after the event trigger.
It can be used for tracing required only when a certain variable access occurs, instead of continuous tracing.
The trace data sampled at one event trigger is called a block. The trace buffer for multi trace in MB2147-01 can hold 64K frames. When dividing into blocks, select the size of one block from 128/256/512/1024 frame. 64 to 512 blocks can be sampled according to the block size.
There are the following two event triggers of the multi trace.
Figure 2.3-4 Multi Trace Sampling
Data of 128 to 1024 frames can be sampled according to the block size at each time an event occurs (trace end trigger). This data unit is called a block, and each sampled block is numbered starting from 0. This is called the block number.
A block is a collection of sampled data before and after the event trigger occurs. At the event trigger is 0, trace data sampled before reaching the event trigger point is numbered negatively, and trace data sampled after the event trigger point is numbered positively. These frame numbers are called local numbers (See Figure 2.3-5).
In addition to this local number, there is another set of frame numbers starting 1 with the oldest data in the trace buffer. This is called the global number. Since the trace buffer can hold 64K frames, frames are numbered 1 to 65536 (See Figure 2.3-5).
To specify which frame data is displayed, use the global number or block and local numbers.

Figure 2.3-5 Frame Number in Multi Trace

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). A block is sampled data in combination with the trace data before the event hit and the trace delay.
When the multi trace end trigger (event) hit occurs, the delay is acquired as many as the number of occurrence of the subsequent trace end trigger hit.
Example: If you want to get the trace delay for three blocks, the event hit needs to occur four times.

Get four times of the hit to the trace end trigger

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".

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. Set event mode to multi trace mode. 3. Enable trace function. 4. Set event and sequencer. 5. Set trace-buffer-full break.
Before executing the multi trace, the following settings must be made. After these settings, trace data is sampled when a program is executed.
Use SET MODE command for this setting.
Use the SET MODE command for this setting.
Use the ENABLE MULTITRACE command for this setting. To disable the function, use the DISABLE MULTITRACE command.
Set an event for sampling the multi trace. Use the SET TRACETRIGGER command for this setting.
To break when the trace buffer becomes full, set the trace-buffer-full break. Use the SET MULTITRACE command for this setting.
Use SET MULTITRACE command to set this.
Use SET DELAY command to set this.

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 Function
SET TRACETRIGGER SHOW TRACETRIGGER CANCEL TRACETRIGGER ENABLE TRACETRIGGER DISABLE TRACETRIGGER
Sets events Displays event setup status Deletes event Enables event Disables event
SET MULTITRACE SHOW MULTITRACE SEARCH MULTITRACE ENABLE MULTITRACE DISABLE MULTITRACE CLEAR MULTITRACE
Sets trace-buffer-full break Displays trace data Searches trace data Enables trace function Disables trace function Clears trace data
Sets trace delay Displays trace delay
Multi trace mode

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.
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.
>SHOW TRACE/STATUS en/dis = enable ; Trace function enabled buffer full = nobreak ; Buffer full break function disabled sampling = end ; Trace sampling terminates code = enable ; Code execution enabled verbose = disable ; Verbose trace disabled frame no. = -00120 to 00000 ; Frame -120 to 0 store data >
[Example]

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.
Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified.
- In Single Trace Mode
>SHOW TRACE/CYCLE -6 ; Start displaying from frame -6
>SHOW TRACE/CYCLE -6..0 ; Display from frame -6 to frame 0
>SHOW TRACE -6 ; Start displaying from frame -6
>SHOW TRACE -6..0 ; Displays from frame -6 to frame 0
[Example]

Trace sampling is performed at each machine cycle, but the sampling results are difficult to display because they are influenced by pre-fetch, etc. This is why the emulator has a function to allow it to analyze trace data as much as possible. The resultant data is displayed after processes such as eliminating pre-fetch effects, analyzing execution instructions, and sorting in instruction execution order are performed automatically. However, this function can be specified only in the single trace while in the debugging mode.
In this mode, data can be displayed in the following format.

Address Disassemble Description Time Stamp
Hexadecimal Indecates instruction executed Displays difference of executed time between this frame and next frame (decimal). The unit is ns.
>SHOW TRACE -194 frame no. address mnemonic time stamp -00675 : FF0 2C1 PUSHW A 375
-00672 : 0 18257 external write access. 5F 375 -00669 : 018258 external write access. 5E 375 -00666 : FF 02C2 CALL \ sort_val 625 -00661 : 018 255 external write access. C5 625 -00658 : 018256 external write access. 02 625 \ sort_val :
-00655 : FF00D2 LINK #0E 500 -00651 : 018253 external read access. 81 625 -00648 : 018254 external read access. 81 625 -00645 : 000186 in ternal write access. 0000 625 -00643 : ** RESET ** >
: :
** WAIT **
Detailed information at all sampled machine cycles can be displayed.
In this mode, no source is displayed irrespective of the setup defined by the SET SOURCE command.
>SHOW TRACE/CYCLE -672 frame no. address data a-status d-status Qst dfg event time stamp -00672 : 018257 EWA --- & 125 -00671 : 018257 5F --- EXECUTE --- @ 125 -00670 : 018257 5F --- EXECUTE --- @ 125 -00669 : 018257 EWA --- & 125 -00668 : 018257 82 --- EXECUTE --- @ 125 -00667 : FF02C6 5F --- EXECUTE --- @ 125 -00666 : --- EXECUTE 4by C 125 -00665 : FF02C6 ICF --- & D 125 -00664 : FF02C6 5F06 --- EXECUTE FLH @ 125 -00663 : FF00D2 ICF --- & 125 -00662 : FF00D2 0E08 --- EXECUTE --- @ 125 -00661 : 018255 EWA --- & 125

How to read trace data
frame no. address data a-status d-status Qst dfg event time stamp
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(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)
(6):instruction queue status
(7):information valid flag
(8):event information
(9):time stamp display (ns unit)
displays difference of executed time between this frame and next frame (decimal)
Information about event hits is excluded from the displayed information. For code execution, in particular, the effect of a prefetch is eliminated in consideration of the count of data in the instruction queue. Therefore, the information about hits is displayed for frames after a prefetch frame at an address for which an event is set.

Only the source line can be displayed. This mode is enabled only in the debugging mode.
step no. source
The following operation may be subjected to trace sampling immediately after the MCU operation is stopped (tool hold). Remember that the operation is unique to evaluation chips and not performed by mass-produced products.
Access to address 0x000100 and addresses between 0x0FFFFDC and 0x0FFFFFF
[Example]

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.
To disable the trace function, use the DISABLE TRACE command. Check whether or not the trace function is currently enabled by executing the SHOW TRACE command with /STATUS specified, or by using the built-in variable, %TRCSTAT.
Tracing terminates when the delay count ends after the sequencer has terminated. If Not Break is specified here, tracing terminates without a break operation. It is possible to check whether or not tracing has terminated by executing the SHOW TRACE command with /STATUS specified, or by using the built-in variable, %TRCSAMP.
To read trace data, use the SHOW TRACE command; to search trace data, use the SEARCH TRACE command. Use the SET DELAY command to set the delay count and break operation after the delay count.
>>SHOW TRACE/STATUS
buffer ful = nobreak
sampling = on
buffer full = nobreak
sampling = end
frame no. = -00805 to 00000
step no. address mnemonic time stamp
sort_val:
If the CLEAR TRACE command is executed with the trace ending state, trace data sampling can be re- executed by re-executing the sequencer from the beginning.
[Example] · en/dis = enable · en/dis = enable

This section explains how to save 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Save] from the shortcut menu. The [Save as] dialog
appears. Specify the file name and where to save trace data. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SHOW TRACE/FILE command.
For details, refer to Section "4.33 SHOW TRACE (type 3)" in "SOFTUNE Workbench Command Reference Manual". When additionally saving trace data in an existing file, execute the SHOW TRACE/FILE/APPEND command.

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. To measure performance, set the event mode to the performance mode using the SET MODE command.
The performance measurement allows the time between two event occurrences to be measured and the number of event occurrences to be counted. Up to 65535 event occurrences can be measured.
Measures time interval between two events.
Events can be set at 8 points (1 to 8). However, in the performance measurement mode, the intervals, starting event number and ending event number are combined as follows. Four intervals have the following fixed
event number combination:
Interval Starting Event Number Ending Event Number
The specified events become performance measurement points automatically, and occurrences of that event are counted.

Set the event mode to the performance mode using the SET MODE command. This enables the performance measurement function.
> ■Setting Minimum Measurement Unit for Timer
It is 1ns as the minimum measurement unit for the timer used to measure performance. And a resolution of performance measurement data is 25ns.
When the buffer for storing performance measurement data becomes full, a executing program can be broken. This function is called the performance-buffer-full break. The performance buffer becomes full when an event occurs 65535 times.
If the performance-buffer-full break is not specified, the performance measurement ends, but the program does not break.
>SET PERFORMANCE/NOBREAK
> ■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.
Four intervals have the following fixed event number combination.
[Example] · [Example]

Interval Starting Event Number Ending Event Number
The specified events become performance measurement points automatically.
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.
Display performance measurement data by using the SHOW PERFORMANCE command.
Clear performance measurement data by using the CLEAR PERFORMANCE command.
[Example] · >

Display the measured time and measuring count by using the SHOW PERFORMANCE command.
To display the time measured, specify the starting event number or the ending event number.
Count of measuring within given time interval
event = 1 -> 2 time (µs) | count
min time = 11637.0 +
max time = 17745.0 0.0 - 8999.0 | 0
avr time = 14538.0 9000.0 - 9999.0 | 0
10000.0 - 10999.0 | 0
11000.0 - 11999.0 | 2
12000.0 - 12999.0 | 19
13000.0 - 13999.0 | 52
14000.0 - 14999.0 | 283
15000.0 - 15999.0 | 92
16000.0 - 16999.0 | 3
17000.0 - 17999.0 | 1
18000.0 - 18999.0 | 0
19000.0 - | 0
>SHOW PERFORMANCE/TIME 1,13000,16999,500 event = 1 -> 2 time (µs) | count min time = 11637.0 + max time = 17745.0 0.0 - 12999.0 | 21 avr time = 14538.0 13000.0 - 13499.0 | 13 13500.0 - 13999.0 | 39 14000.0 - 14499.0 | 121 14500.0 - 14999.0 | 162 15000.0 - 15499.0 | 76 15500.0 - 15999.0 | 16 16000.0 - 16499.0 | 2 16500.0 - 16999.0 | 1 17000.0 - 17499.0 | 1 +
Lower time limit for display
Upper time limit for display

This emulator has the C0 coverage measurement function. Use this function to find what percentage of an entire program has been executed.
When testing a program, the program is executed with various test data input and the results are checked for correctness. When the test is finished, every part of the entire program should have been executed. If any part has not been executed, there is a possibility that the test is insufficient.
This emulator coverage function is used to find what percentage of the whole program has been executed. In addition, details such as which addresses were not accessed can be checked.
This enables the measurement coverage range to be set.
To execute the C0 coverage, set a range within the code area. In addition, setting a range in the data area, permits checking the access status of variables such as finding unused variables, etc.
Execution of coverage measurement is limited to the address space specified as the debug area.
Therefore, set the debug area in advance.
This is operable by enabling the coverage function on the chip tabs: [Environment] - [Setup Debugging Environment] - [Debug Environment] menu.
The procedure for coverage measurement is as follows:
The following operation can be made in coverage measurement:
- Abortion and resume of coverage measurement: ENABLE COVERAGE, DISABLE COVERAGE
When the coverage measurement function is used, the monitoring function in RAM area of the 0 bank cannot be used. For more details, refer to Section "2.3.9 Real-time Monitoring".

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. Up to 32 ranges can be specified.
By specifying /AUTOMATIC for the command qualifier, the code area for the loaded module is set automatically. However, the library code area is not set when the C compiler library is linked.
>SET COVERAGE FF0000 .. FFFFFF ■Measuring Coverage
When preparing for coverage measurement, execute the program.
Measurement starts when the program is executed by using the GO, STEP, or CALL command.
To display the measurement result, use the SHOW COVERAGE command. The following can be displayed:
>SHOW COVERAGE/MODULE sample.abs (84.03%) +- startup.asm (90.43%) +- sample.c (95.17%) +- samp.c (100.00%)
Displays the load modules and the coverage rate of each module.
[Example]

+ + + address 0123456789ABCDEF0123456789ABCDEF0123456 ... ABCDEF C0(%) FF0000 **3*F* 32.0
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.
Display one line of a coverage rate
address +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F C0(%) FF0000 - 100.0 FF0010 - 100.0 FF0020 - - - 18.6 FF0030 - 100.0 FF0040 - . - 93.7 FF0050 - 100.0 FF0060 0.0 FF0070 0.0 FF0080 0.0
Display the access status of every 1 address
. : No access

>SHOW COVERAGE/SOURCE main * 70: { 71: int i; 72: struct table *value[16]; 73: * 74: for (i=0; i
Displays access status of each source line.
. : No Access Accessed Blank: Line which the code had not been generated or is outside the scope of the coverage measurement
* :
>SHOW COVERAGE/INSTRUCTION F9028F sample.c$70 { * F9028F \main: * F9028F 0822 LINK #22 * F90291 4F01 PUSHW RW0 sample.c$74 for (i=0; i
Displays access status of each source line.
. : No Access Accessed Blank: Instruction outside the scope of the coverage measurement *:

The real-time monitoring function is used to display the memory contents during program execution.
The emulator can use the real-time monitoring function when the evaluation chip has the external trace bus interface.
A real-time monitoring window is provided to display two 256-byte regions for real-time monitoring purposes. The real-time monitoring window has a function for reading data from the actual memory and displaying it before program execution (copy function), and a function for displaying updated data in red.
To use the real-time monitoring function in the RAM area of the 0 bank, the coverage function must be disabled by the following methods.
Refer to "4.23 DISABLE COVERAGE" in "SOFTUNE Workbench Command Reference Manual".
[Chip] tab on the Setup debug environment dialog.
Refer to "4.7.2.3 Debug Environment" in "SOFTUNE Workbench Operation Manual".

This function measures the program execution time.
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.
In either case, the measurement is performed whenever a program is executed, and the measurement result displays the following two values:
Either of the following methods can be used to display the measurement results.
The results appear 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".
Enter the SHOW TIMER command in the command window.
For details, refer to Section "4.27 SHOW TIMER" in "SOFTUNE Workbench Command Reference Manual".
Either of the following methods can be used to clear the measurement results.
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".

Enter the CLEAR TIMER command in the command window.
For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual".
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.

This section explains power-on debugging by the emulators for the MB2147-01.
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. The following functions are available:
The power-on debugging procedure is described below:
- Set the DIP switch on the adapter board mounted in the upper part of the emulator.
- Turn on the target board and emulator main unit.
- Launch Workbench to start debugging.
For debugging, set hardware breaks, etc.
- To start a power-on debugging, run [Execute] - [Power-ON Debug] menu.
Input the lower limit value of the monitoring voltage from the [User Power Monitor Voltage] dialog box to display PON in the input status bar.
- Run the program.
- Turn the target board off while running and then back on.
- Conduct debugging.
- To terminate the power-on debugging, run [Execute] - [Power-ON Debug] menu.

This section describes the functions of the RAM Checker.
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
- Monitors monitoring addresses at intervals of 100 ms
The debugging window "RAM Checker" has been added to SOFTUNE Workbench to log/monitor monitoring addresses.
For operations of Ram checker Window, refer to Section "3.21 RAM Checker Window" of "SOFTUNE Workbench Operation Manual".
The RAM Checker operates under the following conditions.
The RAM Checker cannot be used for the MB2141/MB2147-05 emulator, or the RS/LAN communication device. In those environments, the main menu [View] - [RAM Checker] is not disabled.
The RAM Checker is enabled only when the debug function on MB2147-01 is set to "RAM Checker" mode. For more details, see Section "2.3.1.6 Debug Function".

Monitoring Point Count 16 points
Size Bytes/word (16 bits)
Event Functions Max. 8 Points
Sampling Time 1 ms (Fixed)
Update Intervals 100 ms (Fixed)
Log File Formats SOFTUNE format or CSV format
- To display in the RAM Checker viewer (recommended)
- Default extension is ".SRL".
- To display in other applications than the RAM Checker viewer
- Default extension is ".CSV".
The CSV format requires size of data approximately 4 times that of the SOFTUNE format.
User sets the monitoring points, Log File, logging status by GUI or Command to use the RAM Checker.
- Set the debug function to "RAM Checker" mode by using [Debug] - [Select Debug Function].
- By short cut menu [Setup...] on the Ram checker Window, user sets the monitoring points.
- By short cut menu [File...] on the Ram checker Window, user sets the Log File.
- By checking the short cut menu: [Logging start] on the Ram checker Window, a logging status of the
Ram Checker becomes to enable.
- Set the debug function to "RAM Checker" mode by using SET MODE/CONFIG command.
- By command: SET RAMCHECK, user sets the monitoring points.
- By command: SET RAMCHECK, user sets the Log File.
- By command: ENABLE RAMCHECK, a logging status of the Ram Checker becomes to enable.
After these commands are set, user program execute and Log File is created by stopped user program. If it is restarted, a Log File is overwritten.
If a setting of Overwrite control is enabled on Setup file dialog, a Log File is saved with different name every other execution.

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".
Execution state for MCU such as stop mode or sleep mode cannot be displayed at status bar during logging.
Following restrictions are made for the size of log file to be created depending on file system where log file is stored.
FAT:Up to 2GB
NTFS: No limit.
If the file system is FAT, FAT32, file name will be changed and continue logging when the size of file is exceeded limitation.
If a file is already existed, log file will be overwritten
Example of an operation
If the size of file is exceeded it's limitation, log file will be created as
filename.srl --> filename#1.srl
If the size gets exceeded the limitation again, log will be shown and changes as follows.
filename#1.srl --> filename#2.srl
filename#N-1.srl --> filename#N.srl
• · •

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.
To halt the operation of CPU, stop mode for low power consumption and power off condition at power-on debug function will be saved to log.
Trigger point uses event-hit in SOFTUNE Workbench. It is necessary to set event in SOFTUNE Workbench to use trigger point. When the event-hit is appeared, its information is recorded in a log.
The Data Lost is appeared in the following two causes.
- The Data Lost caused by hardware
The emulator obtains data access history of RAM at intervals of 1 ms, but if two or more data access the same address within 1 ms, the emulator obtains only the data of the last access. Data loss caused by hardware indicates that several data accessed the same address.
- The Data Lost caused by software
SOFTUNE Workbench obtains data from the emulator at intervals of 100 ms. However, other application may disable the SOFTUNE Workbench for obtaining data at intervals of 100 ms. In such cases, the RAM Checker Viewer does not display a portion of the data, but displays the invalid time band graphically.
If logging is halted by break or stopping an execution, software lost could be appeared for 1ms to 15ms. at the end of log. This happens because log after stopping an execution will be obtained until logging is stopped, thus this is not an actual data lost.
For details of RAM Checker viewer, refer to RAM Checker Viewer Manual (FswbRView.pdf) and Help.

This section explains how to check information about the MB2147-01 emulator debugger.
This emulator debugger enables you to check the following information at startup.
If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
Use one of the following methods to check debugger information.
Refer to Section "1.19 SHOW SYSTEM" in "SOFTUNE Workbench Command Reference Manual".
- Version information dialog
Select [Help] - [Version Information] menu. For details, refer to Section "4.9.3 Version Information" in "SOFTUNE Workbench Operation Manual".
F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED,
PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version ======================================================= Add in DLLs
SiCmn Product name: SOFTUNE Workbench File Path: SiC907.dll path Version: SiC907.dll version -
SiM907 Product name: SOFTUNE Workbench File Path: SiM907.dll path Version: SiM907.dll version - Language Tools
- F2MC-16 Family SOFTUNE C Compiler version

- F2MC-16 Family SOFTUNE Linker version
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 : Current debugger type MCU type : Currently selected target MCU VCpu dll name : Path and name of the currently used VCpu dll VCpu dll version : Version of the currently used virtual debugger DLL DSU type : Currently used DSU type Common version : Version of monitor (common) Monitor version : Version of monitor (dependent) Configuration board ID : Configuration board ID Configuration board version : Configuration board version MCU frequency : Operating frequency Communication device : Device type Baud rate : Baud rate (at RS connection) Host name : LAN host name (at LAN connection) REALOS version : REALOS version
SiIODef Product name: Softune Workbench File Path: SiIODef.dll path Version: SiIODef.dll version ======================================================= Current path: Path of the currently used project Language: Currently used language Help file path: Help file path

This section explains the functions of the emulator debuggers for the MB2147-05.
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.
MB2147-01
MB2147-05
MB2198
The emulator debugger for the MB2147-05 is software that controls an emulator from a host computer via a communications line (RS-232C or USB) to evaluate programs.
The following series can be debugged:
F 2 MC-16LX
Before using the emulator, it must be initialized. For details, refer to "Appendix B Downloading Monitor Program" of "SOFTUNE Workbench Operation Manual".

This section explains the operating environment setup.
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. Adjusted settings can be used as new default settings from the next time.
- Monitoring program automatic loading
- MCU operation mode
- Debug area · - Memory mapping

Emulators for MB2147-05 can automatically update the monitoring program at emulator startup.
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.
The monitoring program and configuration binary data to be compared for update are in Lib\907 under the directory where Workbench is installed.
Enable/disable the monitoring program automatic loading function by choosing [Environment] - [Debugging Environment Setup] - [Setup Wizard] menu.

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.
At emulator start-up, the MCU is in the debugging mode.
The data access to internal bus may not be detected by emulator in native mode. Therefore, when the MCU operation mode is changed, all the following are initialized:
- Trace measurement settings and trace buffer
All the operations of evaluation chips can be analyzed, but their operating speed is slower than that of mass- produced chips.
Evaluation chips have the same timing as mass-produced chips to control the operating speed. Note that the restrictions the shown in Table 2.4-1 are imposed on the debug functions.
Table 2.4-1 Restrictions on Debug Functions in Native Mode
Applicable series Restrictions on debug functions
Common to all series - When a data read access occurs on the MCU internal bus, the internal
bus access information is not sampled and stored in the trace buffer. - Even when a data break or event (data access condition) is set for
data on the MCU internal bus, it may not become a break factor or sequencer-triggering factor. - The coverage function may fail to detect an access to data on the
MCU internal bus.
- Data breakpoints

Set the intensive debugging area out of the whole memory space. The area functions are enhanced.
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.
Setting the debug area enhances the breakpoint function.
- Enhancement of Breakpoints
Up to six breakpoints (not including temporary breakpoints set using GO command) can be set when the debug area has not yet been set.
When setting the debug area as the CODE attribute, up to 65535 breakpoints can be set if they are within the area. At this time, up to six breakpoints can be set for an area other than the debug area, but the total count of breakpoints must not exceed 65535. In 00 to 0F bank and 0F0 to 0FF bank, a breakpoint can be set without specifying the debug area. (DEBUG1, DEBUG2)

A unit in which memory is allocated is called an area. There are five different 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. Up to four user memory areas can be set with no limit on the size of each area. Define a region on a 256-byte boundary.
Access attributes can be set for each area; for example, CODE, READ, etc., can be set for ROM area, and READ, WRITE, etc. can be set for RAM area. If the MCU attempts access in violation of these attributes, the MCU operation is suspended and an error is displayed (guarded access break).
To set the user memory area, use the SET MAP command.
- Emulation Memory Area
Memory space substituted for emulator memory is called the emulation memory area, and this memory is called emulation memory.
It is possible to set up to four areas of 256-KB maximum (including an internal ROM area described later) as emulation memory area. Define a region on a 256-byte boundary. An area larger than 256-KB can be specified at one time but is divided internally into two or more 256-KB areas for management purposes.
Memory manipulation commands can be executed in relation to emulation memory areas while MCU execution is in progress.
Emulation memory areas can be set using the SET MAP command.
Further, the access attributes can be set as with user memory areas.
Even if the MCU internal resources are set as emulation memory area, access is made to the internal resources.
- 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 256-KB can be specified.
The internal ROM area with a size up to 1 MB can be specified 2 areas.
Memory manipulation commands can be executed in relation to emulation memory areas while MCU execution is in progress.
The internal ROM area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map... " from "Setup".

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.
The internal ROM image area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map... " from "Setup". This area attribute is automatically set to READ/CODE. The same data as in the internal ROM area appears in the internal ROM image area.
The internal memory area, it is set a suitable area automatically by the selected MCU.
A memory area that does not belong to any of the areas described above is part of the user memory area. This area is specifically called the undefined area.
The undefined area can be set to either NOGUARD area, which can be accessed freely, or GUARD area, which cannot be accessed. Select either setup for the whole undefined area. If the area attribute is set to GUARD, a guarded access error occurs if access to this area is attempted.
- Undefined Area

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.
The access attributes shown in Table 2.4-2 can be specified for memory areas.
A guarded memory access break occurs if access is attempted in violation of these attributes while executing a program.
When access to the user memory area and the emulation memory area is made using program commands, such access is allowed regardless of the CODE, READ, WRITE attributes. However, access to memory with the GUARD attribute in the undefined area, causes an error.
Table 2.4-2 Types of Access Attributes
CODE Instruction Execution Enabled
User Memory Emulation Memory
READ Data Read Enabled
WRITE Data Write Enabled
NOGUARD No check of access attribute
When access is made to an area without the WRITE attribute by executing a program, a guarded access break occurs after the data has been rewritten if the access target is the user memory. However, if the access target is the emulation memory, the break occurs before rewriting. In other words, write-protection (memory data cannot be overwritten by writing) can be set for the emulation memory area by not specifying the WRITE attribute for the area.
This write-protection is only enabled for access made by executing a program, and is not applicable to access by commands.
Area Attribute Description · GUARD Access Disabled · Undefined

Use the following commands for memory mapping.
SET MAP: Set memory map.
SHOW MAP: Display memory map.
CANCEL MAP: Change memory map setting to undefined.
000000 .. FFFFFF noguard
The rest of setting area numbers
user = 8 emulation = 5
>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
000000 .. 0001FF read write user
000200 .. 007FFF guard
008000 .. 008FFF read write user
009000 .. FEFFFF guard
FF0000 .. FFFFFF read write cod e emulation
008000 .. 008FFF copy
The rest of setting area numbers
user = 6 emulation = 3
> ■Internal ROM Area Setting
The [Setup Map] dialog box is displayed using [Environment] - [Debugger Memory Map] menu. You can set the internal ROM area using the [Internal ROM Area] after the [Map Adding] dialog box is displayed by clicking on the [Setting] button. You can set two areas. Both require empty Emulation area to be set. You can set the region size by (Empty space of the emulation area) x (one area size).
Specify the internal ROM area from the ending address H'FFFFFF (fixed) for area 1. Also, it is possible to delete the internal ROM area.

When using commands to execute a program, there are several points to note.
For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
- No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
PCB NCC SPB MOV ILM,#imm8 ORCCR,#imm8
DTB ADB CNR ANDCCR,#imm8 POPW PS
- No break occurs when breakpoint set at address other than starting address of instruction.
- No break occurs when both following conditions met at one time.
- Instruction for which breakpoint set starts from odd-address, - Preceding instruction longer than 2 bytes length, and breakpoint already set at last 1-byte address of preceding instruction (This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction).
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.
MOVS SECQ WBTS MOVSWI SECQWI MOVSD SECQD FILS FILSW
MOVSW SECQW MOVSI SECQI WBTC MOVSWD SECQWD FILSI FILSWI
- Invalid Breakpoints · - Abnormal Breakpoint

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.
It is possible to select "No reset generated by watchdog timer counter overflow" while executing a program using the GO, STEP, CALL commands.
Use the ENABLE WATCHDOG, DISABLE WATCHDOG commands to control the watchdog timer.
The start-up default in this program is "Reset generated by watchdog timer counter overflow".
>GO
[Example]

This section explains the commands available during the execution of a user program.
This emulator debugger allows you to use certain commands during the execution of a user program.
For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual".
The double circle indicates that it is available during the execution of a user program.
Table 2.4-3 shows the commands available during the execution of a user program.
Table 2.4-3 Commands Available during Execution of User Program
Function Restrictions Major Commands
MCU reset - 1.3 RESET
Memory operation (Read/Write) Emulation memory only operable 5.1 EXAMINE, 5.2 ENTER, 5.3 SET MEMORY, 5.4 SHOW MEMORY, 5.5 SEARCH MEMORY, 5.8 COMPARE, 5.9 FILL, 5.10 MOVE, 5.11 DUMP
Line assembly, Disassembly Emulation memory only enabled 6.1 ASSEMBLE, 6.2 DISASSEMBLE
- [Debug] - [Run] - [Go] menu
- [Go] button on the debug toolbar
The commands in Table 2.4-3 cannot be used when the GO command is entered in the command window.
"E4404S Command error (MCU is busy)."

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.
In this emulator debugger, five kinds of break functions are supported.

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.
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. It is possible to set it in this 65535 debuggers. However, it is necessary to set the debugging area as a code break area.
When a break occurs due to a code break, the following message is displayed on the Status Bar.
Break at Address by breakpoint ■Setting Method
The code break is controlled by the following method.
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/Disassembly window
There are several points to note in using code break. First, some points affecting code break are explained.
- Instruction for which breakpoint set starts from odd-address
- Preceding instruction longer than 2 bytes length, and breakpoint already set at last 1-byte address of
preceding instruction (This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction.)

Here are some additional points about the effects on other commands.
- If instruction executed by STEP command, instruction execution not aborted.
- If breakpoint specified with GO command, set at instruction immediately after such instruction, the
breakpoint does not break.
When the debugging area is set again, all breakpoints in the area are cleared.

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.
The data break is a function to abort the program execution when MCU accesses data as for a specified address.
When a break occurs due to a data break, the following message is displayed on the Status Bar.
Break at Address by databreak at Access address ■Setting Method
The data break is controlled by the following method.
Refer to "3.9 SET DATABREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Data] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
When the debugging area is set again, all breakpoints in the area are cleared.

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.
A guarded access break aborts a executing program when access is made in violation of the access attribute set by using the [Setup] - [Memory Map] menu, and access is attempted to a guarded area (access-disabled area in undefined area).
There are three types of the following in Guarded access break.
When the instruction execution is done to the area without the code attribute, the break is done.
When the area without the read attribute is read, the break is done.
When the area without the write attribute is write, the break is done.
If a guarded access occurs while executing a program, the following message is displayed on the Status Bar and the program is aborted.
Break at Address by guarded access {code/read/write} at Access address
Code Guarded is affected by pre-fetching.
The F2MC-16L/16LX/16/16H family pre-fetch up to 4 bytes. So, when setting the program area mapping, set a little larger area (5 bytes max.) than the program area actually used.
Similarly, the F2MC-16F family pre-fetch up to 8 bytes. So, when setting the program area mapping, set a little larger area (9 bytes max.) than the program area actually used.
Code guarded · Read guarded · Write guarded

It is a function to abort the program execution when the trace buffer becomes full.
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 ■Setting Method
The trace-buffer-full break is controlled by the following method.
Refer to "4.30 SET TRACE (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the execution of the program compulsorily.
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
A forced break is not allowed while the MCU is in the low-power consumption mode or hold state. When a forced break is requested by the [Debug] - [Abort] menu while executing a program, the menu is disregarded if the MCU is in the low-power consumption mode or hold state. If a break must occur, then reset the cause at user system side, or reset the cause by using the [Debug] - [Reset MCU] menu, after inputting the [Debug] - [Abort] menu.
When the MCU enters the power-save consumption mode or hold state while executing, the status is displayed on the Status Bar.

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.
The data recorded by sampling in machine cycle units, is called a frame.
The trace buffer can store 64K frames (65536). Since the trace buffer has a ring structure, when it becomes full, it automatically returns to the start to overwrite existing data.
Data sampled by the trace function is called trace data.
The following data is sampled:
- Access status: Read/Write/Internal access, etc.
- Device status: Instruction execution, Reset, Hold, etc.
- Queue status: Count of remaining bytes of instruction queue, etc.
(Since the data signal is shared with other signals, it does not always output data. Therefore, the trace samples information indicating whether or not the data is valid.)
The following data does not leave access data in the trace buffer.
- Portion of access data while in native mode.
When operating in the native mode, the F2MC-16L/16LX family of chips sometime performs simultaneous multiple bus operations internally. However, in this emulator, monitoring of the internal ROM bus takes precedence. Therefore, other bus data being accessed simultaneously may not be sampled (in the debugging mode, all operations are sampled). ■Frame Number
A number is assigned to each frame of sampled trace data. This number is called a frame number.
The frame number is used to specify the display start position of the trace buffer. The value 0 is assigned to trace data at the triggering position for sequencer termination. Negative values are assigned to trace data that have been sampled before arrival at the triggering position (See Figure 2.4-1).
If there is no triggering position for sequencer termination, the value 0 is assigned to the last-sampled trace data.

Figure 2.4-1 Frame Number at Tracing

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:
- Access attribute (read/write)
Another function can be used so that sampling of redundant frames occupying two or more trace frames, such as SLEEP and READY, can be reduced to sampling of one frame.
- Address · - Address mask

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.
To perform a trace, complete the following setup steps. When a program is executed after completion of the steps, trace data is sampled.
Enable the trace function using the ENABLE TRACE command.
To disable the trace function, use the DISABLE TRACE command.
The trace function is enabled by default when the program is launched.
A break can be invoked when the trace buffer becomes full.
To perform setup, use the SET TRACE command. This break feature is disabled when the program starts. To view the setting, use SHOW TRACE/STATUS.
Table 2.4-4 shows the commands related to a trace.
Table 2.4-4 Trace-related Commands
SET TRACE SHOW TRACE SEARCH TRACE ENABLE TRACE DISABLE TRACE CLEAR TRACE
Sets trace-buffer-full break Displays trace data Searches for trace data Enables trace function Disables trace function Clears trace function
Available command Function

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.
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.
en/dis = enable ; Trace function enabled
buffer full = nobreak ; Buffer full break function disabled sampling = end ; Trace sampling terminates frame no. = -00120 to 00050 ; Frame -120 to 50 store data step no. = -00091 to 00022 ; Step -91 to 22 store data >
[Example]

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.
Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified.
- In Single Trace Mode
>SHOW TRACE/CYCLE -6 ; Start displaying from frame -6
>SHOW TRACE/CYCLE -6..10 ; Display from frame -6 to frame 10
>SHOW TRACE -6 ; Start displaying from step -6
>SHOW TRACE -6..10 ; Displays from step -6 to step 10
[Example]

Trace sampling is performed at each machine cycle, but the sampling results are difficult to display because they are influenced by pre-fetch, etc. This is why the emulator has a function to allow it to analyze trace data as much as possible. The resultant data is displayed after processes such as eliminating pre-fetch effects, analyzing execution instructions, and sorting in instruction execution order are performed automatically. However, this function can be specified only in the single trace while in the debugging mode.
In this mode, data can be displayed in the following format.

step no. address mnemonic
\sub4:
-00189 : FF010A MOVL A,001A
-00183 : ** RESET **
Detailed information at all sampled machine cycles can be displayed.
In this mode, no source is displayed irrespective of the setup defined by the SET SOURCE command.
>SHOW TRACE/CYCLE -587 frame no. address data a-status d-status Qst dfg -00587 : FF0106 0106 --- FLH -00586 : FF0106 0008 ECF EXECUTE --- @ -00585 : FF0106 0106 --- EXECUTE --- -00584 : 1010E8 10E8 --- --- -00583 : 1010E8 0102 EWA EXECUTE --- @ -00582 : 1010E8 0102 --- EXECUTE --- -00581 : 000186 0186 --- 2by -00580 : 000186 10F2 IRA EXECUTE --- @ -00579 : 1010E6 10E6 --- --- -00578 : 1010E6 10F2 EWA EXECUTE --- @ -00577 : 1010E6 10F2 --- EXECUTE --- -00576 : 000186 0186 --- ---

How to read trace data
frame no. address data a-status d-status Qst dfg
(1) (2) (3) (4) (5) (6) (7)
(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
ECF:code fetch to external memory
---:valid "d-status" information
(5):device information (d-status)
STANDBY:hardware standby
THOLD :tool hold
UHOLD :user hold
WAIT :waiting by ready pin
SLEEP :sleep
STOP :stop
EXECUTE:execute instruction
RESET :reset
:invalid d-status information
(6):instruction queue status
FLH:flush queue
-by:number of remainder code of queue is -byte(-:1 to 8)
(7):valid flag
&:this frame address is valid
@:this frame data is valid

Only the source line can be displayed. This mode is enabled only in the debugging mode.
step no. source
The following operation may be subjected to trace sampling immediately after the MCU operation is stopped (tool hold). Remember that the operation is unique to evaluation chips and not performed by mass-produced products.
Access to address 0x000100 and addresses between 0x0FFFFDC and 0x0FFFFFF
[Example]

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.
To disable the trace function, use the DISABLE TRACE command. Check whether or not the trace function is currently enabled by executing the SHOW TRACE command with /STATUS specified, or by using the built-in variable, %TRCSTAT.
Tracing terminates when the sequencer has terminated. If Not Break is specified here, tracing terminates without a break operation. It is possible to check whether or not tracing has terminated by executing the SHOW TRACE command with /STATUS specified, or by using the built-in variable, %TRCSAMP.
To read trace data, use the SHOW TRACE command; to search trace data, use the SEARCH TRACE command.
>>SHOW TRACE/STATUS
buffer full = nobreak
sampling = on
buffer full = nobreak
sampling = end
frame no. = -00805 to 00000
step no. = -00262 to 00000
step no. address mnemonic level
\sub5:
If the CLEAR TRACE command is executed with the trace ending state, trace data sampling can be re- executed by re-executing the sequencer from the beginning.
[Example] · en/dis = enable · en/dis = enable

This section explains how to save 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Save] from the shortcut menu. The [Save as] dialog
appears. Specify the file name and where to save trace data. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SHOW TRACE/FILE command.
For details, refer to Section "4.33 SHOW TRACE (type 3)" in "SOFTUNE Workbench Command Reference Manual". When additionally saving trace data in an existing file, execute the SHOW TRACE/FILE/APPEND command.

This function measures the program execution cycle count.
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.
The measurement is performed whenever a program is executed, and the measurement result displays the
following two values:
Either of the following methods can be used to display the measurement results.
The results appear 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".
Enter the SHOW TIMER command in the command window.
For details, refer to Section "4.27 SHOW TIMER" in "SOFTUNE Workbench Command Reference Manual". ■Clearing Measurement Results
Either of the following methods can be used to clear the measurement results.
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".
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 number of execution cycles 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.

This section explains the functions of the emulator debuggers for the MB2198.
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.
The emulator debugger for the MB2198 is software that controls an emulator from a host computer via a communications line (RS-232C, LAN, or USB) to evaluate programs.
The following series can be debugged:
Before using the emulator, the emulator must be initialized.
For further details, refer to "Appendix B Download Monitor Program", and "Appendix C Setting up LAN
Interface" of "SOFTUNE Workbench Operation Manual".

This section explains the operating environment setup.
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. Adjusted settings can be used as new default settings from the next time.

The MB2198 emulator can automatically update the monitoring program at emulator startup.
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.
The monitoring program and configuration binary data to be compared for update are in Lib\907 under the directory where Workbench is installed.
Enable/disable the monitoring program automatic loading function by choosing [Environment] - [Debug Environment] - [Setup Wizard] menu.

The MB2198 emulator automatically loads and executes the Boot ROM file during startup of the debug.
When the MB2198 emulator is specified, at the starting of debugging the Boot ROM file is automatically loaded and then executed. The Boot ROM file is in Lib\907\BootROM under the directory where Workbench is installed.
The directory containing the Boot ROM file can be displayed using the [Project] - [Setup Project] menu, and can be modified in the setup project dialog. In addition, it is also possible to automatically execute the Boot ROM file during the debugger startup or reset of MCU. For details, see the "SOFTUNE Workbench Operation Manual".

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.
In full trace mode, execution of all the instructions can be traced with no trace data missed. However, when branching has been performed for three times or more within 11 cycles, getting the trace data will be given a higher priority, as waits are inserted for MCU, it may not run in real time.
In real time mode, execution can be performed in the real time of a program. However, when branching has been performed for three times or more within 11 cycles, some of the trace data may be missed.
In addition, an error may occur during measurement of the cycle count.

This section describes the operation frequency setup.
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.

When using commands to execute a program, there are several points to note.
For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
NCC ADB
F 2 MC-16FX
SPB CNR
MOV ILM,#imm8 AND CCR,#imm8
OR CCR,#imm8 POPW PS
When executing the instructions listed in the notes on the GO command as invalid 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.
(This "already-set" breakpoint is an invalid breakpoint that won't break, because it has been set at an address other than the starting address of an instruction.) ■Controlling Watchdog Timer
It is possible to select "The watchdog timer is stopped in the break. " while executing a program using the GO, STEP, CALL commands.
Use the ENABLE WATCHDOG, DISABLE WATCHDOG commands to control the watchdog timer.
The start-up default in this program is "Enables the watchdog time during break".
>GO
[Example]

This section explains the commands available during the execution of a user program.
This emulator debugger allows you to use certain commands during the execution of a user program.
For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual".
The double circle indicates that it is available during the execution of a user program.
Table 2.5-1 shows the commands available during the execution of a user program.
Besides, when the real-time monitor function is used, the specified memory area will be displayed in the real- time memory window, and data can be read (updated) even during MCU execution.
Table 2.5-1 Commands Available during Execution of User Program
Function Restrictions Major Commands
MCU reset - 1.3 RESET
Displaying MCU execution status - 2.12 SHOW STATUS
Displaying execution cycle measurement value (cycle)
Memory operation (Read/Write) - 5.1 EXAMINE, 5.2 ENTER, 5.3 SET MEMORY, 5.4 SHOW MEMORY, 5.5 SEARCH MEMORY, 5.8 COMPARE, 5.9 FILL, 5.10 MOVE, 5.11DUMP
Line assembly, Disassembly - 6.1 ASSEMBLE, 6.2 DISASSEMBLE
Set breakpoints Operable while the "Breakpoint Settings during Execution" is enabled in the execution tab of the debug environment dialog*
3.1 SET BREAK (type 1), 3.2 SET BREAK (type 2), 3.3 SET BREAK (type 3), 3.6 CANCEL BREAK, 3.7 ENABLE BREAK, 3.8 DISABLE BREAK, 3.9 SET DATABREAK (type 1), 3.10 SET DATABREAK (type 2), 3.12 CANCEL DATABREAK, 3.13 ENABLE DATABREAK, 3.14 DISABLE DATABREAK
*: For further details, refer to Section "2.5.4 Break".

- [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.
"E4404S Command error (MCU is busy)."

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.
In this emulator debugger, seven kinds of break functions are supported.

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.
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.
The maximum setting number is as follows:
When a break occurs due to a code break, the following message is displayed on the Status Bar.
Break at Address by hardware breakpoint
Break at Address by breakpoint ■Setting Method
The code break is controlled by the following method.
- SET BREAK/HARD (Hardware)
- SET BREAK/SOFT (Software)
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoints set dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/Disassembly window

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.
- Make sure that the breakpoint must include the starting address of an instruction. Break may not
occur.
- When execution is performed starting from the address where the hardware break was set, if the
preceding execution has been stopped due to reasons other than instruction break, break will occur without execution of the instruction. In such a case, when re-execution is performed, the instruction will be executed.
There are the following considerations for the software break.
- Setting cannot be performed in areas, such as ROM, where write cannot be correctly performed.
In such cases, a verify error will occur when a program starts to be executed (when continuous execution or step execution is started).
- Be sure to set the breakpoint in the starting address of an instruction. If the breakpoint is set in
the middle of an instruction, the program may run away.

It is a function to abort the program execution when the data access (read and write) is done to a specified address.
It is a function to abort the program execution when the data access (read and write) is done to a specified address.
When a break occurs due to a data break, the following message is displayed on the Status Bar.
Break at Address by databreak at Access address ■Setting Method
The data break is controlled by the following method.
Refer to "3.9 SET DATABREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoint Set Dialog [Data] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".

This function aborts the program execution when access has been performed using the specified attribute for the specified area.
For the specified area, when the specified access attribute is found during execution of a user program, guarded access break will occur.
Guarded access can be specified with the following 3 types of attributes:
Break will occur when an instruction is executed for the specified area
Break will occur when read is performed for the specified area
Break will occur when write is performed for the specified area
If a guarded access occurs while executing a program, the following message is displayed on the Status Bar and the program is aborted.
Break at Address by guarded access {code/read/write} at Access address ■Setting Method
The guarded access break is controlled by the following method.
Refer to "1.48 SET GUARDMAP" in "SOFTUNE Workbench Command Reference Manual".
- Map set dialog
Refer to "4.7.3 Memory Map" in "SOFTUNE Workbench Operation Manual".
Code guarded · Read guarded · Write guarded

A sequential break is a function to abort an executing program as event sequential control, when the sequential conditions are established.
It is a function to abort the program execution by the sequential control of the event, when the sequential conditions are established. For details of the sequential control, refer to Section "2.5.5 Control by Sequencer".
When a break occurs due to a sequential break, the following message is displayed.
Break at Address by sequential break (level = Level No.) ■Types of Sequential Break
This debugger has the following two types of the sequential breaks.
8 level sequence is set in the sequence window displayed in [View]-[Sequence] menu. This sequence has the following features.
3 level sequence is set in the 3 level sequence setting dialog displayed in [Debug]-[3 level sequence] menu. For details, refer to section "4.6.6 Sequence" in "SOFTUNE Workbench Operation Manual".
The last level number of the sequencer is always 7. Therefore, if the level number of the message displayed in the status bar at the sequential break is either 8 or 3 level, 7 is displayed in the last level number of the sequencer.

It is a function to abort the program execution when the trace buffer becomes full.
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 ■Setting Method
The trace-buffer-full break is controlled by the following method.
Refer to "4.30 SET TRACE (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full.
When a break occurs due to a performance-buffer-full break, the following message is displayed on the Status Bar.
Break at Address by performance buffer full ■Setting Method
The performance-buffer-full break is controlled by the following method.
Refer to "4.8 SET PERFORMANCE (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Performance set dialog
Refer to "4.4.13 Performance" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has.
It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has.
When a break occurs due to an external trigger break, the following message is displayed on the Status Bar.
Break at Address by external trigger break ■Setting Method
The external trigger break is controlled by the following method.
Refer to "3.42 SET TRIGGER" in "SOFTUNE Workbench Command Reference Manual".
- Debugging environment set dialog [emulation]tab
Refer to "4.7.2.3 Debug Environment" in "SOFTUNE Workbench Operation Manual".

It is a function to abort the execution of the program compulsorily.
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
A forced break is not allowed while the MCU is in the low-power consumption mode or hold state. When a forced break is requested by the [Debug] - [Abort] menu while executing a program, the menu is disregarded if the MCU is in the low-power consumption mode or hold state. If a break must occur, then reset the cause at user system side, or reset the cause by using the [Debug] - [Reset MCU]menu, after inputting the [Debug] - [Abort] menu.
When the MCU enters the power-save consumption mode or hold state while executing, the status is displayed on the Status Bar.

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.
As shown in Table 2.5-2, controls can be made at 8 different levels.
One event can be set for one level.
The sequencer can perform shift from any level to any level, and the restart conditions can also be specified.
Table 2.5-2 Sequencer Specifications
Level count 8 level
Conditions settable for each level
1 event conditions (1 to 65535 times pass count can be specified for each condition.)
Restart conditions 1 event conditions (1 to 65535 times pass count can be specified.)
Operations after shift Break, trace control (start/end)
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. However, since hardware is shared with trace triggers, the actual numbers is calculated as follows.
Current maximum constant of events = 8 - (current number of break settings + current number of trace trigger settings)
Table 2.5-3 shows the conditions that can be set for events.
Table 2.5-3 Conditions for Event and Trace Trigger
Address Memory location (address bit masking disabled)
Data 16-bit data (data bit masking enabled)
Access size Byte, word
Access attribute Code/Data read/Data write
Bus master CPU, DMA
Function Specifications · Condition Description

The sequence event is setting by the following command.

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. 4) When the condition that the level becomes END the shift ahead consists, the sequencer ends and the break is done.
The sequencer works in the following order. The event can be set as each level and a restart condition.
When the level the shift ahead has been END, re-execution of the user program will restart the sequencer.

Figure 2.5-1 Operation of Sequencer


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.
The data recorded by sampling in machine cycle units, is called a frame.
The trace buffer can store 64K frames (65536). When the enhancing trace board is used, it becomes capacity for 256M (268,435,456) frame.
Since the trace buffer has a ring structure, when it becomes full, it automatically returns to the start to overwrite existing data.
Data sampled by the trace function is called trace data.
The following data is sampled:
Branching source address, branching target address, disassemble
Access address, Access data, Access size, Access attribute (read/write), and Bus master (CPU/DMA)
Program stop, Trace start/end, Reset, Loop count, Extended time stamp frame, Data lost
A number is assigned to each frame of sampled trace data. This number is called a frame number.
The frame number is used to specify the display start position of the trace buffer. The value 0 is assigned to trace data at the triggering position for sequencer termination. Negative values are assigned to trace data that have been sampled before arrival at the triggering position (See Figure 2.5-2).
If there is no triggering position for sequencer termination, the value 0 is assigned to the last-sampled trace data.

Figure 2.5-2 Frame Number at Tracing

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.
Moreover, the function to compress into one frame when the same frame is repeated is provided, too.
When preselected conditions are met during MCU bus operation monitoring, a trigger for starting a trace can be generated. This function is called a trace trigger.
For the use of the trace trigger function, specify the code (/CODE) and data access (/READ/WRITE).
Up to 4 trace triggers can be preset each for code attribute and data access attribute. However, actually, the maximum number of trace triggers is determined as indicated below because the common hardware is used with events.
Current trace trigger maximum constant = 4 - (current break count setting + current event count setting)
For the trace trigger setup conditions that can be defined, see Table 2.5-2.
For trace trigger setup, use the following commands:
Figure 2.5-3 shows a trace sampling operation.
Figure 2.5-3 Trace Sampling Operation (Trace Trigger)


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.
To perform a trace, complete the following setup steps. When a program is executed after completion of the steps, trace data is sampled.
Enable the trace function using the ENABLE TRACE command.
To disable the trace function, use the DISABLE TRACE command.
The trace function is enabled by default when the program is launched.
Use of the trace trigger allows control of the trace sampling, making full use of the limited-size trace buffer. Such setups should be performed on a necessary base.
The trace trigger can specify the start/stop of trace sampling with the trigger hit as the reason.
When the trace trigger is used, setup is performed by inputting the SET TRACE/TRIGGER command.
A break can be invoked when the trace buffer becomes full.
To perform setup, use the SET TRACE command. This break feature is disabled when the program starts. To view the setting, use SHOW TRACE/STATUS.
Table 2.5-4 shows trace related commands in single trace.
Table 2.5-4 Trace Related Commands in Single Trace
SET TRACETRIGGER Sets up the trace trigger
CANCEL TRACETRIGGER Deletes the trace trigger
SHOW TRACETRIGGER Displays the trace trigger
SET TRACE Sets trace buffer full break
SHOW TRACE Displays trace data
SEARCH TRACE Searches for trace data
ENABLE TRACE Enables trace function
DISABLE TRACE Disables trace function
CLEAR TRACE Clears trace function
Available command Function

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.

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.
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.
en/dis = enable ; Trace function enabled
buffer full = nobreak ; Buffer full break function disabled
code = enable ; Code execution enabled
loop compress = enable ; loop compress function enabled
frame no. = -00120 to 00000 ; Frame -120 to 0 store data
[Example] · >

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.
Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified.
>SHOW TRACE/RAWDATA -6 ; Start displaying from frame -6
>SHOW TRACE/RAWDATA -6..0 ; Display from frame -6 to frame 0
>SHOW TRACE -6 ; Start displaying from step -6
>SHOW TRACE -6..0 ; Displays from step -6 to step 0
[Example]

The frame output by the emulator is not analyzed and it displays it as it is.
The display of the source is done and corked in this mode regardless of the setting by the SET SOURCE command.
Time Stamp Disassemble Description
Indicates instruction executed.
Displays difference of executed time between this frame and next frame (decimal). The unit is cycle.
Frame Number Decimal, signed
frame no. address data(mnemonic) time stamp - 02400 : DF02B3 BRA DF0296 - > DF0296 1 - 02399 : write 0010 at 004A32 - 02398 : read 0010 at 004A32 8 - 02397 : DF029B BGE DF02B5 - > DF02B5 [INT] 3 - 02396 : DF02BC == > == 10 - 02395 : write 0000 at 0001A0 0 - 02394 : write 0000 at 004A32 2 - 02393 : read /DMA 0000 at 004A32 2 - 02392 : read 0000 at 0001A2 6 - 02391 : DF02C4 BRA DF02CA - > DF02CA 1 - 02390 : write 0001 at 0001A2 1 - 02389 : ==== > ===== - 02388 : DF02CA MOV A,#10
Branching by hardware interrupt
Jump address Hexadecimal Branch destination address of branch instruction
Special frame is as follows.
Break at "address": Displays address which program execution is stopped.
Trace ON code(data) hit: Indicates that trace acquisition is started.
Trace OFF code(data) hit: Indicates that trace acquisition is stopped.

Reset: Indicates that reset is detected.
Loop Count "Number of times": Displays number of times which loop count occurs.
Extended time stamp frame: Displays here when the value of time stamp is 8191 or more.
Data Lost Error: Indicates that data is lost.
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. Special frames other than the program lockup frame are displayed.
The display in this mode is as follows.
Time stamp Disassemble Description
Displays difference of executed time between this frame and next frame (decimal). The unit is cycle.
Display that supplements between branch frames.
Frame Number Decimal, signed
Special frame is as follows.
Trace ON code(data) hit: Indicates that trace acquisition is started.
Trace OFF code(data) hit: Indicates that trace acquisition is stopped.
Reset: Indicates that reset is detected.
Loop Count "Number of times": Displays number of times which loop count occurs.
Extended time stamp frame: Displays here when the value of time stamp is 8191 or more.
Data Lost Error: Indicates that data is lost.

Only the source line can be displayed.
step no. source
[Example]

This section explains how to save 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Save] from the shortcut menu. The [Save as] dialog
appears. Specify the file name and where to save trace data. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SHOW TRACE/FILE command.
For details, refer to Section "4.33 SHOW TRACE (type 3)" in "SOFTUNE Workbench Command Reference Manual". When additionally saving trace data in an existing file, execute the SHOW TRACE/FILE/APPEND command.

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.
The performance measurement allows the time between two event occurrences to be measured and the number of event occurrences to be counted. Up to 65535 event occurrences can be measured.
Measures time interval between two events. Two sections can be set.
The specified events become performance measurement points automatically, and occurrences of that event are counted.

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.
It is 1ns as the minimum measurement unit for the timer used to measure performance. Moreover, the resolution of the measurement data depends on the clock of CPU.
When the buffer for storing performance measurement data becomes full, a executing program can be broken. This function is called the performance-buffer-full break. The performance buffer becomes full when an event occurs 65535 times.
If the performance-buffer-full break is not specified, the performance measurement ends, but the program does not break.
>SET PERFORMANCE/NOBREAK
> ■Setting Events
The event is set by event setting (performance section setting) dialog or SET PERFORMANCE command. Two sections can be set.
The specified events become performance measurement points automatically.
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.
Display performance measurement data by using the SHOW PERFORMANCE command.
Clear performance measurement data by using the CLEAR PERFORMANCE command.
[Example] · [Example] · >

Display the measured time and measuring count by using the SHOW PERFORMANCE command.
To display the time measured, specify the starting event number or the ending event number.
Count of measuring within given time interval
Lower time limit for display
Upper time limit for display

This function measures the program execution time.
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.
In either case, the measurement is performed whenever a program is executed, and the measurement result displays the following two values:
Either of the following methods can be used to display the measurement results.
The results appear 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".
Enter the SHOW TIMER command in the command window.
For details, refer to Section "4.27 SHOW TIMER" in "SOFTUNE Workbench Command Reference Manual".
Either of the following methods can be used to clear the measurement results.
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".
Enter the CLEAR TIMER command in the command window.
For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual".

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.

This section explains power-on debugging by the emulators for the MB2198.
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. The following functions are available:
The power-on debugging procedure is described below:
For debugging, set hardware breaks, etc.
Input the lower limit value of the monitoring voltage from the [User Power Monitor Voltage] dialog box to display PON in the input status bar.]

This section describes the emulator debugger functions that are available when the MB2100-01 is specified.
The emulator debugger for MB2100-01 has the following features:
The following operations can be controlled during the execution of the user program:
Similar to the RAM area, data can be downloaded to FLASH memory as well as read/written from the memory window.
Events can be used in the following six functions:
The number of points that can be set varies depending on the function and model.
This function inhibits the transition to the standby mode before it is attempted when starting the debugger.

This section describes the method of starting debugging by with the use the MB2100-01 emulator debugger.
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" in "SOFTUNE Workbench Operation Manual".
When starting debugging, perform checking for initial settings. When an item of initial setting is not correct, debugging cannot be started.
- Operating environments of the target
Verify whether the operating environment of the target has a problem. For details, refer to "2.6.1.1 Operating Environments of the Target".
Verify whether the security function has been enabled. For details, refer to "2.6.1.2 Security".
- Security

This section describes the setting of the target operating environments of the MB2100-01 emulator debugger.
In this emulator debugger, it is necessary to set the following items according to the operating environments of the target.
These settings influence the communication speed of the debugger.
Set main clock (MCLK).
The communication speed between MB2100-01 and the user system varies depending on the main clock.
Specified the length of the cable that suits the length of DEBUG I/F cable.
The allowance maximum transfer rate from MB2100-01 to the direction of MCU changes according to this length of the cable.
The setup wizard sets the operating environments of the target.
For details, refer to "4.7.2.5 Setup Wizard" in "SOFTUNE Workbench Operation Manual".
Figure 2.6-1 Setup Wizard (Communication Setting)



This section describes the security of the MB2100-01 emulator debugger.
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.
When a dialog shown below is displayed, enter a preset password. The password is needs to be entered each time the debugger is activated.
For details on the password, refer to the description of Password for "OCD (On Chip Debugger)" start permission in the hardware manual for the product used.
Figure 2.6-2 Debugger Connection Password


This section describes the method of ending debugging being executed with the use of the MB2100-01 emulator debugger.
When ending debugging, select the [Debug] - [End debug] menu.
Turn off the power supply of the target after selecting the [End debug] menu.
When the debugger has aborted for some reason, problems as described below can occur. When starting debugging again, take corresponding countermeasures.
When a software break is set in a flash memory area, the contents of the flash memory are rewritten with the code of the software break. When debugging has ended normally, the re-written data is reverted. If it has ended abnormally, software break code may remain without data being reverted.
When starting the debugger, it checks whether this software break exists. If it does, the following message appears.
"The software break set in A on B might remain."
A: A project name displayed when the debugger aborted
B: The date when the debugger aborted
When the message is displayed, download again the program to the flash memory.
When the debugger has aborted, the DEBUG I/F enters the pull-up state. When starting debugging again, ensure that the power supply of MB2100-01 is turned on again.
A warning message related to a software break is displayed even when a project other than the project name displayed in the message is used.
After a software breakpoint was deleted, a warning message may be displayed even if the debugger was ended abnormally while using another debug function.

This section describes setting for efficient debugging.
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.
Therefore, if the default value is used as it is, there is no need to change this setting. In addition, a set value once specified is set as a default for the subsequent operation.

This section describes setting for increasing the communication speed during debugging.
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. The standard clock frequency for high-speed communication is different in optimal value depending on the MCU. For details, refer to the hardware manual of model to be used.
The method of setting the standard clock frequency for high-speed communication is described below.
Select the [Setup] - [Debug environment] - [Debug environment] menu, and then select the [Frequency] tab.
For details, refer to "4.7.2.3 Debug Environment" in "SOFTUNE Workbench Operation Manual".
Execute the SET FREQUENCY command.
For details, refer to "1.45 SET FREQUENCY" in "SOFTUNE Workbench Command Reference Manual".
If the frequency is changed during high-speed communication mode, the MCU must be reset. The frequency is changed after a reset is updated.

This section describes the method of switching the debug function correspondingly to the usage.
The emulator debugger allows the debug functions to be selectively used by effecting mode switching correspondingly to the usage.
The mode has two types described below.
This mode selects the method of measuring the user-program execution time.
- Time measurement mode (default)
This mode measures the time from the start of execution to the break occurrence.
This mode measures the time between specified two events (points).
This mode selects the using method for the pass count function.
This mode uses the sequential function. The pass count break cannot be used.
- Pass count break mode (default)
This mode uses the pass count break. The sequential function cannot be used.
Methods of switching to the execution time mode and the pass count mode are described below.
Select the [Setup] - [Debug environment] - [Debug environment] menu, and then select the [Event] tab.
For details, refer to "4.7.2.3 Debug Environment" in "SOFTUNE Workbench Operation Manual".
Execute the SET MODE command.
For details, refer to "1.9 SET MODE (type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Performance mode · - Sequential mode

This section describes the method of executing a user program with the MB2100-01 emulator debugger.
A user program is executed in a procedure described below.
Select the [File] - [Open workspace file] menu.
For details, refer to "2.6.1 Starting debugging".
When loading a project target file, select the [Debug] - [Load target file] menu.
Select the [Debug] - [Run] - [GO] menu.
For other executions, such as step execution, refer to "4.6.1 Run" in "SOFTUNE Workbench Operation Manual".
This emulator debugger is capable of controlling the following during the execution of a user program.

The debug function can be set or released while executing the 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.
Table 2.6-1 shows the commands available during execution of user program. For more details, see
"●Debugger" in "SOFTUNE Workbench Command Reference Manual".
Table 2.6-1 Commands Available during Execution of User Program
Function Major Command name*1
Reset MCU 1.3 RESET
Memory operation (read/write) 5.1 EXAMINE 5.2 ENTER 5.3 SET MEMORY 5.4 SHOW MEMORY 5.5 SEARCH MEMORY 5.8 COMPARE 5.9 FILL 5.10 MOVE 5.11 DUMP
Line assemble/disassemble 6.1 ASSEMBLE 6.2 DISASSEMBLE
Set/delete breakpoint 3.1 SET BREAK (type1) 3.3 SET BREAK (type3) 3.6 CANCEL BREAK 3.7 ENABLE BREAK 3.8 DISABLE BREAK 3.10 SET DATABREAK (type2) 3.12 CANCEL DATABREAK 3.13 ENABLE DATABREAK 3.14 DISABLE DATABREAK
Set/delete sequencer 3.22 SET EVENT(type 2) 3.24 CANCEL EVENT 3.25 ENABLE EVENT 3.26 DISABLE EVENT 3.27 SET SEQUENCE (type1) 3.34 CANCEL SEQUENCE(type 1) 3.36 ENABLE SEQUENCE(type 1) 3.38 DISABLE SEQUENCE(type 1)
Trace operation 4.15 CLEAR TRACE 4.17 ENABLE TRACE (type2) 4.19 DISABLE TRACE (type2) 4.20 SEARCH TRACE
*1 : Refer to "SOFTUNE Workbench Command Reference Manual".

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)."

This section describes the monitoring function in the MB2100-01 emulator debugger.
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.
The use procedure of the monitoring function is described below.
According to the above, a portion with variation during the program execution is displayed in red.
According to the above, a portion with variation during the program execution is displayed in red.

This section describes power-on debug function in the MB2100-01 emulator debugger.
Power-on debug is a function to debug the sequence immediately after turning on of the power supply of the target system.
The use procedure of power-on debug is as follows:
Select [Debug] - [Start debug] menu.
Select [Debug] - [Run] - [Power on Debug] menu.
It shifts to power-on debug mode.
Continuous execution of the user program that doesn't do anything such as infinity looping is recommended.
Display the confirmation dialog whether the program execution is interrupted.
After the power supply returns, the program starts running from the reset vector.
Before executing the user program
Select [Debug] - [Run] - [Power on Debug] menu.
After executing the user program
Press the cancel button by the interruption dialog displayed in power-on debug mode.

- Execution cycle measurement
- Data match status of Data watch break
- Hit count of Sequence
- Hit count of Passcount break
- Performance measurement · - Performance measurement · - Trace data

When using commands to execute a program, there are several points to note.
For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints.
- No break occurs when the breakpoint is set at three instructions or less executed continuously from the
user interrupt.
- No break occurs when breakpoint set at address other than starting address of instruction.
- No break occurs when a breakpoint is set at three instructions or less immediately after the following
instructions.
PCB NCC SPB MOV ILM,#imm8 OR CCR,#imm8 INT addr16 INT9 JCTX @A Undefined instruction
DTB ADB CNR AND CCR,#imm8 POPW PS INTP addr24 INT #vct RETI
When executing the instructions listed in the notes on the GO command as invalid breakpoints, such an instruction and next three instructions are executed as a single instruction. Furthermore, when above-mentioned instructions are included in the next continuous instructions, all of them and the next continuous three instructions or less are executed as a single instruction.
[Example] When instructions as invalid breakpoints is consecutive
NOP (2)
RETI (3)
MOVN A,#-0 (4)
MOVW RW0,A (5)
NOP (6)
NOP (7)

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.
Consequently, the program counter (PC) advances to NOP instruction (7) when the step operation is executed from the point of "POP PS" instruction (1).
- Execution cycle measurement
- Data match status of Data watch break
- Performance measurement

This section describes the access method to the flash memory in the MB2100-01 emulator debugger.
In this emulator debugger, the direct operation of the content of the flash memory can be done as well as RAM area.
When data is written into the flash memory, the data is stored temporarily. Subsequently, the contents of the flash memory need to be matched with each other with specific timing.
The matching operation is referred to as "flash memory synchronization" (or, "synchronization of flash memory").
There are two types of flash memory synchronization:
Updates the contents of the flash memory.
Updates the stored data on the flash memory.
Flash memory synchronization can be performed in either a manual or automatic method.
Select the [Environment] - [Flash area control] menu. For details, refer to "4.7.4 Flash area control" in "SOFTUNE Workbench Operation Manual".
Flash memory synchronization is automatically performed if the target flash memory area is updated when carrying out one of the following operations.
- Load the following files.
Target file (Load module file) Binary file
- Save the following files (specify name).
Load module file Binary file
- View the following windows
Memory window Disassembly window Source window Trace window

- View the following dialogs.
Line Assembly dialog (Disassembly window) Break setting dialog [Software]
Select the [Environment] - [Flash area control] menu. For details, refer to "4.7.4 Flash area control" in "SOFTUNE Workbench Operation Manual".
- When a user program has been executed
- When a reset has been issued
- When debugging has been ended
- When the use of software break is set to prohibition
- When the target file is automatically loaded at start of debugging
To shorten flash memory synchronization processing, set the communication speed of the debugger to the high-speed mode. For details, refer to "2.6.3.1 Increasing Communication Speed during Debugging".

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 -> Flash]
Memory writing, loading, etc. by the user
Execution and reset, etc.
Occurrence of flash memory synchronization [Debugger -> Flash]

Debugger Flash memory

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 -> Debugger]
Execution of a user program that writes to the flash memory
Synchronization [Flash -> Debugger]
Occurrence of flash memory synchronization [Flash -> Debugger]
Debugger Flash memory
![Page 307 of the Fujitsu F2 MC-16 user manual — 2.6.6 To Interrupt the Program Execution [Break]](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/page-307.webp?w=400)
This section describes the method of interrupting the execution of the user program in the MB2100-01 emulator debugger.
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;
When by each break function aborts program execution, the address where a break occurred and the break factor are displayed.

This function suspends program execution by monitoring a specified address by hardware. A break occurs before an instruction at the specified address is executed.
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) has the hardware/count for which a path count can be set.
The maximum number of points that can be set is as follows:
When the code break (hardware) occurs, the following message appears in the status bar.
Break at [Address] by code event break
Break at [Address] by sequential or pass count break ■How to set
Control the code break in the following methods:
Refer to "3.1 SET BREAK(type 1)" in "SOFTUNE Workbench Command Reference Manual".
- "Code" tab in the breakpoint setting dialog
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/disassemble window
Refer to "3.7 Source Window" or "3.9 Disassemble Window" in "SOFTUNE Workbench Operation Manual".
If the specified condition is satisfied in the debugger, note that the following phenomenon occurs.

- 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 - POPW PS - AND CCR #imm8 - OR CCR #imm8 - MOV ILM #imm8 - Prefix codes (PCB, DTB, ADB, SPB, CMR, NCC) - INT9 - INT #vct - JCTX @A - RETI - Undefined instructions (exceptions)
- Data watch break
- Data break · - Sequence

This function suspends program execution by monitoring a specified address by software. A break occurs before executing an instruction at the specified address.
This function suspends program execution by monitoring a specified address by software.
When the code break (software) occurs, the following message appears in the status bar.
Break at [Address] by breakpoint ■Operation Requirements
Please set the use of the software break to permission when you use the code break (software) by the following method. It is not possible to set it to not only the flash memory area but also RAM area when prohibiting it.
For details, refer to "4.7.2.5 Setup Wizard" in "SOFTUNE Workbench Operation Manual".
- Debug environment setting dialog "Break" tab
For details, refer to "4.7.2.3 Debug Environment" in "SOFTUNE Workbench Operation Manual".
Control the code break in the following methods:
Refer to "3.1 SET BREAK(type1)" in "SOFTUNE Workbench Command Reference Manual".
- "Code" tab in breakpoint setting dialog
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/disassemble window
Refer to "3.7 Source Window" or "3.9 Disassemble Window" in "SOFTUNE Workbench Operation Manual".
- Setup wizard

This function suspends program execution when data access (read/write) is made to a specified address.
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.
Break at [Address] by data event break ■How to set
Control the data break in the following methods:
Refer to "3.9 SET DATABREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- "Data" tab in the breakpoint setting dialog
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Data watch break
- Code break · - Sequence

This function forcibly suspends program execution.
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 ■How to Generate
A forced break is generated in the following methods:
[Debug] - [Abort] menu
Refer to "4.6.2 Abort" in "SOFTUNE Workbench Operation Manual".
Refer to "2.4 ABORT" in "SOFTUNE Workbench Command Reference Manual".
In any one of the following, even when the forced break is caused to occur, the user program may not stop. Solutions are described below.
[Phenomenon] When the communication speeds of the debugger is low, it can take time to receive a
program stop request.
[Solution] Await for some time until receipt of the stop request is completed.
[Phenomenon] When the interrupt level of the program stop request is low, the interrupt is masked by the
CPU interrupt level (ILM).
[Solution 1] Alter the interrupt level of the stop request, and issue a stop request again.
[Solution 2] Issue a program forced-stop request.
[Phenomenon] It is considered that the debugger is in power-on debugging.
[Solution] Cancel the power-on debug mode.
[Phenomenon] It is considered that the MCU is in a hang-up state.
[Solution] Issue a reset.
If the forced break is performed in CPU pause state a break occurs after that mode is released.
For more details, see "Appendix C. Debugger Suspension Messages" in "SOFTUNE Workbench Command Reference Manual".

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.
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. Up to 2 points can be set.
The following message is displayed in the status bar, when a data watch break occurs.
Break at address by breakpoint (data watch)
The break conditions for the data watch break are illustrated in the Figure 2.6-3.
Figure 2.6-3 Break Conditions for Data Watch Break
Program flow Data watch
When data does not match, no break occurs.

When data matches, a break occurs.
Control the data watch break in the following methods:
Refer to "3.3 SET BREAK(type3)" in "SOFTUNE Workbench Command Reference Manual".
- "Code" tab in the breakpoint setting dialog
"Hardware/data watch" Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".

- Code break · - Data break · - Sequence

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).
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. This becomes sequencer termination condition. This sequencer is called a 2-level sequencer.
Furthermore, pass information up to that point is reset and an event for restart which monitors the passage of level 1 againg can be set.
When events are set to each level as shown in example, the sequencer operates as shown in Figure 2.6-4.
Figure 2.6-4 Operation of Sequencer

[Example]

Table 2.6-2 shows the specifications of the sequencer for this emulator debugger.
Table 2.6-2 Specifications of Sequencer
No. of levels 2 levels
Restart function Available (one)
Conditions of each event (Code/data)
Address Pass count: 1 to 1048575 Attribute: Read/write Data size: Byte, Word, Long (Attribute and data size can be specified only for data events.)
Operation when conditions are met
Control the sequencer in the following methods:
- Select [Debug] - [Sequence] menu.
For details, refer to "4.6.6 Sequence" in "SOFTUNE Workbench Operation Manual".
For details, refer to "3.22 SET EVENT(type 2)" or "3.28 SET SEQUENCE (type2)" in "SOFTUNE Workbench Command Reference Manual".
Function Specification

For details, refer to "2.6.3.2 Switching Debug Function".
- Data watch break
- In code event
The pass count may be added several times by one instruction execution.
- In data event
A data access in the string instruction is optimized in the chip.
- Code break · - Data break

This section explains the function of measuring the number of program execution cycles.
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 to 288,230,376,151,711,743 cycles.
- The total number of execution cycles after the previous clear operation
The maximum number of cycles that can be measured is "2 to the power of 64 - 1", in other words, up to 18,446,744,073,709,551,615 cycles.
Either of the following methods can be used to display the measurement results.
The results appear 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".
Enter the SHOW TIMER command in the command window.
For details, refer to Section "4.27 SHOW TIMER" in "SOFTUNE Workbench Command Reference Manual".
Either of the following methods can be used to clear the measurement results.
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".
Enter the CLEAR TIMER command in the command window.
For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual".
Click the [Comment] button in the time measurement dialog to display error information about the measurement results.

![Page 320 of the Fujitsu F2 MC-16 user manual — 2.6.8 Measuring Event-to-Event Execution Cycle Count [Performance Measurement]](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/page-320.webp?w=400)
This section explains how to measure the execution cycle count between two events in the MB2100-01 emulator debugger.
This emulator debugger measures the execution cycle count between two events, which the system has passed while a user program is running. This is referred to as "performance measurement".
The features for the performance measurement are as follows.
The following shows the performance measurement image.
![Fujitsu F2 MC-16 — 2.6.8 Measuring Event-to-Event Execution Cycle Count [Performance Measurement] diagram (page 320)](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/fig-320-1.webp)
The measurement items for the performance function are as follows.
Cycle count : Accumulates the number of cycles required to carry out the event-to-event execution.
Measuring count : Accumulates the number of times the system passes from event to event.
Remeasuring performance refers to a function that clears the measuring count during execution of a user program and remeasures from the beginning.
To carry out remeasuring, select [Restart] in the shortcut menu of the performance window.
If necessary, you can respecify the performance measuring interval (event) during execution.
This restarts measuring at the times when events have been set.
![Page 321 of the Fujitsu F2 MC-16 user manual — 2.6.8 Measuring Event-to-Event Execution Cycle Count [Performance Measurement]](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/page-321.webp?w=400)

This section explains how to measure the event-to-event execution cycle count in the MB2100-01 emulator debugger.
Use the following steps to measure the performance.
Each of these steps can be executed in two methods: using GUI (window or dialog) and using only the command. In both methods, the same measurement result is obtained.
- Select [View] - [Performance] menu.
For details, refer to Section "3.18 Performance Window" in "SOFTUNE Workbench Operation Manual".
- Right-click on the performance window, and select [Setup] from the shortcut menu. The performance
setting dialog appears. Here, click the [Display Range] tab to specify the interval in which performance is to be measured. For details, refer to Section "4.4.14 Performance" in "SOFTUNE Workbench Operation Manual".
- Right-click on the performance window, and select [Refresh] from the shortcut menu. The performance
measurement result appears.

- Execute the SET EVENT command.
For details, refer to Section "3.22 SET EVENT(type 2)" in "SOFTUNE Workbench Command Reference Manual".
- Execute the SET PERFORMANCE command.
For details, refer to Section "4.9 SET PERFORMANCE (type 3)" in "SOFTUNE Workbench Command Reference Manual".
- Execute the SHOW PERFORMANCE command.
For details, refer to Section "4.11 SHOW PERFORMANCE(type 1)" in "SOFTUNE Workbench Command Reference Manual".
The performance measurement is ended in one of the following cases.
![Page 324 of the Fujitsu F2 MC-16 user manual — 2.6.9 Viewing Program Execution History [Trace]](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/page-324.webp?w=400)
This section describes the trace function of this emulator debugger.
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.
This emulator debugger has the following trace functions.
The trace data acquisition is started and ended at the following times.
- a user program has been executed; or
- the [Start] menu has been selected when a user program has been executed.
- a user program has been stopped; or
- the [Abort] menu has been selected during trace data acquisition.
A place to store recorded data is called a "trace buffer".
Each unit of data stored in the trace buffer is called a "frame".
The trace buffer can contain up to 1,024 frames.
The trace buffer has a ring-like structure. If the trace buffer becomes full, it is automatically overwritten from the beginning.
Figure 2.6-5 shows how data is stored in the trace buffer.
![Page 325 of the Fujitsu F2 MC-16 user manual — 2.6.9 Viewing Program Execution History [Trace]](/cdn/reader/ab/abd7aaaae28b39ac94b596e004d928b8ff824bc11fa736845421c6241585987c/images/page-325.webp?w=400)
Figure 2.6-5 Acquiring Trace Data
When a break occurred during execution of a program
Start execution Stop execution Start execution Stop execution
| | Max. 1,024 frames
Executing the forced start will clear the trace data that was stored until then.
Program flow · Trace Buffer

This section explains how to display trace data.
The following three formats can be used to display trace data.
RAW data: Displays trace data without analyzing it.
Instruction: Displays trace data in the order in which instructions are executed.
Sampled trace data is numbered by frame. This number is called a "frame number".
When displaying trace data, the starting location in the trace buffer can be specified using the frame number.
Ordinarily, the last sampled trace data is assigned to frame number 0.
Trace data is displayed in the trace window or command window.
The following two display methods are available, both of which enable you to obtain the same result.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [RAW data], [Instruction], or [Source] from the shortcut
menu. For details, refer to Section "3.14 Trace Window" in "SOFTUNE Workbench Operation Manual".
- Right-click on the trace window, and select [Refresh] from the shortcut menu. Trace data is updated in
the trance window. For details, refer to Section "3.14 Trace Window" in "SOFTUNE Workbench Operation Manual".

For details, refer to Section "4.32 SHOW TRACE (type 2)" in "SOFTUNE Workbench Command Reference Manual".
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.

This section describes trace data that is displayed in the RAW data mode.
This format displays frames that are output from the emulator without analyzing them.
Figure 2.6-6 shows a RAW data display example.
Figure 2.6-6 Example of the RAW Data Display
Frame Number Indicates instruction executed.
>SHOW TRACE /RAWDATA -10 frame no. address mnemonic - 00010 : FF00E1 RETI -> FF010E - 00009 : FF011F BRA FF010E -> FF010E - 00008 : FF010E MOVW A,0190 -> FF00CE [INT] - 00007 : FF00E1 RETI -> FF010E - 00006 : FF011F BRA FF010E -> FF010E - 00005 : FF010E MOVW A,0190 -> FF00CE [INT] - 00004 : FF00E1 RETI -> FF010E - 00003 : FF011F BRA FF010E -> FF010E - 00002 : FF010E MOVW A,0190 -> FF00CE [INT] - 00001 : FF00E1 RETI -> FF010E 00000 : ==== > =====
Hexadecimal Branch destination address of branch instruction
Branching by hardware interrupt
Break at "address" : program execution is stopped.
frame no.
Displays frame numbers in decimal notation.
Displays a branch address.
Branch destination address = 110C6:"-> 000110C6"
Branch source address = 110A8:"000110A8 ->"
Displays the instructions that are executed.

This section describes trace data that is displayed in the instruction mode.
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 Display that supplements between branch frames.
>SHOW TRACE /RAWDATA -2400 frame no. address mnemonic sample.c$39 } - 00003 : FF011F BRA FF010E -> FF010E sample.c$36 while (flag2) { - 00002 : FF010E MOVW A,0190 -> FF00CE [INT] sample.c$14 { ExtInt: : FF00CE LINK #00 : FF00D0 PUSHW RW0 sample.c$15 *((char __io*)0x59) =0; : FF00D2 MOV A,#59 : FF00D4 MOVW RW0,A : FF00D5 MOVN A,#0 : FF00D6 MOV @RW0,A
Hexadecimal Branch destination address of branch instruction
Branching by hardware interrupt
frame no.
Displays the frame number in decimal form.
Displays the branch addresses.
Displays disassembly of the instructions that are executed between branch addresses.
For branch addresses (b-addr), an instruction between the branch addresses is extracted to get the frames to complement each other by disassembly. When they are complemented, the frame number field is blank.

This section describes trace data that is displayed in the source line mode.
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. source : sample.c$61 if (p->val >= tblp[j - 1]->val) -00007 : sample.c$62 break; : sample.c$66 tblp [i - 1] = p; -00006 : sample.c$67 } : sample.c$53 while (max > 1) { : sample.c$54 p = tblp [max - 1]; : sample.c$55 tblp [max - 1] = tblp[0]; : sample.c$56 max--; : sample.c$57 i = 1;
frame no.
Displays frame numbers as decimal number.
Displays the source line to be executed.
source

This section explains how to save 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Save] from the shortcut menu. The [Save as] dialog
appears. Specify the file name and where to save trace data. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SHOW TRACE/FILE command.
For details, refer to Section "4.33 SHOW TRACE (type 3)" in "SOFTUNE Workbench Command Reference Manual". When additionally saving trace data in an existing file, execute the SHOW TRACE/FILE/APPEND command.

This section explains how to search 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. The same result is obtained from both methods.
- Select [View] - [Trace] menu.
- Right-click on the trace window, and select [Find] from the shortcut menu. The trace data search dialog
appears. Specify the address or frame number to be displayed. For details, refer to Section "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
- Execute the SEARCH TRACE command.
For details, refer to Section "4.37 SEARCH TRACE" in "SOFTUNE Workbench Command Reference Manual".
Trace data can search only branching source address.

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.
The semihosting feature is a function to display a message output by the user program on the debugger window.
As shown in Figure 2.6-9, when receiving an output request to the message buffer register (MBR) on debug I/O, the debugger displays the output content on the window by receiving the content.
In this case, data from the user program to the debugger is output via DEBUG I/F from MBR according to the arrow in Figure 2.6-9.
For details of on-chip debugger (OCD) and MBR, refer to the hardware manual.
Figure 2.6-9 Data Flow in Semihosting Feature
MBR
USB
MB2100-01
DEBUG I/F DEBUG I/F
Terminal window is the window displaying data when receiving an output request from user program to MBR. Refer to section "3.22 Terminal Window" of "SOFTUNE Workbench Operation Manual" for details of terminal window.
The data output to the terminal window is interpreted and output as ASCII characters. However, the supported control characters are'\n', '\r' and '\t'. The other control characters and the characters after 0x80 are output as '.'.
The terminal window will appear when the data to be displayed is acquired.

Use the following procedure to display the content of the output request to MBR on the terminal window.
- The content is displayed in the terminal window selected by [View] - [Terminal] menu. For details,
refer to section "3.22 Terminal Window" in "SOFTUNE Workbench Operation Manual".
- Enter the SET LOGGING/TERMINALWINDOW command in the command window. For details,
refer to section "11.1 SET LOGGING" of "SOFTUNE Workbench Command Reference Manual".

This section explains how to check information about the MB2100-01 emulator debugger.
This emulator debugger enables you to check the following information at startup.
If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
Use one of the following methods to check debugger information.
Refer to Section "1.19 SHOW SYSTEM" in "SOFTUNE Workbench Command Reference Manual".
- Version information dialog
Select [Help] - [Version Information] menu. For details, refer to Section "4.9.3 Version Information" in "SOFTUNE Workbench Operation Manual".
F2MC-16 Family SOFTUNE Workbench VxxLxx ALL RIGHTS RESERVED,
PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED ======================================================= Cpu information file path: CPU information file path Cpu information file version: CPU information file version ======================================================= Add in DLLs SiCmn Product name: SOFTUNE Workbench File Path: SiC907.dll path Version: SiC907.dll version - SiiEd File Path: SiiEd3.ocx path Version: SiiEd3.ocx version SiM907 Product name: SOFTUNE Workbench File Path: SiM907.dll path Version: SiM907.dll version - Language Tools - F2MC-16 Family SOFTUNE C Compiler version

- SOFTUNE FJ-OMF to HEX Converter version
File Path: f2hs.exe 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 : Current debugger type MCU type : Currently selected target MCU VCpu dll name : Path and name of the currently used VCpu dll VCpu dll version : Version of the currently used virtual debugger DLL SiDRVo dll version : Version of the currently used MB2100-01 driver DLL DSU type : Currently used DSU type Adapter version : Adapter version FPGA version : FPGA version Maker ID : ID that indicates the device manufacturer CPU family ID : ID that indicates the CPU family installed in the device DSU type ID : ID that indicates the OCD-DSU installation type. DSU version ID : ID that indicates version information of the DSU installed in the device Device ID : ID that indicates device information Device version ID : ID that indicates device version OSC clock : Oscillator frequency PLL clock : Reference clock frequency for high-speed communication Clock mode : Clock mode [Main/ Sub/ PLL] Communication mode : Communication mode Communication device : Device type REALOS version : REALOS version SiIODef Product name: Softune Workbench File Path: SiIODef.dll path Version: SiIODef.dll version ======================================================= Current path: Path of the currently used project Language: Currently used language Help file path: Help file path ============================================================================

This section describes the functions of the 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.

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.
The following resources are required to build the monitor program into the target hardware.
Table 2.7-1 Resources Used by Monitor Debugger
1 UART Necessary For communication with host computer 4800/9600/19200/38400 bps
2 Monitor ROM Necessary Need about 10 KB (For details, refer to link map.)
3 Work RAM Necessary Need about 2 KB (For details, refer to link map.)
4 External-interrupt switch Option Uses for forced abortion of program. When the switch is not built-in, the program can stop at the breakpoint only.
5 Timer Option Uses for SET TIMER/SHOW TIMER . Needs 32 bits in 1 μs units.

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.
In this monitor debugger, the following two types of break functions are supported.

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.
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.
The number that can be set is 16 points.
When a break occurs due to a software break, the following message is displayed on the status bar:
Break at Address by breakpoint ■Setting Method
The software break is controlled by the following method.
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
- Breakpoint Set Dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
- Source window/Disassembly window
There are a couple of points to note when using software breaks.

It is a function to abort the execution of the program compulsorily.
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



INDEX
The index follows on the next page. This is listed in alphabetic order.










FUJITSU SEMICONDUCTOR • CONTROLLER MANUAL
F 2 MC-16 FAMILY
USER’S MANUAL
April 2011 the 6th edition
Edited Sales Promotion Dept.
Colophon · SOFTUNETM Workbench


Owners and our team usually reply within a day — and your question helps the next person too.
Be the first to ask — other owners or our team will answer.