User’s Manual ID78K0 Integrated Debugger Guide (Windows™ based operation) Target device 78K/0 series Document No. U11649EJ1V2UM00 (1st edition) Date Published March 1998 J CP(K) © 1991 1996 Printed in Japan IBM PC/AT is a trademark of International Business Machines Corporation. i386 and i486 are trademarks of Intel Corporation. MS-DOS and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Windows is an abbreviation of Microsoft TM Windows TM Operating System. The information in this document is subject to change without notice. No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Corporation. NEC Corporation assumes no responsibility for any errors which may appear in this document. NEC Corporation does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from use of a device described herein or any other liability arising from use of such device. No license, either express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC Corporation or of others. M7A 96. 10 Regional Information Some information contained in this document may vary from country to country. Before using any NEC product in your application, pIease contact the NEC office in your country to obtain a list of authorized representatives and distributors. They will verify: • Device availability • Ordering information • Product release schedule • Availability of related technical literature • Development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, AC supply voltages, and so forth) • Network requirements In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. NEC Electronics Inc. (U.S.) NEC Electronics (Germany) GmbH NEC Electronics Hong Kong Ltd. Santa Clara, California Tel: 408-588-6000 800-366-9782 Fax: 408-588-6130 800-729-9288 Benelux Office Eindhoven, The Netherlands Tel: 040-2445845 Fax: 040-2444580 Hong Kong Tel: 2886-9318 Fax: 2886-9022/9044 NEC Electronics (France) S.A. Velizy-Villacoublay, France Tel: 01-30-67 58 00 Fax: 01-30-67 58 99 Seoul Branch Seoul, Korea Tel: 02-528-0303 Fax: 02-528-4411 NEC Electronics (France) S.A. NEC Electronics Singapore Pte. Ltd. Milton Keynes, UK Tel: 01908-691-133 Fax: 01908-670-290 Spain Office Madrid, Spain Tel: 01-504-2787 Fax: 01-504-2860 United Square, Singapore 1130 Tel: 65-253-8311 Fax: 65-250-3583 NEC Electronics Italiana s.r.1. NEC Electronics (Germany) GmbH Milano, Italy Tel: 02-66 75 41 Fax: 02-66 75 42 99 Scandinavia Office Taeby, Sweden Tel: 08-63 80 820 Fax: 08-63 80 388 NEC Electronics (Germany) GmbH Duesseldorf, Germany Tel: 0211-65 03 02 Fax: 0211-65 03 490 NEC Electronics (UK) Ltd. NEC Electronics Hong Kong Ltd. NEC Electronics Taiwan Ltd. Taipei, Taiwan Tel: 02-719-2377 Fax: 02-719-5951 NEC do Brasil S.A. Cumbica-Guarulhos-SP, Brasil Tel: 011-6465-6810 Fax: 011-6465-6829 J98. 2 Preface Preface Thank you for purchasing the ID78K0 integrated debugger. Conventional debuggers are used by entering commands directly. The ID78K0 integrated debugger, on the other hand, runs under Windows to provide a friendly, easy-to-use GUI (Graphical User Interface). Its operation is mouse-based, and operation is possible without having to refer to the manual. Also, frequently used commands are represented as buttons, allowing their activation simply by clicking the button with the mouse. «Purpose» The purpose of this manual is to provide the user with a brief explanation of how to use the ID78K0 integrated debugger. This manual should be read together with the “ID78K0 Integrated Debugger User’s Manual (Reference).” For a detailed explanation of each window, refer to the “ID78K0 Integrated Debugger User’s Manual (Reference).” «Files supplied with the integrated debugger» Files used with the integrated debugger File name ID78K0.EXE Explanation Debugger main section. The debugger is started by executing this file. ID78K0P.DLL Contains the libraries used for link processing with Project Manager. DB78K0.DLL Contains libraries for file and symbol processing. AS78K0.DLL Contains libraries for assembly and disassembly. EX78K0.DLL Contains libraries for communication with the in-circuit emulator. EX78K0.OM0 Downloaded into the in-circuit emulator when the debugger starts. ID78K0.HLP Help file. EXPC.INI Initial file. Used to specify a set point and an interrupt address for the PC interface board. Sample programs File name Explanation SAMPLE.C Sample program written in C. SUB.C Sample program written in C. SAMPLE.LNK Load module file for sample programs SAMPLE.C and SUB.C. µµµµµPD78014. i Contains the subroutines of SAMPLE.C. Compiled by Preface «Target device» The device which is to be the target of debugging by the integrated debugger is called a target device. The table below lists target devices, their associated device files, microprograms, and the names of the CPUs which select the target devices. Target device CPU name Device file µµµµµPD78014 78014 D014.78K µµµµµPD78044 78044 D044.78K µµµµµPD78054 78054 D054.78K µµµµµPD78064 78064 D064.78K Note: For details of other devices, contact your NEC sales representative or authorized dealer. «In-circuit emulator» An in-circuit emulator and dedicated interface board are required to use the integrated debugger. The table below lists the in-circuit emulator boards and interface boards that can be connected to host machines. In-circuit emulator Product name Explanation IE-78000-R-A In-circuit emulator main board IE-78xxx-R-EM(Note 1) Product type dependent board Note 1. For details, contact your NEC sales representative or authorized dealer. Interface boards Product name Explanation IE-70000-98-IF-A Interface board for PC-9801 and 9821 Series (C bus) IE-70000-98-IF-B Interface board for PC-9801 and 9821 Series (C bus) IE-70000-98N-IF(Note 2) Interface board for 98NOTE (110-pin expansion bus) IE-70000-PC-IF-B(Note 3) Interface board for IBM-PC/AT Series (ISA bus) Note 2. Note 3. The IE-70000-98N-IF is corrected to the expansion bus (110-pin type) of 98NOTE. The IE-70000-PC-IF-A cannot be used. ii Preface «Host machine» The integrated debugger runs under Windows. machine to be used. The table below lists the requirements for the Item Requirement Host machine PC-9801, 9821 or IBM-PC/AT Series CPU i80386 or above (i80486, 33 MHz or above recommended) Main memory 4M bytes or more (8M bytes or more recommended) OS Windows 3.1 or Windows 95 Screen size 640 x 400 dots or larger (800 x 600 dots or larger recommended) «Configuration» • Chapter 1 Overview Explains general operations of the integrated debugger. • Chapter 2 Basic Operations Explains the relationships between windows and other information by purpose. • Chapter 3 Advanced Use of ID78K0 Describes the terms used in the explanation of the integrated debugger. «Conventions» The following explains the conventions used throughout this manual. : Indicates a key to be pressed. + “ ” ‘ ’ [ ] GRPH key : : : : Indicates keys which must be pressed at the same time. Indicates a character string. Indicates a character. Indicates an optional parameter. : Representation of a key featured by the PC-9801 and 9821 Series. The Alt key of the IBM-PC/AT Series has the same function. All representations of keys in this manual are for the PC-9801 and 9821 Series. PC/AT Series computer as a host machine, see Appendix B. iii When using an IBM- Preface «Screen» The descriptions in this manual refer to Windows 95 screens unless specified otherwise. The differences between Windows 3.1 screens and Windows 95 screens are as described below. Windows 3.1 Windows 95 Remarks Displays the control menu. Control menu box With Windows 95, an icon or the Windows logo is displayed. Minimizes the window. Window size modification Maximizes the window. Restores the window to its original size. Close button (None) Closes the window. Multiple options can be selected. Option Only one of the multiple options can be selected. Control menu box Window size modification, program closing Windows 95 screen Windows 3.1 screen Options iv Preface «Cautions» • To perform source debugging, add options for creating debug information whenever compiling, assembly, or linking is performed. Otherwise, source debugging may not be possible. • When creating your own startup routine in C, add the symbols given below. result in part of the step execution not being performed correctly. Where to add Symbol to be added Start of startup routine _@cstart End of startup routine _@cend Failing to do so may «Related Documents» The documents (user’s manuals) related to this manual are listed below: Document name Document number ID78K0 Integrated Debugger User’s Manual, Reference RA78K Series Assembler Package Japanese English U11539J U11539E Language EEU-815 EEU-1399 Operation EEU-809 EEU-1404 RA78K Series Structured Assembler Preprocessor EEU-817 EEU-1402 CC78K Series C Compiler Language EEU-655 EEU-1280 Operation EEU-656 EEU-1284 IEU-849 EEU-1372 U-10085JJ EEU-1343 78K/0 Series User’s Manual, Instructions µµµµµPD78014, 78014Y Sub-Series Note: The above documents may be revised without notice. designing an application system. v Use the latest versions when Contents Chapter 1 Overview------------------------------------------------------------------------------------------------ 1 1.1 Starting and Terminating the Debugger ------------------------------------------------------- 2 1.1.1 Starting ----------------------------------------------------------------------------------- 2 1.1.2 Terminating------------------------------------------------------------------------------ 3 1.2 Making Maximum Use of the Main Window -------------------------------------------------- 4 1.2.1 Main Window Functions -------------------------------------------------------------- 4 1.2.2 Making Maximum Use of Menus --------------------------------------------------- 5 1.2.3 One-Touch Tool Bar Operation----------------------------------------------------- 5 1.2.4 Using Information Provided by the Status Bar ---------------------------------- 7 Chapter 2 Basic Operations ------------------------------------------------------------------------------------- 8 2.1 Establishing the Environment -------------------------------------------------------------------- 9 2.1.1 Selecting a Device--------------------------------------------------------------------- 10 2.1.2 Selecting a CPU Clock --------------------------------------------------------------- 11 2.1.3 Mapping ---------------------------------------------------------------------------------- 12 2.1.4 Specifying a Stack Area-------------------------------------------------------------- 13 2.1.5 Setting the Alternate Software Operation Clock -------------------------------- 14 2.1.6 Setting Memory Banks --------------------------------------------------------------- 16 2.1.7 Loading/Saving the Debugging Environment ----------------------------------- 18 2.2 Source Level Debugging -------------------------------------------------------------------------- 20 2.2.1 Notes on Compilation, Assembly, and Linking---------------------------------- 20 2.2.2 Downloading a Program-------------------------------------------------------------- 21 2.2.3 Displaying a Source ------------------------------------------------------------------- 22 2.2.4 Functions Supported by the Source Window ----------------------------------- 23 2.2.5 Jump from the Source Window----------------------------------------------------- 24 2.3 Instruction Level Debugging---------------------------------------------------------------------- 25 2.3.1 Assembly Language Display and Online Assembly --------------------------- 26 2.3.2 Saving and Referencing Displayed Assembly Language Code ------------ 27 2.3.3 Functions Supported by the Assemble Window -------------------------------- 28 2.3.4 Jump from the Assemble Window ------------------------------------------------- 29 2.4 Manipulating Memory ------------------------------------------------------------------------------ 30 2.4.1 Displaying and Modifying Memory Data------------------------------------------ 30 2.4.2 Basic Memory Data Operations ---------------------------------------------------- 31 2.4.3 Saving and Referencing Displayed Memory Data ----------------------------- 32 2.4.4 Functions Available in the Memory Window------------------------------------- 33 2.4.5 Jumping from the Memory Window------------------------------------------------ 34 2.5 Manipulating Registers ---------------------------------------------------------------------------- 35 2.5.1 Displaying and Modifying Registers ----------------------------------------------- 35 2.5.2 Saving and Referencing Displayed Register Data ----------------------------- 36 2.5.3 Functions Available in the Register Window ------------------------------------ 37 2.5.4 Functions Available in the SFR Window ----------------------------------------- 37 2.5.5 Jumping from the Register Window ----------------------------------------------- 38 2.6 Creating Events ------------------------------------------------------------------------------------- 39 2.6.1 Setting and Referencing Events in the Source Window and Assemble Window --------------------------------------------------------------- 40 2.6.2 Creating Event Conditions ----------------------------------------------------------- 41 2.6.3 Setting Events -------------------------------------------------------------------------- 43 2.6.4 Saving and Restoring Event Conditions------------------------------------------ 44 2.6.5 Functions Available in the Event Manager--------------------------------------- 45 2.6.6 Jumping to an Event Setting Address--------------------------------------------- 46 vi Contents 2.7 2.8 2.9 Manipulating Symbols (Variables) -------------------------------------------------------------- 47 2.7.1 Displaying and Modifying Variables ----------------------------------------------- 48 2.7.2 Saving and Referencing Symbol Data -------------------------------------------- 50 2.7.3 Functions Available in the Variable Window and Local Variable Window --------------------------------------------------------------- 51 Using the Tracer Effectively ---------------------------------------------------------------------- 52 2.8.1 Displaying Trace Results ------------------------------------------------------------ 53 2.8.2 Saving and Referencing Trace Results------------------------------------------- 54 2.8.3 Effective Trace Memory Usage 1 (Trace Mode Setting) --------------------- 55 2.8.4 Effective Trace Memory Usage 2 (Trace Full Break, Snapshot Trace)----------------------------------------------- 59 2.8.5 Inter-Window Connection Functions (Window Connection Function, Jump Function) ------------------------------- 61 Measuring the Execution Time ------------------------------------------------------------------ 63 2.9.1 Measuring Program Execution Time ---------------------------------------------- 63 2.9.2 Time Measurement Using the Tracer --------------------------------------------- 64 Chapter 3 Advanced Use of ID78K0 ----------------------------------------------------------------------------- 65 3.1 Verifying the Validity of Evaluation-------------------------------------------------------------- 66 3.1.1 Coverage -------------------------------------------------------------------------------- 66 3.1.2 Verifying the Validity of Evaluation Based on Coverage---------------------- 67 3.1.3 Notes on Coverage Results --------------------------------------------------------- 69 3.2 Using External Sense Clips ---------------------------------------------------------------------- 70 3.2.1 Tracing External Data----------------------------------------------------------------- 71 3.2.2 Trigger Output -------------------------------------------------------------------------- 72 3.2.3 Real-Time RAM Output -------------------------------------------------------------- 73 3.2.4 Creating an Event by ANDing a Data Condition-------------------------------- 74 3.3 Measuring Time by Setting Conditions -------------------------------------------------------- 75 Appendix A Error Messages ------------------------------------------------------------------------------------- 77 Appendix B Key Functions --------------------------------------------------------------------------------------- 87 B.1 Functions of Special Function Keys------------------------------------------------------------ 87 B.2 Functions of Special Function Keys ( CTRL + Key) ---------------------------------------- 88 Appendix C Menus------------------------------------------------------------------------------------------------- 89 vii [MEMO] Chapter 1 Overview Chapter 1 Overview This chapter outlines the debugger. 1.1 Starting and Terminating the Debugger This section explains how to start and terminate the debugger. 1.2 Making Maximum Use of the Main Window The main window appears when the debugger is started. The main window supports many functions. By making full use of these functions, the efficiency of debugging can be significantly enhanced. 1 Chapter 1 Overview 1.1 Starting and Terminating the Debugger 1.1 Starting and Terminating the Debugger • The debugger can be started and terminated easily. • To start the debugger, select the icon, shortcut key, or corresponding item in the start menu. These will have been registered when the software was installed. • To terminate the debugger, select the corresponding item from the menu. When terminating the debugger, you may select saving of the debugging environment. Doing so allows the debugger to be used immediately the next time it is started. 1.1.1 Starting 1. 2. 3. 4. Start Windows. Turn on the in-circuit emulator. Turn on the target, if being used. Double-click the icon or shortcut key, registered when the debugger was installed. 5. After the debugger starts, the configuration dialog box appears. 2 Chapter 1 Overview 1.1 Starting and Terminating the Debugger 6. Select a debug target device. (Note that the debug target device can be selected only when the debugger is being started.) 7. Set the clock source, memory mapping, and other required items. 8. Once all the necessary items have been set, click the button. This completes device initialization and causes the required data to be downloaded to the in-circuit emulator. 9. Once downloading has been completed, the main window of the debugger opens. window is used as the core window for debugging. 1.1.2 Terminating 1. Select File from the menu bar of the main window. 2. Select Exit from the File pull-down menu. 3. The Exit Debugger dialog box appears. 4. Click the button to terminate the debugger. 3 The main Chapter 1 Overview 1.2 Making Maximum Use of the Main Window 1.2 Making Maximum Use of the Main Window • All debugger windows are based on the main window. • The main window supports many functions, all of which are easy to use. 1.2.1 Main Window Functions • The main window supports four major functions. • Many debugger operations are performed from the main window. functions. Function Menu bar Tool bar Window display area Status bar Remember the following four Description Contains all the functions supported by the debugger. To perform some operation with the debugger, first check the contents of the menu bar. Contains the most-frequently used commands. While no target is connected, try clicking each of the buttons, and make a note of the graphic identifying each button. Windows are displayed in this area. These windows include, for example, the Source window and Assemble window, both of which are used whenever debugging is performed. The status of the in-circuit emulator (IE) is displayed in this area. The IE status and break cause are particularly important. Tool Bar: Contains he most-frequently used commands. Tool bar commands can be executed by a single action, making them extremely conventient to use. Menu bar: All operations supported by the debugger are displayed on pull-down menus. Window display area: Windows are displayed. Status bar: Information such as IE inforation is displayed. 4 Chapter 1 Overview 1.2 Making Maximum Use of the Main Window 1.2.2 Making Maximum Use of Menus • The menus contain all the functions supported by the debugger. • Even when you are not familiar with the debugger's functions, briefly studying each of the pulldown menus will allow you to understand the range of functions available. • The menus are outlined below. Menu File Edit View Option Execute Operation Browse Jump Window Help 1.2.3 Description Contains file operation commands. This menu enables the switching of the source displayed in the Source window, the loading and saving of project files, and other file operations. Provides commands for copying and pasting displayed data, as well as commands for memory editing. Contains display commands. Using this menu, you can retrieve variables, enter the display start address, and display variables. Allows you to display and hide the tool bar, status bar, and buttons in each window, and to establish the debugger environment. Contains execution commands. Also, trace mode setting is performed from this menu. Allows you to perform window mode switching, and to specify connection to the trace window. Contains the commands used to open each window. From this menu, you can display windows such as the event and coverage windows. Allows you to jump to the source window, assemble window, and memory window. Allows you to specify how windows are to be displayed, the arrangement of icons, and also enables switching between windows. Displays help information. One-Touch Tool Bar Operation • The tool bar consists of buttons which correspond to frequently used commands. Commands are executed simply by clicking the corresponding button. • The function of each button is identified by a suitably representative graphic. • The commands assigned to the tool bar buttons can also be executed from the menu bar. Commands for program execution: Commands for controlling program execution Window manipulation commands: Frequently used commands such as that for displaying a source and that for displaying registers. 5 Chapter 1 Overview Display 1.2 Making Maximum Use of the Main Window Description Stops user program execution. Executes a user program. As soon as the break conditions are satisfied, the user program terminates. Executes a user program. Even when break conditions are satisfied, the user program does not terminate. Executes the program in real time, until execution returns to the calling function. Executes the program, step by step. Every time this button is clicked, one step of the program is executed. For source level debugging, one step corresponds to one line. For instruction level debugging, one step corresponds to one instruction. Performs Next step execution of the program. Every time this button is clicked, one step of the program is executed, by means of Next step execution. For source level debugging, one step corresponds to one line. For instruction level debugging, one step corresponds to one instruction. Initializes the debugger or emulation CPU. Opens the Reset Debugger dialog box. Displays the source text. Opens the Source window. Displays the stack contents. Opens the Stack window. Displays a disassembled program. Opens the Assemble window. Displays the contents of memory. Opens the Memory window. Displays the register contents. Opens the Register window. Registers and sets break events. Opens the Break dialog box. Displays trace results. Opens the Trace View window. Registers and sets trace events. Opens the Trace dialog box. Displays the SFR contents. Opens the SFR window. Displays timer measurement results. Opens the Timer window. 6 Chapter 1 Overview 1.2 Making Maximum Use of the Main Window 1.2.4 Using Information Provided by the Status Bar • The status bar displays important data including, for example, the status of the IE and the cause of a break. • If a break occurs at a point where no break has been set, or if no source appears when a break occurs, for example, check this area first. Status bar: Information relating to IE is displayed. Break cause information is particularly important. 1. Source file name: 2. Function name: 3. 4. PC value: CPU status: CPU status TARGET HOLD STANDBY LUTCHUP 5. IE status: IE status RUN STEP BREAK TRACE TIMER 6. Break cause: Cause Compulsory Break Temporally Break Event Break Out Of Range Break Trace Full Break Non Map Break SFR Illegal Stack Overflow Write Protect Displays the source file name and source line number corresponding to the indicated PC value. If no file information is available, "---" is displayed. Displays the function name corresponding to the indicated PC value. If no function information is available, "---" is displayed. Displays the current PC value. Displays the status of the CPU (µµµµµPD780xx: target device). Description The target is on. Bus hold mode Halt or stop mode Latch-up has been detected. emulator immediately. Turn off the target and in-circuit Displays the operation status of the in-circuit emulator. Description Real-time execution in progress Step-by-step execution in progress Break status Tracing in progress Timer measurement in progress Displays the reason for a break. causes. The table below lists possible break Description Normal break (manual break) Normal break (break caused by internal processing) Break triggered by an event Break caused by procedure step termination Break caused by trace full state Access to a non-mapped area was attempted. Illegal access to an SFR was attempted. Break caused by stack overflow An attempt was made to write to a write-protected area. 7 Chapter 2 Basic Operations Chapter 2 Basic Operations This chapter explains the basic operations of the ID78K0. Each section clarifies how windows are related to each other. 2.1 Establishing the Environment Explains how to establish a debugging environment. 2.2 Source Level Debugging Explains the use of the Source window to debug a source program. 2.3 Instruction Level Debugging Explains the use of the Assemble window to perform assembler level debugging. 2.4 Manipulating Memory Explains the use of the Memory window to perform modification, initialization, and other operations on memory. 2.5 Manipulating Registers Explains the functions of the Register window, used to manipulate general-purpose registers, and those of the SFR window, used to manipulate SFRs. 2.6 Creating Events Events are very useful for debugging. section explains how to set an event. Events can be used for program and trace control. This 2.7 Manipulating Symbols (Variables) The debugger supports the input of symbols as data. and display variables. This section explains how to enter symbols 2.8 Using the Tracer Effectively The IE-78000-R-A contains 32K frames of trace memory. The tracer is used to trace data, making it very useful for detecting program problems. This section explains the use of the tracer. 2.9 Measuring the Execution Time Explains the time required to execute a program from beginning to end, and time tags written in the tracer. 8 Chapter 2 Basic Operations 2.1 Establishing the Environment 2.1 Establishing the Environment • Establishing an environment allows the debugger to recognize the configuration of a target system. Establishing a debugging environment enables the maximum utilization of the debugger functions. • The environment must be established whenever the debugger is started. • Once an environment has been established, it can be saved to a file, subsequently eliminating the need to newly establish the environment. When the debugger is next started, the environment can be established simply by loading the file (project file). • For the ID78K0 operating environment, set the following items: Item Device CPU clock Peripheral equipment operation Memory bank switching Alternate operation clock Memory mapping Mask option Setting window Configuration dialog box Location in environment setup diagram <1>CPU <2> <3> <4> <6> <7> CLOCK <1> CPU Configuration dialog box Bank Set dialog box Configuration dialog box Configuration dialog box Mask Option dialog box <1> CPU <8> MEMORY <1> CPU <5> <8> MEMORY <1> CPU Can be set only when the debugger is being started Can be set at any time Target jig In-circuit emulator <1> CPU Remarks CLOCK CLOCK <6> <2> External Clock Internal Clock <3> <4> <7> External Clock or 6-8pin short Subsystem clock MEMORY Subsystem clock or 6-8pin short EP-78xxx-R <8> IE-78000-R-A IN CIRCUIT EMULATOR MEMORY <5> IE alternate memory (64K bytes) Power supply Target jig Establishing an Environment 9 Chapter 2 Basic Operations 2.1.1 Selecting a Device 2.1 Establishing the Environment • A device can be selected in the Configuration dialog box that appears when the debugger is started. Note that once the debugger has started, this selection cannot be changed. Setting in the Configuration dialog box: 1. Start the debugger. 2. Select a device in the Configuration dialog box that appears when the debugger is started. When the main window has already been opened: 1. Terminate, then restart, the debugger. Selecting a device 10 Chapter 2 Basic Operations 2.1.2 Selecting a CPU Clock 2.1 Establishing the Environment • A CPU clock is selected in the Configuration dialog box that appears when the debugger is started. Note that once the debugger has started, the CPU clock cannot be changed. Setting in the Configuration dialog box: 1. Start the debugger. 2. Change the CPU clock in the Configuration dialog box that appears when the debugger is started. When the main window has already been opened: 1. Terminate, then restart, the debugger. • When "Internal" is selected as the CPU clock, the clock provided by the in-circuit emulator is used as the CPU clock. This clock frequency is determined by the connected emulation board (EM board). Emulation board(Note) CPU clock frequency when "Internal" is selected IE-78014-R-EM 8.38 MHz IE-78014-R-EM-A IE-780208-R-EM 4.19 MHz IE-78044-R-EM IE-78064-R-EM 5.0 MHz IE-78078-R-EM IE-78098-R-EM 6.0 MHz Note For emulation boards not listed here, refer to the manual provided with the board. To use the clock provided by the target, select "External." 11 Chapter 2 Basic Operations 2.1.3 Mapping 2.1 Establishing the Environment • When external ROM/RAM is used in addition to internal ROM and internal RAM (including SFRs and registers), the area to be mapped must be set. To add an area to be mapped: 1. Open the Configuration dialog box. This dialog box appears when the debugger is started. It can also be displayed by selecting Option -> Configuration... from the menu bar. 2. Set the Memory Attribute area, then click the button. To delete a mapped area: 1. Open the Configuration dialog box. This dialog box appears when the debugger is started. It can also be displayed by selecting Option -> Configuration... from the menu bar. 2. Select the mapped area to be deleted, then click the button. Mapping can be performed using the Configuration dialog box. Emulation ROM: IE alternate ROM Emulation RAM: IE alternate RAM Target : Target RAM Stack : Stack area specification 12 Chapter 2 Basic Operations 2.1.4 Specifying a Stack Area 2.1 Establishing the Environment • To monitor stack operation, specify a stack area. • When a stack area has been specified, any stack operation (CALL, RET, PUSH, POP) performed outside the set area is detected as being an illegal access. • An area in internal high-speed RAM can be specified as the stack area. • When no stack area is specified, the entire internal high-speed RAM area is used as the stack area. To specify a stack area: 1. Open the Configuration dialog box. This dialog box appears when the debugger is started. It can also be displayed by selecting Option -> Configuration... from the menu bar. 2. Set the Memory Attribute area, then click the button. To cancel the stack area specification: 1. Open the Configuration dialog box. This dialog box appears when the debugger is started. It can also be displayed by selecting Option -> Configuration... from the menu bar. 2. Select the mapped stack area to be deleted, then click the button. The µPD78014 contains 1024 bytes of internal high-speed RAM between addresses 0xfb00 and 0xfeff. Therefore, set the area to be mapped within this range. 13 Chapter 2 Basic Operations 2.1 Establishing the Environment 2.1.5 Setting the Alternate Software Operation Clock • The alternate software is control software that runs on the 78K0 device. It controls the resources (register values, SFRs, and memory) of the target while the in-circuit emulator is in break mode. • The alternate software accesses the target resources directly. • The operation of the alternate software uses the same clock as the user program. If, therefore, the user program uses a low-speed clock while the in-circuit emulator is in break mode, the alternate software will also operate slowly, thus lowering the overall speed of debugger operation. To avoid this, specify the use of the alternate software operation clock. To set the operation clock: 1. Open the Configuration dialog box. This dialog box appears when the debugger is started. It can also be displayed by selecting Option -> Configuration... from the menu bar. 2. Select the operation clock in the alternate software operation clock selection area. Setting alternate software operation clock 14 Chapter 2 Basic Operations 2.1 Establishing the Environment The alternate software operating environment is illustrated below. ID78K0.EXE AS78K0.DLL DB78K0.DLL EX78K0.DLL EX78K0.0M0 Control software During break: Alternate software While running: User program I/O and memory on the target SV board CPU for IE control: V53 IE-78000-R-A BK, EM board Emulation CPU: 78K0 IN CIRCUIT EMULATOR Trace board Power supply Target 15 Chapter 2 Basic Operations 2.1 2.1.6 Setting Memory Banks Establishing the Environment • The 78K0 series has an address space consisting of up to 64K bytes between addresses 0 and 0xffff. • A program of 64K bytes or more can be run by switching part or all of the program area between addresses 0 and 0xffff. • The structure of the memory banks is shown below. In the following figure, the 16K-byte space between addresses 4000h and 7fffh is used for the memory banks. Five banks, 0 to 4, are used. When bank 0 is selected, data in bank 0 can be accessed at addresses 4000h to 7fffh, a linear space existing between address 0h and 7fffh. When bank 0 is selected, the spaces corresponding to banks 1 to 4 cannot be accessed. When bank 3 is selected, the data in bank 3 can be accessed between addresses 4000h and 7fffh. The other banks cannot be accessed. Memory Bank Switching FFFFH FFFFH SFR SFR Bank4 Bank4 Bank3 7FFFH Bank2 7FFFH Bank memory Bank2 Bank memory Bank1 4000H Bank1 Bank0 4000H Bank0 3FFFH Bank3 3FFFH Internal ROM Internal ROM 0000H 0000H When bank 3 is selected When bank 0 is selected 16 Chapter 2 Basic Operations 2.1 Establishing the Environment • To switch between memory banks, program the generation of the upper address by using, for example, ports. • So that the debugger can control the memory banks effectively, set the ports and other data to be used for bank switching when establishing the environment. To set up the memory banks, click the BANK Set button in the Configuration dialog box. The dialog box for memory bank setting will appear. 17 Chapter 2 Basic Operations 2.1 Establishing the Environment 2.1.7 Loading/Saving the Debugging Environment • Saving the debugging environment into a project file enables subsequent debugging to be performed in exactly the same environment. Debugging environment Load At start After start Save After start At exit Method Specify a project file to be read, using its full path name, as a start option. Load a project file by using the Project file load dialog box. Save a project file using the Project file save dialog box. Select "Save Project File" in the Exit Debugger dialog box, then terminate the debugger. After the debugger starts (loading) \ Before the debugger starts Enter the full path name of a project file. After the debugger starts (save) \ When the debugger terminates When terminating the debugger, select 18 Chapter 2 Basic Operations 2.1 Establishing the Environment Data to be loaded/saved Window Configuration dialog box Bank Set dialog box Main window Load Module dialog box Extended Option dialog box Mask Option dialog box Source Path dialog box Source window Assemble window Memory window Stack window SFR window Local Variable window Trace View window Show Trace dialog box Snap Trace dialog box Event Manager Event Link dialog box Break dialog box Trace dialog box Snap-Shot dialog box Event Set dialog box Register window Variable window Coverage window Data All items All items Setting information File information downloaded Setting information Setting information Source path information Window display information, font information Window display information, display start address Window display information, display start address Window display information Window display information Window display information Window display information Setting information Setting information Window display information, all event information Window display information Window display information Window display information Window display information Window display information Window display information, displayed bank Window display information, displayed variable information Window display information 19 Chapter 2 Basic Operations 2.2 Source Level Debugging 2.2 Source Level Debugging • • • • 2.2.1 ID78K0 can set breakpoints and display variables for a source. Many source level operations are supported, thus greatly enhancing debugging efficiency. Source level debugging can be performed by loading a file containing source information. Source level debugging is particularly effective for debugging programs written in C or structured assembly language. Notes on Compilation, Assembly, and Linking • When source level debugging is performed, the file to be loaded must contain source debugging information. • Source debugging information is included in the object by specifying the option for adding debugging information at assembly or compile time. • The following shows how to set options at compilation, assembly, and linking: Type of source to be debugged C program Without in-line assembly description With in-line assembly description Required action Specify the -G option at compile time. Assembly language program 1. At compile time, specify the -a option to output an assembly source file. 2. Assemble the source generated in 1, above, without specifying any debug options (-GA, NGA). 1. Specify the -GS option at structured assembly. 2. Assemble the source generated in 1, above, without specifying any debug options (-GA, NGA). Specify the -GA option at assembly. Link Specify the -G option at linking. Structured assembly language program 20 Chapter 2 Basic Operations 2.2.2 Downloading a Program 2.2 Source Level Debugging • Load module files and hexadecimal files can be downloaded. • When a downloaded file contains source debugging information, source level debugging can be performed. To perform downloading: 1. Select File -> Download... from the menu bar to open the Load Module dialog box. 2. Load the desired file. Select the file to be loaded. \ 21 Chapter 2 Basic Operations 2.2.3 Displaying a Source 2.2 Source Level Debugging • After a load module file containing source debugging information has been downloaded, the source can be displayed. • If the source file is stored in a directory other than that containing load module file, or if the source file is stored in more than one directory, source path information must be provided to the debugger. To display a source: 1. Select Browse -> Source Text... from the menu bar or click the Source window. button to open the To change the source file displayed in the Source window: 1. Activate the Source window. 2. Select File -> Open... from the menu bar to open the Source file select dialog box. When a source file is stored in another directory or in more than one directory: 1. Select Option -> Source Path... from the menu bar to open the Source Path dialog box. Specifying a directory containing a source file: Source Path dialog box Displaying a source file: Source window \ Selecting a source file to be displayed in the Source window: Source file select dialog box 22 Chapter 2 Basic Operations 2.2 Source Level Debugging 2.2.4 Functions Supported by the Source Window • The Source window Supports a wide range of functions, such as the setting of breakpoints and the addition of variables to be displayed. • The supported functions are listed below: Function Using the mouse Setting/deleting a Click the point mark area. breakpoint Procedure From the keyboard 1. Select a line number (with the mouse). 2. Select Execute -> Set BP from the menu bar. ( CTRL + B ) Setting PC --- 1. Select a line number (with the mouse). 2. Select Execute -> Set PC from the menu bar. ( CTRL + E ) Displaying a variable 1. Select a variable. 2. Click the button then the Retrieving a character string 1. Checking an event 1. 2. 2. button. Select a variable. Click the button. Select an event line. Click the button. Setting, deleting, and displaying a breakpoint, and displaying an event 1. Select a variable (with the mouse). 2. Select View -> Watch Variable... or View Variable... from the menu bar. 1. Select a variable (with the mouse). 2. Select View -> Search... from the menu bar. 1. Select an event line (with the mouse). 2. Select View -> Event? from the menu bar. Event? button: Event manager PC position Line number: Mainly used as the pointer for keyboard entry. Select a character string. (Token-based selection is enabled by double-clicking.) Select an event setting line. Watch button: Variable window View button: Variable View dialog box Search button: Find dialog box 23 Chapter 2 2.2.5 Basic Operations 2.2 Source Level Debugging Jump from the Source Window • Jump from the Source window to the Assemble window and Memory window is supported. • Using the jump function, it is easy to check the source text assemble results. • Select a source line number as the jump destination. Then, the start address of the selected source line is set as the jump pointer. Jump destination Assemble window Memory window Procedure 1. Select a source line number. 2. Select Jump -> Assemble... from the menu bar. 1. Select a source line number. 2. Select Jump -> Memory... from the menu bar. The jump destination is the address of the source line, displayed in reverse video: In the following example, the start address of the 38th line is set as the jump pointer. Jump to the Assemble window Jump to the Memory window 24 Chapter 2 Basic Operations 2.3 Instruction Level Debugging 2.3 Instruction Level Debugging • The contents of memory can be displayed, modified, and retrieved in assembly language. • Instruction level debugging supports a higher level of precision than source level debugging. • Assembly language code can be displayed in the Assemble window and Trace View window. This section mainly explains the operations supported by the Assemble window. 25 Chapter 2 Basic Operations 2.3 Instruction Level Debugging 2.3.1 Assembly Language Display and Online Assembly • The Assemble window allows you to view assembly language code and perform online assembly. • With the online assemble function, patching can be performed. Simple bugs can be corrected and confirmed immediately. Display Assemble To select a displayed address Procedure Open the Addressing dialog box in either of the following two ways: 1. Select Browse -> Assemble... from the menu bar. 2. Click the button. To display instructions starting from an 1. Select an address to be used as the display address selected in another window (such pointer. as the Source, Memory, or Register 2. Select Jump -> Assemble... from the menu bar. window) Modification 1. Open the Assemble window. button to enter modify mode. 2. Click the 3. Position the cursor to the mnemonic display/modification area, then correct the program. 4. After completing the correction of the program, click the, 5. Click the button to rewrite the program. button to enter view mode. Specifying the start address for display: Addressing dialog box Assembly language display: Assemble window (display mode) ToModify button: Change to modify mode ToView button: Change to view mode Online assembly Program correction: Assemble window (modify mode) 26 Chapter 2 Basic Operations 2.3 Instruction Level Debugging 2.3.2 Saving and Referencing Displayed Assembly Language Code • The displayed assembly language code can be saved to a file. The saved file can subsequently be referenced. • The file is saved in text format, such that any commercially available editor can be used to view its contents. To save displayed assembly language code to a file: 1. Activate the Assemble window. 2. Select File -> Save As... from the menu bar. 3. Save the displayed assembly language code using the View file save dialog box. To open and reference the saved file: 1. Activate the Assemble window. 2. Select File -> Open... from the menu bar. 3. Load the file to be referenced using the View file load dialog box. Saving the display contents to a file: View file save dialog box Reference window The window used for loading and opening a file is opened as a reference window. All operations other than search are disabled while this window is displayed. \ \ Displaying the contents saved to a file: View file load dialog box 27 Chapter 2 Basic Operations 2.3 Instruction Level Debugging 2.3.3 Functions Supported by the Assemble Window • The Assemble window supports many functions such as the setting of breakpoints and PC setting. • The supported functions are listed below: Function Setting/deleting a breakpoint Using the mouse Click the point mark area. Procedure Using the keyboard 1. Select an address (with the mouse). 2. Select Execute -> Set BP from the menu bar. ( CTRL + B ) Setting PC --- 1. Select an address (with the mouse). 2. Select Execute -> Set PC from the menu bar. ( CTRL + E ) 1. Select a character string (with the mouse). 2. Select View -> Search... from the menu bar. Retrieving a character string 1. Select a character string. Checking an event 2. Click the button. 1. Select the address at which an event is set. 2. Click the button. 1. Select the address at which an event is set (with the mouse). 2. Select View -> Event? from the menu bar. Setting, deleting, and displaying a breakpoint, and displaying an event Address: The address displayed in reverse video is set as the pointer for PC position a function. ToModify button: Program correction Search button: Find dialog box Event? button: Event manager 28 Chapter 2 Basic Operations 2.3 2.3.4 Jump from the Assemble Window Instruction Level Debugging • Jump from a line in the Assemble window to the corresponding source line or memory address is supported. • Select an address as the jump destination. Then, the selected address is set as the jump pointer. • When the jump destination is the Source window, a jump is made to a source line including the jump pointer. Jump destination Source window Memory window 1. 2. 1. 2. Procedure Select an address. Select Jump -> Source Text... from the menu bar. Select an address. Select Jump -> Memory... from the menu bar. The jump destination is the address displayed in reverse video: In the following example, address 132H is the jump pointer. Jump to the Source window A jump is made to the source line including address 132H in the Source window. Jump to the Memory window 29 Chapter 2 2.4 Basic Operations Manipulating Memory 2.4 Manipulating Memory • The user can display, modify, and search for memory data. • The user can display and modify memory data in ASCII format. 2.4.1 Displaying and Modifying Memory Data • The user can display and modify memory data in the Memory window. Memory a display address is to be selected Display When Procedure The Addressing dialog box can be opened by means of either of the following two procedures: 1. Select Browse -> Memory... from the menu bar. 2. Select the button. 1. Select an address to act as a display pointer. When memory data is to be displayed starting from an address 2. Select Jump -> Memory... from the menu bar, or press selected in another window (such CTRL + M. as the Source window, Assemble window, or Register window) Modification 1. Open the Memory window. 2. Switch to modify mode by clicking the button. 3. Position the cursor to the desired memory display/modification area, then modify the data. 4. After entering the new data, execute the modification by clicking the button. 5. Switch to view mode by clicking the Specifying a desired display start address: Addressing dialog box Memory display: Memory window (view mode) ToModify button: Used to switch to modify mode. ToView button: Used to switch to view mode. Memory modification: Memory window (modify mode) 30 button. 2.4 Chapter 2 Basic Operations 2.4.2 Basic Memory Data Operations Manipulating Memory • Basic memory data operations are enabled by activating the Memory window. • The basic operations include initialization, copy, and comparison. To initialize memory: Select Edit -> Memory -> Memory Fill... from the menu bar. To copy memory data: Select Edit -> Memory -> Memory Copy... from the menu bar. To compare memory data: Select Edit -> Memory -> Memory Compare... from the menu bar. Memory initialization: Memory Fill dialog box String data of no more than 16 bytes can be specified. Memory copy: Memory Copy dialog box A memory copy destination can be specified. Activate the Memory window. Memory comparison: Memory Compare dialog box If memory data comparison reveals a mismatch, the Memory Compare result dialog box appears. 31 2.4 Manipulating Memory Chapter 2 Basic Operations 2.4.3 Saving and Referencing Displayed Memory Data • Displayed memory data can be saved to a file. A file containing saved memory data can be referenced. • Memory data is saved in text format, allowing an editor to be used to reference saved memory data. To save displayed memory data to a file: 1. Activate the Memory window. 2. Select File -> Save As... from the menu bar. 3. Save the displayed memory data by using the View file save dialog box. To open and reference a file containing saved memory data: 1. Activate the Memory window. 2. Select File -> Open... from the menu bar. 3. Load the file to be referenced by using the View file load dialog box. Saving displayed memory data to a file: View file save dialog box \ Reference window. Load and open the file to be displayed. The window is opened for reference. All operations other than Search are disabled. \ Displaying memory data that has been saved to a file: View file load dialog box 32 2.4 Manipulating Memory Chapter 2 Basic Operations 2.4.4 Functions Available in the Memory Window • The Memory window allows the user to perform a range of functions including modification in ASCII format, and data search. • The available functions are listed below. Function Character string search Procedure 1. Select a character string. button, or select View -> Search... from the 2. Click the menu bar. Select View -> Memory -> Ascii from the menu bar. ASCII character display selection Type display selection Select View -> Memory -> Nibble, Byte, Word, or Long from the menu bar. Select View -> Bin, Oct, Dec, or Hex from the menu bar. Number system display selection Data display. ToModify button: Used to modify data. The user can select binary, octal, decimal, or hexadecimal Display in ASCII display. The user can also select nibble, byte, word, and long for display. Search button: Find dialog box Address display: An address displayed in reverse video acts as a pointer to be used with each function. 33 2.4 Chapter 2 Basic Operations 2.4.5 Jumping from the Memory Window Manipulating Memory • This function enables a jump to the source line or disassembly start address corresponding to an address in the Memory window. • A jump destination can be specified by selecting a desired address. The selected address serves as a jump pointer. • When a jump is made to the Source window, a jump to the source line including the jump pointer occurs. Jump destination Source window Assemble window Procedure 1. 2. 1. 2. Select an address. Select Jump -> SourceText... from the menu bar. Select an address. Select Jump -> Assemble... from the menu bar. A jump is made to the address displayed in reverse video. In this case, address D0H is the jump pointer. Jump to the Source window. A jump to the source line including address D0H in the Source window occurs. Jump to the Assemble window 34 Chapter 2 Basic Operations 2.5 Manipulating Registers 2.5 Manipulating Registers • Registers are classified into three major types: control registers, general-purpose registers, and special function registers (SFRs). • The control registers and general-purpose registers can be displayed and modified in the Register window. The SFRs can be displayed and modified in the SFR window. 2.5.1 Displaying and Modifying Registers • The user can display and modify control registers, general-purpose registers, and SFRs. • The user can manipulate control registers and general-purpose registers in the Register window, and manipulate SFRs in the SFR window. Memory registers and generalpurpose registers (Register window) SFRs (SFR window) Display Control Modification (common to the Register window and SFR window) Procedure Select Browse -> Register... from the menu bar, or click the button. Select Browse -> Sfr... from the menu bar, or click the button. 1. Open a desired window. 2. Switch to modify mode by clicking the button. 3. Position the cursor to a desired register, then modify the data. 4. After making the modification, execute the modification by clicking the button. 5. Switch to view mode by clicking the Displaying and modifying control registers and general-purpose registers Register window (view mode) button. Displaying and modifying SFRs SFR window (view mode) SFR window (modify mode) Register window (modify mode) ToModify button: Used to switch to modify mode. ToView: Used to switch to view mode. 35 Chapter 2 Basic Operations 2.5 Manipulating Registers 2.5.2 Saving and Referencing Displayed Register Data • Displayed register data can be saved to a file. A file containing saved register data can be referenced. • Register data is saved in text format, allowing an editor to be used to reference saved register data. To save displayed register data to a file: 1. Activate a desired window. 2. When the Register window has been selected, select File -> Open/save Condition -> Save File as... from the menu bar. When the SFR window has been selected, select File -> Save As... from the menu bar. 3. Save the displayed register data by using the View file save dialog box. To open and reference a file containing saved register data: 1. Activate a desired window. 2. When the Register window has been selected, select File -> Open/save Condition -> Open Condition... from the menu bar. When the SFR window has been selected, select File -> Open... from the menu bar. 3. Load the file to be referenced by using the View file load dialog box. Saving displayed register data to a file: View file save dialog box \ Reference window. Load and open the file to be displayed. The window is opened for reference. All operations related to modification are disabled. \ Displaying register data that has been saved to a file: View file load dialog box 36 Chapter 2 Basic Operations 2.5 Manipulating Registers 2.5.3 Functions Available in the Register Window • The Register window allows the user to choose between the function name display option and absolute name display option, choose between the register display option and pair register display option, and so forth. • The available functions are listed below. Function Absolute name switching display/function name display Display Register display/pair register display Number system display selection 2.5.4 Procedure Absolute name: Select View -> Absolute Name from the menu bar. Function name: Select View -> Function Name from the menu bar. Register display: Select View -> Register from the menu bar. Pair register display: Select View -> Register Pair from the menu bar. Select View -> Bin, Oct, Dec, or Hex from the menu bar. Functions Available in the SFR Window • The SFR window allows the user to select the display order, specify whether attribute data is to be displayed, and so forth. • The available functions are listed below. Function Display order selection Attribute display selection Pickup display selection Procedure The user can choose either address order or alphabetic order as the display order: Select View -> Sfr -> Address Sort from the menu bar. Select View -> Sfr -> Attribute -> Show or Hide from the menu bar. Only those SFRs that have been modified but not yet written to a target in modify mode are displayed. Select View -> Sfr -> Pick Up from the menu bar. Address order, attribute display (default) Pickup display Hiding attribute data Alphabetical order 37 Chapter 2 Basic Operations 2.5 2.5.5 Jumping from the Register Window Manipulating Registers • This function enables a jump to the source line, disassembly start address, or memory address corresponding to a register value in the Register window. • A jump destination can be specified by selecting a desired register. The value of a selected register acts as a jump pointer. • When a jump is made to the Source window, a jump to that source line including the jump pointer is performed. Jump destination Source window Assemble window Memory window Procedure 1. Select a register 2. Select Jump -> SourceText... from the menu bar. 1. Select a register. 2. Select Jump -> Assemble... from the menu bar. 1. Select a register. 2. Select Jump -> Memory... from the menu bar. A jump is made to the value of the selected register. In this case, address D0H, held in the BC register, is the jump pointrer. Jump to the Source window. A jump to that source line including address D0H in the Source window is performed. Jump to the Assemble window 38 Chapter 2 Basic Operations 2.6 Creating Events 2.6 Creating Events • An event, set beforehand in a program, specifies that an operation is to be performed when a specified condition is satisfied. • Two types of conditions are used. One is an execution event, which is set for a program execution address. The other is an access event, which is set for memory data accessed by a programmed instruction. • Four types of events are used to perform operations. These include break events for terminating the program or analyzer, and qualified events, section events, and snapshot events which are used to control the tracer. • The event-related windows are listed below. Operation Event management Event condition creation Event setting Event condition Event link condition Break condition Trace condition Snapshot condition External sense clip condition 39 Window Event Manager Event Set dialog box Event Link dialog box Break dialog box Trace dialog box Snap-Shot dialog box External Sense Clip dialog box Chapter 2 Basic Operations 2.6 Creating Events 2.6.1 Setting and Referencing Events in the Source Window and Assemble Window • In the Source window and Assemble window, break events can be set, and events can be referenced. • If a break event is set in the Source window or Assemble window, a parallel-linked event link condition, named Break-L, is automatically created. • All set break events become execution events (with the status set to Run). Function Break event setting Procedure Use any of the five methods described below. 1. Click the point mark area. 2. Double-click a line number or address. 3. Select a line number or address, then click the button. 4. Select a line number or address, then select Execute -> Set BP from the menu bar. 5. Select a line number or address, then press CTRL + B . Event condition reference Use either of the two methods described below. Select an address or line number indicated by E in the point mark area, then perform either of the following operations: 1. Click the button. 2. Select View -> Event? from the menu bar. Line number and address: An address displayed in reverse video becomes the pointer used for input. Break event setting Point mark area: A break event can be set simply by clicking this area. Event reference: When an event is referenced, the Event Manager is opened, and the event is marked. 40 Chapter 2 Basic Operations 2.6 2.6.2 Creating Event Conditions Creating Events • Event conditions are divided into two main types: execution events for detecting an execution address, and access events for detecting access data. • When an execution event is used, it can be combined with an event condition. Function Event condition creation Event link condition creation Procedure The Event Set dialog box is used. Select Browse -> Event -> EventSet... from the menu bar. 1. Create an execution event in the Event Set dialog box. 2. Open the Event Manager by selecting Browse -> Event -> EventManager... from the menu bar. 3. Open the Event Link dialog box by selecting Browse -> Event -> EventLinkSet... from the menu bar. 4. Create an event link condition by dragging & dropping the execution event created in 1., above. Event condition link: Event Link dialog box Event condition creation: Event Set dialog box Use execution events. Event link condition creation and registration Event condition creation and registration An execution event is an event for which the status is Run. Event management: Event Manager 41 Chapter 2 Basic Operations 2.6 Creating Events • Examples of event condition setting are given below. When the Event Set dialog box is opened, the default screen, shown below, initially appears. Modify the screen settings as required. <1> <2> <3> <4> <5> <6> <7> Condition When a program at address 0x100 is executed When memory access to address 0xfe00 is performed When memory access is performed for addresses 0xfe00 to 0xfe7f <1>0x100 Setting <2>0 <3>Run <1>0xfe00 <4>0x00 <2>0 <5>ff <1>0xfe00-0xfe7f <3>Data R/W <5>ff <3>Data R/W <2>0 <4>0 <2>ffff <3>Data Read <5>ff <2>0 <3>Data Write <5>fe When memory is read (with no address condition set) If bit 0 is 1 when writing to address 0xfb01 is performed <1>0 <4>0 <1>0xfb01 <4>1 When 0x10 is written to address 0xfb01 When an event is to be set at the start of function sub(), coded in C When the value of variable cnt, registered in C, becomes 0x46 When an event is to be set with the START function of the assembler When the value of assembler variable DATA becomes 35H <1>0xfb01 <2>0 <3>Data Write <4>0x10 <5>0 <1>_sub <2>0 <3>Run Remarks The defaults are used for <4>, <5>, <6>, and <7>. The defaults are used for <6> and <7>. The defaults are used for <6> and <7>. An event occurs when any address in the range is accessed. The defaults are used for <6> and <7>. The defaults are used for <6> and <7>. For mask specification, set those bits to be monitored to 0, and set the other bits to 1. The defaults are used for <6> and <7>. The defaults are used for <4>, <5>, <6>, and <7>. <1>_cnt <4>0x46 <2>0 <5>0 <3>Data R/W The defaults are used for <6> and <7>. <1>START <2>0 <3>Run The defaults are used for <4>, <5>, <6>, and <7>. <1>DATA <4>35H <2>0 <5>0 <3>Data R/W The defaults are used for <6> and <7>. 42 Chapter 2 Basic Operations 2.6 2.6.3 Setting Events Creating Events Event conditions registered in the Event Set dialog box or Event Link dialog box can be used as break conditions and trace conditions. Condition When used as a break condition When used as a trace condition When used as a snapshot condition When used as an external sense clip condition Procedure Select Browse -> BreakSet... from the menu bar. Select Browse -> Trace -> TraceSet... from the menu bar. Select Browse -> Trace -> SnapShotTraceSet... from the menu bar. Select Execute -> ExtSenseClip... from the menu bar. Set an event in the desired dialog box by dragging and dropping from the Event Manager. Setting a condition enabling the output of data to the external sense clip: External Sense Clip dialog box Setting a break condition: Break dialog box Setting a snapshot condition: Snap-Shot dialog box Setting a trace condition: Trace dialog box 43 Chapter 2 Basic Operations 2.6 2.6.4 Saving and Restoring Event Conditions Creating Events • Event conditions can be saved to a file. Saved event conditions can be referenced. • Event conditions are saved in text format, allowing an editor to be used to reference saved event conditions. To save an event condition to a file: 1. Activate the Event Manager. 2. Select File -> Open/save Condition -> Save File as... from the menu bar of the Event Manager. 3. Save the event condition by using the View file save dialog box. To restore a saved event condition: 1. Activate the Event Manager. 2. Select File -> Open/save Condition -> Open Condition... from the menu bar of the Event Manager. 3. Load the file containing the event condition to be restored with the View file load dialog box. Saving an event condition to a file: View file save dialog box \ \ Restoring an event condition saved to a file: View file load dialog box 44 Chapter 2 Basic Operations 2.6 2.6.5 Functions Available in the Event Manager Creating Events • The Event Manager allows the user to use a variety of functions such as enabling/disabling an event, deleting an event, and referencing an event. • The available functions are listed below. Function Enabling/disabling an event Procedure Select an event to be enabled or disabled, then perform the following: To enable the event: Deleting an event Detailed event condition display Changing the order of display Referencing/modifying an event condition Click the To disable the event: Click the 1. Select the event to be deleted. button. button. 2. Click the button. Select View -> Detail from the menu bar of the Event Manager. The order of display can be changed using the menu bar of the Event Manager. To enable display in event name order: Select View -> Name. To enable display in type order: Select View -> Kind. 1. Select the event to be referenced or modified. 2. Select an option from Operation in the menu bar of the Event Manager. Event Manager Event Manager (detailed display) Referencing an event 45 Chapter 2 Basic Operations 2.6 2.6.6 Jumping to an Event Setting Address Creating Events • This function enables a jump to the source line, disassembly start address, or memory address corresponding to the address of an event condition in the Event Manager. • A jump destination can be specified by selecting an event condition. The start address of a selected event condition acts as a jump pointer. • When a jump is made to the Source window, a jump to that source line including the jump pointer is performed. Jump destination Source window Assemble window Memory window Procedure 1. Select an event condition. 2. Select Jump -> SourceText... from the menu bar. 1. Select an event condition. 2. Select Jump -> Assemble... from the menu bar. 1. Select an event condition. 2. Select Jump -> Memory... from the menu bar. A jump is made to the address of the selected event, Event02. In this case, the start address (D0H) of function main is the jump pointer. Jump to the Source window. A jump to that source line including address D0H in the Source window is performed. Jump to the Assemble window 46 Chapter 2 Basic Operations 2.7 Manipulating Symbols (Variables) 2.7 Manipulating Symbols (Variables) • The user can display and modify the values of variables. • Before an operation such as symbol debugging can be performed, a load module file including debug information must be loaded. • The user can enter symbols in the address and data input fields of each window. • To enter symbols, observe the input formats indicated below. Type of symbol Variable defined in C Input format _fnc file#_fnc Variable defined in assembler language fnc file#fnc Source line number file:no SFR sfrneme fnc: Function name or variable name sfrname: no: Line number 1. 2. 3. SFR name file: File name When specifying a variable defined in C, prefix the variable with an underbar (_). Use a sharp (#) as the separator between a file name and variable name. Use a colon (:) as the separator between a file name and line number. • The windows related to symbol operations are listed below. Operation Display of variables Registration of displayed variables Temporary display of variables Display of local variables Window Variable window Add Variable dialog box Variable View dialog box Local Variable window 47 Chapter 2 Basic Operations 2.7 2.7.1 Displaying and Modifying Variables Manipulating Symbols (Variables) • The user can display and modify the values of variables in the Variable window, Variable View dialog box, and Local Variable window. Variable Display Display at all times Temporary display Display of local variables Modifi- Variable cation modification Procedure Display the variables in the Variable window. Select View -> Watch Variable... from the menu bar. 1. Select a source variable displayed in the Source window. 2. Select View -> View Variable... from the menu bar, or click the button in the Source window. Select Browse -> Local Variable... from the menu bar. Use the Variable window to modify a variable. Use the Local Variable window to modify a local variable. Both windows are modified as follows: 1. Open the desired window. Local variable modification 2. Switch to modify mode by clicking the button. 3. Position the cursor to the variable to be modified, then modify the data. 4. After entering the new data, execute the modification by clicking the button. Registration Switch to view mode by clicking the button. The Variable window allows the user to register a displayed variable. To register a variable in the Source window: 1. Select a source variable displayed in the Source window. 2. Select View -> Watch Variable... from the menu bar, or click the button in the Source window. Deletion To register a variable in the Add Variable dialog box for variable registration: 1. Select View -> Add Variable... from the menu bar. 2. Register the variable in the Add Variable dialog box. The user can delete any variable displayed and registered in the Variable window. 1. Select the variable to be deleted. 2. Select Operation -> Delete from the menu bar. 48 Chapter 2 Basic Operations 2.7 Manipulating Symbols (Variables) After a variable has been selected in the Source window, that variable can be displayed or modified by clicking the Watch button, or can be temporarily displayed by clicking the View button. Temporary display of variables: Variable View dialog box Display and modification of local variables: Local Variable window Display and modification of variables: Variable window To register a variable by keyboard input, or to display a variable registered by the assembler in the Variable window: Add Variable dialog box 49 Chapter 2 Basic Operations 2.7 Manipulating Symbols (Variables) 2.7.2 Saving and Referencing Symbol Data • Displayed symbol data can be saved to a file. A file containing saved symbol data can be referenced. • Symbol data is saved in text format, allowing an editor to be used to reference saved symbol data. To save displayed symbol data to a file: 1. Activate the desired window. 2. When the Variable window has been selected, select File -> Open/save Condition -> Save File as... from the menu bar. When the Local Variable window has been selected, select File -> Save As... from the menu bar. 3. Save displayed symbol data by using the View file save dialog box. To open and reference a file containing saved symbol data: 1. Activate the desired window. 2. When the Variable window has been selected, select File -> Open/save Condition -> Open Condition... from the menu bar. When the Local Variable window has been selected, select File -> Open... from the menu bar. 3. Load the file to be referenced by using the View file load dialog box. Saving displayed register data to a file: View file save dialog box \ Reference window. Load and open the file to be displayed. The window is opened for reference. All operations related to modification are disabled. \ Displaying symbol data that has been saved to a file: View file load dialog box 50 Chapter 2 Basic Operations 2.7 Manipulating Symbols (Variables) 2.7.3 Functions Available in the Variable Window and Local Variable Window • The Variable window and Local Variable window give the user access to a variety of functions, such as the ability to modify the data number system. • The available functions are listed below. Function Display of variables of pointer type Number system display selection Procedure A variable of pointer type is prefixed by + or -. Variable prefixed by +: The value of the variable indicated by the pointer is displayed by double-clicking. At this time, the prefix of the displayed variable changes to -. Variable prefixed by -: The display of the value of the variable indicated by the pointer is stopped by double-clicking. At this time, the prefix of the displayed variable changes to +. Select View -> Bin, Oct, Dec, Hex, or Proper from the menu bar. A variable prefixed by + or - is a variable of pointer type. Double-clicking a variable of pointer type prefixed by + displays the value of the variable indicated by the pointer. At this time, the prefix of the displayed variable changes from + to -. Variable window Data display. ToModify button: Used to modify data. The user can choose binary, octal, decimal, hexadecimal, or automatic for display. 51 Chapter 2 Basic Operations 2.8 Using the Tracer Effectively 2.8 Using the Tracer Effectively • • • • The tracer records device operations in trace memory. The IE-78000-R-A has 32K frames of trace memory. Trace memory has a ring buffer structure. For combined events, four trace methods are supported: Trace cycle Machine cycle trace Event cycle trace Trace mode Total trace Total trace Conditional trace Sectional trace Qualified trace Remarks Port trace operation is possible. Trace operation is performed only when the device performs a read, write, or fetch operation. The start and end of trace operation can be specified using an event condition. Trace operation is performed only when an event condition match is detected. • The trace-related windows are listed below. Operation Trace result display Display item Trace display selection Snapshot display Trace condition setting Snapshot condition setting Trace result search Window Trace View window Show Trace dialog box Snap Trace dialog box Trace dialog box Snap-Shot dialog box Trace pick-up dialog box 52 Chapter 2 Basic Operations 2.8 2.8.1 Displaying Trace Results Using the Tracer Effectively • Trace results can be displayed in the Trace View window. To display trace results: Select Browse -> Trace -> TraceView... from the menu bar, or click the Frame number The execution time Display of fetch-type access results. between frames is The results of program execution are displayed. counted. Display of data access results. The results of R/W accesses to memory are displayed. Trace status. Statuses such as the IE status at trace stop are displayed. Item Frame Time Address Data Statu Address Data Statu ExtP DisAsm button. Port trace results. In machine cycle trace, port trace operation is possible. External sense clip input/output results are displayed. Disassembly display. This display is provided when fetch-type access is performed and the status is M1. Description Displays trace frame numbers. Valid range: 0 < Trace frame number < 32,767 Displays the number of clock pulses taken by the target chip between the start of execution of the immediately preceding trace address and the start of execution of the current trace address. For the clock signal, the CPU clock is not used. Instead, the 10-MHz clock signal of the in-circuit emulator is used. Measurement range: 1 < Time tag < 0xffffff Displays program fetch results. This field displays the following information depending on the fetch status displayed in the Status field: M1 : Fetch of the first byte of an instruction OP : Operation code fetch IF : Invalid fetch Displays data access results. This field displays the following information depending on the access status display in the Status field: VECT : Vector read R : Data read W : Data write Displays the input level of the external sense clips when trace has been performed. Displays the results of disassembly. This information is displayed only when the fetch status is M1. 53 Chapter 2 Basic Operations 2.8 2.8.2 Saving and Referencing Trace Results Using the Tracer Effectively • Trace results can be saved to a file. A file containing saved trace results can be referenced. • Trace results are saved in text format, allowing an editor to be used to reference saved trace results. To save trace results to a file: 1. Activate the Trace View window. 2. Select File -> Save As... from the menu bar. 3. Save trace results with the View file save dialog box. To open and reference a file containing saved trace results: 1. Activate the Trace View window. 2. Select File -> Open... from the menu bar. 3. Load the file to be referenced by using the View file load dialog box. Saving displayed data to a file: View file save dialog box If the range to be saved consists of about 100 frames or more, a dialog box for reporting the save status is opened. To stop the save operation, click the Stop button. \ Reference window. Load and open the file to be displayed. The window is opened for reference. \ Displaying data saved to a file: View file load dialog box 54 Chapter 2 Basic Operations 2.8 Using the Tracer Effectively 2.8.3 Effective Trace Memory Usage 1 (Trace Mode Setting) • Trace memory can be used effectively by setting a trace condition and trace mode. • Three major trace modes are supported: Trace mode Total trace Sectional trace Qualified trace Description All accesses are traced. The user can choose between machine cycle trace and event cycle trace. A section from one event to another is traced. This mode is useful, for example, for tracing one particular function. Only an event condition match point is traced. This mode is useful, for example, for tracing particular memory accesses. • Each trace mode is described below. 1. The data for each of the following modes indicates the results of executing test program 1 from address 80H to address 8EH. 2. Test program 1 initializes, to zero, the four bytes of memory from address 0FE00H to address 0FE03H. Test program 1: Addr Data 0080 61D0 0082 16FFFC 0085 A100 0087 A304 0089 BB 008A 8BFD 008C 00 008D 00 008E FAFE Clearing RAM Mnemonic SEL RB0 MOVW HL,#0FCFFH MOV A,#0H MOV B,#4H MOV [HL+B],A DBNZ B,$89H NOP NOP BR $8EH Selects register bank 0. Sets the initialization start address, minus 1. Sets initialization data. Sets the number of bytes to be initialized. Initializes memory. Determines termination. 55 Chapter 2 1. Basic Operations 2.8 Using the Tracer Effectively Results of total trace (event cycle trace) ♦ The results of total trace are indicated below. ♦ All accesses are traced, so that all program operations can be identified. ♦ Program fetch operations, and data read and write operations are traced. frame 32738 32739 32740 32741 32742 32743 32744 32745 32746 32747 32748 32749 32750 32751 32752 32753 32754 32755 32756 32757 32758 32759 32760 32761 32762 32763 32764 32765 32766 Faddr 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A Fdat 61 D0 16 FF FC A1 00 A3 04 BB 8B Fstat M1 OP M1 OP OP M1 OP M1 OP M1 M1 008B 0089 008A FD BB 8B OP M1 M1 008B 0089 008A FD BB 8B OP M1 M1 008B 0089 008A FD BB 8B OP M1 M1 008B 008C 008D 008E 008F FD 00 00 FA FE OP M1 M1 M1 OP Maddr Mdat Mstat DisAsm SEL RB0 MOVW HL,#0FCFFH MOV A,#0H MOV B,#4H MOV [HL+B],A DBNZ B,$89H FD03 00 W MOV [HL+B],A DBNZ B,$89H FD02 00 W MOV [HL+B],A DBNZ B,$89H FD01 00 W MOV [HL+B],A DBNZ B,$89H FD00 00 W NOP NOP BR $8EH ♦ Total trace mode is set as follows: 1. Disable all trace event conditions. 2. Select a trace cycle. Select Execute -> Trace -> Machine All. Trace or Event All. Trace from the menu bar. 56 Chapter 2 2. Basic Operations 2.8 Using the Tracer Effectively Results of sectional trace ♦ The results of sectional trace from address 89H to address 8CH are shown below. ♦ The range to be traced can be specified, such that trace memory is used effectively. frame Faddr Fdat Fstat Maddr Mdat Mstat DisAsm 32750 0089 BB M1 MOV [HL+B],A 32751 008A 8B M1 DBNZ B,$89H 32752 FD03 00 W 32753 008B FD OP 32754 0089 BB M1 MOV [HL+B],A 32755 008A 8B M1 DBNZ B,$89H 32756 FD02 00 W 32757 008B FD OP 32758 0089 BB M1 MOV [HL+B],A 32759 008A 8B M1 DBNZ B,$89H 32760 FD01 00 W 32761 008B FD OP 32762 0089 BB M1 MOV [HL+B],A 32763 008A 8B M1 DBNZ B,$89H 32764 FD00 00 W 32765 008B FD OP 32766 008C 00 M1 NOP ♦ Sectional trace mode and the event conditions can be set as shown below. ♦ By enabling trace event conditions, a conditional trace operation can be performed. Set sectional trace conditions as follows: Start: Event01 End: Event02 Event occurrence conditions Event01: Execution of address 89h Event02: Execution of 8ch 57 Chapter 2 3. Basic Operations 2.8 Using the Tracer Effectively Results of qualified trace ♦ The results of qualified trace, for data read and write operations only, are indicated below. ♦ Only those points that are to be traced are traced, allowing large amounts of data to be traced. Note, however, that since trace is performed only when an event condition match is detected, the context is difficult to grasp. frame Faddr Fdat Fstat Maddr Mdat Mstat DisAsm 32763 FD03 00 W 32764 FD02 00 W 32765 FD01 00 W 32766 FD00 00 W ♦ Qualified trace mode and an event condition can be set as shown below. ♦ By enabling a trace event condition, a conditional trace operation can be performed. Set a qualified trace condition as follows: Event03 Event condition Event03: When data read or write is performed at any address 58 Chapter 2 Basic Operations 2.8 2.8.4 Effective Trace Memory Usage 2 (Trace Full Break, Snapshot Trace) Using the Tracer Effectively • Trace full break 1. Trace memory has a ring buffer structure. This means that, once the trace memory is filled with trace data, the existing trace data is overwritten by the new data, starting from the oldest data. 2. To preserve the trace results, trace operation can be stopped once the trace memory is full. Trace full break setting: Select Execute -> Trace Full Break from the menu bar. • Snapshot trace 1. Trace memory is used to store the execution history. In addition to the execution history, other data can be stored by specifying a snapshot event. 2. The snapshot trace function writes specified data into trace memory when a condition is satisfied. The following data can be written: Data Register Data SFR Memory Description All registers of the current bank (PC, SP, PSW, AX, BC, DE, HL) Up to five points in SFRs or memory can be traced. 3. Before data is written into trace memory, the execution of the user program is stopped. 4. For the program below, the method of writing the register and SFRs (P0, P1) when address 0fd02h is accessed is shown. Test program 1: Addr Data 0080 61D0 0082 16FFFC 0085 A100 0087 A304 0089 BB 008A 8BFD 008C 00 008D 00 008E FAFE Clearing RAM Mnemonic SEL RB0 MOVW HL,#0FCFFH MOV A,#0H MOV B,#4H MOV [HL+B],A DBNZ B,$89H NOP NOP BR $8EH Selects register bank 0. Sets an initialization start address, minus 1. Sets initialization data. Sets the number of bytes to be initialized. Initializes memory. Determines termination. 59 Chapter 2 Basic Operations 2.8 Using the Tracer Effectively Example of snapshot event setting Event condition: Address: 0fd02h Status : Data R/W Data : All data Snapshot condition: Event: Event 01 Snapshot data: Registers, SFRs (P0, P1) Trace data PC SP PSW X:R0 A:R1 C:R2 B:R3 DE:RP2 HL:RP3 MEM1(DAT) MEM2(DAT) frame Faddr Fdat Fstat Maddr Mdat Mstat DisAsm 32742 0089 BB M1 MOV [HL+B],A 32743 008A 8B M1 DBNZ B,$89H 32744 FD03 00 W 32745 008B FD OP 32746 0089 BB M1 MOV [HL+B],A 32747 008A 8B M1 DBNZ B,$89H 32748 FD02 00 W 32749 008B FD OP 0089 FEE0 02 00 00 00 02 0000 FCFF P0(00) P1(00) 32755 0089 BB M1 MOV [HL+B],A 32756 008A 8B M1 DBNZ B,$89H 32757 FD01 00 W 32758 008B FD OP 32759 0089 BB M1 MOV [HL+B],A 32760 008A 8B M1 DBNZ B,$89H 32761 FD00 00 W 32762 008B FD OP ♦ In frame 32748, a match with event condition Event01 was detected, causing snapshot event Snap to occur. ♦ Between frame 32749 and frame 32755, the debugger stopped once to write snapshot data into the tracer. 60 Chapter 2 Basic Operations 2.8 Using the Tracer Effectively 2.8.5 Inter-Window Connection Functions (Window Connection Function, Jump Function) • Window connection function: This function displays trace results in each window. When the user positions the cursor to the Trace View window, each of the windows (Source window, Assemble window, and Memory window) can be manipulated interactively, thus allowing trace operation in each window. • Jump function: A jump can be made to a position in the Source window, Assemble window, and Memory window corresponding to the address value of a frame line specified in the Trace View window. • When the window connection function is used, the Trace View window remains active. When the jump function is used, however, the jump destination window becomes the active window. Window connection function Jump function Function Connection to the Source window Connection to the Assemble window Connection to the Memory window Jump to the Source window Operation Activate the Trace View window. Select Window Connect -> SourceText from the menu bar. Activate the Trace View window. Select Window Connect -> Assemble from the menu bar. Activate the Trace View window. Select Window Connect -> Memory from the menu bar. Select a frame in the Trace View window. Select Jump -> SourceText... from the menu bar, or press CTRL + U . Jump to the Assemble window Select a frame in the Trace View window. Select Jump -> Assemble... from the menu bar, or press CTRL + A . Jump to the Memory window Select a frame in the Trace View window. Select Jump -> Memory... from the menu bar, or press CTRL + M . 61 Chapter 2 Basic Operations 2.8 Using the Tracer Effectively • With the window connection function and jump function, connection is made to the data in each window as follows: Function Source window Assemble window Memory window Window connection Fetch address Jump function Fetch address Data read address and data write address Fetch address, data read address, and data write address For window connection and jump For jump For window connection and jump For window connection and jump 62 Chapter 2 Basic Operations 2.9 Measuring the Execution Time 2.9 Measuring the Execution Time • The IE-78000-R-A has two timers. One timer measures the time from the start of execution to the end of trace operation. The other timer measures the time from the start of the previous trace operation to the start of the current trace operation. • The specifications of the two timers are as follows: Timer For execution time measurement For trace interval measurement (time tag) 2.9.1 Maximum measurement time Approx. 14 minutes and 18 seconds Approx. 1.677 seconds Minimum measurement time Approx. 500 nanoseconds Approx. 100 nanoseconds Measuring Program Execution Time • The time from the start of program execution to the end of program execution is displayed in the Timer window. • The measurement time depends on the execution mode, as indicated below. Execution mode Step execution Real-time execution Non-break real-time execution Measurement section Last instruction From the start of execution to a break From the start of execution to termination of the tracer • The Timer window can be opened as follows: Execution time display: Select Browse -> Timer... from the menu bar, or press the File Operation 63 button. Chapter 2 Basic Operations 2.9 2.9.2 Time Measurement Using the Tracer Measuring the Execution Time • For measurement of a short section, regularly executed processing, and so forth, the time tag is useful. • When compared with the execution times displayed in the Timer window, shorter times are obtained with the time tag. However, the time tag stores multiple data items in trace memory, so that information such as time distribution data can be checked using a separate tool. • With the time tag, the time from the start of the previous trace operation to the start of the current trace operation is measured. This measurement is conducted not only while the program is being executed but also while the program is stopped. This means that the time tag data for the first program execution frame is meaningless. Time tag. The interval from the previous frame to the current frame is displayed. An actual time, counted in 100 ns steps, is converted to a hexadecimal number for display. To convert a displayed value to an actual time, convert the displayed value to a decimal number, then multiply that number by 100 ns. 64 Chapter 3 Advanced Use of ID78K0 Chapter 3 Advanced Use of ID78K0 This chapter describes several advanced uses of the ID78K0. essential to normal operation. Note that these uses are usually not 3.1 Verifying the Validity of Evaluation Evaluation is essential to the development of a program. If the evaluation of a particularly important item is omitted for some reason, bugs may remain in a program that is offered for retail sale. This section describes the use of the coverage functions to verify the validity of evaluation. 3.2 Using External Sense Clips The in-circuit emulator status or the contents of memory can be output in real time, by using external sense clips together with event conditions. This section describes the use of the external sense clips. 3.3 Measuring Time by Setting Conditions Basically, the Timer window of the ID78K0 supports only the measurement of the time that elapses between the start and end of program execution. Shorter periods can, however, be measured by using the tracer in combination with events. 65 Chapter 3 Advanced Use of ID78K0 3.1 Verifying the Validity of Evaluation 3.1 Verifying the Validity of Evaluation • Evaluation is essential to the development of a program. If the evaluation of a particularly important item is omitted for some reason, bugs may remain in a program that is offered for retail sale. • This section describes the use of the coverage functions to verify the validity of evaluation. Note, however, that the validity of evaluation cannot be completely verified based on only the results of coverage. 3.1.1 Coverage • Coverage is a record of the flow of the execution of a program. While the tracer can trace program execution backwards, coverage merely indicates whether specified instructions within a program have actually been executed. • The debugger supports coverage for the read, write, and fetch operations. • The results of coverage can be displayed in the Coverage window. • The following window and dialog boxes are used for coverage: Window Coverage window Coverage Efficiency View dialog box Coverage Condition Setting dialog box Coverage Memory Clear dialog box Description Displays the results of coverage. Displays the coverage results, as a percentage, for each function or specified address range. Used to add items to be displayed in the Coverage Efficiency View dialog box. Initializes the coverage memory. Coverage window Coverage Memory Clear dialog box Coverage Condition Setting dialog box Coverage Efficiency View dialog box 66 Chapter 3 Advanced Use of ID78K0 3.1 Verifying the Validity of Evaluation 3.1.2 Verifying the Validity of Evaluation Based on Coverage • Ideally, all possible patterns of program execution should be evaluated. Due to time or other restrictions, however, evaluation may have to be restricted by, for example, sampling and combining several patterns. Evaluation based on sampled patterns must, however, be checked for validity. • One method of verifying the validity of evaluation is the use of the coverage results to check whether all instructions have been executed. • The above check can easily be performed by using the Coverage window and the memory map in the link list file (.MAP), output upon linkage of the program. Verification based on coverage 1. 2. 3. Refer to the memory map in the link list file to identify any free spaces (* gap *) in the program. Refer to the contents of the Coverage window to check whether all memory spaces other than the free spaces, identified in step 1, have been accessed (read, written, or fetched). If any unaccessed space is revealed by step 2, check the program and review the evaluation items. If any free space in the program has been accessed, check that space by, for example, setting event conditions. Example link list file *** Memory map *** SPACE=REGULAR MEMORY=ROM BASE ADDRESS=0000H SIZE=8000H OUTPUT INPUT INPUT SEGMENT SEGMENT MODULE @@VECT00 @@VECT00 @cstart * gap * @@VECT14 @@VECT14 SAMPLE * gap * @@CALT @@CALT @cstart @@CALT SAMPLE @@CALT C_SUB * gap * BASE ADDRESS 0000H 0000H 0002H 0014H 0014H 0016H 0040H 0040H 0040H 0040H 0040H SIZE 0002H 0002H 0012H 0002H 0002H 002AH 0000H 0000H 0000H 0000H 0040H CSEG AT CSEG AT CSEG CALLT0 Intermediate lines omitted @@CNST 0080H 0000H CSEG UNITP @@CNST @cstart 0080H 0000H @@CNST SAMPLE 0080H 0000H @@CNST C_SUB 0080H 0000H @@CODE 0080H 02D1H CSEG @@CODE @cstart 0080H 0050H @@CODE SAMPLE 00D0H 0130H In this example, 0002H to 0013H, 0016H to 003FH, and 0040H to 007FH are free spaces. 67 Chapter 3 Advanced Use of ID78K0 3.1 Verifying the Validity of Evaluation Example coverage results (results of executing the example link list file) Unaccessed spaces In this example, the reset vector at addresses 0 and 1 has not been accessed. performed upon a reset must, therefore, be evaluated. 68 The operation Chapter 3 Advanced Use of ID78K0 3.1 3.1.3 Notes on Coverage Results Verifying the Validity of Evaluation • When checking the coverage results, note the results of conditional branches. • The IE-78000-R-A supports C0 coverage, which cannot be used to check how processing has branched at a conditional branch instruction. Example of execution of a conditional branch instruction 1. When the following program is executed from address 80H to 8CH, a conditional branch instruction is executed at address 86H. Execution jumps to address 88H because the condition is false. Addr 0080 0082 0084 0086 0088 008A 008C 2. Data A101 A302 4D01 BD02 610B A200 00 Mnemonic MOV A,H MOV B,#2H CMP A,#1H BNZ $8AH ADD A,B MOV C,#0H NOP ; Assume that the H register contains 1. The coverage results are as follows, indicating that all instructions have been executed. All instructions at addresses 80H to 8CH have been executed. 3. Actually, however, the condition may be true, depending on the stored data, thus causing address 88H to be skipped. In such a case, the coverage results do not cover all evaluation items. 69 Chapter 3 Advanced Use of ID78K0 3.2 Using External Sense Clips 3.2 Using External Sense Clips • External sense clips have various functions. They can be used to post notification of the incircuit emulator status or output 1-byte RAM data in real-time. • The use of external sense clips may enable essential processing which has not been possible conventionally. • External sense clips No. 01 to 08 are provided. The debugger handles them as bits 0 to 7, respectively. External sense clip number No.08 No.07 No.06 No.05 No.04 No.03 No.02 No.01 Debugger handles as: Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 • When external sense clips are set to output mode, they must be pulled up using resistors. In such a case, a voltage exceeding +15 V cannot be applied to the sense clips. • The tracer traces the potential difference between each external sense clip and GND, regardless of whether the sense clips are set to input or output mode. The HC4050B (used as an input buffer) determines whether the trace data for each external sense clip is 1 or 0. • The trace data for external sense clips can be used for event conditions, thus enabling the setting of a wide range of event conditions. 70 Chapter 3 Advanced Use of ID78K0 3.2.1 Tracing External Data 3.2 Using External Sense Clips • To trace the state of each pin of the target device, set the external sense clips to input mode (default). Input data can be incorporated into event conditions, such that an event can be triggered by an external source. Setting procedure 1. Set the external sense clips to input mode. Set to input mode. 2. 3. Connect external sense clips to the pins to be traced. To set an event, set event conditions using the Event Set dialog box. checked using the Trace View window. The results of trace can be Trace data for external sense clips Set this area to incorporate external sense clip data into the event conditions. 71 Chapter 3 Advanced Use of ID78K0 3.2.2 Trigger Output 3.2 Using External Sense Clips • To output the in-circuit emulator status or other data, set the external sense clips to trigger output mode. Set to trigger output mode • Trigger output data is output under the following condition: Trigger output condition When the pass count becomes 0 upon the occurrence of a break event Trigger data is not output upon the occurrence of a fail-safe or manual break. • Trigger output data is output from external sense clip No. 01. • When external sense clips are set to output mode, they must be pulled up using resistors. Connection diagram Trigger output waveform Vdd(Max:15V) Vdd R TRG OUT GND TRG OUT Trigger condition satisfied Connect external sense clip No. 01. Time t 72 Chapter 3 Advanced Use of ID78K0 3.2 3.2.3 Real-Time RAM Output Using External Sense Clips • The IE-78000-R-A does not support real-time RAM sampling. Only 1-byte data in memory can be output in real-time, by using event conditions in combination with external sense clips and simple external jigs. Create an access event. In this example, the contents of address 0xfe00 are output. Drag & drop the event into the event setting area, then select Output. • Because data is being output in real time, it can also be used as a trigger source for other targets. • When external sense clips are set to output mode, they must be pulled up using resistors. Transition of data output from external sense clip Latch the contents of the data bus upon the occurrence of the set event. The latched data is held until the next occurrence of the event. Data The set event occurs. Example connection Vdd(Max:15V) R LED No.01 - No.08 GND Connect each external sense clip. 73 Chapter 3 Advanced Use of ID78K0 3.2 Using External Sense Clips 3.2.4 Creating an Event by ANDing a Data Condition • Advanced events can be created by using external sense clips. • An event condition can be created by ANDing a data condition, as follows: Procedure for creating an event condition by ANDing a data condition 1. Create an event having a data condition. 2. Set the event created in step 1 as an output condition for the external sense clips. 3. Pull up the eight external sense clips using resistors. 4. Create an event having an address condition or execution condition. 5. Specify an external sense data condition for the event created in step 4, thus creating an event having a condition ANDing those specified in steps 1 and 4. Example Causing an event to occur when 15h is written into address 0fe12h, provided address 0fe00h contains 20h Set Address, Status, and Data. Set External as the default or Mask in ff. Set an event condition, and set the external sense clips to output mode. Finally, set Address, Status, and Data for another event. Specify the value at address 0fe00h for External. In this example, one data condition is ANDed with another data condition. A data condition can also be ANDed with an execution condition. An event condition like that shown above can be set for various events, thus enabling the creation of advanced events. First try specifying "on." 74 Chapter 3 Advanced Use of ID78K0 3.3 Measuring Time by Setting Conditions 3.3 Measuring Time by Setting Conditions • The timer measurement function of the IE-78000-R-A does not support the setting of event conditions. The user may, however, require information such as the intervals that elapse between a function being called, or whether timer interrupts are generated correctly and on time. • Time measurement using event conditions in combination with the tracer is described below. Setting procedure 1. Set an event at the beginning of the function for which time will be measured. program is used as an example: Example program to be subject to time measurement Addr Data Mnemonic > 0080 A300 MOV B,#0H 0082 43 INC B T 0083 63 MOV A,B ; Set an event. 0084 8BFE DBNZ B,$84H 0086 73 MOV B,A 0087 FAF9 BR $82H This program executes an infinite loop between addresses 82H and 87H. between the executions of the instruction at address 83H are measured. 2. The following The intervals (µs) Set event and trace conditions as follows: Set an event at the beginning of the processing to be subject to time measurement. Set a qualified event. 75 Chapter 3 3. Advanced Use of ID78K0 3.3 Measuring Time by Setting Conditions After the event and trace conditions have been set, the execution of the program is traced as follows: Check that the execution times are satisfactory by converting the time tag data to an actual time by using, for example, spreadsheet software. 4. Save the trace results to a file. The execution times can be obtained by converting the time tag data to actual times by using, for example, spreadsheet software. Conversion results Frame number Time tag data [hex] Actual time [µ µs] 32666 32667 32668 32669 32670 32671 32672 32673 32674 0x2671 0x2756 0x283B 0x291F 0x2A14 0x2AEA 0x2BCE 0x2CB3 0x2D98 984.1 1007.0 1029.9 1052.7 1077.2 1098.6 1121.4 1144.3 1167.2 Time tag data is counted every 100 ns. then convert the radix. To obtain an actual time, convert hexadecimal to decimal, 76 Appendix A Error Messages Appendix A Error Messages This appendix lists the error and warning messages output by ID78K0. An error message consists of error number + type + message . Type Error number A type is represented by an alphabetic character. Type Message There are three types: Explanation Abort error. A F W Processing is interrupted and the debugger ends. be continued. If this error occurs, debugging cannot Format (syntax) error. Processing is interrupted. The currently open windows and dialog boxes are closed. Warning. Processing is interrupted. The currently open windows and dialog boxes remain as is. A message contains the names of the file, variable, and device related to the error, as follows: Representation in message Explanation xxx Low-order three digits of device name yyy File name zzz Function name 77 Appendix A Error Messages Error messages (1/9) Error No. --- --- ----- --- --- --- --- 0001 0003 0004 0005 0006 0009 000a 000e 000f 0012 0014 0015 0016 0017 Type Message Explanation -Can’t open this file. please make The project file format is incorrect, or the file content sure, now Active Window. has collapsed. Loading the project file was discontinued. -Cannot find “character string”. The search character was not found. The search was discontinued. Alternatively, opening the specified file was discontinued because no data was in the file. -Event Name is not set. There is no event name. Specify the name of the event when adding it. -Event number already exist. It is impossible to add an event having the same number as an existing event. Change the number of the event to be added or of the existing event. -Not enough memory. Because of insufficient memory, a window cannot be displayed, its content cannot be changed, or changes to it cannot be retained. Assign sufficient memory, and retry. -Other view mode window exist. Two or more active windows of the same type cannot be opened simultaneously. An active window that was already open was closed. -Sorry, Too large view file. The specified view file (.MEM, .TVW, or .DIS) contains more than 1000 lines. Its display was discontinued. -“event name” is already exist. It is impossible to add an event having the same name as an existing event. Change the name of the event to be added or of the existing event. A Communication open error Communication with the in-circuit emulator (IE) is not possible. A Hardware error A hardware error is detected. A Monitor time out Data was not transferred to and from the monitor program. Clock pulses may not be being supplied to the target CPU or power may not be supplied. Check the above and restart the debugger. A Not found monitor file The monitor file is not found. A Monitor file error A monitor file error is detected. A Communication failed Communication with the IE failed. A Verify error A verify error is detected. A User program Cannot run The user program cannot be executed. A Illegal receive data An illegal response is received. A Emulation-Board conflicts with The EM board ID does not match the value in the Device-file device file. W Target power off The power of the target device is off. W Program is running The user program is running. W Already break The user program is already in the break status. W Tracer is running The tracer is running. 78 Appendix A Error Messages Error messages (2/9) Error No. 0018 001d 0020 0021 0022 0023 0024 0026 0077 0078 007a 007e 00c8 01a1 Type W W W W W W W W F F F W W A 01a3 A 01a5 A 01a6 01a8 A A 0600 A 0f13 A 0f14 A 0f15 A Message Timer is running Measure is off Execution mode error Mapping error Trace block not found There is no trace data Trace range over Bus hold mode Search data not found Measure overflow Not specified coverage range Event No.3 is using User program is stepping Invalid EX78Kx.OM0 Explanation Timer measurement is in progress. Timer measurement is not performed. An execution mode error is detected. A mapping error is detected. The specified trace block does not exist. There is no trace data. The trace range has been exceeded. The bus hold mode is active. The search data does not exist. The timer measurement result overflowed. The coverage range has not been specified. Event condition No. 3 is in use. The user program step is being executed. The executor file (EX78K0.OM0) was not read correctly. The executor file may not exist or may have been destroyed. Install the executor file again and restart the debugger. Unconnected Emulation-board The emulation board (IE-780xx-R-EM) is not correctly connected. Connect the IE-780xx-R-EM to the IE-78000-R-A correctly. Unconnected I/O emulation-board Emulation board 1 (IE-78xxx-R-EM1) is not correctly connected. Connect the IE-78xxx-R-EM1 to the IE-78000-R-A correctly. Executor is running The executor is running. Invalid EXPC.INI The initialize file (EXPC.INI) was not read correctly. The initialize file may not exist or may have been destroyed. Install the initialize file again and restart the debugger. Communication buffer error The area for the buffer used for exchanging data with the IE was not reserved. End other MSWindows applications, change the setting of the MSWindows swap file, or install additional main memory in the host machine. Send timed out Data transmission to the IE failed. Possible causes include an invalid interface board setting and IE power off condition. Install the initialize file again, then restart the debugger. Receive timed out No response was received from the IE. The IE may be abnormal. Check the IE and restart the debugger. Invalid D0xxx.78K The device file (D0xxx.78K) cannot be read correctly. The device file may not be located in the specified directory or it may have been destroyed. Install the device file again, then restart the debugger. 79 Appendix A Error Messages Error messages (3/9) Error No. 1000 Type Message A failure in initialization 1003 1004 1006 1007 F F F A Illegal relocation address Illegal parameter Illegal address Not enough substitute memory 100b F Program Is Running 100c F Different Bussize 100d F Total Maximum Over 100e 100f 10ff F W A Enable Maximum Over Wrong Target Status(Power Off) Communication Error 2000 2002 F F Illegal sfr name User program is running 2003 2004 2005 2006 F F W F Illegal SFR number Illegal bit number Redraw sfr name This SFR is hidden SFR 2007 F Can’t Read/Write 2008 200a F F Too big number Illegal Bit Pattern 20ff A Communication Error 3000 3001 3002 F F F Illegal address Different data Illegal source address 3003 F Illegal destination address 3004 F Illegal address (source & destination) 3005 3006 F F Illegal parameter User program is running 3008 F No Parameter Explanation An attempt to initialize the IE failed. Check whether the IE is abnormal. It is impossible to relocate to a specified address. The parameter is illegal. The address is illegal. An attempt was made to map IE alternate memory in an area of 64K bytes or more. A user program is running. This command cannot be executed. An attempt was made to make duplicate specification in areas having different bus sizes. An attempt was made to specify a bus larger than the maximum size (8). The bus size is larger than 8. The target state is unstable. It is impossible to communicate with the IE. Check whether the IE is abnormal. The SFR name is illegal. A user program is running. This command cannot be executed. An attempt was made to access a nonexistent SFR. There is no bit SFR at the specified bit position. The SFR has been disabled from redrawing. This SFR is not open to general use. It is impossible to display or change data for the SFR. An attempt was made to write to a write-protected SFR or read from a read-protected SFR. The specified SFR was not found. An attempt was made to specify an illegal value for an SFR. Communication with the IE is impossible. Check whether the IE is abnormal. The address is illegal. There is a memory content mismatch. The specified source address range does not fall within the mapping range (during a memory search, comparison, or copy). The specified destination address range does not fall within the mapping range (during a memory search, comparison, or copy). The specified address range does not fall within the mapping range (during a memory search, comparison, or copy). The parameter is illegal. A user program is running. This command cannot be executed. There is no parameter. 80 Appendix A Error Messages Error messages (4/9) Error No. 3009 Type Message F Parameter Size Alignment Error 300a F 300b F 300c F 300d F 300e F 300f F 3010 F 3011 F 30ff A 4000 4001 4002 4003 4004 4005 4006 F F F F F F F 4007 F 4008 4009 400a 400b 400c 400d F F F F F F 400e 400f F F 4010 4011 F A 4012 F Explanation The parameter size is illegal. Change the parameter according to the memory access size. Memory Alignment Error The address value is illegal. Change the address value according to the memory access size. Source Start Address Alignment The source address is illegal. Change the source Error address according to the memory access size. Error, Destination Start Address In the destination address range, a memory range Alignment Error with a conflicting access memory size was specified. End Address Alignment Error The end address is illegal. Change the end address according to the memory access size. Different Access Size in This Area In the address range, a memory range with a conflicting access memory size was specified. Different Access Size in Source In the source address range, a memory range with Area a conflicting access memory size was specified. Different Access Size in Destination In the destination address range, a memory range Area with a conflicting access memory size was specified. Different Access Size, Source & The access size conflicts between the source and Destination destination address ranges. Communication Error Communication with the IE is impossible. Check whether the IE is abnormal. Number is referenced now The specified event condition cannot be deleted. Illegal table number The specified table number is illegal. Illegal start address The start address is illegal. Illegal end address The end address is illegal. Illegal status The status is illegal. Illegal data The data is illegal. Can’t action number An attempt was made to use an event number that was already in use. Can’t empty number An attempt was made to register more than 32,767 events of the same type. Table not found The specified event has not been registered. Illegal data size The data size is illegal. Illegal type mode The mode is illegal. Illegal parameter The parameter is illegal. Illegal type number The type is illegal. Table overflow An attempt was made to register more than 32,767 events of the same type. No entry event number The specified event does not exist. Illegal Elink data An event condition specified with a range condition or pass condition was used as an event link condition. Alternatively, only one event condition was specified. Function not found The specified function was not found. No free memory There is no sufficient memory. End unnecessary applications, or close the Debugger window. Timer not enabled The timer is disabled. Enable it if timer measurement must be made. 81 Appendix A Error Messages Error messages (5/9) Error No. 4013 4014 Type Message W Data access size mismatch at the bus size F Can’t use software break 4015 F Not point-address 4016 F Not renew event condition. 4017 F Specified odd-address by wordaccess. 5000 5002 5003 5004 5005 5006 5007 5008 5009 500a 500b A A A A A A A F F F W Illegal type number Illegal file name Cannot file seek Cannot file close Illegal device format Cannot device initialize Illegal device information Cannot open device file Cannot open EX78KX.OM0 file No match device file of version Device has no relocatable iram. 6001 6002 6003 6004 F F F F Illegal entry symbol name Illegal parameter Illegal entry function name Out of Buffer flow 6005 7001 F F Illegal expression User program is running 7002 F User program is stopped 7003 F Trace function is active 7004 7005 F F Trace memory is OFF No Return Address, Can’t Execute 7010 W 7012 A Warning, No Source Line Information Not enough memory 82 Explanation The access size in an event condition does not match the bus size for mapping. At present, no software break can be used. Specify that a software break be usable, using the Extended Option dialog box. It is impossible to use, as an address condition, an event condition specifying a range. This event condition is being used for another event. It is impossible to change the address range condition or pass count condition. The data value was not detected in word data beginning at an odd address. Do not include that data value in the setting. The type is illegal. The device file cannot be opened. An attempt to seek the file failed. An attempt to close the file failed. The format of the device file is illegal. An attempt to initialize the IE failed. There is no device information. The specified device file cannot be opened. The EX78K0.OM0 cannot be opened. The version of the device file is illegal. The currently selected device does not support relocation in internal RAM. The symbol name is illegal. The parameter is illegal. The function name is illegal. Function display in the Stack window is incomplete. The maximum allowable line size is 512 characters. The expression is illegal. A user program is running. This command cannot be executed. A user program is at a break. This command cannot be executed. The tracer is running. This command cannot be executed. The tracer is off. The return address of the current function was not found. Step execution based on the Return command is not carried out. Instruction-level step execution was carried out because there was no source information. There is no sufficient memory. End unnecessary applications, or close the Debugger window. Appendix A Error Messages Error messages (6/9) Error No. 70fe Type Message A Bus Hold Error 70ff A Communication Error 7801 F Step wait canceled 7802 F Step aborted 7f00 7f02 7f03 F F A Interrupted step Suspended step Run/Step cancel failed. CPU resetted 7f04 F Illegal address 8000 8001 8002 8003 9002 F F F F F File not found Illegal line number Current data is not set Ilegal address Illegal set value a001 a002 F F Illegal expression Start address bigger than end address a003 F Source path not found a004 F Expression is too big a005 A Not enough memory a006 a008 a009 a00a a00b a00c F F F F A A Illegal argument Source path not set File not found File not open File not close File not read a00d F Not source file of LM a00e a00f a010 F F A Illegal line number Illegal variable Communication failed Explanation The bus is on hold. The user program cannot be executed. Communication with the IE is impossible. Check whether the IE is abnormal. Step execution was discontinued. So, communication with the IE may become impossible. An illegal access break occurred during step execution. Check the user program. Step execution was forced to end. Step execution was suspended. An attempt to break the user program failed. The IE is unstable because the evaluation chip was reset. Make sure that the IE is normal, then restart it. An attempt was made to execute in an non-mapped area. The file was not found. The line number is illegal. The current information has not been set. The address is illegal. The specified value cannot be set in a register. Specify a value that can be set. The expression is illegal. The start address is greater than the end address (start address > end address). Check the addresses. The specified source path information is illegal. Specify the correct source path information. The size of the expression is greater than 127 characters. There is no sufficient memory. End unnecessary applications, or close the Debugger window. The argument is illegal. The source path has not been specified. The file was not found. The file cannot be opened. An attempt to close the file failed. An attempt to read the file failed. It is likely that the file has collapsed. The specified source file has not been registered for the load module file. A file not registered for the load module file cannot be displayed in the Source window. The line number is illegal. The variable does not exist. Communication with the IE is impossible. Check whether the IE is abnormal. 83 Appendix A Error Messages Error messages (7/9) Error No. a011 a012 Type Message F Can’t access register F Can’t access memory b000 b001 F F Command line error Task type not found b002 b003 b004 b005 b008 b009 F F F F F A File not found Function not found Illegal magic number Symbol not found Illegal value Not enough memory b00a F Illegal symbol entry b00b F Current type noting b00c F Current file noting b012 b015 F A Line number too large Read error b016 b017 b019 b01a b01d A A A A F Open error Write error Seek error Close error Address not found b01e F No line information(not compile with -g) b01f b020 b021 F F F Cannot find member Cannot find value Striped LM b022 b026 F F Null statement line Max dimension array over b027 b029 b02a F F A End of file Illegal address Communication failed b02b F No stack frame point Explanation The register cannot be accessed. Check the IE. The specified memory (variable) cannot be accessed. Check the IE or map setting. The parameter is illegal. The load module file does not contain program information. The file was not found. The specified function was not found. The magic number for the load module file is illegal. The symbol was not found. The expression is illegal. There is no sufficient memory. End unnecessary applications, or close the Debugger window. There is an illegal symbol in the load module file. It is likely that there is a bug related to the programming language. There is no debug information. Load the load module file. There is no current source file. Alternatively the source file cannot be opened because the load module file has not been loaded. The line number is illegal. An attempt to read the file failed. It is likely that the file has collapsed. The file cannot be opened. An attempt to write to the file failed. An attempt to seek the file failed. An attempt to close the file failed. There is no source line that corresponds to the current PC value. There is no source line information in the load module file. Attach the debug option, and carry out recompilation, assembly, and linkage. No member was found in the specified structure. The specified enumeration constant is illegal. There is no symbol information in the load module file. The line number is illegal. A four-dimensional or greater-scale array cannot be displayed. The file is not complete. The address is illegal. Communication with the IE is impossible. Check whether the IE is abnormal. Stack tracing is impossible with the current PC value. 84 Appendix A Error Messages Error messages (8/9) Error No. b02c Type Message F Max block overflow b02d c001 c002 c003 F F A A Illegal argument Cannot open file Cannot close file Cannot read file c004 c005 A F Cannot seek file Illegal file type c006 c007 c008 c009 F F F A Illegal magic number This file is not load-module file Old coff version Not enough memory c00a c00b c00c c00d F F F F Illegal address LM not load Illegal argument User program is emulating c00e F User program is tracing c010 A Communication failed c011 c012 F F Illegal file format Check sum error c013 F Too big size c014 c100 d001 F F F Cannot write file Not support Not enough memory e000 e001 e002 e003 e004 F F F F F Illegal argument Illegal start address Illegal end address Size too long Can’t open file Explanation The maximum number of blocks in one function is exceeded. The function cannot be displayed. (The maximum number of blocks per function is 256.) The argument is illegal. The file cannot be opened. An attempt to close the file failed. An attempt to read the file failed. It is likely that the file has collapsed. An attempt to seek the file failed. The format of the file is illegal. This file cannot be handled. The magic number for the load module file is illegal. The specified file is not a load module file. The version of the load module file is illegal. There is no sufficient memory. End unnecessary applications, or close the Debugger window. The address is illegal. The load module file has not been loaded. This is an internal error. A user program is running. This command cannot be executed. The tracer is running. This command cannot be executed. Communication with the IE is impossible. Check whether the IE is abnormal. The format of the load module file (LNK) is illegal. A checksum error occurred in reading the load module file. Check the load module file. The address range for uploading has exceeded 1M byte. An attempt to write to the file failed. The Tektronix format is not supported. There is no sufficient memory. End unnecessary applications, or close the Debugger window. This is an internal error. The start address is illegal. The end address is illegal. The address value is illegal. The specified file cannot be opened. 85 Appendix A Error Messages Error messages (9/9) Error No. e005 Type Message F Can’t read file e006 e007 e008 F F F Can’t seek file Can’t write file Not enough memory e009 XXXX F F Illegal file format Internal error Explanation An attempt to read the file failed. It is likely that the file has collapsed. An attempt to seek the file failed. An attempt to write to the file failed. There is no sufficient memory. End unnecessary applications, or close the Debugger window. The format of the file is illegal. An internal error occurred. 86 Appendix B Key Functions Appendix B Key Functions Debugging can be carried out more effectively when ID78K0 is operated using the special function keys. In the following explanation of the special function keys, general key representations (generic key representations) are used. For the IBM-PC/AT Series, the key representations may differ slightly depending on the keyboard type. B.1 Functions of Special Function Keys PC-9801 and 9821 Series Function Key IBM-PC/AT Series Deletes the character immediately before the cursor and moves the cursor to the position of the deleted character. The character string following the cursor is moved back. Captures the entire screen into the clipboard as a bit image. (Windows function) <1> Closes the pulldown menu. <2> Closes the modal dialog box. Moves the cursor to the menu bar. BS BackSpace COPY PrintScreen ESC Esc GRPH Alt HELP End HOME CLR Home ROLL UP PageUp ROLL DOWN PageDown SPACE Space Displays the last line. Also, the cursor is positioned to the last line. Displays the first line. Also, the cursor is positioned to the first line. Scrolls the display up by one screen. Also, the cursor is positioned to the top of the screen. Scrolls the display down by one screen. Also, the cursor is positioned to the top of the screen. Inserts one blank. TAB Tab Positions the cursor to the next item. ↑ ↑ ↓ ↓ ← ← → → ↵ ↵ Moves the cursor up. Scrolls the screen down by one line when the cursor is positioned to the top of the screen. Moves the cursor down. Scrolls the screen up by one line when the cursor is at the bottom of the screen. Moves the cursor to the left. Scrolls the screen to the right by one item when the cursor is in the leftmost column. Moves the cursor to the right. Scrolls the screen to the left by one item when the cursor is in the rightmost column. Confirms input data. 87 Appendix B Key Functions B.2 Functions of Special Function Keys ( CTRL + Key) Key (Common to the PC-9801, 9821, and IBM-PC/AT Series) Function B Using the data value in the current window as an address to jump to, disassembles and displays the program starting from that address. Opens the Assemble window. Sets a breakpoint in a selected line. C Copies a selected character string to the clipboard buffer. D PC setting and window view: The Call dialog box is opened. E PC setting. F Switches a window to modify mode. This has the same effect as clicking A the button. G Executes a program. This has the same effect as clicking the H Switches a window to the Hold state. I Switches a window to the Active state. M Using the data value in the current window as an address to jump to, displays the contents of memory starting from that address. Opens the Memory window. If the Source window is current: Allows the user to select a source view file. Opens the source file select dialog box. Otherwise: Displays an appropriate view file in the current window. Opens the view file save dialog box. Stops the execution of a program. This has the same effect as clicking the button. O P button. R Performs step execution until control returns to the calling function. This button. has the same effect as clicking the S Saves the contents of the current window to a view file. T V Performs step execution. This has the same effect as clicking the button. Using the data value in the current window as an address to jump to, displays an appropriate source text and source line. Opens the Source window. Pastes the contents of the clipboard buffer to the text cursor position. W Switches a window to view mode. This has the same effect as clicking the U button. X Performs Next step execution. This has the same effect as clicking the button. Z Cancels the previous editing operation. 88 Appendix C Menus Appendix C Menus This Appendix lists the menus supported by ID78K0. Symbols used in the menu lists Symbol [Item] Table C-1 Meaning Item on a menu bar No symbol Item in a pull-down menu → (arrow) Item in a cascaded menu The number of arrows corresponds to the nesting level. Main Window (1/4) Menu Mnemonic Explanation [File] Open... CTRL+O Opens a file. Save CTRL+S Saves the contents of the current window into the view file. Save As... Saves the contents of the current window into a view file having a different name. Close Closes the current window. Print Prints the contents of the current window. Down load... Downloads a program. Up load... Uploads a program. Open/Save Project →Open Project... Opens a project file. →Save Overwrites the project file with the current debugging environment. →Save As... Saves the current debugging environment into a project file. Open/Save Log Records the history of execution. Exit Exits from the debugger. [Edit] Undo CTRL+Z Cancels the most recent editing. Copy CTRL+C Copies a selected character string into the clipboard buffer. Paste CTRL+V Pastes the contents of the clipboard buffer at the point to which the text cursor is positioned. Write in Writes the modified contents into the target device. Restore Cancels the modified contents. Memory →Memory Fill... Initializes memory. →Memory Copy... Copies the contents of memory. →Memory Compare... Compares the contents of memory. →File Compare... Compares the view file with the contents of memory. 89 Appendix C Table C-1 Menus Main Window (2/4) Menu Mnemonic Explanation [View] Search... Searches for a character string or numerical value. Address... Displays the contents of memory at a specified address. View Variable... Displays the value of a specified variable temporarily. Watch Variable... Displays the value of a specified variable continuously. Add Variable... Adds a variable to the Variable window. Sym To Adr... Converts symbols. Delete Deletes a specified value. Bin Selects binary display format. Oct Selects octal display format. Dec Selects decimal display format. Hex Selects hexadecimal display format. Proper Selects a default display format for each variable. Event ? Displays event information. Memory →Nibble Displays data in nibble format. →Byte Displays data in byte format. →Word Displays data in word format. →Long Displays data in long format. →Ascii Switches on or off ASCII view mode. Sfr →Address Sort Selects alphabetic display order or display in order of addresses. →Pick Up Displays only modified SFRs. →Attribute →→Show Displays the attribute view area. →→Hide Hides the attribute view area. →Compulsion Read Performs forced reading of a read-protected SFR. →Synchronize Writes the modified SFRs to the target device. Trace View →Trace View... Selects the trace view contents. →Snap View... Selects the snapshot trace view contents. →Normal Title Displays the trace frame titles. →Snap Title Displays the snapshot frame titles. →All Title Displays all titles. →Open Frame... Specifies a view frame number. →Pick Up... Selects a view frame. Coverage → 1 Byte Displays data in 1-byte units. →64 Byte Displays data in 64-byte units. 90 Appendix C Table C-1 Menus Main Window (3/4) Menu Mnemonic Explanation [Option] Tool Bar Displays or hides the tool bar. Status Bar Displays or hides the status bar. Button Displays or hides the buttons in the window. Source Mode Selects the source mode. Instruction Mode Selects the instruction mode. Configuration... Sets the environment. Source Path... Sets source path information. Extended Option... Sets extended options. Mask Option... Sets mask options. [Execute] Stop CTRL+P Stops the execution of a program. Go CTRL+G Executes a program. Return CTRL+R Executes a program, step by step, until control is returned to the calling function. Step CTRL+T Executes a program step by step. Next CTRL+X Performs Next step execution of a program. Go & Go Repeatedly executes a program. Go & Come Executes a program up to a specified address. Slowmotion Continues step-by-step execution. CPU Reset & Go Resets the CPU before starting execution. CPU Reset... Resets the CPU. Set BP CTRL+B Sets a breakpoint. Set PC CTRL+E Sets the address in the program counter. Call... CTRL+D Sets PC in the specified address and moves. ExtSenceClip... Sets external sense clip mode. Trace Cond. Trace Sets conditional tracing mode. Machine All. Trace Sets machine cycle, all-tracing mode. Event All. Trace Sets event cycle, all-tracing mode. Trace Full Break Breaks after full tracing. [Operation] Active CTRL+I Puts the window in the active state. Hold CTRL+H Puts the window in the hold state. ToModify CTRL+F Puts the window in modify mode. ToView CTRL+W Puts the window in view mode. Window Connect →SourceText Links to the Source window. →Assemble Links to the Assemble window. →Memory Links to the Memory window. 91 Appendix C Table C-1 Menus Main Window (4/4) Menu Mnemonic Explanation [Browse] SourceText... Opens the Source window. Variable... Opens the Variable window. Assemble... Opens the Assemble window. Memory... Opens the Memory window. Register... Opens the Register window. Stack Trace... Opens the Stack window. Sfr... Opens the SFR window. Local Variable... Opens the Local Variable window. BreakSet... Opens the Break dialog box. Timer... Opens the Timer window. Trace →TraceSet... Opens the Trace dialog box. →TraceView... Opens the Trace View dialog box. →SnapShotTraceSet... Opens the Snap-Shot dialog box. Event →EventSet... Opens the Event Set dialog box. →EventManager... Opens the Event Manager. →EventLinkSet... Opens the Event Link dialog box. Coverage →View... Opens the Coverage window. →Clear... Opens the Coverage Memory Clear dialog box. →Condition... Opens the Coverage Condition Setting dialog box. →Efficiency... Opens the Coverage Efficiency View dialog box. [Jump] SourceText... CTRL+U Jumps to the Source window. Assemble... CTRL+A Jumps to the Assemble window. Memory... CTRL+M Jumps to the Memory window. [Window] Cascade Displays the window in cascade style. Tile Displays the window in tile style. Arrange Icons Re-arranges the icons. Close All Closes all windows except the main window. [Help] About... Displays the information about the version. 92 Appendix C Menus Table C-2 Event Manager Menu Mnemonic Explanation [File] Open... Opens an event setting file. Save Saves the current event settings into the event setting file, overwriting the previously saved setting. Save As... Saves the current event settings into a specified event setting file. Print Prints the event registration/setting information. Close Closes the Event Manager. [Edit] Undo Cancels the most recent editing. Copy Copies a specified icon using a different name. All Select Selects all icons. Delete Deletes a specified icon. [View] Name Sorts the icons into event name order. Kind Sorts the icons into event type order. Detail Switches between normal view and detail view. [Execute] Set Break Enables a break condition. Cancel Break Disables a break condition. Set Trace Enables a trace condition. Cancel Trace Disables a trace condition. Set SnapShotTrace Enables a snapshot condition. Cancel SnapShotTrace Disables a snapshot condition. [Operation] BreakSet... Opens the Break dialog box. TraceSet... Opens the Trace dialog box. SnapShotTraceSet... Opens the Snap-Shot dialog box. EventSet... Opens the Event Set dialog box. EventLinkSet... Opens the Event Link dialog box. [Jump] SourceText... Jumps to the Source window. Assemble... Jumps to the Assemble window. Memory... Jumps to the Memory window. 93 Appendix C Table C-3 Menus Register Window Menu Mnemonic Explanation [File] Open/save Condition →Open Condition... Opens the selected file for reference. →Save Condition Saves the contents of the window into a view file. →Save File as... Saves the current event settings into a specified view file. Close Closes the Register window. [Edit] Undo Cancels the most recent editing. Copy Copies a selected character string into the clipboard buffer. Paste Pastes the contents of the clipboard buffer at the point to which the text cursor is positioned. Write in Writes the modified contents into the target device. Restore Cancels the modified contents. [View] Absolute Name Displays absolute register names. Functional Name Displays functional register names. Register Displays registers individually. Register Pair Displays register pairs. Bin Displays data in binary format. Oct Displays data in octal format. Dec Displays data in decimal format. Hex Displays data in hexadecimal format. [Operation] Active Puts the Register window in the active state. Hold Puts the Register window in the hold state. ToModify Puts the Register window in modify mode. ToView Puts the Register window in view mode. [Jump] SourceText... Jumps to the Source window. Assemble... Jumps to the Assemble window. Memory... Jumps to the Memory window. 94 Appendix C Table C-4 Menus Variable Window Menu Mnemonic Explanation [File] Open/save Condition →Open Condition... Opens the selected file for reference. →Save Condition Saves the contents of the window into a view file. →Save File as... Saves the contents of the window into a specified view file. Close Closes the Variable window. [Edit] Undo Cancels the most recent editing. Copy Copies a selected character string into the clipboard buffer. Paste Pastes the contents of the clipboard buffer at the point to which the text cursor is positioned. Write in Writes the modified contents into the target device. Restore Cancels the modified contents. [View] Bin Displays variable values in binary format. Oct Displays variable values in octal format. Dec Displays variable values in decimal format. Hex Displays variable values in hexadecimal format. Proper Displays variable values in default format for each variable. [Operation] Active Puts the Variable window in the active state. Hold Puts the Variable window in the hold state. ToModify Puts the Variable window in modify mode. ToView Puts the Variable window in view mode. Delete Removes a specified variable from the Variable window. Table C-5 Timer Window Menu Mnemonic Explanation [File] Open/save Condition →Open Condition... Opens a file. →Save Condition Saves the contents of the window into the original file. →Save File as... Saves the contents of the window into a specified file. Close Closes the Timer window. [Operation] Active Places the Timer window in the active state. Hold Places the Timer window in the hold state. 95 Facsimile Message From: Name Company Tel. Although NEC has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. Despite all the care and precautions we've taken, you may encounter problems in the documentation. Please complete this form whenever you'd like to report errors or suggest improvements to us. FAX Address Thank you for your kind support. North America Hong Kong, Philippines, Oceania NEC Electronics Inc. NEC Electronics Hong Kong Ltd. Corporate Communications Dept. Fax: +852-2886-9022/9044 Fax: 1-800-729-9288 1-408-588-6130 Korea Europe NEC Electronics Hong Kong Ltd. NEC Electronics (Europe) GmbH Seoul Branch Technical Documentation Dept. Fax: 02-528-4411 Fax: +49-211-6503-274 South America NEC do Brasil S.A. Fax: +55-11-6465-6829 Asian Nations except Philippines NEC Electronics Singapore Pte. Ltd. Fax: +65-250-3583 Japan NEC Semiconductor Technical Hotline Fax: 044-548-7900 Taiwan NEC Electronics Taiwan Ltd. Fax: 02-719-5951 I would like to report the following error/make the following suggestion: Document title: Document number: Page number: If possible, please fax the referenced page or drawing. Document Rating Excellent Good Acceptable Poor Clarity Technical Accuracy Organization CS 98.2