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, m onitor 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
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.
MC is the abbreviation of FUJITSU Flexible Microcontroller.
■ Organization of This Manual
This manual consists of the following 2 chapters.
CHAPTER 1 BASIC FUNCTIONS
This chapter describes the basic functions on the SOFTUNE Workbench.
CHAPTER 2 DEPENDENCE FUNCTIONS
This chapter describes the functions dependent on each Debugger.
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.
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.
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
CHAPTER 1 BASIC FUNCTIONS
1.1Workspace 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 subpr oject 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.2Project 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 th e file t o 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
MC-16: V30L26 or earlier
*: F
■ 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 se tting 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], [Comp ile/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 proj ect
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
Macro Descriptions Usable in Manager".
4
CHAPTER 1 BASIC FUNCTIONS
1.3Project 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 an d built to link its target file b efore making and
building the parent project.
The use of project dependence enables simultaneous making and building of two or m ore 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.4Make/Build Function
This section explains the make/build function of SOFTUNE Workbench.
■ Make Function
Make function generates a target file by compiling/assembling only u pdated source files from all sou rce 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
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 re quired for gener ating the targ et 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.1Customize 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 h a s the macros indicating that any file name and toolspecific options are specified as options.
■ Macro List
If any character string other than parameters is specified, it is passed directly to the tool. For details abo ut 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.
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.5Include 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. Th is 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 dependenci e s of the com piled/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.6Functions 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 sou rce files (common options) and th e 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 abo ut the
parameters, see Section "1.11 Macro Descriptions Usable in Manager". For details about the tool option s for
each tool, see the manual of each tool.
10
CHAPTER 1 BASIC FUNCTIONS
1.7Error 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 inform ation
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, th e modify
error message formats for pre-installed Fujitsu language tools are defined as part of the system, these can not
be modified.
■ Syntax
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] me nu.
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 i s 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
CharactersSemantics
%fInterpret as source file name and inform editor.
%lInterpret as line numb er and inform editor.
%hBecome keyword when searching help file.
%*Skip any desired character.
%[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 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.
- K e yword 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 j umps to the line. Once a book mark 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.9Storing 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 functi on 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 add ed immediately after
the editor name. The names of file to be opened by the editor and the initial location of the cursor (the li ne
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
2. When a valid file name cannot be acquired by the above procedure, the file name w ith a focus in the
%x (project path) is determined as follows:
1. If a focus is on the SRC tab of project w indow and a valid file name is selected, the project path is a
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 edi tor, there are line
numbers to which there will be no correct jump if the entire option is not given double-quotes.
name becomes the file name.
built-in editor becomes the file name.
path to the project in which the file is stored.
14
Table 1.9-1 List of Special Characters for Analyzing Error Message
Parameter Semantics
%% Means specifying % itself
%f Means specifying file name
%l Means specifying line number
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.10Storing 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.11Macro 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
Editors".
■ 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.
- E xternal tools:Table 1.11-1 and Table 1.11-2
- Customize build: Table 1.11-1 and Table 1.11-2
- T ool options:Table 1.11 -2
The directory symbol \ is added to the option directories in Table 1.11-1 but not to t he 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.
17
CHAPTER 1 BASIC FUNCTIONS
Table 1.11-1 List of Macros That Can Be Specified 1
Parameter Meaning
%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
Parameter Meaning
%(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)
%(ENV [Environment
variable])
%(TEMPFILE) Temporary file is created and its full-path name is passed. (*4)
The macros in (*1) are determined as follows:
Environment variable specified in environment variable brackets is
passed.
18
- 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
CHAPTER 1 BASIC FUNCTIONS
- T ool 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 obt ained 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 Meaning
[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
*: 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
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/assembli ng
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.
- S ave 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 pr evious versions of SOFTUNE cannot be used. In particu lar, add the
set values of [User Include Directory] and [Librar y Sea rc h Dire ctory] to [Tool Options Settings].
21
CHAPTER 1 BASIC FUNCTIONS
1.13Debugger 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
1.14Memory 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".
CHAPTER 1 BASIC FUNCTIONS
23
CHAPTER 1 BASIC FUNCTIONS
1.15Register Operations
This section describes the register operations.
■ Register Operations
The Register window is opened when the [View] - [Register] menu is ex ecuted. 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
1.16Line 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
CHAPTER 1 BASIC FUNCTIONS
25
CHAPTER 1 BASIC FUNCTIONS
1.17Symbolic 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 wit hi n modul e)
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 th e symbol information table by loadi ng 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 wh ich 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
■ Line Number Information
Line number information is set with the line number information tab le 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:
CHAPTER 1 BASIC FUNCTIONS
[Source File Name] $Line Number
27
CHAPTER 1 BASIC FUNCTIONS
1.17.1Referring 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 modu le 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 shoul d be specified by the
module and function to which the variable belongs. This m ethod 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 Cu rrent 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.2Referring 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
Address of variableint data; &data Address of data
Reference typeint i;
int &ri = i;
st.c
stp- >c
uni.i Value of member i of uni
ri Same as i
Value of member c of st
Value of member c of the structure
to which stp points
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
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
31
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1Simulator Debugger
This section describes the functions of the simulator debugger for the F2MC-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 useFs907s.exe (This product)20MB
CODE size of target programper 64 KB6MB
DATA size of target program per 64 KB1.5MB
Insufficient RAM space will lead to an extreme decrease in simulation speed.
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 li ke I/O ports. For details, see the sections concerning I/O port
simulation and interrupt simulation.
- I nstruction simulation
- Memory simulation
- I /O port simulation (Input port)
- I /O port simulation (Output port)
- I nterrupt simulation
- Reset simulation
- Power-save consumption mode simulation
CHAPTER 2 DEPENDENCE FUNCTIONS
33
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.1Setting Operating Environment
This section explains the operating environment setup.
■ Setting Operating Environment
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.
• Boot ROM file automatic execution
34
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.1.1Boot ROM File Automatic Execution
The simulator debugger for F2MC-16FX automatically loads and executes the Boot ROM
file at the start of debugging.
■ Boot ROM File Automatic Execution
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 disp layed using the [Project] - [Setup Project] menu , and
can be modified in the setup project dialog. In addition, it is also possi ble 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
2
F
MC-16FX: Starting address of the Boot ROM file
Other than F
• 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.
2
MC-16FX: Entry point in the target file (reset vector)
MC-16FX or not:
35
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.2Instruction Simulation
This section describes the instruction simulation executed by SOFTUNE Workbench.
■ Instruction Simulation
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.
36
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.3Memory 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.
- L oad the file output by the Linkage Editor (Load Module File) u sing 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.
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 sim ulation.
Input port simulation has the following types:
- Whenever a program reads the specified port, data is input from the pre-defined data input source.
- W henever 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 f ile. 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 th e 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 memo ry map is necessar y to set I/O port. When deleting memory ma p, I/O
port is also deleted.
38
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.5Interrupt Simulation
This section describes the interrupt simulation executed by SOFTUNE Workbench.
■ Interrupt Simulation
Simulate the operation of the MCU (including intel ligent 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 runn ing (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.
Note:
The method of generating interrupts is set by the [Setup]-[Debug envi ronment]-[Interrup t] menu. If interru pts
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:
- E xecution of undefined instructions
- A ddress error in program access
(Program access to internal RAM area and internal I/O area)
2
- S tack area error (only for F
When an external interrupt is generated while under an interrupt mask at high-speed simulator
debugger, that interrupt factor is eliminated.
MC-16F)
39
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.6Reset Simulation
This section describes the reset simulation executed by SOFTUNE Workbench.
■ Reset Simulation
The simulator debugger simulates the operation when a reset signal is inp ut to the MCU using the [Debug][Reset MCU] menu and initializes the registers. Th e function for perform ing reset processing by operation of
MCU instructions (writing to RST bit in standby control register) is also suppo rted. In this case, the reset
message (Reset) is displayed on the status bar.
40
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.7Low-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 processin g can be operated. Writing to the standby
control register using a command is not prohibited.
41
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.8STUB 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.
■ Setting Method
The STUB function can be set by the following commands.
execution starts
Program execution
execution ends
Breakpoint is hit
Execution restarts
Execution stops
Break (STUB) processing
Yes
Is there a command list
in breakpoint?
Yes
Processa command list in
breakpoint (execute commands).
Re-execute (is NOBREAK
specified)?
No
No
42
• Dialog
1. Breakpoint Set Dialog - [Code] tab
2. Breakpoint Set Dialog - [Data] tab
• Command
1. SET BREAK
2. SET DATABREAK
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.9Break
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.1Code 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
- S ou rce 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.
• No break occurs when breakpoint set at address other than starting address of instruction.
• MOV ILM,#imm8 • AND CCR,#imm8
• OR CCR,#imm8 • POPW PS
44
Here are some additional points about the effects on other commands.
Note:
CHAPTER 2 DEPENDENCE FUNCTIONS
● Dangerous BreakPoints
• Never set a breakpoint at an address other than the instruction starting address.
• If a breakpoint is the last 1 byte of an instruction longer than 2 bytes length, and i f 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.
[High-speed version simulator debugger]
• When the break function is used, it is necessary to set the memory map beforehand. When the
memory map is deleted, the setting of the breakpoint is deleted.
• When the breakpoint with pass count is set to the reset vector in 16FX, hit count is cleared after the
Boot ROM file is executed. For details of the execution of the Boot ROM file, refer to "■ Setting
Options in [Boot ROM] (Only MB2198)" of section "4.5.5.9 Setting Debug Options" in "SOFTUNE
Workbench Operation Manual".
45
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.9.2Data Break
It is a function that the simulator debugger aborts the program execution when the data
access (read and write) specified while executing the program is done.
■ Flow of Data Break
The simulator debugger does the following processing when the program writes in the breakpoint or it reads
it.
1) After the execution of the instruction is completed, the execution of the program is aborted.
2) It moves to 3) when the program execution is restarted when the access frequency is checked, and it
doesn't reach the access frequency of the specified data break, and it reaches the access frequency.
3) When it reaches the access frequency and the program execution is aborted, the memory position of the
instruction in which it is writing (Or, read it) is displayed to the memory position o f the data breakpoint
and the memory position in the status bar.
4) Next, the executed memory position is displayed.
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.
• Command
- SET DATABREAK
• Dialog
- Breakpoint Set Dialog [Data] tab
Note:
[High-speed version simulator debugger]
• When the break function is used, it is necessary to set the memory map beforehand. When the
memory map is deleted, the setting of the breakpoint is deleted.
• When the breakpoint with pass count is set to the reset vector in 16FX, hit count is cleared after the
Boot ROM file is executed. For details of the execution of the Boot ROM file, refer to "■ Setting
Options in [Boot ROM] (Only MB2198)" of section "4.5.5.9 Setting Debug Options" in "SOFTUNE
Workbench Operation Manual".
Refer to "3.10 SET DATABREAK (type 2)" in "SOFTUNE Workbench Command Reference
Manual".
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
46
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.9.3Trace-Buffer-Full Break
It is a function to abort the program execution when the trace buffer becomes full.
■ Trace-Buffer-Full Break
It is a function to abort the program execution when the trace buffer becomes full.
When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar.
Break at Address by trace buffer full
■ Setting Method
The trace-buffer-full break is controlled by the following method.
• Command
- SET TRACE/BREAK
Refer to "4.29 SET TRACE(type 1)" in "SOFTUNE Workbench Command Reference Manual".
• Dialog
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
47
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.9.4Guarded Access Break
It is a function to abort the program execution when the violation to the access attribute,
doing the access, and guarded (An undefined area cannot be accessed) area are
accessed.
■ Guarded Access Break
It is a function to abort the program execution when the violation to the access attribute, doing the access,
and guarded (An undefined area cannot be accessed) area are accessed.
Guarded access break functions as follows.
• Code guarded
When the instruction execution to the area without the code attri bute
• Read guarded
When read the area without the read attribute
• Write guarded
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
48
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.9.5Forced Break
It is a function to abort the execution of the program compulsorily.
■ Forced Break
It is a function to abort the execution of the program compulsorily.
When a break occurs due to a forced break, the following message is displayed on the Status Bar.
Break at Address by command abort request
49
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.10Measuring Execution Cycle Count
This function measures the program execution cycle count.
■ Measurement Items
Measures program execution cycle count and step counts.
● Execution Cycle Count
This is calculated based on the basic cycle count of each instruction described in the Programming Manual.
A compensation value (a, b), which is described in the list of an instruction in Programming Manual, is
calculated as 1.
The maximum measurable value varies, as shown below, whether the normal or the high-speed simulator
debugger is used.
Normal debugger:Max. (2 to the power of 32 - 1) = 4,294,967,295 cycles
High-speed debugger:Max. (2 to the power of 64 - 1) = 18,446,744,073,709,551,615 cycles
● Execution Step Count
Measures program execution step counts.
For both the normal simulator debugger and the high-speed sim ulator 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:
• Step counts spent on the previous program execution
• Total step counts spent on the program execution since the previous clearing
■ Displaying Measurement Results
Either of the following methods can be used to display the measurement results.
● Display by dialog
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".
● Display by command
Enter the SHOW TIMER command in the command window.
For deta i l s , ref e r to S e c tion " 4 .27 S H O W TIME R " in "SOFTUNE Workbench Command Reference Manual".
50
■ Clearing Measurement Results
Either of the following methods can be used to clear the measurement results.
● Operation by dialog
Click the [Clear] button in the time measurement dialog, which can be displayed by selecting [Debug] –
[Time Measurement] menu.
For details, refer to Section "4.6.8 Time Measurement" in "SOFTUNE Workbench Operation Manual".
● Clearing by command
Enter the CLEAR TIMER command in the command window.
For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual".
Note:
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.
CHAPTER 2 DEPENDENCE FUNCTIONS
51
CHAPTER 2 DEPENDENCE FUNCTIONS
.
.
.
.
-3
-2
-1
0 (Trigger point)
2.1.11Trace
The address and status information can be sampled during program execution to record
it in a trace buffer. This function is called a trace.
■ Trace
The address and status information can be sampled during program execution to record it in a trace buffer.
This function is called a trace. 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.
■ Trace Data
The simulator debugger can sample 1000 frames of trace data for the address of the executed instruction.
■ Abortion of Trace Measurement
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.
■ 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 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
52
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.11.1Setting Trace
You must set the following two items to perform a trace. After that, trace data will be
sampled with the execution of the program.
■ Setting Trace
1. Enable the trace function. This program will startup and will be enabled.
•Dialog
This is done by [Setup] - [Trace] in the trace window shortcut menu.
• Command
Enter the ENABLE TRACE command.
2. Set the trace buffer full break. When the trace buffer is full, you can make a break. When starting up this
program, it is setup for no breaks.
•Dialog
This is done using the trace window shortcut menu [Setup] - [Trace].
• Command
Enter the SET TRACE/BREAK command.
53
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.11.2Displaying Trace Data
Data recorded in the trace buffer can be displayed.
■ Displaying Trace Data
The trace window or command window displays how much trace data is stored in the trace buffer.
• Trace window
Select [Refresh] in the trace window shortcut menu.
• Command window
Enter the SHOW TRACE command.
■ Display Format of Trace Data
There are two display formats of the trace data.
• Instruction: The instruction operation is displayed in disassembly units.
• Source: This mode only displays source lines.
■ Clearing Trace Data
Either of the following methods can be used to clear data in the trace buffer.
•Window
Select [Clear] in the trace window shortcut menu.
• Command
Enter the CLEAR TRACE command.
54
2.1.11.3Searching Trace Data
The trace buffer can be searched to locate target data.
■ Searching Trace Data
The trace buffer has 1000 frames, so the target data may not be found immediately. Therefore the trace data
can be searched from data in the trace buffer by specifying an address.
■ How to Search Trace Data
Either of the following methods can be used to search the trace data.
•Window
Select [Find] in the trace window shortcut menu.
• Command
Enter the SEARCH TRACE command.
CHAPTER 2 DEPENDENCE FUNCTIONS
55
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.11.4Saving Trace Data
This section explains how to save trace data.
■ Saving Tr ace 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.
● Using GUI for Saving Trace Data
1. Display the trace window.
- S elect [View] - [Trace] menu.
2. Specify the name of the file in which to save trace data.
- 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".
● Using Command for Saving Trace Data
1. Save trace data.
- 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.
56
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.12Measuring Coverage
In the high-speed version simulator debugger, the C0 coverage measurement function is
provided. Use this function to find what percentage of an entire program has been
executed.
■ Coverage Measurement Function
When testing a program, the program is executed with various test data input and the results are checked for
correctness. 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.
■ Coverage Measurement Procedures
The procedure for coverage measurement is as follows:
• Set range for coverage measurement:SET COVERAGE
• Measuring coverage:GO, STEP, CALL
• Displaying measurement result:SHOW COVERAGE
■ Coverage Measurement Operation
The following operation can be made in coverage measurement:
• Load/Save of coverage data:LOAD/COVERAGE. SAVE/COVERAGE
The procedure for coverage measurement is as follows:
• Set range for coverage measurement:SET COVERAGE
• Measure coverage:GO, STEP, CALL
• Display measurement result:SHOW COVERAGE
■ Setting Range for Coverage Measurement
Use the SET COVERAGE command to set the measurement range. Up to 32 ranges can be specified.
By specifying /AUTOMATIC for the command qualifier, the code area for the loaded module is set
automatically. However, the library code area is not set when the C compiler library is linked.
[Example]
>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.
■ Displaying Coverage Measurement Result
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
● Displaying coverage rate of total measurement area (specify /TOTAL for the command qualifier)
>SHOW COVERAGE/TOTAL
total coverage : 82.3%
● Displaying coverage rate of load module (specify /MODULE for the command qualifier)
>SHOW COVERAGE/MODULE
sample.abs . . . . . . . . . . . . . . (84.03%)
+- startup.asm . . . . . . . . . . . (90.43%)
+- sample.c . . . . . . . . . . . . . (95.17%)
+- samp.c . . . . . . . . . . . . . . (100.00%)
58
Displays the load modulesand the coverage rate of each module.
● Summary (Specify /GENERAL for command qualifier)
Displays execution status of each machine command line.
. :
*
:
Blank :
No executing
Executing
Instruction outside the scope of the coverage measurement
LINK
PUSHW
MOVN
MOVW
MOVW
CMPW
BGE
LSLW
MOVW
MOVEA
ADDW
MOV
MULUW
ADDW
#22
RW0
A,#0
@RW3-02,A
A,@RW3-02
A,#0010
F902B5
A,@RW3-02
A
RW0,A
A,@RW3-22
RW0,A
A,#14
A,@RW3-02
A,#01A0
60
CHAPTER 2 DEPENDENCE FUNCTIONS
2.1.13Checking Debugger Information
This section explains how to check information about the simulator debugger.
■ Debugger Information
This simulator debugger enables you to check the following information at startup.
• SOFTUNE Workbench file information
If any errors have been discovered during SOFTUNE Workbench operations, check this information and
contact our sales department or support department.
■ How to Check
Use one of the following methods to check debugger information.
• Command
- SHOW SYSTEM
Refer to Section "1.19 SHOW SYSTEM" in "SOFTUNE Workbench Command Reference Manual".
• Dialog
- Version information dialog
Select [Help] - [Version Information] menu.
For details, refer to Section "4.9.3 Version Information" in "SOFTUNE Workbench Operation
Manual".
■ Displayed Contents
F2MC-16 Family SOFTUNE Workbench VxxLxx
ALL RIGHTS RESERVED,
COPYRIGHT(C) FUJITSU SEMICONDUCTOR LIMITED 1997
LICENCED MATERIAL -
PROGRAM PROPERTY OF FUJITSU SEMICONDUCTOR LIMITED
=======================================================
Cpu information file path: CPU information file path
Cpu information file version: CPU information file version
=======================================================
Add in DLLs
------------------------------------------------------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
=======================================================
Current path: Path of the currently used project
Language: Currently used language
Help file path: Help file path
62
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2Emulator Debugger (MB2141)
This section explains the functions of the emulator debuggers for the MB2141.
■ Emulator Debugger
When choosing the emulator debugger from the setup wizard, select one of the following emulators. The
following description explains the case when MB2141 has been selected.
MB2141
MB2147-01
MB2147-05
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
2
MC-16/16H
F
2
F
MC-16F
2
F
MC-16L
2
F
MC-16LX
When MB2141-507 pod used
2
MC-16F
F
2
F
MC-16L
2
F
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".
63
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.1Setting Operating Environment
This section explains the operating environment setup.
■ Setting Operating Environment
For the emulator debugger for the MB2141, it is necessary to set the following operating environment.
Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required
when using the default settings. Adjusted settings can be used as new default settings from the next time.
- MCU operation mode
- Debug area
- Memory mapping
- Timer minimum measurement unit
64
2.2.1.1MCU Operation Mode
There are two MCU operation modes as follows:
• Debugging Mode
• Native Mode
■ Setting MCU Operation Mode
Set the MCU operation mode.
There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET
RUNMODE command.
At emulator start-up, the MCU is in the debugging mode.
When the MCU operation mode is changed, all the following are initialized:
- Data breakpoints
- E vent condition settings
- S equencer settings
- Trace measurement settings and trace buffer
CHAPTER 2 DEPENDENCE FUNCTIONS
- Performance measurement settings and measured result
● Debugging Mode
All the operations of evaluation chips can be analyzed, but their operating speed is slower than that of massproduced chips.
● Native Mode
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
2
MC-16/16H
F
Common to all series - When a data read access occurs on the MCU internal bus, the internal bus
- Memory mapping setting is disabled and each area is accessed to the MCU
specifications.
- Traces cannot be disassembled.
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.
65
CHAPTER 2 DEPENDENCE FUNCTIONS
■ MCU Operation Speed
To support a broader range of MCU operation speeds, the emulator adjusts control of the MCU according to
the MCU operation speed.
Normally, set the low-speed operation mode. If the F
malfunctions occur, change the setting to the high-speed operation mode.
Also, to start at low speed and then change to high speed because of the gear setting, etc., use the SET
RUNMODE command to change the setting.
2
MC-16H/16F series is operated at high speed and
66
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.1.2Debug Area
Set the intensive debugging area out of the whole memory space. The area functions are
enhanced.
■ Setting Debug Area
There are two debug areas: DEBUG1, and DEBUG2. A continuous 512KB area (8 banks) is set for each
area.
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 b reakpoints 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.
67
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.1.3Memory Area Types
A unit in which memory is allocated is called an area. There are seven different area
types.
■ Memory Area Types
A unit to allocate memory is allocated is called an area. There are seven different area types as follows:
- User Memory Area
Memory space in the user system is called the user memory area and this memory is called the user
memory. 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).
2
To set the user memory area, use the SET MAP command. The F
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.
MC-16/16H only allows this setup in
Note:
68
Even if the MCU internal resources are set as emulation memory area, access is made to the internal
2
resources. The F
- Mirror Area
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.
MC-16/16H only allows this setup in the debugging mode.
Note:
Note:
CHAPTER 2 DEPENDENCE FUNCTIONS
When the F
2
MC-16/16H is used, mirror area setup can be performed only in the debu gging mode.
- Internal ROM Area
The area where the emulator internal memory is substituted for internal ROM is called the in ternal 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 automa tically 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.
Note that the debug information is only enabled for either one (one specified when linked). To debug onl y
the internal ROM image area, change the creation type of the load module file.
Note:
Note:
The internal memory area, it is set a suitable area automa tically by the selected MCU.
- Internal Instruction RAM Area (F2MC-16H only)
Some types of MCUs have the internal instruction RAM, and this area is call ed 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 automa tically by the selected MCU.
- Undefined Area
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.
69
CHAPTER 2 DEPENDENCE FUNCTIONS
Note:
2
The F
MC-16/16H only allows this setup in the debugging mode.
70
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.1.4Memory Mapping
Memory space can be allocated to the user memory, the emulation memory, etc., and the
attributes of these areas can be specified.
However, the MCU internal resources are not dependent on this mapping setup and
access is always made to the internal resources.
■ Access Attributes for Memory Areas
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
Area Attribute Description
User Memory
Emulation Memory
Undefined GUARD Access Disabled
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 f or 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.
■ Creating and Viewing Memory Map
Use the following commands for memory mapping.
SET MAP:Set memory map.
SHOW MAP:Display memory map.
CANCEL MAP:Ch ange mem or y map setting to undef ined .
CODE Instruction Execution Enabled
READ Data Read Enabled
WRITE Data Write Enabled
NOGUARD No check of access attribute
71
CHAPTER 2 DEPENDENCE FUNCTIONS
[Example]
>SHOW MAP
addressattributetype
000000 .. FFFFFFnoguard
The rest of setting area numbers
user = 8emulation = 5
>SET MAP/USER H'0..H'1FF
>SET MAP/READ/CODE/EMULATION H'FF0000..H'FFFFFF
>SET MAP/USER H'8000..H'8FFF
>SET MAP/MIRROR/COPY H'8000..H'8FFF
>SET MAP/GUARD
>SHOW MAP
addressattributetype
000000 .. 0001FFread writeuser
000200 .. 007FFFguard
008000 .. 008FFFread writeuser
009000 .. FEFFFFguard
FF0000 .. FFFFFFread write codeemulation
mirror address area
008000 .. 008FFFcopy
The rest of setting area numbers
user = 6emulation = 3
>
■ Internal ROM Area Setting
The [Setup Map] dialog box is displayed using [En vir onment] - [Debug ger Memo ry Map] m enu. Yo u 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)
72
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.
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.1.5Timer Minimum Measurement Unit
The timer minimum measurement unit affects the sequencer, the emulation timer and the
performance measurement timer.
■ Setting Timer Minimum Measurement Unit
Choose either 1 μs or 100 ns as the timer minimum measurement unit for the emulator for measuring time.
The minimum measurement unit for the following timers is changed dep en ding on this setup.
• Timer values of sequencer (timer conditions at each level)
• Emulation timer
• Performance measurement timer
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 Le ngth 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.
SET TIMERSCALE :Sets minimum measurement unit for timers
SHOW TIMERSCALE :Displays status of minimum measurement unit setting for timers
When using commands to execute a program, there are several points to note.
■ Notes on GO Command
For the GO command, two breakpoints that are valid only while executing commands can be set. However, it
is required to be careful in setting these breakpoints.
- Invalid Breakpoints
No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
PCB
2
MC-16L/16LX/16/16H
F
2
MC-16F
F
- N o break occurs when breakpoint set at address other than starting address of instruction.
- No break occurs when both following conditions met at one time.
- I nstruction for which breakpoint set starts from odd-address,
- P receding 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).
NCC
SPB
MOV ILM,#imm8
OR CCR,#imm8
PCB
NCC
SPB
DTB
ADB
CNR
AND CCR,#imm8
POPW PS
DTB
ADB
CNR
74
CHAPTER 2 DEPENDENCE FUNCTIONS
- Abnormal Breakpoint
Setting a breakpoint at the instruction immediately after string instructions listed below, may cause a
break in the middle of the string instruction without executing the instruction to the end.
2
MC-16L/16LX/16/16H
F
2
MC-16F
F
■ Notes on STEP Command
- Exceptional Step Execution
When executing the instructions listed in the notes on the GO command as invalid breakpoints and
abnormal breakpoints, such instructions and the next instruction are executed as a single instruction.
Furthermore, if such instructions are continuous, then all these continuous instructions and the next
instruction are executed as a single instruction.
- Step Execution that won't Break
Note that no break occurs after step operation when both the following conditions are met at one time.
- When step instruction longer than 2 bytes and last code ends at even address
- W hen breakpoint already set at last address (This "already-set" breakpoint is an invalid b reakpoint that
won't break, because it has been set at an address other than the starting address of an instruction.)
MOVS
SECQ
WBTS
MOVSWI
SECQWI
MOVSD
SECQD
FILS
FILSW
MOVS
SECQ
WBTS
MOVSWI
SECQWI
MOVSD
SECQD
FILS
FILSW
MOVM
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.
- E NABLE WATCHDOG: Reset generated by watchdog timer counter overflow
- D ISABLE WATCHDOG: No reset generated by watchdog timer counter overflow
The start-up default in this program is "Reset generated by watchdog timer counter overflow".
[Example]
>DISABLE WATCHDOG
>GO
75
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.3Commands Available during Execution of User Program
This section explains the commands available during the execution of a user program.
■ Commands Available during Execution of User Program
This emulator debugger allows you to use certain commands during the execution of a user program.
For more details, see "■ 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
Line assembly, Disassembly Emulation memory only enabled
Mirror area, Disassembly only enabled
Displaying coverage measurement
data
Displaying event Disabled in performance mode 3.23 SHOW EVENT
Notes:
• The conditions which allow you to use the commands in Table 2.2-4 are limited to the following
cases when a user program is executed.
- [Debug] - [Run] - [Go] menu
- [Go] button on the debug toolbar
The commands in Table 2.2-4 cannot be used when the GO command is entered in the command
window.
• 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)."
-
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
6.1 ASSEMBLE,
6.2 DISASSEMBLE
4.19 SHOW COVERAGE
76
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.4On-the-fly Memory Access
While on-the-fly, the area mapped to the emulation memory is Read/Write enabled, but
the area mapped to the user memory area is Read-only enabled.
■ Read/Write Memory while On-the-fly
The user memory cannot be accessed while on-the-fly (when execute the MCU). However, the emulation
memory can be accessed. (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 onthe-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 onthe-fly.
- Mirror Area
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.
77
CHAPTER 2 DEPENDENCE FUNCTIONS
The following commands access memory.
- Memory operation commands
SET MEMORY, SHOW MEMORY, EXAMINE, ENTER,
COMPARE, FILL, MOVE, SEARCH MEMORY, DUMP,
COPY, VERIFY
- Data load/save commands
LOAD, SAVE
Figure 2.2-1 Access to Mirror Area while MCU Suspended
Executing
command
MCU
operation
(Suspended)
Executing
command
Memory access
Emulation memory
(Mirror setting)
Reflected
User memory
Figure 2.2-2 On-the-fly Access to Mirror Area
Memory read
Emulation memory
(Mirror setting)
Note:
78
Reflected
MCU
operation
(Operating)
Memory access
User memory
Memory access by a bus master other than the MCU is not reflected in the mirror area.
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5Break
In this emulator debugger, seven types of break functions can be used. When the
program execution is aborted by each break function, the address and the break factor to
do the break are displayed.
■ Break Functions
In this emulator debugger, the following seven types of break functions are supported.
• Code break
• Data break
• Sequential break
• Guarded access break
• Trace-buffer-full break
• Performance-buffer-full break
• Forced break
79
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5.1Code Break
It is a function to abort the program execution by observing the specified address. The
break is done before an instruction the specified address is executed.
■ Code Break
It is a function to abort the program execution by observing the specified address. The break is done before
an instruction the specified address is executed. 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.
• Command
- SET BREAK
Refer to "3.1 SET BREAK (type 1)" in "SOFTUNE Workbench Command Reference Manual".
• Dialog
- Breakpoints set dialog [Code] tab
Refer to "4.6.4 Breakpoint" in "SOFTUNE Workbench Operation Manual".
•Window
- S ou rce 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.
• 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.
- I nstruction for which breakpoint set starts from odd-address
- P receding 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.)
• MOV ILM,#imm8 • AND CCR,#imm8
• OR CCR,#imm8 • POPW PS
80
● Abnormal Breakpoint
• Setting a breakpoint at the instruction immediately after string instructions listed below, may cause a
break in the middle of the string instruction without executing the instruction to the end.
Here are some additional points about the effects on other commands.
● Dangerous Breakpoints
Never set a breakpoint at an address other than the instruction starting address. If a breakpoint is the last 1
byte of an instruction longer than 2 bytes length, and if such an address is even, the following abnormal
operation will result:
- If instruction executed by STEP command, instruction execution not aborted.
- If breakpoint specified with GO command, set at instruction immediately after such instruction, the
breakpoint does not break.
CHAPTER 2 DEPENDENCE FUNCTIONS
• MOVSI• MOVSWI• SECQI• SECQWI• WBTC
• MOVSD• MOVSWD• SECQD• SECQWD
• FILS• FILSI• FILSW• FILSWI
Note:
When the debugging area is set again, all breakpoints in the area are cleared.
81
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5.2Data Break
The data break is a function to abort the program execution when the data access (read
or write) is done to the address specified while executing the program.
■ Data Break
The data break is a function to abort the program execution when MCU accesses data as for a specified
address.
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.
Note:
• Command
- SET DATABREAK
Refer to "3.10 SET DATABREAK (type 2)" in "SOFTUNE Workbench Command Reference
Manual".
• Dialog
- 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.
82
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5.3Sequential Break
A sequential break is a function to abort a executing program, when the sequential
condition is met by event sequential control.
■ Sequential Break
It is a function to discontinue the program execution wh en the sequential condit ion 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".
■ Setting Method
The sequential break is controlled by the following method.
1. Set event mode (SET MODE)
2. Set events (SET EVENT)
3. Set sequencer (SET SEQUENCE)
83
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5.4Guarded Access Break
The guarded access break is an abortion of the program execution that happens when
the violation to the set access attribute, doing the access, and guarded (An undefined
area cannot be accessed) area are accessed.
■ Guarded Access Break
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.
Code guarded
When the instruction execution is done to the area without the code attribute, the break is done.
Read guarded
When the area without the read attribute is read, the break is done.
Write guarded
Note:
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.
2
The F
mapping, set a little larger area (5 bytes max.) than the program area actually used.
Similarly, the F
set a little larger area (9 bytes max.) than the program area actually used.
MC-16L/16LX/16/16H family pre-fetch up to 4 bytes. So, when setting the program area
2
MC-16F family pre-fetch up to 8 bytes. So, when setting the program area mapping,
84
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5.5Trace-Buffer-Full Break
It is a function to abort the program execution when the trace buffer becomes full.
■ Trace-Buffer-Full Break
It is a function to abort the program execution when the trace buffer becomes full.
When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar.
Break at Address by trace buffer full
■ Setting Method
The trace-buffer-full break is controlled by the following method.
• Command
- SET TRACE/BREAK
Refer to "4.29 SET TRACE (type 1)" in "SOFTUNE Workbench Command Reference Manual".
• Dialog
- Trace Set Dialog
Refer to "4.4.8 Trace" in "SOFTUNE Workbench Operation Manual".
85
CHAPTER 2 DEPENDENCE FUNCTIONS
2.2.5.6Performance-Buffer-Full Break
It is a function to abort the program execution when the buffer for the performance
measurement data storage becomes full.
■ Performance-Buffer-Full Break
It is a function to abort the program execution wh en 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.
• Command
- SET PERFORMANCE/BREAK
Refer to "4.7 SET PERFORMANCE (type 1)" in "SOFTUNE Workbench Command Reference
Manual".
• Dialog
- Performance set dialog
Refer to "4.4.13 Performance" in "SOFTUNE Workbench Operation Manual".
86
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.