FUJITSU SEMICONDUCTOR CONTROLLER MANUAL CM41-00313-6E F2MC-16 FAMILY SOFTUNETM Workbench USER'S MANUAL
F2MC-16 FAMILY SOFTUNETM Workbench USER'S MANUAL FUJITSU SEMICONDUCTOR LIMITED
PREFACE ■ What is the SOFTUNE Workbench? SOFTUNE Workbench is support software for developing programs for the F2MC-16 family of microprocessors / microcontrollers. It is a combination of a development manager, simulator debugger, emulator debugger, monitor debugger, and an integrated development environment for efficient development. ■ Purpose of this manual and target readers This manual explains functions of SOFTUNE Workbench.
• • • • • • • 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.
READING THIS MANUAL ■ Configuration of Page In each section of this manual, the summary about the section is described certainly, so you can grasp an outline of this manual if only you read these summaries. And the title of upper section is described in lower section, so you can grasp the position where you are reading now.
iv
CONTENTS CHAPTER 1 BASIC FUNCTIONS ..................................................................................... 1 1.1 Workspace Management Function ..................................................................................................... 2 1.2 Project Management Function ............................................................................................................ 3 1.3 Project Dependence ..................................................................................
2.1.11.3 Searching Trace Data ............................................................................................................... 55 2.1.11.4 Saving Trace Data .................................................................................................................... 56 2.1.12 Measuring Coverage ................................................................................................................... 57 2.1.12.1 Coverage Measurement Procedures ..................................
2.2.10.1 Coverage Measurement Procedures ...................................................................................... 2.2.11 Execution Time Measurement ................................................................................................... 2.2.12 Sampling by External Probe ...................................................................................................... 2.2.13 Checking Debugger Information ............................................................................
2.4.1 Setting Operating Environment ................................................................................................. 2.4.1.1 Monitoring Program Automatic Loading ................................................................................. 2.4.1.2 MCU Operation Mode ............................................................................................................. 2.4.1.3 Debug Area ...............................................................................................
2.5.7 Measuring Performance ............................................................................................................ 2.5.7.1 Performance Measurement Procedures ................................................................................. 2.5.7.2 Display Performance Measurement Data ............................................................................... 2.5.8 Execution Time Measurement ............................................................................................
x
CHAPTER 1 BASIC FUNCTIONS This chapter describes the basic functions on the SOFTUNE Workbench. 1.1 Workspace Management Function 1.2 Project Management Function 1.3 Project Dependence 1.4 Make/Build Function 1.5 Include Dependencies Analysis Function 1.6 Functions of Setting Tool Options 1.7 Error Jump Function 1.8 Editor Functions 1.9 Storing External Editors 1.10 Storing External Tools 1.11 Macro Descriptions Usable in Manager 1.12 Setting Operating Environment 1.13 Debugger Types 1.
CHAPTER 1 BASIC FUNCTIONS 1.1 Workspace Management Function This section explains the workspace management function of SOFTUNE Workbench. ■ Workspace SOFTUNE Workbench uses workspace as a container to manage two or more projects including subprojects. For example, a project that creates a library and a project that creates a target file using the project can be stored in one workspace.
CHAPTER 1 BASIC FUNCTIONS 1.2 Project Management Function This section explains the project management function of SOFTUNE Workbench. ■ Project Management Function The project manages all information necessary for development of a microcontroller system. Especially, its major purpose is to manage information necessary for creation of a target file.
CHAPTER 1 BASIC FUNCTIONS level of a compiler and MCU setting, can be created within one project.
CHAPTER 1 BASIC FUNCTIONS 1.3 Project Dependence This section explains the project dependence of SOFTUNE Workbench. ■ Project Dependence If target files output by other projects must be linked, a subproject is defined in the project required in [Project] - [Project Dependence] menu. The subproject is a project on which other projects depend. By defining project dependence, a subproject can be made and built to link its target file before making and building the parent project.
CHAPTER 1 BASIC FUNCTIONS 1.4 Make/Build Function This section explains the make/build function of SOFTUNE Workbench. ■ Make Function Make function generates a target file by compiling/assembling only updated source files from all source files registered in a project, and then joining all required object files. This function allows compiling/assembling only the minimum of required files. The time required for generating a target file can be sharply reduced, especially, when debugging.
CHAPTER 1 BASIC FUNCTIONS 1.4.1 Customize Build Function This section describes the SOFTUNE Workbench to set the Customize Build function. ■ Customize Build function In SOFTUNE Workbench, different tools can be operated automatically before and after executing the Assembler, Compiler, Linker, Librarian, Converter, or Configurator started at Compile, Assemble, Make, or Build.
CHAPTER 1 BASIC FUNCTIONS Note: When checking [Use the Output window], note the following: • Once a tool is activated, Make/Build is suspended until the tool is terminated. • The Output window must not be used with a tool using a wait state for user input while the tool is executing. The user can not perform input while the Output window is in use, so the tool cannot be terminated. To forcibly terminate the tool, select the tool on the Task bar and input Control - C, or Control - Z.
CHAPTER 1 BASIC FUNCTIONS 1.5 Include Dependencies Analysis Function This section describes the function of the Include Dependencies Analysis of SOFTUNE Workbench. ■ Analyzing Include Dependencies A source file usually includes some include files. When only an include file has been modified leaving a source file unchanged, SOFTUNE Workbench cannot execute the Make function unless it has accurate and updated information about which source file includes which include files.
CHAPTER 1 BASIC FUNCTIONS 1.6 Functions of Setting Tool Options This section describes the functions to set options for the language tools activated from SOFTUNE Workbench. ■ Function of Setting Tool Options To create a desired target file, it is necessary to specify options for the language tools such as a compiler, assembler, and linker. SOFTUNE Workbench stores and manages the options specified for each tool in project configurations.
CHAPTER 1 BASIC FUNCTIONS 1.7 Error Jump Function This section describes the error jump function in SOFTUNE Workbench. ■ Error Jump Function When an error, such as a compile error occurs, double-clicking the error message displayed in the Output window, opens the source file where the error occurred, and automatically moves the cursor to the error line. This function permits efficient removal of compile errors, etc.
CHAPTER 1 BASIC FUNCTIONS [Example] *** %f(%l) %h: or, %[*] %f(%l) %h: The first four characters are "*** ", followed by the file name and parenthesized page number, and then the keyword for help continues after one blank character. This represents the following message: ***C :\Sample\sample.c(100) ■ Reference Section Setup Error Jump 12 E4062C: Syntax Error: near /int.
CHAPTER 1 BASIC FUNCTIONS 1.8 Editor Functions This section describes the functions of the SOFTUNE Workbench built-in standard editor. ■ Standard Editor SOFTUNE Workbench has a built-in editor called the standard editor. The standard editor is activated as the Edit window in SOFTUNE Workbench. As many Edit windows as are required can be opened at one time. The standard editor has the following functions in addition to regular editing functions.
CHAPTER 1 BASIC FUNCTIONS 1.9 Storing External Editors This section describes the function to set an external editor to SOFTUNE Workbench. ■ External Editor SOFTUNE Workbench has a built-in standard editor, and use of this standard editor is recommended. However, another accustomed editor can be used, with setting it, instead of an edit window. There is no particular limit on which editor can be set, but some precautions (below) may be necessary.
CHAPTER 1 BASIC FUNCTIONS 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 %x Means specifying project path ■ Example of Optional Settings Table 1.9-2 Example of Optional Settings Editor name Argument WZ Editor V4.0 %f /j%l MIFES V1.0 %f+%l UltraEdit32 %f/%l/1 TextPad32 %f(%l) PowerEDITOR %f -g%l Codewright32 %f -g%l Hidemaru for Win3.
CHAPTER 1 BASIC FUNCTIONS 1.10 Storing External Tools This section describes the function to set an external tool to SOFTUNE Workbench. ■ External Tools A non-standard tool not attached to SOFTUNE Workbench can be used by setting it as an external tool and by calling it from SOFTUNE Workbench. Use this function to coordinate with a source file version control tool.
CHAPTER 1 BASIC FUNCTIONS 1.11 Macro Descriptions Usable in Manager This section explains the macro descriptions that can be used in the manager of SOFTUNE Workbench. ■ Macros SOFTUNE Workbench has special parameters indicating that any file name and tool-specific options are specified as options. The use of these parameters as tool options eliminates the need for options specified each time each tool is started.
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.
CHAPTER 1 BASIC FUNCTIONS - Tool options • Null character - Others 1. File as focus is on the SRC tab of project window and valid file name is selected 2. File on which focus is in internal editor as no valid file name can be obtained in 1 3. Null character if no valid file name can be obtained The macros in (*2) are determined as follows: - Customize build and tool options • Information on configuration of project under building, making, compiling and assembling - Others 1.
CHAPTER 1 BASIC FUNCTIONS [Example] Macro expansion in external tools Focus is on Subprj project file in the SRC tab of project window. %a : C:\Subprj\Release\Abs\Subprj.abs %A : SUBPRJ.abs %D : C:\Subprj\Release\Abs\ %E : .abs %(FILE[FOLDER]) : Source Files\Common %(PRJFILE) : C:\Subprj\Subprj.prj Focus is not in the SRC tab of project window. %a : C:\Wsp\Sample\Debug\Abs\Sample.abs %A : Sample.abs %D : C:\Wsp\Sample\Debug\Abs\ %(PRJFILE) : C:\Wsp\Sample\Sample.
CHAPTER 1 BASIC FUNCTIONS 1.12 Setting Operating Environment This section describes the functions for setting the SOFTUNE Workbench operating environment. ■ Operating Environment Set the environment variables for SOFTUNE Workbench and some basic setting for the Project. To set the operating environment, use the [Setup]-[Setup Development Environment] menu. ● Environment Variables Environment variables are variables that are referred to mainly using the language tools activated from SOFTUNE Workbench.
CHAPTER 1 BASIC FUNCTIONS 1.13 Debugger Types This section describes the types of SOFTUNE Workbench debuggers. ■ Type of Debugger SOFTUNE Workbench integrates three types of debugger: a simulator debugger, emulator debugger, and monitor debugger. Any one can be selected depending on the requirement. ■ Simulator Debugger The simulator debugger simulates the MCU operations (executing instructions, memory space, I/O ports, interrupts, reset, etc.) with software to evaluate a program.
CHAPTER 1 BASIC FUNCTIONS 1.14 Memory Operation Functions This section describes the memory operation functions. ■ Functions for Memory Operations - Display/Modify memory data Memory data can be display in the Memory window and modified. - Fill The specified memory area can be filled with the specified data. - Copy The data in the specified memory area can be copied to another area. - Compare The data in the specified source area can be compared with data in the destination area.
CHAPTER 1 BASIC FUNCTIONS 1.15 Register Operations This section describes the register operations. ■ Register Operations The Register window is opened when the [View] - [Register] menu is executed. The register and flag values can be displayed in the Register window. For further details about modifying the register value and the flag value, refer to "4.4.4 Register" in "SOFTUNE Workbench Operation Manual".
CHAPTER 1 BASIC FUNCTIONS 1.16 Line Assembly and Disassembly This section describes line assembly and disassembly. ■ Line Assembly To perform line-by-line assembly (line assembly), right-click anywhere in the Disassembly window to display the short-cut menu, and select [Line Assembly]. For further details about assembly operation, refer to "4.4.3 Assembly" in "SOFTUNE Workbench Operation Manual". ■ Disassembly To display disassembly, use the [View]-[Disassembly] menu.
CHAPTER 1 BASIC FUNCTIONS 1.17 Symbolic Debugging The symbols defined in a source program can be used for command parameters (address). There are three types of symbols as follows: • Global Symbol • Static Symbol within Module (Local Symbol within Module) • Local Symbol within Function ■ Types of Symbols A symbol means the symbol defined while a program is created, and it usually has a type. Symbols become usable by loading the debug information file.
CHAPTER 1 BASIC FUNCTIONS ■ Line Number Information Line number information is set with the line number information table in SOFTUNE Workbench when a debug information file is loaded. Once registered, such information can be used at anytime thereafter.
CHAPTER 1 BASIC FUNCTIONS 1.17.1 Referring to Local Symbols This section describes referring to local symbols and Scope. ■ Scope When a local symbol is referred to, Scope is used to indicate the module and function to which the local symbol to be referred belongs. SOFTUNE Workbench automatically scopes the current module and function to refer to local symbols in the current module with preference.
CHAPTER 1 BASIC FUNCTIONS 1.17.2 Referring to Variable of C Language C language variables can be specified using the same descriptions as in the source program written in C language. ■ Specifying C Language Variables C language variables can be specified using the same descriptions as in the source program. The address of C language variables should be preceded by the ampersand symbol "&". Some examples are shown in the Table 1.17-1. Table 1.
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.
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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1 Simulator 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.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Simulation Range The simulator debugger simulates the MCU operations (instruction operations, memory space, I/O ports, interrupts, reset, power-save consumption mode, etc.) Peripheral I/Os, such as a timer, DMAC and serial I/O, other than the CPU core of the actual chip are not supported as peripheral resources. I/O space to which peripheral I/Os are connected is treated as memory space.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the simulator debugger for 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.1.1 Boot 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.2 Instruction Simulation This section describes the instruction simulation executed by SOFTUNE Workbench. ■ Instruction Simulation This simulates the operations of all instructions supported by the F2MC-16/16L/16LX/16H/16F. It also simulates the changes in memory and register values due to such instructions.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.3 Memory Simulation This section describes the memory simulation executed by SOFTUNE Workbench. ■ Memory Simulation The simulator debugger must first secure memory space to simulate instructions because it simulates the memory space secured in the host PC memory. The following operation is required. - To secure the memory area, either use the [Setup] - [Memory Map] menu, or the SET MAP command in the Command window.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.4 I/O Port Simulation This section describes I/O port simulation executed by SOFTUNE Workbench. ■ I/O Port Simulation (Input Port) There are two types of simulations in I/O port simulation: input port simulation, and output port simulation. Input port simulation has the following types: - Whenever a program reads the specified port, data is input from the pre-defined data input source.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.5 Interrupt Simulation This section describes the interrupt simulation executed by SOFTUNE Workbench. ■ Interrupt Simulation Simulate the operation of the MCU (including intelligent I/O service*) in response to an interrupt request. Note that intelligent I/O service does not support any end request from the resource. Provisions for the causes of interrupts and interrupt control registers are made by referencing data in the install file read at simulator start up.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.6 Reset Simulation This section describes the reset simulation executed by SOFTUNE Workbench. ■ Reset Simulation The simulator debugger simulates the operation when a reset signal is input to the MCU using the [Debug][Reset MCU] menu and initializes the registers. The function for performing reset processing by operation of MCU instructions (writing to RST bit in standby control register) is also supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.7 Low-Power Consumption Mode Simulation This section describes the low-power consumption SOFTUNE Workbench mode simulation executed by SOFTUNE Workbench. ■ Low-Power Consumption Mode Simulation The MCU enters the low-power consumption mode in accordance with the MCU instruction operation (Write to SLEEP bit or STOP bit of standby control register).
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.8 STUB Function This section describes the STUB function which executes commands automatically when the breakpoint hit occurs. ■ STUB Function The STUB function is supported so that a series of commands in the command list can automatically be executed when a specified breakpoint is hit. The use of this function enables spot processing, such as simple I/O simulation, external interrupt generation, and memory reprogramming, without changing the main program.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9 Break In the simulator debugger, five types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this simulator debugger, the following five types of break functions are supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.1 Code Break It is a function that the simulator debugger aborts the program execution when the code access specified while executing the program is done. ■ Flow of Code Break When the program reaches the breakpoint (Immediately before an instruction memory positional is executed), the simulator debugger does the following processing. 1) The execution of the program is aborted (Before executing the instruction).
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 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 2.1.9.2 Data Break It is a function that the simulator debugger aborts the program execution when the data access (read and write) specified while executing the program is done. ■ Flow of Data Break The simulator debugger does the following processing when the program writes in the breakpoint or it reads it. 1) After the execution of the instruction is completed, the execution of the program is aborted.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.3 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■ Setting Method The trace-buffer-full break is controlled by the following method.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.4 Guarded Access Break It is a function to abort the program execution when the violation to the access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed. ■ Guarded Access Break It is a function to abort the program execution when the violation to the access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed. Guarded access break functions as follows.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.9.5 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.10 Measuring Execution Cycle Count This function measures the program execution cycle count. ■ Measurement Items Measures program execution cycle count and step counts. ● Execution Cycle Count This is calculated based on the basic cycle count of each instruction described in the Programming Manual. A compensation value (a, b), which is described in the list of an instruction in Programming Manual, is calculated as 1.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11 Trace The address and status information can be sampled during program execution to record it in a trace buffer. This function is called a trace. ■ Trace The address and status information can be sampled during program execution to record it in a trace buffer. This function is called a trace. 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11.1 Setting Trace You must set the following two items to perform a trace. After that, trace data will be sampled with the execution of the program. ■ Setting Trace 1. Enable the trace function. This program will startup and will be enabled. • 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11.2 Displaying Trace Data Data recorded in the trace buffer can be displayed. ■ Displaying Trace Data The trace window or command window displays how much trace data is stored in the trace buffer. • Trace window Select [Refresh] in the trace window shortcut menu. • 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11.3 Searching Trace Data The trace buffer can be searched to locate target data. ■ Searching Trace Data The trace buffer has 1000 frames, so the target data may not be found immediately. Therefore the trace data can be searched from data in the trace buffer by specifying an address. ■ 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.11.4 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Saving Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2. Specify the name of the file in which to save trace data.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.12 Measuring Coverage In the high-speed version simulator debugger, the C0 coverage measurement function is provided. Use this function to find what percentage of an entire program has been executed. ■ Coverage Measurement Function When testing a program, the program is executed with various test data input and the results are checked for correctness. When the test is finished, every part of the entire program should have been executed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.12.1 Coverage Measurement Procedures The procedure for coverage measurement is as follows: • Set range for coverage measurement:SET COVERAGE • Measure coverage:GO, STEP, CALL • Display measurement result:SHOW COVERAGE ■ Setting Range for Coverage Measurement Use the SET COVERAGE command to set the measurement range. Up to 32 ranges can be specified. By specifying /AUTOMATIC for the command qualifier, the code area for the loaded module is set automatically.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Summary (Specify /GENERAL for command qualifier) >SHOW COVERAGE/GENERAL (HEX)0X0 +1X0 +2X0 +---------------+---------------+-----address 0123456789ABCDEF0123456789ABCDEF0123456 FF0000 **3*F*....... -----... ABCDEF C0(%) 32.0 Display the access status of every 16 addresses . : No access 1 to F : Display the number accessed in 16 addresses by the hexadecimal number. : Access all of the 16 addresses.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Displays per source line (specify /SOURCE for the command qualifier) >SHOW COVERAGE/SOURCE main * 70: { 71: int i; 72: struct table *value[16]; 73: * 74: for (i=0; i<16; i++) * 75: value[i] = &target[i]; 76: sort_val(value, 16L); * 77: . 78: } Displays execution status of each source line. .
CHAPTER 2 DEPENDENCE FUNCTIONS 2.1.13 Checking 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.
CHAPTER 2 DEPENDENCE FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - Language Tools - F2MC-16 Family SOFTUNE C Compiler version File Path: fcc907s.exe path - F2MC-16 Family SOFTUNE Assembler version File Path: fasm907s.exe path - F2MC-16 Family SOFTUNE Linker version File Path: flnk907s.exe path - F2MC-16 Family SOFTUNE Librarian version File Path: flib907s.exe path - SOFTUNE FJ-OMF to S-FORMAT Converter version File Path: f2ms.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2 Emulator Debugger (MB2141) This section explains the functions of the emulator debuggers for the MB2141. ■ Emulator Debugger When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2141 has been selected.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2141, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings. Adjusted settings can be used as new default settings from the next time.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1.1 MCU Operation Mode There are two MCU operation modes as follows: • Debugging Mode • Native Mode ■ Setting MCU Operation Mode Set the MCU operation mode. There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET RUNMODE command. At emulator start-up, the MCU is in the debugging mode.
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 F2MC-16H/16F series is operated at high speed and malfunctions occur, change the setting to the high-speed operation mode. Also, to start at low speed and then change to high speed because of the gear setting, etc., use the SET RUNMODE command to change the setting.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1.2 Debug Area Set the intensive debugging area out of the whole memory space. The area functions are enhanced. ■ Setting Debug Area There are two debug areas: DEBUG1, and DEBUG2. A continuous 512KB area (8 banks) is set for each area. Set the debug area using the SET DEBUG command. Setting the debug area enhances the breakpoints/data breakpoints and the coverage measurement function.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1.3 Memory Area Types A unit in which memory is allocated is called an area. There are seven different area types. ■ Memory Area Types A unit to allocate memory is allocated is called an area. There are seven different area types as follows: - User Memory Area Memory space in the user system is called the user memory area and this memory is called the user memory. Up to eight user memory areas can be set with no limit on the size of each area.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: When the F2MC-16/16H is used, mirror area setup can be performed only in the debugging mode. - Internal ROM Area The area where the emulator internal memory is substituted for internal ROM is called the internal ROM area, and this memory is called the internal ROM memory. Only one internal ROM area with a size up to 128 KB can be specified. The internal ROM area is capable to set by the "Setup Map" dialog opening by "Debugger Memory Map... " from "Setup".
CHAPTER 2 DEPENDENCE FUNCTIONS Note: The F2MC-16/16H only allows this setup in the debugging mode.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1.4 Memory Mapping Memory space can be allocated to the user memory, the emulation memory, etc., and the attributes of these areas can be specified. However, the MCU internal resources are not dependent on this mapping setup and access is always made to the internal resources. ■ Access Attributes for Memory Areas The access attributes shown in Table 2.2-2 can be specified for memory areas.
CHAPTER 2 DEPENDENCE FUNCTIONS [Example] >SHOW MAP address attribute 000000 .. FFFFFF noguard type The rest of setting area numbers user = 8 emulation = 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 address attribute type 000000 .. 0001FF read write user 000200 .. 007FFF guard 008000 .. 008FFF read write 009000 .. FEFFFF guard FF0000 ..
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.1.5 Timer Minimum Measurement Unit The timer minimum measurement unit affects the sequencer, the emulation timer and the performance measurement timer. ■ Setting Timer Minimum Measurement Unit Choose either 1 μs or 100 ns as the timer minimum measurement unit for the emulator for measuring time. The minimum measurement unit for the following timers is changed depending on this setup.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, it is required to be careful in setting these breakpoints. - Invalid Breakpoints No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual". The double circle indicates that it is available during the execution of a user program. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.4 On-the-fly Memory Access While on-the-fly, the area mapped to the emulation memory is Read/Write enabled, but the area mapped to the user memory area is Read-only enabled. ■ Read/Write Memory while On-the-fly The user memory cannot be accessed while on-the-fly (when execute the MCU). However, the emulation memory can be accessed. (The using cycle-steal algorithm eliminates any negative effect on the MCU speed.
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 Memory access Executing command Emulation memory (Mirror setting) Reflected MCU operation (Suspended) User memory Figure 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5 Break In this emulator debugger, seven types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this emulator debugger, the following seven types of break functions are supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.1 Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed. ■ Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed. It is possible to set it in this 65535 debuggers. However, it is necessary to set the debugging area as a code break area.
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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.2 Data Break The data break is a function to abort the program execution when the data access (read or write) is done to the address specified while executing the program. ■ Data Break The data break is a function to abort the program execution when MCU accesses data as for a specified address. When a break occurs due to a data break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.3 Sequential Break A sequential break is a function to abort a executing program, when the sequential condition is met by event sequential control. ■ Sequential Break It is a function to discontinue the program execution when the sequential condition consists by the sequential control of the event. Use a sequential break when the event mode is set to normal mode using the SET MODE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.4 Guarded Access Break The guarded access break is an abortion of the program execution that happens when the violation to the set access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.5 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■ Setting Method The trace-buffer-full break is controlled by the following method.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.6 Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. ■ Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. When a break occurs due to a performannce-buffer-full break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.5.7 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6 Events The emulator can monitor the MCU bus operation, and generate a trigger at a specified condition called an event. In this emulator, event triggers are used in order to determine which function event triggers are used accounting to event modes for the following functions; • Sequencer • Sampling condition for multi-trace • Measuring point in performance measurement ■ Setting Events Eight events or less can be set. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS [Example] >SET EVENT 1,func1 >SET EVENT/WRITE 2,data[2],!d=h'10 >SET EVENT/MODIFY 3,102 An event can be set in the Event window as well. ■ Event Modes There are three event modes as listed below. To determine which function event triggers are used for, select one using the SET MODE command. The default is normal mode. The event value setting are made for each mode, so switching the event mode changes the event settings as well.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6.1 Operation in Normal Mode As shown in the figure below, the event trigger set in the normal mode performs input to the sequencer. In the sequencer, either branching to any level, or terminating the sequencer, can be specified as an operation at event trigger occurrence. This enables debugging (breaks, limiting trace, measuring time) while monitoring program flow. ■ Operation in Normal Mode The termination of sequencer triggers the delay counter.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Event-related Commands in Normal Mode Since the real-time trace function in the normal mode is actually the single trace function, the commands can be used to control. Table 2.2-6 shows the event-related commands that can be used in the normal mode. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6.2 Operation in Multi Trace Mode When the multi trace mode is selected as the event mode, the real-time trace function becomes the multi trace function, and events are used as triggers for multitracing. ■ Operation in Multi Trace Mode Multitracing is a trace function that samples data before and after an event trigger occurrence.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Event-related Commands in Multi Trace Mode Table 2.2-7 shows the event-related commands that can be used in the multi-race mode. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.6.3 Operation in Performance Mode Event triggers set in the performance mode are used to measure performance. The time duration between two event occurrences can be measured and the event occurrences can be counted. ■ Operation in Performance Mode The event triggers that are set in the performance mode are used to measure performance. The time duration between two event occurrences can be measured and the event occurrences can be counted. Figure 2.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Event-related Commands in Performance Mode Table 2.2-8 shows the event-related commands that can be used in the performance mode. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7 Control by Sequencer This emulator has a sequencer to control events. By using this sequencer, sampling of breaks, time measurement and tracing can be controlled while monitoring program flow (sequence). A break caused by this function is called a sequential break. To use this function, set the event mode to normal mode using the SET MODE command. Use the SET EVENT command to set events. ■ Control by Sequencer As shown in Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.1 Setting Sequencer The sequencer operates in the following order: (1) The sequencer starts from level 1 simultaneously with the start of program executing. (2) Depending on the setting at each level, branching to the required level is performed when the condition is met. (3) When sequencer termination is specified, the sequencer terminates when the condition is met. (4) When the sequencer terminates, the delay counter starts counting. ■ Setting Sequencer Figure 2.
CHAPTER 2 DEPENDENCE FUNCTIONS [Setup Examples] - Terminate sequencer when event 1 occurs. >SET SEQUENCE/EVENT 1,1,J=0 - Terminate sequencer when event 2 occurs 16 times. >SET SEQUENCE/EVENT 1,2,16,J=0 - Terminate sequencer when event 2 occurs after event 1 occurred. However, do not terminate sequencer if event 3 occurs between event 1 and event 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.2 Break by Sequencer A program can suspend program execution when the sequencer terminates. This break is called a sequential break. ■ Break by Sequencer A program can suspend program execution when the sequencer terminates. This break is called a sequential break. As shown in Figure 2.2-7, the delay count starts when the sequencer terminates, and after delay count ends, either "break" or "not break but tracing only terminates" is selected as the next operation.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.3 Trace Sampling Control by Sequencer When the event mode is in the normal mode, real-time trace executing tracing called single trace. If the trace function is enabled, single trace samples all the data from the start of executing a program until the program is suspended. ■ Trace Sampling Control by Sequencer Sets up suspend/resume trace sampling for each condition at each level of the sequencer. Figure 2.2-8 shows the trace sampling flow.
CHAPTER 2 DEPENDENCE FUNCTIONS [Setup Example] Suspend trace sampling when event 1 occurs, and then resume at event 2 and keep sampling data until event 3 occurs. Start Level 1 Event 1 occurs NO YES Suspend trace sampling. Level 2 Event 2 occurs NO YES Resume trace sampling. Level 3 Event 3 occurs NO YES Suspend trace sampling.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.4 Time Measurement by Sequencer Time can be measured using the sequencer. A time measurement timer called the emulation timer is used for this purpose. When branching is made from a specified level to another specified level, a timer value is specified. Up to two emulation timer values can be fetched. This function is called the timer latch function.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.7.5 Sample Flow of Time Measurement by Sequencer In the following sample, when events are executed in the order of Event 1, Event 2 and Event 3, the execution time from the Event 1 to the Event 3 is measured. However, no measurement is made if Event 4 occurs anywhere between Event 1 and Event 3.
CHAPTER 2 DEPENDENCE FUNCTIONS >SET SEQUENCE/EVENT 1,1,J=2 >SET SEQUENCE/EVENT 2,4,J=1 >SET SEQUENCE/EVENT 2,2,J=3 >SET SEQUENCE/EVENT 3,4,J=1 >SET SEQUENCE/EVENT 3,2,J=0 >SET SEQUENCE/LATCH 1,1,2 >SET SEQUENCE/LATCH 2,3,0 Indicates that, if event 3 occurs at level 3, the sequencer terminates and let the timer latched. >SHOW SEQUENCE Sequencer Enable Indicates that, if event 1 occurs at level 1, move to level 2 and let the timer latched.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.1 Single Trace The single trace traces all data from the start of executing a program until the program is aborted. ■ Function of Single Trace The single trace is enabled by setting the event mode to normal mode using the SET MODE command. The single trace traces all data from the start of executing a program until the program is suspended.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Frame Number and Step Number in Single Trace The sampled trace data is numbered in frame units. This number is called the frame number. When displaying trace data, the starting location in the trace buffer can be specified using the frame number.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.2 Setting Single Trace The following settings (1) to (4) are required before executing single trace. Once these settings have been made, trace data is sampled when a program is executed. (1) Set event mode to normal mode. (2) Enable trace function. (3) Set events, sequencer, and delay count. (4) Set trace-buffer-full break. ■ Setting Single Trace The following settings are required before executing single trace.
CHAPTER 2 DEPENDENCE FUNCTIONS (4) Set trace-buffer-full break. The program can be allowed to break when the trace buffer becomes full. Use the SET TRACE command for this setting. The default is Not Break. Display the setup status using the SHOW TRACE/STATUS command. Table 2.2-10 lists trace-related commands that can be used in the single trace function. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.3 Multi trace The multi trace samples data where an event trigger occurs for 8 frames before and after the event trigger. ■ Multi Trace Function Execute multi trace by setting the event mode to the multi trace mode using the SET MODE command. The multi trace samples data where an event trigger occurs for 8 frames before and after the event trigger. It can be used for tracing required only when a certain variable access occurs, instead of continuous tracing.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.4 Setting Multi Trace Before executing the multi trace, the following settings must be made. After these settings, trace data is sampled when a program is executed. (1) Set event mode to multi trace mode. (2) Enable trace function. (3) Set event. (4) Set trace-buffer-full break. ■ Setting Multi Trace Before executing the multi trace, the following settings must be made. After these settings, trace data is sampled when a program is executed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.5 Displaying Trace Data Storage Status It is possible to Displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command in the single trace mode, and to the SHOW MULTITRACE command in the multi trace mode. ■ Displaying Trace Data Storage Status It is possible to Displays how much trace data is stored in the trace buffer.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.6 Specify Displaying Trace Data Start It is possible to specify from which data in the trace buffer to display. To do so, specify a frame number with the SHOW TRACE command in the single trace mode, or specify either a global number, or a block number and local number with the SHOW MULTITRACE command in the multi trace mode. A range can also be specified.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.7 Display Format of Trace Data A display format can be chosen by specifying a command identifier with the SHOW TRACE command in the single trace, and with the SHOW MULTITRACE command in the multi trace. The source line is also displayed if "Add source line" is selected using the SET SOURCE command. There are three formats to display trace data: • Display in instruction execution order (Specify /INSTRUCTION.) • Display all machine cycles (Specify /CYCLE.
CHAPTER 2 DEPENDENCE FUNCTIONS Address Hexadecimal Disassemble Description Indecates instruction executed Step Number Decimal, signed Data Display of sequencer level Indicates sequencer level executed when trace sampled. Indicates 0 if sequencer not in use. Hexadecimal >SHOW TRACE/INSTRUCTION -194 step no. address mnemonic level \sub4: -00194 : FF0106 LINK #00 4 -00193 : 000186 internal read access. 10F2 5 -00192 : 1010E6 external write access. 10F2 5 -00191 : 000186 internal write access.
CHAPTER 2 DEPENDENCE FUNCTIONS [Example] >>SHOW TRACE/CYCLE frame no.
CHAPTER 2 DEPENDENCE FUNCTIONS (7):valid flag @:valid frame for this data (8):sequencer level (9):external probe data ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. This mode is enabled only in the single trace mode while in the debugging mode. [Example] >>SHOW TRACE/SOURCE -194 118 step no. source -00194 : gtg1.c$251 { -00190 : gtg1.c$255 -00168 : gtg1.c$259 { -00164 : gtg1.c$264 p = (char *) &df; -00161 : gtg1.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.8 Reading Trace Data On-the-fly Trace data can be read while executing a program. However, this is not possible during sampling. Disable the trace function or terminate tracing before attempting to read trace data. ■ Reading Trace Data On-the-fly in Single Trace To disable the trace function, use the DISABLE TRACE command.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Reading Trace Data On-the-fly in the Multi Trace Use the DISABLE MULTITRACE command to disable the trace function before reading trace data. Check whether or not the trace function is currently enabled by executing the SHOW MULTITRACE command with /STATUS specified, or by using the built-in variable %TRCSTAT. To read trace data, use the SHOW MULTITRACE command; to search trace data, use the SEARCH MULTITRACE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.8.9 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Saving Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2. Specify the name of the file in which to save trace data.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.9 Measuring Performance It is possible to measure the time and pass count between two events. Repetitive measurement can be performed while executing a program in real-time, and when done, the data can be totaled and displayed. Using this function enables the performance of a program to be measured. To measure performance, set the event mode to the performance mode using the SET MODE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.9.1 Performance Measurement Procedures Performance can be measured by the following procedure: • Setting event mode. • Setting minimum measurement unit for timer. • Specify performance-buffer-full break. • Setting events. • Execute program. • Display measurement result. • Clear measurement result. ■ Setting Event Mode Set the event mode to the performance mode using the SET MODE command. This enables the performance measurement function.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Setting Events Set events using the SET EVENT command. The starting/ending point of time measurement and points to measure pass count are specified by events. Events at 8 points (1 to 8) can be set. However, in the performance measurement, the intervals, starting event number and ending event number are fixed in the following combination. - Measuring Time Four intervals have the following fixed event number combination.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.9.2 Display Performance Measurement Data Display the measured time and measuring count by using the SHOW PERFORMANCE command. ■ Displaying Measured Time To display the time measured, specify the starting event number or the ending event number. Event number Count of measuring within given time interval >SHOW PERFORMANCE/TIME 1,9000,18999,1000 Minimum execution t ime Maximum execution t ime event = 1 -> 2 min time = 11637.0 max time = 17745.0 0.0 - 8999.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.10 Measuring Coverage This emulator has the C0 coverage measurement function. Use this function to find what percentage of an entire program has been executed. ■ Coverage Measurement Function When testing a program, the program is executed with various test data input and the results are checked for correctness. When the test is finished, every part of the entire program should have been executed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.10.1 Coverage Measurement Procedures The procedure for coverage measurement is as follows: • Set range for coverage measurement : SET COVERAGE • Measure coverage : GO, STEP, CALL • Display measurement result : SHOW COVERAGE ■ Setting Range for Coverage Measurement Use the SET COVERAGE command to set the measurement range. The measurement range can be set only within the area defined as the debug area. Up to 32 ranges can be specified.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Displaying coverage rate of load module (specify /MODULE for the command qualifier) >SHOW COVERAGE/MODULE sample.abs . . . . . . . . . . . . . . (84.03%) + - startup.asm . . . . . . . . . . . (90.43%) + - sample.c . . . . . . . . . . . . . (95.17%) + - samp.c . . . . . . . . . . . . . . (100.00%) Displays the load modules and the coverage rate of each module.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Displays per source line (specify /SOURCE for the command qualifier) >SHOW COVERAGE/SOURCE main * 70: { 71: int i; 72: struct table *value[16]; 73: * 74: for (i=0; i<16; i++) * 75: value[i] = &target[i]; 76: sort_val(value, 16L); * 77: . 78: } Displays execution status of each source line. .
CHAPTER 2 DEPENDENCE FUNCTIONS Note: With MB2141 emulator, the code coverage measurement is affected by a prefetch. Note when analyzing.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.11 Execution Time Measurement This function measures the program execution time. ■ Measurement Items Measures time between the start and stop of program execution. The timer for measuring time is called the emulation timer. The measurement time depends on as follows by the minimum measurement unit for the emulation timer.
CHAPTER 2 DEPENDENCE FUNCTIONS • Clearing by dialog Click the [Clear] button in the time measurement dialog, which can be displayed by selecting [Debug] [Time Measurement] menu. For details, refer to Section "4.6.8 Time Measurement" in "SOFTUNE Workbench Operation Manual". • 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".
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.12 Sampling by External Probe An external probe can be used to sample (input) data. There are two sampling types: sampling the trace buffer as trace data, and sampling using the SHOW SAMPLING command. ■ Sampling by External Probe There are two sampling types to sample data using an external probe: sampling the trace buffer as trace data, and sampling using the SHOW SAMPLING command.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Displaying and Setting External Probe Data When a command that can use external probe data is executed, external probe data is displayed in 8-digit binary or 2-digit hexadecimal format. The displayed bit order is in the order of the IC clip cable color code order (Table 2.2-12). The MSB is at bit7 (Violet), and the LSB is at bit0 (Black). The bit represented by 1 means HIGH, while the bit represented by 0 means LOW.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.2.13 Checking Debugger Information This section explains how to check information about the MB2141 emulator debugger. ■ Debugger Information This emulator debugger enables you to check the following information at startup. • SOFTUNE Workbench file information • Hardware information If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
CHAPTER 2 DEPENDENCE FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - Language Tools - F2MC-16 Family SOFTUNE C Compiler version File Path: fcc907s.exe path - F2MC-16 Family SOFTUNE Assembler version File Path: fasm907s.exe path - F2MC-16 Family SOFTUNE Linker version File Path: flnk907s.exe path - F2MC-16 Family SOFTUNE Librarian version File Path: flib907s.exe path - SOFTUNE FJ-OMF to S-FORMAT Converter version File Path: f2ms.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3 Emulator Debugger (MB2147-01) This section explains the functions of the emulator debuggers for the MB2147-01. ■ Emulator When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2147-01 has been selected.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2147-01, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings. Adjusted settings can be used as new default settings from the next time.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.1 Monitoring Program Automatic Loading The MB2147-01 emulator can automatically update the monitoring program at emulator startup. ■ Setting Monitoring Program Automatic Loading When the MB2147-01 emulator is specified, data in the emulator can be checked at the beginning of debugging to load an appropriate monitoring program and configuration binary data automatically into the emulator.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.2 MCU Operation Mode There are two MCU operation modes as follows: • Debugging Mode • Native Mode ■ Setting MCU Operation Mode Set the MCU operation mode. There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET RUNMODE command. At emulator start-up, the MCU is in the debugging mode. The data access to internal bus may not be detected by emulator in native mode.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.3 Debug Area Set the intensive debugging area out of the whole memory space. The area functions are enhanced. ■ Setting Debug Area There are two debug areas: DEBUG3, and DEBUG4. A continuous 1 MB area (16 banks) is set for each area. Set the debug area using the SET DEBUG command. Setting the debug area enhances the coverage measurement function. - Enhancement of Coverage Measurement Function Setting the debug area enables the coverage measurement function.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.4 Memory Area Types A unit in which memory is allocated is called an area. There are five different area types. ■ Memory Area Types A unit to allocate memory is allocated is called an area. There are five different area types as follows: - User Memory Area Memory space in the user system is called the user memory area and this memory is called the user memory. Up to four user memory areas can be set with no limit on the size of each area.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: The internal memory area, it is set a suitable area automatically by the selected MCU. - Internal ROM Image Area Some types of MCUs have data in a specific area of internal ROM appearing to 00 bank. This specific area is called the internal ROM image area. 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.5 Memory Mapping Memory space can be allocated to the user memory and the emulation memory, etc., and the attributes of these areas can be specified. However, the MCU internal resources are not dependent on this mapping setup and access is always made to the internal resources. ■ Access Attributes for Memory Areas The access attributes shown in Table 2.3-2 can be specified for memory areas.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Creating and Viewing Memory Map Use the following commands for memory mapping. SET MAP: Set memory map. SHOW MAP: Display memory map. CANCEL MAP: Change memory map setting to undefined. [Example] >SHOW MAP address attribute 000000 .. FFFFFF noguard type The rest of setting area numbers user = 8 emulation = 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..
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.6 Debug Function The debug function has the following two types. Only the function of the selected mode can be used. The selectable debug mode depends on the emulator or its connection form. • RAM Checker mode • Trace Enhancement mode ■ Setting of Debug Function Set the debug function. The debug function has the RAM Checker and the Trace Enhancement mode. The selectable mode depends on the emulator or its connection form.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.1.7 Event Mode There are three event modes as listed below. • Normal mode • Multi trace mode • Performance mode ■ Event Mode Event mode is used to determine which function the event triggers are used for. To set the mode, use [Event] tab on [Setup] - [Debug Environment] - [Debug Environment] menu or the SET MODE command on the command window. The default is normal mode. There are three event modes as listed below.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints. - Invalid Breakpoints - No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Notes on STEP Command - Exceptional Step Execution When executing the instructions listed in the notes on the GO command as invalid breakpoints and abnormal breakpoints, such instructions and the next instruction are executed as a single instruction. Furthermore, if such instructions are continuous, then all these continuous instructions and the next instruction are executed as a single instruction.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual". The double circle indicates that it is available during the execution of a user program. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS Table 2.3-3 Commands Available during Execution of User Program (2 / 2) Function Restrictions 1. Enabled only when trace execution ended *1 Set trace delay 2. Enabled only when the debug function is in "Trace Enhancement" mode.*2 Displaying execution cycle measurement value (Timer) - Major Commands 4.45 SET DELAY, 4.46 SHOW DELAY 4.27 SHOW TIMER Memory operation (Read/Write) Emulation memory only operable *3 Read only enabled in real-time monitoring area 5.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4 Break In this emulator debugger, nine types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this emulator debugger, nine types of break functions are supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.1 Code Break It is a function to abort the program by observing the specified address. The break is done before an instruction the specified address is executed. ■ Code Break It is a function to abort the program by observing the specified address. The break is done before an instruction the specified address is executed. It is possible to set it in this 65535 debuggers. When a break occurs due to a code break, the following message is displayed on the Status Bar.
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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.2 Data Break The data break is a function to abort the program execution when the data access (read or write) is done to the address specified while executing the program. ■ Data Break The data break is a function to abort the program execution when MCU accesses data as for a specified address. It is possible to set it in this two debuggers. When a break occurs due to a data break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.3 Monitoring Data Break It is a special break function to abort execution while it is corresponding to specified data when the program reaches a specified address. ■ Monitoring Data Break It is a special break function to abort execution while it is corresponding to specified data when the program reaches a specified address. If the break condition of the data watch break is shown in figure, it becomes as shown in the figure below.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.4 Sequential Break A sequential break is a function to abort a executing program, when the sequential condition is met by event sequential control. ■ Sequential Break It is a function to discontinue the program execution when the sequential condition consists by the sequential control of the event. Use a sequential break when the event mode is set to normal mode using the SET MODE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.5 Guarded Access Break The guarded access break is an abortion of the program execution that happens when the violation to the set access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.6 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■ Setting Method The trace-buffer-full break is controlled by the following method.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.7 Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. ■ Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. When a break occurs due to a performance-buffer-full break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.8 External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has. ■ External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has. When a break occurs due to an external trigger break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.4.9 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.5 Control by Sequencer This emulator has a sequencer to control events. By using this sequencer, sampling of breaks or traces can be controlled while monitoring program flow (sequence). A break caused by this function is called a sequential break. ■ Control by Sequencer As shown in Table 2.3-4, controls can be made at 3 different levels. One event can be set for one level. The sequencer always moves from Level 1 through Level 2 to Level 3.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Setting Events The emulator can monitor the MCU bus operation, and generate a trigger for a sequencer at a specified condition. This function is called an event. In the event, code (/CODE) and data access (/READ/WRITE) can be specified. Up to eight events can be set. However, since hardware is shared with trace triggers, the actual numbers is calculated as follows.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.5.1 Setting Sequencer The sequencer operates in the following order: 1) The sequencer starts after the program execution. 2) Depending on the setting at each level (1 & 2), branching to the next level is performed when the condition is met. 3) The sequencer is restarted when the restart condition is met. 4) The sequencer is terminated and a break occurs when the level 3 condition is met.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.3-1 Operation of Sequencer Program execution start Level1 NO Event1 occurs YES YES Event4 occurs NO Level2 Event3 occurs YES YES NO Event4 occurs NO Level3 Event2 occurs YES NO Break ■ Setting Sequencer The sequencer can be set by the dialog or the command. ● Setting by dialog Select [Debug] - [Sequence] menu. For details, refer to "4.6.6 Sequence" in "SOFTUNE Workbench Operation Manual". ● Setting by Command 1.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace. ■ Trace Buffer The data recorded by sampling in machine cycle units, is called a frame.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.3-2 Frame Numbering at Tracing . . . . -3 -2 -1 0 (Trigger point) ■ Trace Filter To make effective use of the limited trace buffer capacity, in addition to the code fetch function, a trace filter function is incorporated to provide a means of acquiring information about data accesses to a specific region.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.3-3 Trace Sampling Operation (Trace Trigger) Start Resume Suspend Resume Suspend Resume Suspend Program flow Trace buffer ■ Setting Data Monitoring Trace Trigger When the debug function on MB2147-01 is set to Trace Enhancement mode, it is possible to set a trace trigger by a data monitoring condition. For the data monitoring condition, see the data monitoring break in Section "2.3.4 Break".
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.1 Setting Single Trace To perform a single trace, follow steps 1 through 4 below. When a program is executed after completion of the following steps, trace data is sampled. 1) Set an event mode to single trace mode. 2) Enable the trace function. 3) Perform the event and sequencer setup. 4) Perform trace buffer full break setup. ■ Setting Trace To perform a single trace, complete the following setup steps.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.2 Multi Trace Only when an event trigger occurred, the multi trace samples data before and after the event trigger. ■ Multi Trace To use the multi trace function, the SET MODE command is set to the following mode. Debug function: "Trace Enhancement" mode Event mode: "Multi trace" mode The multi trace samples data where an event trigger (trace end trigger) occurs before and after the event trigger.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.3-5 Frame Number in Multi Trace Block number Trace buffer Frame number Global number 1 2 512 Local number 1 2 : : 64 : : 127 128 129 130 : : 192 : : 255 256 - 63 - 62 : : 0 : : + 62 + 63 - 63 - 62 : : 0 : : +62 +63 65409 65410 : : 65472 : : 65535 65536 - 63 - 62 : : 0 : : +62 +63 Event trigger Event trigger Event trigger ■ Trace Delay The trace data which is acquired after one event occurrence is called a trace delay.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: The multi trace function in MB2147-01 is exclusive with the RAM Checker function. For more details, refer to Section "2.3.1.6 Debug Function".
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.3 Setting Methods of Multi Trace Before executing the multi trace, the following settings must be made. After these settings, trace data is sampled when a program is executed. 1. Set the debug function to "Trace Enhancement" mode. 2. Set event mode to multi trace mode. 3. Enable trace function. 4. Set event and sequencer. 5. Set trace-buffer-full break. ■ Setting Methods of Multi Trace Before executing the multi trace, the following settings must be made.
CHAPTER 2 DEPENDENCE FUNCTIONS Table 2.3-7 shows the list of trace-related commands that can be used in multi trace mode. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.4 Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command. ■ Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.5 Specify Displaying Trace Data Storage Status The data display start position in the trace buffer can be specified by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified. ■ Specifying Displaying Trace Data Start Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.6 Display Format of Trace Data The trace data display format can be selected by running the SHOW TRACE command with a command modifier specified. If setup is completed with the SET SOURCE command so as to select a source line addition mode, a source line is attached to the displayed trace data. There are three formats to display trace data: • Display in instruction execution order (Specify /INSTRUCTION.) • Display all machine cycles (Specify /CYCLE.
CHAPTER 2 DEPENDENCE FUNCTIONS Address Hexadecimal Disassemble Description Time Stamp Indecates instruction executed Displays difference of executed time between this frame and next frame (decimal). The unit is ns. Step Number Decimal, signed Data Hexadecimal >SHOW TRACE -194 frame no. address mnemonic time stamp -00 675 : FF0 2C1 PUSHW A 375 -00 672 : 0 18257 ex ternal write access. 5F 375 -00 669 : 018258 external write access.
CHAPTER 2 DEPENDENCE FUNCTIONS How to read trace data frame no.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. This mode is enabled only in the debugging mode. [Example] >SHOW TRACE/SOURCE -1010..-86 step no. source -01007 : sample.c$68 value[i] = &target[I]; -00905 : sample.c$68 value[i] = &target[I]; -00803 : sample.c$68 value[i] = &target[I]; -00698 : sample.c$70 -00655 : sample.c$9 -00594 : sample.c$13 -00185 : sample.c$14 -00149 : sample.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.7 Reading Trace Data On-the-fly Trace data can be read while executing a program. However, this is not possible during sampling. Disable the trace function or terminate tracing before attempting to read trace data. ■ Reading Trace Data On-the-fly To disable the trace function, use the DISABLE TRACE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.6.8 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Saving Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2. Specify the name of the file in which to save trace data.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.7 Measuring Performance It is possible to measure the time and pass count between two events. Repetitive measurement can be performed while executing a program in real-time, and when done, the data can be totaled and displayed. Using this function enables the performance of a program to be measured. To measure performance, set the event mode to the performance mode using the SET MODE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.7.1 Performance Measurement Procedures Performance can be measured by the following procedure: • Setting event mode. • Setting minimum measurement unit for timer. • Specify performance-buffer-full break. • Setting events. • Execute program. • Display measurement result. • Clear measurement result. ■ Setting Event Mode Set the event mode to the performance mode using the SET MODE command. This enables the performance measurement function.
CHAPTER 2 DEPENDENCE FUNCTIONS Interval Starting Event Number Ending Event Number 1 1 2 2 3 4 3 5 6 4 7 8 ● Measuring Count The specified events become performance measurement points automatically. ■ Executing Program Start measuring when executing a program by using the GO or CALL command. If a break occurs during interval time measurement, the data for this specific interval is discarded.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.7.2 Display Performance Measurement Data Display the measured time and measuring count by using the SHOW PERFORMANCE command. ■ Displaying Measured Time To display the time measured, specify the starting event number or the ending event number. Event number Count of measuring within given time interval >SHOW PERFORMANCE/TIME 1,9000,18999,1000 Minimum execution time Maximum execution time time (µs) | count event = 1 -> 2 min time = 11637.0 max time = 17745.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.8 Measuring Coverage This emulator has the C0 coverage measurement function. Use this function to find what percentage of an entire program has been executed. ■ Coverage Measurement Function When testing a program, the program is executed with various test data input and the results are checked for correctness. When the test is finished, every part of the entire program should have been executed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.8.1 Coverage Measurement Procedures The procedure for coverage measurement is as follows: • Set range for coverage measurement : SET COVERAGE • Measure coverage : GO, STEP, CALL • Display measurement result : SHOW COVERAGE ■ Setting Range for Coverage Measurement Use the SET COVERAGE command to set the measurement range. The measurement range can be set only within the area defined as the debug area. Up to 32 ranges can be specified.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Summary (Specify /GENERAL for command qualifier) >SHOW COVERAGE/GENERAL (HEX)0X0 +1X0 +2X0 +---------------+---------------+-----address 0123456789ABCDEF0123456789ABCDEF0123456 FF0000 **3*F*....... -----... ABCDEF C0(%) 32.0 Display the access status of every 16 addresses . : No access 1 to F : Display the number accessed in 16 addresses by the hexadecimal number. : Access all of the 16 addresses. * ● Details (Specify /DETAIL for command qualifier.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Displays per source line (Specify /SOURCE for the command qualifier) >SHOW COVERAGE/SOURCE main * 70: { 71: int i; 72: struct table *value[16]; 73: * 74: for (i=0; i<16; i++) * 75: value[i] = &target[i]; 76: * 77: sort_val(value, 16L); . 78: } Displays access status of each source line. .
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.9 Real-time Monitoring The real-time monitoring function is used to display the memory contents during program execution. ■ Real-time Monitoring The emulator can use the real-time monitoring function when the evaluation chip has the external trace bus interface. A real-time monitoring window is provided to display two 256-byte regions for real-time monitoring purposes.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.10 Execution Time Measurement This function measures the program execution time. ■ Measurement Items Measures time between the start and stop of program execution. In this emulator debugger, the measurement is performed by the emulation timer or cycle counter. The following shows the features.
CHAPTER 2 DEPENDENCE FUNCTIONS • Clearing by command Enter the CLEAR TIMER command in the command window. For details, refer to Section "4.28 CLEAR TIMER" in "SOFTUNE Workbench Command Reference Manual". Note: The measured execution time is added about ten extra cycles per execution. If the execution cycle is measured, execute many instructions continuously in order to minimize the effect of error.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.11 Power-on Debugging This section explains power-on debugging by the emulators for the MB2147-01. ■ Power-on Debugging Power-ON debugging refers to the operation to debug the operating sequence that begins when the power to the target is switched on. For products with a dedicated power-on debugging terminal, the MB2147-01 emulator can debug the sequence performed immediately after power-on.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.12 RAM Checker This section describes the functions of the RAM Checker. ■ Overview The RAM checker obtains history logs of accessing the monitoring addresses on SOFTUNE Workbench and graphically displays log files using the accessory tool, "RAM Checker Viewer".
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Specifications List Monitoring Point Count 16 points Size Bytes/word (16 bits) Event Functions Max. 8 Points Sampling Time 1 ms (Fixed) Update Intervals 100 ms (Fixed) Log File Formats SOFTUNE format or CSV format • SOFTUNE format - To display in the RAM Checker viewer (recommended) - Default extension is ".SRL". • CSV format - To display in other applications than the RAM Checker viewer - Default extension is ".CSV".
CHAPTER 2 DEPENDENCE FUNCTIONS For details about settings of the RAM Checker viewer, refer to Section "3.21 RAM Checker Window" of "SOFTUNE Workbench Operation Manual". and "4.47 SET RAMCHECK" to "4.51 DISABLE RAMCHECK" of "SOFTUNE Workbench Command Reference Manual". Note: Execution state for MCU such as stop mode or sleep mode cannot be displayed at status bar during logging.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ RAM Checker Viewer The RAM Checker Viewer is a tool for graphically displaying changes in data values with the passage of time. There are the following three types of data display formats: - Bit display (Logic Analyzer image) - Data value display (bent line graph) - Bit/data value display (simultaneous display bit and data values) It displays halting CPU, trigger points and the Data Lost as other information.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.3.13 Checking Debugger Information This section explains how to check information about the MB2147-01 emulator debugger. ■ Debugger Information This emulator debugger enables you to check the following information at startup. • SOFTUNE Workbench file information • Hardware information If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
CHAPTER 2 DEPENDENCE FUNCTIONS - F2MC-16 Family SOFTUNE Linker version File Path: flnk907s.exe path - F2MC-16 Family SOFTUNE Librarian version File Path: flib907s.exe path - SOFTUNE FJ-OMF to S-FORMAT Converter version File Path: f2ms.exe path - SOFTUNE FJ-OMF to INTEL-HEX Converter version File Path: f2is.exe path - SOFTUNE FJ-OMF to INTEL-EXT-HEX Converter version File Path: f2es.exe path - SOFTUNE FJ-OMF to HEX Converter version File Path: f2hs.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4 Emulator Debugger (MB2147-05) This section explains the functions of the emulator debuggers for the MB2147-05. ■ Emulator When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2147-05 has been selected.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2147-05, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings. Adjusted settings can be used as new default settings from the next time.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.1 Monitoring Program Automatic Loading Emulators for MB2147-05 can automatically update the monitoring program at emulator startup. ■ Monitoring Program Automatic Loading When the emulators for MB2147-05 is specified, data in the emulator can be checked at the beginning of debugging to load an appropriate monitoring program and configuration binary data automatically into the emulator.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.2 MCU Operation Mode There are two MCU operation modes as follows: • Debugging Mode • Native Mode ■ Setting MCU Operation Mode Set the MCU operation mode. There are two operation modes: the debugging mode, and the native mode. Choose either one using the SET RUNMODE command. At emulator start-up, the MCU is in the debugging mode. The data access to internal bus may not be detected by emulator in native mode.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.3 Debug Area Set the intensive debugging area out of the whole memory space. The area functions are enhanced. ■ Setting Debug Area There are two debug areas: DEBUG3, and DEBUG4. A continuous 1 MB area (16 banks) is set for each area. Set the debug area using the SET DEBUG command. Setting the debug area enhances the breakpoint function.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.4 Memory Area Types A unit in which memory is allocated is called an area. There are five different area types. ■ Memory Area Types A unit to allocate memory is allocated is called an area. There are five different area types as follows: - User Memory Area Memory space in the user system is called the user memory area and this memory is called the user memory. Up to four user memory areas can be set with no limit on the size of each area.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: The internal memory area, it is set a suitable area automatically by the selected MCU. - Internal ROM Image Area Some types of MCUs have data in a specific area of internal ROM appearing to 00 bank. This specific area is called the internal ROM image area. 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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.1.5 Memory Mapping Memory space can be allocated to the user memory and the emulation memory, etc., and the attributes of these areas can be specified. However, the MCU internal resources are not dependent on this mapping setup and access is always made to the internal resources. ■ Access Attributes for Memory Areas The access attributes shown in Table 2.4-2 can be specified for memory areas.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Creating and Viewing Memory Map Use the following commands for memory mapping. SET MAP: Set memory map. SHOW MAP: Display memory map. CANCEL MAP: Change memory map setting to undefined. [Example] >SHOW MAP address attribute 000000 .. FFFFFF noguard type The rest of setting area numbers user = 8 emulation = 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..
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints. - Invalid Breakpoints - No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Notes on STEP Command ● Exceptional Step Execution When executing the instructions listed in the notes on the GO command as invalid breakpoints and abnormal breakpoints, such instructions and the next instruction are executed as a single instruction. Furthermore, if such instructions are continuous, then all these continuous instructions and the next instruction are executed as a single instruction.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual". The double circle indicates that it is available during the execution of a user program. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4 Break In this emulator debugger, five kinds of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this emulator debugger, five kinds of break functions are supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.1 Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed. ■ Code Break It is a function to abort the program execution by observing the specified address. The break is done before an instruction the specified address is executed. It is possible to set it in this 65535 debuggers. However, it is necessary to set the debugging area as a code break area.
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.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.2 Data Break The data break is a function to abort the program execution when the data access (read or write) is done to the address specified while executing the program. ■ Data Break The data break is a function to abort the program execution when MCU accesses data as for a specified address. When a break occurs due to a data break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.3 Guarded Access Break The guarded access break is an abortion of the program execution that happens when the violation to the set access attribute, doing the access, and guarded (An undefined area cannot be accessed) area are accessed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.4 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■ Setting Method The trace-buffer-full break is controlled by the following method.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.4.5 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace. ■ Trace Buffer The data recorded by sampling in machine cycle units, is called a frame.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.4-1 Frame Number at Tracing . . . -3 -2 -1 0 (Trigger point) ■ Trace Filter To make effective use of the limited trace buffer capacity, in addition to the code fetch function, a trace filter function is incorporated to provide a means of acquiring information about data accesses to a specific region.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.1 Setting Trace To perform a trace, follow steps (1), (2) below. When a program is executed after completion of the following steps, trace data is sampled. (1) Enable the trace function. (2) Perform trace-buffer-full break setup. ■ Setting Trace To perform a trace, complete the following setup steps. When a program is executed after completion of the steps, trace data is sampled. 1) Enable the trace function. Enable the trace function using the ENABLE TRACE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.2 Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command. ■ Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.3 Specifying Displaying Trace Data Start The data display start position in the trace buffer can be specified by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified. ■ Specifying Displaying Trace Data Start Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.4 Display Format of Trace Data The trace data display format can be selected by running the SHOW TRACE command with a command modifier specified. If setup is completed with the SET SOURCE command so as to select a source line addition mode, a source line is attached to the displayed trace data. There are three formats to display trace data: • Display in instruction execution order (Specify /INSTRUCTION.) • Display all machine cycles (Specify /CYCLE.
CHAPTER 2 DEPENDENCE FUNCTIONS Address Hexadecimal number Step Number Decimal number, signed Disassemble Description Indecates instruction executed Data Hexadecimal number >SHOW TRACE/INSTRUCTION -194 step no. address mnemonic \sub4: -00194 : FF0106 LINK # 00 -00193 : 000186 internal read access. 10F2 -00192 : 1010E6 external write access. 10F2 -00191 : 000186 internal write access. 10E6 -00190 : FF0108 ADDSP #F8 -00189 : FF010A MOVL A,001A -00188 : 10001A external read access.
CHAPTER 2 DEPENDENCE FUNCTIONS How to read trace data frame no.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. This mode is enabled only in the debugging mode. [Example] >SHOW TRACE/SOURCE -194 step no. source -00194 : gtg1.c$251 -00190 : gtg1.c$255 -00168 : gtg1.c$259 -00164 : gtg1.c$264 p = (char *) &df; -00161 : gtg1.c$264 p = (char *) &df; -00157 : gtg1.c$265 *(p++) = 0x00; -00145 : gtg1.c$266 *(p++) = 0x00; -00133 : gtg1.c$267 *(p++) = 0x80; -00121 : gtg1.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.5 Reading Trace Data On-the-fly Trace data can be read while executing a program. However, this is not possible during sampling. Disable the trace function or terminate tracing before attempting to read trace data. ■ Reading Trace Data On-the-fly To disable the trace function, use the DISABLE TRACE command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.5.6 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Saving Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2. Specify the name of the file in which to save trace data.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.4.6 Measuring Execution Cycle Count This function measures the program execution cycle count. ■ Measurement Items Measures cycle count between the start and stop of program execution. In this emulator debugger, the measurement is performed by the cycle counter. The following shows the features of the cycle counter.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5 Emulator Debugger (MB2198) This section explains the functions of the emulator debuggers for the MB2198. ■ Emulator Debugger When choosing the emulator debugger from the setup wizard, select one of the following emulators. The following description explains the case when MB2198 has been selected.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1 Setting Operating Environment This section explains the operating environment setup. ■ Setting Operating Environment For the emulator debugger for the MB2198, it is necessary to set the following operating environment. Predefined default settings for all these setup items are enabled at startup. Therefore, setup is not required when using the default settings. Adjusted settings can be used as new default settings from the next time.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1.1 Monitoring Program Automatic Loading The MB2198 emulator can automatically update the monitoring program at emulator startup. ■ Monitoring Program Automatic Loading When the MB2198 emulator is specified, data in the emulator can be checked at the starting of debugging to load an appropriate monitoring program and configuration binary data automatically into the emulator.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1.2 Boot ROM File Automatic Execution The MB2198 emulator automatically loads and executes the Boot ROM file during startup of the debug. ■ Boot ROM File Automatic Execution When the MB2198 emulator is specified, at the starting of debugging the Boot ROM file is automatically loaded and then executed. The Boot ROM file is in Lib\907\BootROM under the directory where Workbench is installed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1.3 MCU Operation Mode There are two MCU operation modes as follows: • Full Trace Mode • Real-Time Mode ■ Setting MCU Operation Mode There are two operation modes: the full trace mode, and the real-time mode. These modes are set using the [Setup] - [Debug environment] - [Debug environment] menu or the SET RUNMODE command of the instruction window. ● Full Trace Mode In full trace mode, execution of all the instructions can be traced with no trace data missed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.1.4 Operation Frequency Control This section describes the operation frequency setup. ■ Operation frequency Set the operation frequency of MCU. Set the operation frequency using a value between 1 and 266MHz, inclusive. This setting optimizes the communication speed between MCU and emulator. This function can be set using the [Setup] - [Debugging Environment] - [Debugging Environment] [Frequency] menu or the SET FREQUENCY command.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.2 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints. ● Invalid Breakpoints • No break occurs when a breakpoint is set at the instruction immediately after the following instructions.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.3 Commands Available during Execution of User Program This section explains the commands available during the execution of a user program. ■ Commands Available during Execution of User Program This emulator debugger allows you to use certain commands during the execution of a user program. For more details, see "■ Debugger" in "SOFTUNE Workbench Command Reference Manual". The double circle indicates that it is available during the execution of a user program. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • The conditions which allow you to use the commands in Table 2.5-1 are limited to the following cases when a user program is executed. - [Debug] - [Run] - [Go] menu - [Go] button on the debug toolbar The commands in Table 2.5-1 cannot be used when the GO command is entered in the command window. • 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)." • In Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4 Break In this emulator debugger, seven kinds of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this emulator debugger, seven kinds of break functions are supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.1 Code Break This function aborts a program by monitoring the specified address using hardware or software. Break occurs prior to execution of the instruction of the specified address. ■ Code Break This function aborts a program by monitoring the specified address using hardware or software. Break occurs prior to execution of the instruction of the specified address.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • Hardware There are the following considerations for the hardware break. - Due to combination use with the sequencer or the trace trigger, the maximum setting number varies. - Do not set the hardware break to the instruction located in the delay slot. If such a setting is performed, branching will not be performed in spite of re-execution after break. - Make sure that the breakpoint must include the starting address of an instruction. Break may not occur.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.2 Data Break It is a function to abort the program execution when the data access (read and write) is done to a specified address. ■ Data Break It is a function to abort the program execution when the data access (read and write) is done to a specified address. When a break occurs due to a data break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.3 Guarded Access Break This function aborts the program execution when access has been performed using the specified attribute for the specified area. ■ Guarded Access Break For the specified area, when the specified access attribute is found during execution of a user program, guarded access break will occur.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.4 Sequential Break A sequential break is a function to abort an executing program as event sequential control, when the sequential conditions are established. ■ Sequential Break It is a function to abort the program execution by the sequential control of the event, when the sequential conditions are established. For details of the sequential control, refer to Section "2.5.5 Control by Sequencer".
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.5 Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. ■ Trace-Buffer-Full Break It is a function to abort the program execution when the trace buffer becomes full. When a break occurs due to a trace-buffer-full break, the following message is displayed on the Status Bar. Break at Address by trace buffer full ■ Setting Method The trace-buffer-full break is controlled by the following method.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.6 Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. ■ Performance-Buffer-Full Break It is a function to abort the program execution when the buffer for the performance measurement data storage becomes full. When a break occurs due to a performance-buffer-full break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.7 External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has. ■ External Trigger Break It is a function to abort the execution of the program when an external signal is input from TRIG pin that the emulator has. When a break occurs due to an external trigger break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.4.8 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar. Break at Address by command abort request Note: A forced break is not allowed while the MCU is in the low-power consumption mode or hold state.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.5 Control by Sequencer This emulator has a sequencer to control events. By using this sequencer, sampling of breaks or traces can be controlled while monitoring program flow (sequence). A break caused by this function is called a sequential break. ■ Control by Sequencer As shown in Table 2.5-2, controls can be made at 8 different levels. One event can be set for one level.
CHAPTER 2 DEPENDENCE FUNCTIONS The sequence event is setting by the following command. • SET SEQUENCE :Sets sequence event • SHOW SEQUENCE :Displays sequence event status • CANCEL SEQUENCE :Deletes event Notes: • In instruction execution (/CODE), an event trigger is generated only when an instruction is executed. This cannot be specified concurrently with other status (/READ or /WRITE).
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.5.1 Operating of sequencer The sequencer works in the following order. 1) The sequencer starts when the program execution begins. 2) It diverges to the level the shift ahead when the condition consists by setting each level. 3) When the restart condition consists, the sequencer is begun again. 4) When the condition that the level becomes END the shift ahead consists, the sequencer ends and the break is done.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6 Real-time Trace While execution a program, the address, data and status information, and the data sampled by an external probe can be sampled in machine cycle units and stored in the trace buffer. This function is called real-time trace. In-depth analysis of a program execution history can be performed using the data recorded by real-time trace. ■ Trace Buffer The data recorded by sampling in machine cycle units, is called a frame.
CHAPTER 2 DEPENDENCE FUNCTIONS Figure 2.5-2 Frame Number at Tracing . . . . -3 -2 -1 0 (Trigger point) ■ Trace Filter To make effective use of the limited trace buffer capacity, in addition to the code fetch function, a trace filter function is incorporated to provide a means of acquiring information about data accesses to a specific region. The following value can be specified in the data trace filter function.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.1 Setting Trace To perform a trace, follow steps (1) to (3) below. When a program is executed after completion of the following steps, trace data is sampled. (1) Enable the trace function. (2) The event and the sequencer are set. (3) Perform trace buffer full break setup. ■ Setting Trace To perform a trace, complete the following setup steps. When a program is executed after completion of the steps, trace data is sampled. 1) Enable the trace function.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: In the case of the data trace trigger, word access from an odd address (in terms of bus access) is performed using a byte access for twice. Note that this is the reason why there will not be any hits even when word access is specified from an odd address.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.2 Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE command. ■ Displaying Trace Data Storage Status It is possible to displays how much trace data is stored in the trace buffer. This status data can be read by specifying /STATUS to the SHOW TRACE.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.3 Specifying Displaying Trace Data Start The data display start position in the trace buffer can be specified by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified. ■ Specifying Displaying Trace Data Start Specify the data display start position in the trace buffer by inputting a step number or frame number using the SHOW TRACE command. The data display range can also be specified.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.4 Display Format of Trace Data The trace data display format can be selected by running the SHOW TRACE command with a command modifier specified. If setup is completed with the SET SOURCE command so as to select a source line addition mode, a source line is attached to the displayed trace data. There are three formats to display trace data: • Display without analyzing trace data (Specify /RAWDATA.) • Display in instruction execution order (Specify /INSTRUCTION.
CHAPTER 2 DEPENDENCE FUNCTIONS Reset: Indicates that reset is detected. Loop Count "Number of times": Displays number of times which loop count occurs. Extended time stamp frame: Displays here when the value of time stamp is 8191 or more. Data Lost Error: Indicates that data is lost. ■ Display in Instruction Execution Order (Specify /INSTRUCTION.) It is a form that is pulled out the divergence frame from the RAW data display, and supplemented between frames with the reverse-assembly display.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Display in Source Line Units (Specify /SOURCE.) Only the source line can be displayed. [Example] >SHOW TRACE/SOURCE -1010..-86 264 step no. source -01007 : sample.c$68 value [i] = &target[I]; -00905 : sample.c$68 value [i] = &target[I]; -00803 : sample.c$68 -00698 : sample.c$70 -00655 : sample.c$9 { -00594 : sample.c$13 -00185 : sample.c$14 i = k; -00149 : sample.c$15 p = tblp[i - 1]; -00088 : sample.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.6.5 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Saving Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2. Specify the name of the file in which to save trace data.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.7 Measuring Performance It is possible to measure the time and pass count between two events. Repetitive measurement can be performed while executing a program in real-time, and when done, the data can be totaled and displayed. Using this function enables the performance of a program to be measured.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.7.1 Performance Measurement Procedures Performance can be measured by the following procedure: 1. Setting minimum measurement unit for timer. 2. Specify performance-buffer-full break. 3. Setting events. 4. Executing program. 5. Displaying performance measurement data. 6. Clearing performance measurement data. ■ Setting Minimum Measurement Unit for Timer It is 1ns as the minimum measurement unit for the timer used to measure performance.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.7.2 Display Performance Measurement Data Display the measured time and measuring count by using the SHOW PERFORMANCE command. ■ Displaying Measured Time To display the time measured, specify the starting event number or the ending event number.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.8 Execution Time Measurement This function measures the program execution time. ■ Measurement Items Measures time between the start and stop of program execution. In this emulator debugger, the measurement is performed by the emulation timer or cycle counter. The following shows the features.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: The measured execution time is added about ten extra cycles per execution. If the execution cycle is measured, execute many instructions continuously in order to minimize the effect of error.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.5.9 Power-On Debugging This section explains power-on debugging by the emulators for the MB2198. ■ Power-on Debugging Power-ON debugging refers to the operation to debug the operating sequence that begins when the power to the target is switched on. For products with a dedicated power-on debugging terminal, the MB2198 emulator can debug the sequence performed immediately after power-on.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6 Emulator Debugger (MB2100-01) This section describes the emulator debugger functions that are available when the MB2100-01 is specified.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.1 Starting debugging This section describes the method of starting debugging by with the use the MB2100-01 emulator debugger. ■ Starting Debugging When starting debugging, select the [Debug] - [Start debug] menu. When debugging is started by a new project, the setup wizard for performing initial setting is activated. For details, refer to "4.7.2.5 Setup Wizard" in "SOFTUNE Workbench Operation Manual".
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.1.1 Operating Environments of the Target This section describes the setting of the target operating environments of the MB2100-01 emulator debugger. ■ Operating Environments of the Target In this emulator debugger, it is necessary to set the following items according to the operating environments of the target. • Source oscillation frequency • Length of DEBUG I/F cable These settings influence the communication speed of the debugger.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • When the operating environment set by the setup wizard is different from the actual operating environment, the debugger cannot be activated. • For details on the DEBUG I/F (interface), refer to "EMBEDDED EMULATOR MB2100-01-E OPERATION MANUAL".
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.1.2 Security This section describes the security of the MB2100-01 emulator debugger. ■ Security When beginning to debug it when the security function of target MCU is effective, it is necessary to enter the password in this emulator debugger. For the security function, refer to the hardware manual of model to be used. ■ How to enter When a dialog shown below is displayed, enter a preset password. The password is needs to be entered each time the debugger is activated.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.2 Ending debugging This section describes the method of ending debugging being executed with the use of the MB2100-01 emulator debugger. ■ Ending debugging When ending debugging, select the [Debug] - [End debug] menu. Turn off the power supply of the target after selecting the [End debug] menu. ■ When the debugger has aborted When the debugger has aborted for some reason, problems as described below can occur.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.3 Efficiently Executing Debugging This section describes setting for efficient debugging. ■ Setting Operating Environment In order to enable the user to even more comfortably execute debugging, the emulator debugger provides the following items required to be set correspondingly to, for example, the operating environment and the usage.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.3.1 Increasing Communication Speed during Debugging This section describes setting for increasing the communication speed during debugging. ■ Standard Clock Frequency for High-speed Communication In the case of this emulator debugger, when the standard clock frequency for high-speed communication is set to the optimal value, the phase modulation mode is enabled, and high-speed communication can be performed between the target and adapter.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.3.2 Switching Debug Function This section describes the method of switching the debug function correspondingly to the usage. ■ Debug Functions The emulator debugger allows the debug functions to be selectively used by effecting mode switching correspondingly to the usage. The mode has two types described below. • Execution time mode This mode selects the method of measuring the user-program execution time.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4 Executing Program This section describes the method of executing a user program with the MB2100-01 emulator debugger. ■ Executing a program A user program is executed in a procedure described below. 1. Open a project (workspace). Select the [File] - [Open workspace file] menu. 2. Start debugging. For details, refer to "2.6.1 Starting debugging". 3. Load an execution-desired target program.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4.1 Setting/Release of Debug Functions The debug function can be set or released while executing the user program. ■ Commands Available during Execution of User Program A specific debug feature can be set/released while executing the user program in this emulator debugger. Either the dialog or the command can be set/released. Table 2.6-1 shows the commands available during execution of user program.
CHAPTER 2 DEPENDENCE FUNCTIONS Note: An error message appears if you enter a command that cannot be used during the execution of a user program. "E4404S Command error (MCU is busy).
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4.2 Monitoring This section describes the monitoring function in the MB2100-01 emulator debugger. ■ Monitoring The monitoring function is capable of real-time referencing a variation in the value of a specific address during user program execution. The function is capable of a variation in the value of a specified watch variable, in addition to the value of a specific address. ■ How to use The use procedure of the monitoring function is described below.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4.3 Power-on Debug This section describes power-on debug function in the MB2100-01 emulator debugger. ■ Power-on Debug Power-on debug is a function to debug the sequence immediately after turning on of the power supply of the target system. ■ How to use The use procedure of power-on debug is as follows: ● When power-on debug 1. Start debug. Select [Debug] - [Start debug] menu. 2. Power-on debug mode is made effective. Select [Debug] - [Run] - [Power on Debug] menu.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • Other debug features cannot be used while debugging power-on at all. • When security is enabled, power on debug is not available. • Selecting the power-on debug menu, the following functions cleared. - Performance measurement - Execution cycle measurement • Turning on the power supply of the target again, the following functions cleared.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.4.4 Notes on Commands for Executing Program When using commands to execute a program, there are several points to note. ■ Notes on GO Command For the GO command, two breakpoints that are valid only while executing commands can be set. However, care is required in setting these breakpoints. ● Invalid Breakpoints - No break occurs when the breakpoint is set at three instructions or less executed continuously from the user interrupt.
CHAPTER 2 DEPENDENCE FUNCTIONS Because "POP PS" (1) is an instruction as invalid breakpoint shown in "Notes on GO Command", no break occurs at three instructions following "POP PS". And because instruction (3) is the instruction shown in above-mentioned note among three instructions (2), (3) and (4) following "POP PS", three instructions (4), (5) and (6) following instruction (3) are executed continuously.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.5 To Access the Flash Memory This section describes the access method to the flash memory in the MB2100-01 emulator debugger. ■ Access to Flash Memory In this emulator debugger, the direct operation of the content of the flash memory can be done as well as RAM area. ■ What is flash memory synchronization? When data is written into the flash memory, the data is stored temporarily.
CHAPTER 2 DEPENDENCE FUNCTIONS - View the following dialogs. Line Assembly dialog (Disassembly window) Break setting dialog [Software] ● Flash memory synchronization [Debbuger -> Flash] • Manual flash memory synchronization Select the [Environment] - [Flash area control] menu. For details, refer to "4.7.4 Flash area control" in "SOFTUNE Workbench Operation Manual".
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Examples of flash memory synchronization ● In the case of [Debugger -> Flash] An image in the case where the flash memory synchronization [Debugger -> Flash] has been performed is shown below. Variations in the values of the debugger and flash memory in the case of the flash memory synchronization [Debugger -> Flash] Debugger Flash memory FF FF FF FF Memory writing, loading, etc. by the user FF FF FF FF Execution and reset, etc.
CHAPTER 2 DEPENDENCE FUNCTIONS ● In the case of [Flash -> Debugger] An image in the case where the flash memory synchronization [Flash -> Debugger] has been performed is shown below.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6 To Interrupt the Program Execution [Break] This section describes the method of interrupting the execution of the user program in the MB2100-01 emulator debugger. ■ Break Functions The function to interrupt the execution of the user program is called a break function.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.1 Code Break (Hardware) This function suspends program execution by monitoring a specified address by hardware. A break occurs before an instruction at the specified address is executed. ■ Code Break (Hardware) This function suspends program execution by monitoring a specified address by hardware. A break occurs before an instruction at the specified address is executed. Code Break (Hardware) has the hardware/count for which a path count can be set.
CHAPTER 2 DEPENDENCE FUNCTIONS - When the break operation is generated while the instruction where the user interrupt is generated and the next one instruction or less are executed - When the break operation is generated while either of the following instructions and the next one instruction or less are executed - INT addr16 - INTP addr24 - POPW PS - AND CCR #imm8 - OR CCR #imm8 - MOV ILM #imm8 - Prefix codes (PCB, DTB, ADB, SPB, CMR, NCC) - INT9 - INT #vct - JCTX @A - RETI - Undefined instructions (except
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.2 Code Break (Software) This function suspends program execution by monitoring a specified address by software. A break occurs before executing an instruction at the specified address. ■ Code Break (Software) This function suspends program execution by monitoring a specified address by software.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.3 Data Break This function suspends program execution when data access (read/write) is made to a specified address. ■ Data Break This function suspends program execution when data access (read/write) is made to a specified address. Up to 8 points can be set. When the data break occurs, the following message appears in the status bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.4 Forced Break This function forcibly suspends program execution. ■ Forced Break This function forcibly suspends program execution. When the forced break occurs, the following message appears in the status bar. Break at [Address] by command abort request ■ How to Generate A forced break is generated in the following methods: • Menu [Debug] - [Abort] menu Refer to "4.6.2 Abort" in "SOFTUNE Workbench Operation Manual". • Command - ABORT Refer to "2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.5 Data Watch Break This special break function suspends program execution when the program reaches a specified instruction address while the value in the specified data address matches with specified data. ■ Data Watch Break This special break function suspends program execution when the program reaches a specified instruction address while the value in the specified data address matches with specified data. Up to 2 points can be set.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • A data watch break shares points with the following functions. The maximum number varies depending on how those functions are used. - Code break - Data break - Sequence • The data watch break may stop if it hits a specified address after a few instructions following the instruction with data detection access are executed. Consequently, it may not stop if it hits the specified address during the execution of an instruction.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.6.6 Sequencer A sequencer is a function to abort the program execution to the specified event condition when program passes the event following a certain flow (sequence). ■ Control by Sequencer Table 2.6-2 shows the specifications of the sequencer function for this emulator debugger. 2 events are set and the level is passed through level 1 to level 2 in this order. This becomes sequencer termination condition. This sequencer is called a 2-level sequencer.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Specifications of Sequencer Table 2.6-2 shows the specifications of the sequencer for this emulator debugger. Table 2.6-2 Specifications of Sequencer Function Specification No. of levels 2 levels Restart function Available (one) Conditions of each event (Code/data) Address Pass count: 1 to 1048575 Attribute: Read/write Data size: Byte, Word, Long (Attribute and data size can be specified only for data events.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • When the pass count mode is a passing count break mode, this function cannot be used. For details, refer to "2.6.3.2 Switching Debug Function". • Depending on the output timing of external trace data, the actual order of code execution may change places with the order of data hit information. For this reason, if a code event and a data event occur close to each other, normal transition may not occur. • A sequencer shares points with the following functions.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.7 Measuring the Program Execution Cycle Count This section explains the function of measuring the number of program execution cycles. ■ Measurement Items This function measures the number of program execution cycles.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • The number of cycles measured normally includes an error of about 10 cycles. However, it may be even more, depending on the bus state. • If a chip reset is issued during debugging, the measurement cycle count is cleared.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.8 Measuring Event-to-Event Execution Cycle Count [Performance Measurement] This section explains how to measure the execution cycle count between two events in the MB2100-01 emulator debugger. ■ Performance Measurement This emulator debugger measures the execution cycle count between two events, which the system has passed while a user program is running. This is referred to as "performance measurement". The features for the performance measurement are as follows.
CHAPTER 2 DEPENDENCE FUNCTIONS Notes: • This function is not available when the execution time mode is set to the time measuring mode. For details, refer to Section "2.6.3.2 Switching Debug Function". • If two triggers (start and end) specified as a measuring interval have occurred at the same time, performance measuring is not performed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.8.1 Measuring Performance This section explains how to measure the event-to-event execution cycle count in the MB2100-01 emulator debugger. ■ Measuring Procedure Use the following steps to measure the performance. 1. Specify the performance measuring interval. 2. Execute the measurement. 3. Display the measurement result. Each of these steps can be executed in two methods: using GUI (window or dialog) and using only the command.
CHAPTER 2 DEPENDENCE FUNCTIONS ● Using Command for Measuring 1. Specify performance events. - Execute the SET EVENT command. For details, refer to Section "3.22 SET EVENT(type 2)" in "SOFTUNE Workbench Command Reference Manual". 2. Specify the performance measuring interval. - Execute the SET PERFORMANCE command. For details, refer to Section "4.9 SET PERFORMANCE (type 3)" in "SOFTUNE Workbench Command Reference Manual". 3. Execute user programs. 4. Display the measurement result.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9 Viewing Program Execution History [Trace] This section describes the trace function of this emulator debugger. ■ What is Trace The function that records the program execution history is called "trace". Trace data contains address information before and after branch, which is available for the analysis of the program execution history. ■ Trace Functions This emulator debugger has the following trace functions.
CHAPTER 2 DEPENDENCE FUNCTIONS ● When break halts program execution Figure 2.6-5 Acquiring Trace Data When a break occurred during execution of a program Start execution Stop execution Start execution Stop execution Program flow Trace Buffer | --------------- Max. 1,024 frames ---------------| Note: Executing the forced start will clear the trace data that was stored until then.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.1 Displaying Trace Data This section explains how to display trace data. ■ Display Formats of Trace Data The following three formats can be used to display trace data. RAW data: Displays trace data without analyzing it. Instruction: Displays trace data in the order in which instructions are executed. Source: Displays trace data on a source line basis. ■ Trace Data Display Position Sampled trace data is numbered by frame. This number is called a "frame number".
CHAPTER 2 DEPENDENCE FUNCTIONS ● Using command window 1. Display trace data for each display mode. RAW data: SHOW TRACE Instruction: SHOW TRACE Source: SHOW TRACE For details, refer to Section "4.32 SHOW TRACE (type 2)" in "SOFTUNE Workbench Command Reference Manual". Note: In the disassembly format, data is read from memory to be displayed. If an instruction is rewritten after code fetching, data will not be displayed correctly.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.2 Trace Data Display Examples (RAW Data) This section describes trace data that is displayed in the RAW data mode. ■ RAW Data Display This format displays frames that are output from the emulator without analyzing them. Figure 2.6-6 shows a RAW data display example. Figure 2.6-6 Example of the RAW Data Display Disassemble Description Frame Number Indicates instruction executed.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.3 Trace Data Display Example (Instruction) This section describes trace data that is displayed in the instruction mode. ■ Instruction Display This mode displays the branch addresses of the RAW data display in disassembly format. Figure 2.6-7 shows an instruction display example. Figure 2.6-7 Example of the Instruction Display Disassemble Description Frame Number Decimal, signed Display that supplements between branch frames.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.4 Trace Data Display Example (Source) This section describes trace data that is displayed in the source line mode. ■ Source Display This mode displays only source lines. Figure 2.6-8 shows a source display example. Figure 2.6-8 Example of the Trace Data Display (Source) >SHOW TRACE/SOURCE -10..-5 frame no. source : sample.c$61 -00007 : sample.c$62 : sample.c$66 -00006 : sample.c$67 } : sample.c$53 while : sample.c$54 : sample.c$55 : sample.c$56 : sample.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.5 Saving Trace Data This section explains how to save trace data. ■ Saving Trace Data Trace data can be saved in a specified file. The following two methods are available to save trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Saving Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2. Specify the name of the file in which to save trace data.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.9.6 Searching for Trace Data This section explains how to search for trace data. ■ Searching for Trace Data The specified address or frame number in trace data can be displayed. The following two methods are available to search for trace data: using GUI (window or dialog) and using only the command. The same result is obtained from both methods. ● Using GUI for Searching for Trace Data 1. Display the trace window. - Select [View] - [Trace] menu. 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.10 How to Display the Output Message from User Program to the Debugger This section explains the semihosting feature of MB2100-01 emulator debugger. ■ What is Semihosting Feature The semihosting feature is a function to display a message output by the user program on the debugger window. As shown in Figure 2.
CHAPTER 2 DEPENDENCE FUNCTIONS ■ Using Method of Semihosting Feature Use the following procedure to display the content of the output request to MBR on the terminal window. 1. Control MBR in the user program. As shown in Figure 2.6-9, it is necessary to control MBR in the user program. Sample project including the control method of MBR is attached in SOFTUNE Workbench V30L36 or later. Control MBR based on this.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.6.11 Checking Debugger Information This section explains how to check information about the MB2100-01 emulator debugger. ■ Debugger Information This emulator debugger enables you to check the following information at startup. • SOFTUNE Workbench file information • Hardware information If any errors have been discovered during SOFTUNE Workbench operations, check this information and contact our sales department or support department.
CHAPTER 2 DEPENDENCE FUNCTIONS - SOFTUNE FJ-OMF to HEX Converter version File Path: f2hs.exe path ------------------------------------------------------SiOsM Product name: Softune Workbench File Path: SiOsM907.dll path Version: SiOsM907.dll version ------------------------------------------------------F2MC-16 Series Debugger DLL Product name: SOFTUNE Workbench File Path: SiD907.dll path Version: SiD907.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.7 Monitor Debugger This section describes the functions of the monitor debugger. ■ Monitor Debugger The monitor debugger performs debugging by putting the target monitor program for debugging into the target system and by communicating with the host. Before using this debugger, the target monitor program must be ported to the target hardware.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.7.1 Resources Used by Monitor Program The monitor program of the monitor debugger uses the I/O resources listed below. The target hardware must have these resources available for the monitor program. ■ Required Resources The following resources are required to build the monitor program into the target hardware. Table 2.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.7.2 Break In the monitor debugger, two types of break functions can be used. When the program execution is aborted by each break function, the address and the break factor to do the break are displayed. ■ Break Functions In this monitor debugger, the following two types of break functions are supported.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.7.2.1 Software Break It is a function to bury the instruction for the break under the memory, and to do the break by the instruction execution. The break is done before an instruction the specified address is executed. ■ Software Break It is a function to bury the instruction for the break under the memory, and to do the break by the instruction execution. The break is done before an instruction the specified address is executed. The number that can be set is 16 points.
CHAPTER 2 DEPENDENCE FUNCTIONS 2.7.2.2 Forced Break It is a function to abort the execution of the program compulsorily. ■ Forced Break It is a function to abort the execution of the program compulsorily. When a break occurs due to a forced break, the following message is displayed on the Status Bar.
CHAPTER 2 DEPENDENCE FUNCTIONS 328
INDEX INDEX The index follows on the next page. This is listed in alphabetic order.
INDEX Index Symbols /CYCLE Displaying All Machine Cycles (Specify /CYCLE.) .......................................................... 116 /INSTRUCTION Display in Instruction Execution Order (Specify / INSTRUCTION.)........ 115, 178, 226, 263 /RAWDATA Display without Analyzing Trace Data (Specify / RAWDATA.) ..................................... 262 /SOURCE Display in Source Line Units (Specify /SOURCE.) ..................................
INDEX Project Configuration ........................................... 3 Control Control by Sequencer ......................... 96, 163, 252 Controlling Watchdog Timer....... 75, 149, 212, 239 Coverage Coverage Measurement Function......... 57, 126, 188 Coverage Measurement Operation ....... 57, 126, 188 Coverage Measurement Procedures ..... 57, 126, 188 Displaying Coverage Measurement Result ............................................ 58, 127, 189 Measuring Coverage ..........................
INDEX Setting Event Mode .................................. 123, 185 Event-related Commands Event-related Commands in Multi Trace Mode ............................................................ 93 Event-related Commands in Normal Mode ........... 91 Event-related Commands in Performance Mode ............................................................ 95 Example Example of Optional Settings .............................. 15 Examples of Macro Expansion ............................
INDEX Line Number Line Number Information ................................... 27 List Macro List..................................................... 7, 17 Specifications List............................................ 197 Low-Power Consumption Mode Low-Power Consumption Mode Simulation ......... 41 M Machine Cycles Displaying All Machine Cycles ......................... 179 Macro Examples of Macro Expansion ............................ 19 Macro List.....................................................
INDEX Multi Trace...................................................... 171 Multi Trace Frame Number ....................... 110, 171 Multi Trace Function ........................................ 110 Operation in Multi Trace Mode ........................... 92 Setting Methods of Multi Trace ......................... 174 Setting Multi Trace........................................... 112 N Native Mode Native Mode ............................................
INDEX Monitoring Program Automatic Loading .................................................. 204, 235 Program stopping conditions ............................. 298 Setting Monitoring Program Automatic Loading .......................................................... 139 Trace Control during Executing User Program .......................................................... 169 Project Active Project...................................................... 2 Active Project Configuration.........................
INDEX Setting Method................................ 42, 44, 46, 47, 80, 82, 83, 85, 86, 153, 155, 156, 157, 159, 160, 161, 215, 217, 219, 243, 245, 246, 248, 249, 250, 326 Setting Methods of Multi Trace ......................... 174 Setting Minimum Measurement Unit for Timer .......................................... 123, 185, 267 Setting Monitoring Program Automatic Loading .......................................................... 139 Setting Multi Trace...........................................
INDEX Display Format of Trace Data ............................. 54 Display without Analyzing Trace Data (Specify / RAWDATA.) ..................................... 262 Displaying Trace Data ........................................ 54 Displaying Trace Data Storage Status .................................. 113, 176, 224, 260 Frame Number and Step Number in Single Trace .......................................................... 107 Function of Single Trace................................... 106 Multi Trace ...
INDEX 338
Colophon CM41-00313-6E FUJITSU SEMICONDUCTOR • CONTROLLER MANUAL F2MC-16 FAMILY SOFTUNETM Workbench USER’S MANUAL April 2011 the 6th edition Published FUJITSU SEMICONDUCTOR LIMITED Edited Sales Promotion Dept.