Fujitsu Computer Accessories F2 MC 16 User Manual

FUJITSU SEMICONDUCTOR  
CONTROLLER MANUAL  
CM41-00313-6E  
2
F MC-16 FAMILY  
TM  
SOFTUNE Workbench  
USER'S MANUAL  
 
2
F MC-16 FAMILY  
TM  
SOFTUNE Workbench  
USER'S MANUAL  
FUJITSU SEMICONDUCTOR LIMITED  
 
 
PREFACE  
What is the SOFTUNE Workbench?  
2
SOFTUNE Workbench is support software for developing programs for the F MC-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.  
Purpose of this manual and target readers  
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.  
Trademarks  
REALOS, SOFTUNE are trademark of Fujitsu Semiconductor Limited, Japan.  
2
Note: F MC is the abbreviation of FUJITSU Flexible Microcontroller.  
Microsoft, Windows and Windows Media are either registered trademarks of Microsoft Corporation in the  
United States and/or other countries.  
The company names and brand names herein are the trademarks or registered trademarks of their respective  
owners.  
Organization of This Manual  
This manual consists of the following 2 chapters.  
i
 
The contents of this document are subject to change without notice.  
Customers are advised to consult with sales representatives before ordering.  
The information, such as descriptions of function and application circuit examples, in this document are presented solely for the  
purpose of reference to show examples of operations and uses of FUJITSU SEMICONDUCTOR device; FUJITSU  
SEMICONDUCTOR does not warrant proper operation of the device with respect to use based on such information. When you  
develop equipment incorporating the device based on such information, you must assume any responsibility arising out of such  
use of the information. FUJITSU SEMICONDUCTOR assumes no liability for any damages whatsoever arising out of the use  
of the information.  
Any information in this document, including descriptions of function and schematic diagrams, shall not be construed as license  
of the use or exercise of any intellectual property right, such as patent right or copyright, or any other right of FUJITSU  
SEMICONDUCTOR or any third party or does FUJITSU SEMICONDUCTOR warrant non-infringement of any third-party's  
intellectual property right or other right by using such information. FUJITSU SEMICONDUCTOR assumes no liability for any  
infringement of the intellectual property rights or other rights of third parties which would result from the use of information  
contained herein.  
The products described in this document are designed, developed and manufactured as contemplated for general use, including  
without limitation, ordinary industrial use, general office use, personal use, and household use, but are not designed, developed  
and manufactured as contemplated (1) for use accompanying fatal risks or dangers that, unless extremely high safety is secured,  
could have a serious effect to the public, and could lead directly to death, personal injury, severe physical damage or other loss  
(i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, mass transport control, medical life  
support system, missile launch control in weapon system), or (2) for use requiring extremely high reliability (i.e., submersible  
repeater and artificial satellite).  
Please note that FUJITSU SEMICONDUCTOR will not be liable against you and/or any third party for any claims or damages  
arising in connection with above-mentioned uses of the products.  
Any semiconductor devices have an inherent chance of failure. You must protect against injury, damage or loss from such  
failures by incorporating safety design measures into your facility and equipment such as redundancy, fire protection, and  
prevention of over-current levels and other abnormal operating conditions.  
Exportation/release of any products described in this document may require necessary procedures in accordance with the  
regulations of the Foreign Exchange and Foreign Trade Control Law of Japan and/or US export control laws.  
The company names and brand names herein are the trademarks or registered trademarks of their respective owners.  
Copyrights © 2004-2011 FUJITSU SEMICONDUCTOR LIMITED All rights reserved.  
ii  
 
READING THIS MANUAL  
Configuration of Page  
In each section of this manual, the summary about the section is described certainly, so you can grasp an  
outline of this manual if only you read these summaries.  
And the title of upper section is described in lower section, so you can grasp the position where you are  
reading now.  
iii  
 
iv  
 
CONTENTS  
v
 
vi  
 
vii  
 
viii  
 
ix  
 
x
 
CHAPTER 1 BASIC FUNCTIONS  
1.1  
Workspace Management Function  
This section explains the workspace management function of SOFTUNE Workbench.  
Workspace  
SOFTUNE Workbench uses workspace as a container to manage two or more projects including subprojects.  
For example, a project that creates a library and a project that creates a target file using the project can be  
stored in one workspace.  
Workspace Management Function  
To manage two or more projects, workspace manages the following information:  
Project  
Active project  
Subproject  
Project  
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.  
Active 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.  
Subproject  
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:  
An absolute (ABS)-type project is specified as a subproject.  
A library (LIB)-type project is specified as a subproject.  
Restrictions on Storage of Two or More Projects  
Only one REALOS-type project can be stored in one workspace.  
2
 
             
CHAPTER 1 BASIC FUNCTIONS  
1.2  
Project Management Function  
This section explains the project management function of SOFTUNE Workbench.  
Project Management Function  
The project manages all information necessary for development of a microcontroller system. Especially, its  
major purpose is to manage information necessary for creation of a target file.  
The project manages the following information:  
- Project configuration  
- Active project configuration  
- Information on source files, include files, other object files, library files  
- Information on tools executed before and after executing language tools (customize build function)  
Project Format  
The project file supports two formats: a 'workspace project format,' and an 'old project format.'  
The differences between the two formats are as follows:  
Workspace project format  
- Supports management of two or more project configurations  
- Supports use of all macros usable in manager  
- Does not support early Workbench versions(*)  
Old project format  
- 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".  
2
*: F MC-16: V30L26 or earlier  
Project Configuration  
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  
3
 
       
CHAPTER 1 BASIC FUNCTIONS  
level of a compiler and MCU setting, can be created within one project.  
In the project configuration, the following information is managed:  
- Name and directory of target file  
- Information on options of language tools to create target file by compiling, assembling and linking  
source files  
- Information on whether to build file or not  
- Information on setting of debugger to debug target file  
Active Project Configuration  
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.  
Note:  
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  
4
 
 
CHAPTER 1 BASIC FUNCTIONS  
1.3  
Project Dependence  
This section explains the project dependence of SOFTUNE Workbench.  
Project Dependence  
If target files output by other projects must be linked, a subproject is defined in the project required in  
[Project] - [Project Dependence] menu. The subproject is a project on which other projects depend.  
By defining project dependence, a subproject can be made and built to link its target file before making and  
building the parent project.  
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.  
5
 
   
CHAPTER 1 BASIC FUNCTIONS  
1.4  
Make/Build Function  
This section explains the make/build function of SOFTUNE Workbench.  
Make Function  
Make function generates a target file by compiling/assembling only updated source files from all source files  
registered in a project, and then joining all required object files.  
This function allows compiling/assembling only the minimum of required files. 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  
Build 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.  
Note:  
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.  
6
 
     
CHAPTER 1 BASIC FUNCTIONS  
1.4.1  
Customize Build Function  
This section describes the SOFTUNE Workbench to set the Customize Build function.  
Customize Build function  
In SOFTUNE Workbench, different tools can be operated automatically before and after executing the  
Assembler, Compiler, Linker, Librarian, Converter, or Configurator started at Compile, Assemble, Make, or  
Build.  
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.  
Setting Options  
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  
Macro List  
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  
Build file  
%(FILE)  
Load module file  
Project file  
%(LOADMODULEFILE)  
%(PRJFILE)  
Workspace file  
Project directory  
Target file directory  
Object file directory  
List file directory  
%(WSPFILE)  
%(PRJPATH)  
%(ABSPATH)  
%(OBJPATH)  
%(LSTPATH)  
%(PRJCONFIG)  
%(ENV[])  
Project construction name  
Environment variable  
Temporary file  
%(TEMPFILE)  
7
 
       
CHAPTER 1 BASIC FUNCTIONS  
Note:  
When checking [Use the Output window], note the following:  
• Once a tool is activated, Make/Build is suspended until the tool is terminated.  
• The Output window must not be used with a tool using a wait state for user input while the tool is  
executing. The user can not perform input while the Output window is in use, so the tool cannot be  
terminated. To forcibly terminate the tool, select the tool on the Task bar and input Control - C, or  
Control - Z.  
8
 
CHAPTER 1 BASIC FUNCTIONS  
1.5  
Include Dependencies Analysis Function  
This section describes the function of the Include Dependencies Analysis of SOFTUNE  
Workbench.  
Analyzing Include Dependencies  
A source file usually includes some include files. When only an include file has been modified leaving a  
source file unchanged, SOFTUNE Workbench cannot execute the Make function unless it has accurate and  
updated information about which source file includes which include files.  
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.  
Note:  
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.  
9
 
   
CHAPTER 1 BASIC FUNCTIONS  
1.6  
Functions of Setting Tool Options  
This section describes the functions to set options for the language tools activated from  
SOFTUNE Workbench.  
Function of Setting Tool Options  
To create a desired target file, it is necessary to specify options for the language tools such as a compiler,  
assembler, and linker. 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".  
- Common options  
These options are effective for all source files (excluding those for which individual options are  
specified) stored in the project.  
- Individual options  
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.  
Tool Options  
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.  
10  
 
     
CHAPTER 1 BASIC FUNCTIONS  
1.7  
Error Jump Function  
This section describes the error jump function in SOFTUNE Workbench.  
Error Jump Function  
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.  
Syntax  
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  
Characters  
%f  
Semantics  
Interpret as source file name and inform editor.  
Interpret as line number and inform editor.  
Become keyword when searching help file.  
Skip any desired character.  
%l  
%h  
%*  
%[char]  
Skip as long as characters in [ ] continues.  
11  
 
       
CHAPTER 1 BASIC FUNCTIONS  
[Example]  
***  
%f(%l)  
%h: or, %[*]  
%f(%l)  
%h:  
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  
Setup Error Jump  
12  
 
 
CHAPTER 1 BASIC FUNCTIONS  
1.8  
Editor Functions  
This section describes the functions of the SOFTUNE Workbench built-in standard editor.  
Standard Editor  
SOFTUNE Workbench has a built-in editor called the standard editor. The standard editor is activated as the  
Edit window in SOFTUNE Workbench. As many Edit windows as are required can be opened at one time.  
The standard editor has the following functions in addition to regular editing functions.  
- 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.  
- Undo function  
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.  
Reference Section  
Edit Window (The Standard Editor)  
13  
 
     
CHAPTER 1 BASIC FUNCTIONS  
1.9  
Storing External Editors  
This section describes the function to set an external editor to SOFTUNE Workbench.  
External Editor  
SOFTUNE Workbench has a built-in standard editor, and use of this standard editor is recommended.  
However, another accustomed editor can be used, with setting it, instead of an edit window. There is no  
particular limit on which editor can be set, but some precautions (below) may be necessary. Use the [Setup] -  
[Editor setting] menu to set an external editor.  
Precautions  
- 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.  
Setting Options  
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:  
1. If the focus is on the SRC tab of Project window, and if a valid file name is selected, the selected file  
name becomes the file name.  
2. When a valid file name cannot be acquired by the above procedure, the file name with a focus in the  
built-in editor becomes the file name.  
%x (project path) is determined as follows:  
1. If a focus is on the SRC tab of project window and a valid file name is selected, the project path is a  
path to the project in which the file is stored.  
2. If no path is obtained, the project path is a path to the active project.  
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.  
14  
 
       
CHAPTER 1 BASIC FUNCTIONS  
Table 1.9-1 List of Special Characters for Analyzing Error Message  
Parameter  
Semantics  
%%  
%f  
Means specifying % itself  
Means specifying file name  
%l  
Means specifying line number  
Means specifying project path  
%x  
Example of Optional Settings  
Table 1.9-2 Example of Optional Settings  
Editor name  
WZ Editor V4.0  
Argument  
%f /j%l  
MIFES V1.0  
UltraEdit32  
%f+%l  
%f/%l/1  
%f(%l)  
TextPad32  
PowerEDITOR  
Codewright32  
Hidemaru for Win3.1/95  
ViVi  
%f -g%l  
%f -g%l  
/j%l:1 %f  
/line=%l %f  
Reference Section  
Editor Setup  
Note:  
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".  
15  
 
     
CHAPTER 1 BASIC FUNCTIONS  
1.10  
Storing External Tools  
This section describes the function to set an external tool to SOFTUNE Workbench.  
External Tools  
A non-standard tool not attached to SOFTUNE Workbench can be used by setting it as an external tool and  
by calling it from SOFTUNE Workbench. 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.  
Setting Options  
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".  
Note:  
When checking [Use the Output window], note the following:  
• Once a tool is activated, neither other tools nor the compiler/assembler can be activated until the  
tool is terminated.  
• The Output window must not be used with a tool using a wait state for user input while the tool is  
executing. The user cannot perform input while the Output window is in use, so the tool cannot be  
terminated. To forcibly terminate the tool, select the tool on the Task bar and input Control - C, or  
Control - Z.  
Reference Section  
Setting Tools  
Starting Tools  
16  
 
       
CHAPTER 1 BASIC FUNCTIONS  
1.11  
Macro Descriptions Usable in Manager  
This section explains the macro descriptions that can be used in the manager of  
SOFTUNE Workbench.  
Macros  
SOFTUNE Workbench has special parameters indicating that any file name and tool-specific options are  
specified as options.  
The use of these parameters as tool options eliminates the need for options specified each time each tool is  
started.  
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  
Macro List  
The following is a list of macros that can be specified in SOFTUNE Workbench.  
The macros usable for each function are listed below.  
- Tool options:  
The directory symbol \ is added to the option directories in Table 1.11-1 but not to the macro directories in  
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.  
17  
 
     
CHAPTER 1 BASIC FUNCTIONS  
Table 1.11-1 List of Macros That Can Be Specified 1  
Parameter  
Meaning  
Passed as full-path name of file. (*1)  
%f  
%F  
%d  
%e  
Passed as main file name of file. (*1)  
Passed as directory of file. (*1)  
Passed as extension of file. (*1)  
%a  
Passed as full-path name of load module file.  
Passed as main file name of load module file. (*2)  
Passed as directory of load module file. (*2)  
Passed as extension of load module file. (*2)  
Passed as directory of project file. (*2)  
Passed as main file name of project file. (*2)  
Passed as %.  
%A  
%D  
%E  
%x  
%X  
%%  
Table 1.11-2 List of Macros That Can Be Specified 2  
Parameter  
Meaning  
%(FILE)  
Passed as full-path name of file. (*1)  
%(LOADMODULEFILE)  
%(PRJFILE)  
Passed as full-path name of load module file. (*2)  
Passed as full-path name of project file. (*2)  
Passed as full-path name of workspace file. (*3)  
Passed as directory of project file. (*2)  
Passed as directory of target file. (*2)  
%(WSPFILE)  
%(PRJPATH)  
%(ABSPATH)  
%(OBJPATH)  
%(LSTPATH)  
%(PRJCONFIG)  
Passed as directory of object file. (*2)  
Passed as directory of list file. (*2)  
Passed as project configuration name. (*2) (*3)  
%(ENV [Environment  
variable])  
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:  
- Customize build  
1. Source file before and after executing compiler and assembler  
2. Target file before and after executing linker, librarian and converter  
3. Configuration file before and after executing configuration  
18  
 
   
CHAPTER 1 BASIC FUNCTIONS  
- Tool options  
• Null character  
- Others  
1. File as focus is on the SRC tab of project window and valid file name is selected  
2. File on which focus is in internal editor as no valid file name can be obtained in 1  
3. Null character if no valid file name can be obtained  
The macros in (*2) are determined as follows:  
- Customize build and tool options  
• Information on configuration of project under building, making, compiling and assembling  
- Others  
1. Information on active configuration of project in which file is stored as focus is on the SRC tab of  
project window and valid file name is selected  
2. Information on active configuration of active project if no valid file name can be obtained in 1  
*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  
Sub parameter  
[PATH]  
Meaning  
Directory of file  
[RELPATH]  
[NAME]  
Relative Path of file  
Main file name of file  
Extension of file  
[EXT]  
[SHORTFULLNAME]  
[SHORTPATH]  
[SHORTNAME]  
[FOLDER]  
Full path name of short file  
Directory of short file  
Main file name of short file  
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.  
Examples of Macro Expansion  
If the following workspace is opened, macro expansion is performed as follows:  
Workspace :  
C:\Wsp\Wsp.wsp  
Active project :  
C:\Wsp\Sample\Sample.prj  
Debug  
Active project configuration  
Object directory :  
C:\Wsp\Sample\Debug\Obj\  
Subproject :  
C:\Subprj\Subprj.prj  
Release  
Active project configuration  
Object directory :  
Target file :  
C:\Subprj\Release\Obj\  
C:\Subprj\Release\Abs\Subprj.abs  
19  
 
   
CHAPTER 1 BASIC FUNCTIONS  
[Example] Macro expansion in external tools  
Focus is on Subprj project file in the SRC tab of project window.  
%a  
: C:\Subprj\Release\Abs\Subprj.abs  
%A  
: SUBPRJ.abs  
%D  
: C:\Subprj\Release\Abs\  
: .abs  
%E  
%(FILE[FOLDER])  
%(PRJFILE)  
: Source Files\Common  
: C:\Subprj\Subprj.prj  
Focus is not in the SRC tab of project window.  
%a  
: C:\Wsp\Sample\Debug\Abs\Sample.abs  
%A  
: Sample.abs  
%D  
: C:\Wsp\Sample\Debug\Abs\  
: C:\Wsp\Sample\Sample.prj  
%(PRJFILE)  
[Example] Macro expansion in customize build  
Release configuration of Subprj project is built.  
%(FILE)  
: C:\Subprj\LongNameFile.c  
%(FILE[PATH])  
%(FILE[RELPATH])  
%(FILE[NAME])  
%(FILE[EXT])  
: C:\Subprj  
: .  
: LongNameFile  
: .c  
%(FILE[SHORTFULLNAME]) : C:\Subprj\LongFi = ~1.c  
%(FILE[SHORTPATH])  
%(FILE[SHORTNAME])  
%(PRJFILE[RELPATH])  
%(PRJPATH)  
: C:\Subprj  
: LongFi~1  
: ..\Subprj  
: C:\Subprj  
%(OBJPATH)  
: C:\Subprj\Release\Obj  
: Release  
%(PRJCONFIG)  
%(ENV[FETOOL])  
%(TEMPFILE)  
: C:\SOFTUNE  
: C:\Subprj\Release\Opt\_fs1056.TMP  
[Example] Macro expansion in tool options  
Release configuration of Subprj project is built.  
%(FILE)  
:
%(PRJFILE[RELPATH])  
%(PRJPATH)  
: ..\Subprj  
: C:\Subprj  
: C:\Subprj\Release\Obj  
: Release  
%(OBJPATH)  
%(PRJCONFIG)  
%(ENV[FETOOL])  
: C:\SOFTUNE  
20  
 
CHAPTER 1 BASIC FUNCTIONS  
1.12  
Setting Operating Environment  
This section describes the functions for setting the SOFTUNE Workbench operating  
environment.  
Operating Environment  
Set the environment variables for SOFTUNE Workbench and some basic setting for the Project.  
To set the operating environment, use the [Setup]-[Setup Development Environment] menu.  
Environment Variables  
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.  
Basic setups for Project  
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.  
Reference Section  
Development Environment  
Note:  
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].  
21  
 
     
CHAPTER 1 BASIC FUNCTIONS  
1.13  
Debugger Types  
This section describes the types of SOFTUNE Workbench debuggers.  
Type of Debugger  
SOFTUNE Workbench integrates three types of debugger: a simulator debugger, emulator debugger, and  
monitor debugger. Any one can be selected depending on the requirement.  
Simulator Debugger  
The simulator debugger simulates the MCU operations (executing instructions, memory space, I/O ports,  
interrupts, reset, etc.) with software to evaluate a program.  
It is used for evaluating an uncompleted system and operation of individual units, etc.  
Emulator Debugger  
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.  
Monitor Debugger  
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.  
22  
 
         
CHAPTER 1 BASIC FUNCTIONS  
1.14  
Memory Operation Functions  
This section describes the memory operation functions.  
Functions for Memory Operations  
- Display/Modify memory data  
Memory data can be display in the Memory window and modified.  
- Fill  
The specified memory area can be filled with the specified data.  
- Copy  
The data in the specified memory area can be copied to another area.  
- Compare  
The data in the specified source area can be compared with data in the destination area.  
- Search  
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".  
23  
 
   
CHAPTER 1 BASIC FUNCTIONS  
1.15  
Register Operations  
This section describes the register operations.  
Register Operations  
The Register window is opened when the [View] - [Register] menu is executed. The register and flag values  
can be displayed in the Register window.  
For further details about modifying the register value and the flag value, refer to "4.4.4 Register" 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".  
Reference Section  
Register Window  
24  
 
     
CHAPTER 1 BASIC FUNCTIONS  
1.16  
Line Assembly and Disassembly  
This section describes line assembly and disassembly.  
Line Assembly  
To perform line-by-line assembly (line assembly), right-click anywhere in the Disassembly window to  
display the short-cut menu, and select [Line Assembly]. For further details about assembly operation, refer to  
"4.4.3 Assembly" in "SOFTUNE Workbench Operation Manual".  
Disassembly  
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.  
Reference Section  
Disassembly Window  
25  
 
       
CHAPTER 1 BASIC FUNCTIONS  
1.17  
Symbolic Debugging  
The symbols defined in a source program can be used for command parameters  
(address). There are three types of symbols as follows:  
• Global Symbol  
• Static Symbol within Module (Local Symbol within Module)  
• Local Symbol within Function  
Types of Symbols  
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:  
Global symbol  
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.  
Static symbol within module (Local symbol within module)  
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.  
Local symbol within function  
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.  
- Automatic variable  
Out of the variables defined in function, those without static declaration and parameters for the  
function.  
Setting Symbol Information  
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.  
26  
 
     
CHAPTER 1 BASIC FUNCTIONS  
Line Number Information  
Line number information is set with the line number information table in SOFTUNE Workbench when a  
debug information file is loaded. Once registered, such information can be used at anytime thereafter. Line  
number is defined as follows:  
[Source File Name] $Line Number  
27  
 
 
CHAPTER 1 BASIC FUNCTIONS  
1.17.1  
Referring to Local Symbols  
This section describes referring to local symbols and Scope.  
Scope  
When a local symbol is referred to, Scope is used to indicate the module and function to which the local  
symbol to be referred belongs.  
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.  
Moving 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.  
Specifying Symbol and Search Procedure  
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:  
1. Local symbols in function in Current Scope  
2. Static symbols in module in Current Scope  
3. Global symbols  
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.  
28  
 
       
CHAPTER 1 BASIC FUNCTIONS  
1.17.2  
Referring to Variable of C Language  
C language variables can be specified using the same descriptions as in the source  
program written in C language.  
Specifying C Language Variables  
C language variables can be specified using the same descriptions as in the source program. The address of C  
language variables should be preceded by the ampersand symbol "&". Some examples are shown in the Table  
Table 1.17-1 Examples of Specifying Variables  
Example of  
Example of Variables  
Specifying  
Variables  
Semantics  
Regular Variable  
int data;  
char *p;  
char a[5];  
data  
*p  
Value of data  
Pointer  
Array  
Value pointed to by p  
a[1]  
Value of second element of a  
Structure  
struct stag {  
char c;  
st.c  
stp- >c  
Value of member c of st  
Value of member c of the structure  
to which stp points  
int i;  
};  
struct stag st;  
struct stag *stp;  
Union  
union utag {  
char c;  
int i;  
uni.i  
Value of member i of uni  
} uni;  
Address of variable  
Reference type  
int data;  
&data  
ri  
Address of data  
Same as i  
int i;  
int &ri = i;  
29  
 
     
CHAPTER 1 BASIC FUNCTIONS  
Notes on C Language Symbols  
The C compiler outputs symbol information with "_" prefixed to global symbols. For example, the symbol  
main outputs symbol information _main. However, SOFTUNE Workbench permits access using the symbol  
name described in the source to make the debug of program described by C language easier.  
Consequently, a symbol name described in C language and a symbol name described in assembler, which  
should both be unique, may be identical.  
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.  
30  
 
 
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1  
Simulator Debugger  
2
This section describes the functions of the simulator debugger for the F MC-16 Family.  
Simulator Debugger  
The simulator debugger simulates the MCU operations (executing instructions, memory space, I/O ports,  
interrupts, reset, etc.) with software to evaluate a program.  
It is used to evaluate an uncompleted system, the operation of single units, etc.  
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".  
Operating Condition of High-speed Simulator Debugger  
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)  
per 64 KB  
20MB  
6MB  
CODE size of target program  
DATA size of target program  
per 64 KB  
1.5MB  
Insufficient RAM space will lead to an extreme decrease in simulation speed.  
Target program size  
CODE  
DATA  
XX(KB)  
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.  
Example: Program with 1 MB of CODE and DATA sizes  
Required RAM space (MB) = 20 + (1024 / 64) × 6 + (1024 / 64) × 1.5 = 140MB  
32  
 
     
CHAPTER 2 DEPENDENCE FUNCTIONS  
Simulation Range  
The simulator debugger simulates the MCU operations (instruction operations, memory space, I/O ports,  
interrupts, reset, power-save consumption mode, etc.) Peripheral I/Os, such as a timer, DMAC and serial I/O,  
other than the CPU core of the actual chip are not supported as peripheral resources. I/O space to which  
peripheral I/Os are connected is treated as memory space. 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.  
- Instruction simulation  
- Memory simulation  
- I/O port simulation (Input port)  
- I/O port simulation (Output port)  
- Interrupt simulation  
- Reset simulation  
- Power-save consumption mode simulation  
33  
 
 
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.1  
Setting Operating Environment  
This section explains the operating environment setup.  
Setting Operating Environment  
2
For the simulator debugger for F MC-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.  
Boot ROM file automatic execution  
34  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.1.1  
Boot ROM File Automatic Execution  
2
The simulator debugger for F MC-16FX automatically loads and executes the Boot ROM  
file at the start of debugging.  
Boot ROM File Automatic Execution  
2
When the simulator debugger for F MC-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".  
Notes:  
• When MCU reset is performed in the simulator debugger, the PC value varies, as shown below,  
2
depending on whether it is F MC-16FX or not:  
2
F MC-16FX: Starting address of the Boot ROM file  
2
Other than F MC-16FX: Entry point in the target file (reset vector)  
• As the simulator debugger does not support fixed boot vectors, it always jumps to the reset vector  
after the execution of the Boot ROM file. For the operation after the execution of the Boot ROM file,  
see the LSI Specification Manual.  
35  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.2  
Instruction Simulation  
This section describes the instruction simulation executed by SOFTUNE Workbench.  
Instruction Simulation  
2
This simulates the operations of all instructions supported by the F MC-16/16L/16LX/16H/16F. It also  
simulates the changes in memory and register values due to such instructions.  
36  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.3  
Memory Simulation  
This section describes the memory simulation executed by SOFTUNE Workbench.  
Memory Simulation  
The simulator debugger must first secure memory space to simulate instructions because it simulates the  
memory space secured in the host PC memory.  
The following operation is required.  
- To secure the memory area, either use the [Setup] - [Memory Map] menu, or the SET MAP command  
in the Command window.  
- 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.  
Simulation Memory Space  
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.  
Memory Area Access Attributes  
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  
Attribute  
CODE  
Semantics  
Instruction operation enabled  
Data read enabled  
READ  
WRITE  
undefined  
Data write enabled  
Attribute undefined (access prohibited)  
37  
 
         
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.4  
I/O Port Simulation  
This section describes I/O port simulation executed by SOFTUNE Workbench.  
I/O Port Simulation (Input Port)  
There are two types of simulations in I/O port simulation: input port simulation, and output port simulation.  
Input port simulation has the following types:  
- Whenever a program reads the specified port, data is input from the pre-defined data input source.  
- 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.  
I/O Port Simulation (Output Port)  
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.  
Note:  
The following method is not supported by high-speed simulator debugger.  
• Whenever the instruction execution cycle count exceeds the specified cycle count, data is input to  
the port.  
Furthermore the setting of memory map is necessary to set I/O port. When deleting memory map, I/O  
port is also deleted.  
38  
 
     
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.5  
Interrupt Simulation  
This section describes the interrupt simulation executed by SOFTUNE Workbench.  
Interrupt Simulation  
*
Simulate the operation of the MCU (including intelligent I/O service ) 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)  
2
- Stack area error (only for F MC-16F)  
Note:  
When an external interrupt is generated while under an interrupt mask at high-speed simulator  
debugger, that interrupt factor is eliminated.  
39  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.6  
Reset Simulation  
This section describes the reset simulation executed by SOFTUNE Workbench.  
Reset Simulation  
The simulator debugger simulates the operation when a reset signal is input to the MCU using the [Debug]-  
[Reset MCU] menu and initializes the registers. The function for performing reset processing by operation of  
MCU instructions (writing to RST bit in standby control register) is also supported. In this case, the reset  
message (Reset) is displayed on the status bar.  
40  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.7  
Low-Power Consumption Mode Simulation  
This section describes the low-power consumption SOFTUNE Workbench mode  
simulation executed by SOFTUNE Workbench.  
Low-Power Consumption Mode Simulation  
The MCU enters the low-power consumption mode in accordance with the MCU instruction operation (Write  
to SLEEP bit or STOP bit of standby control register). Once in the sleep mode or stop mode, a message  
("sleep" 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.  
41  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.8  
STUB Function  
This section describes the STUB function which executes commands automatically when  
the breakpoint hit occurs.  
STUB Function  
The STUB function is supported so that a series of commands in the command list can automatically be  
executed when a specified breakpoint is hit. 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.  
execution starts  
Break (STUB) processing  
Breakpoint is hit  
No  
Is there a command list  
in breakpoint?  
Execution restarts  
Yes  
Process a command list in  
breakpoint (execute commands).  
Re-execute (is NOBREAK  
specified)?  
Yes  
Execution stops  
No  
execution ends  
Setting Method  
The STUB function can be set by the following commands.  
Dialog  
1. Breakpoint Set Dialog - [Code] tab  
2. Breakpoint Set Dialog - [Data] tab  
Command  
1. SET BREAK  
2. SET DATABREAK  
42  
 
     
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.9  
Break  
In the simulator debugger, five types of break functions can be used. When the program  
execution is aborted by each break function, the address and the break factor to do the  
break are displayed.  
Break Functions  
In this simulator debugger, the following five types of break functions are supported.  
Code break  
Data break  
Trace-buffer-full break  
Guarded break  
Forced break  
43  
 
   
CHAPTER 2 DEPENDENCE FUNCTIONS  
2.1.9.1  
Code Break  
It is a function that the simulator debugger aborts the program execution when the code  
access specified while executing the program is done.  
Flow of Code Break  
When the program reaches the breakpoint (Immediately before an instruction memory positional is  
executed), the simulator debugger does the following processing.  
1) The execution of the program is aborted (Before executing the instruction).  
2) When the attainment frequency is checked, and it doesn't reach the attainment frequency of the specified  
breakpoint, the program execution is restarted. It moves to 3) when it reaches the attainment frequency.  
3) The memory position in which execution was aborted is displayed in the status bar.  
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.  
Command  
- SET BREAK  
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".  
Dialog  
- Breakpoint Set Dialog [Code] tab  
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".  
Window  
- Source window/Disassembly window  
Notes on Code Break  
There are several points to note in using code break. First, some points affecting code break are explained.  
Invalid Breakpoints  
No break occurs when a breakpoint is set at the instruction immediately after the following instructions.  
2
F MC-16/16L/16LX/16H: • PCB • DTB • NCC • ADB • SPB • CNR  
• MOV ILM,#imm8 • AND CCR,#imm8  
• OR CCR,#imm8  
• PCB • DTB • NCC • ADB • SPB • CNR  
No break occurs when breakpoint set at address other than starting address of instruction.  
• POPW PS  
2
F MC-16F:  
Here are some additional points about the effects on other commands.  
44  
 
       
CHAPTER 2 DEPENDENCE FUNCTIONS  
Dangerous BreakPoints