NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
M3T-PD79SIM REJ10J0045-0100Z PD79SIM 0000FF 00005F 00005F16 C00016 00C00016 - Datasheet Archive
Simulator Debugger for 79xx Series User's Manual Rev. 1.00 May 1, 2003 REJ10J0045-0100Z · Microsoft, MS-DOS, Windows, and
M3T-PD79SIM M3T-PD79SIM V.3.20 Simulator Debugger for 79xx Series User's Manual Rev. 1.00 May 1, 2003 REJ10J0045-0100Z REJ10J0045-0100Z · Microsoft, MS-DOS, Windows, and Windows NT are registered trademarks of Microsoft Corporation in the U.S. and other countries. · IBM and AT are registered trademarks of International Business Machines Corporation. · Intel and Pentium are registered trademarks of Intel Corporation. · Adobe, Acrobat, and Acrobat Reader are trademarks of Adobe Systems Incorporated. · All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. Keep safety first in your circuit designs! Renesas Technology Corporation and Renesas Solutions Corporation put the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. Notes regarding these materials These materials are intended as a reference to assist our customers in the selection of the Renesas Technology product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corporation, Renesas Solutions Corporation or a third party. Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by Renesas Technology Corporation and Renesas Solutions Corporation without notice due to product improvements or other reasons. It is therefore recommended that customers contact Renesas Technology Corporation, Renesas Solutions Corporation or an authorized Renesas Technology product distributor for the latest product information before purchasing a product listed herein. The information described here may contain technical inaccuracies or typographical errors. Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. Please also pay attention to information published by Renesas Technology Corporation and Renesas Solutions Corporation by various means, including the Renesas home page (http://www.renesas.com). When using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage, liability or other loss resulting from the information contained herein. Renesas Technology semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. Please contact Renesas Technology Corporation, Renesas Solutions Corporation or an authorized Renesas Technology product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. The prior written approval of Renesas Technology Corporation and Renesas Solutions Corporation is necessary to reprint or reproduce in whole or in part these materials. If these products or technologies are subject to the Japanese export control restrictions, they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination. Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the country of destination is prohibited. Please contact Renesas Technology Corporation or Renesas Solutions Corporation for further details on these materials or the products contained therein. For inquiries about the contents of this document or product, fill in the text file the installer generates in the following directory and email to your local distributor. ¥SUPPORT¥Product-name¥SUPPORT.TXT Renesas Tools Homepage http://www.renesas.com/en/tools Preface The PD79SIM PD79SIM is a simulator debugger for Windows, which simulates the 7900 series operation of 16-bit microcomputer and evaluates the target program. This user's manual describes the PD79SIM PD79SIM's features, functions, setting up and operational procedures. Rights to the Program The right to use the program is granted according to provisions under a software license agreement. The PD79SIM PD79SIM program can only be used for the purposes of product development by the user, and cannot be used for any other purposes. Note also that the information in this manual does not convey any guarantee or license for the use of software. If you agree to each article in the Software License Agreement, please fill out and return your Registration Fax. Contents Contents INTRODUCTION 1 1 PD79SIM PD79SIM Introduction 3 2 PD79SIM PD79SIM Features 4 2.1 Multi-Windowing Function .4 2.2 I/O Simulation Function.4 2.3 Interrupt Simulation Function.4 2.4 Simplified System Simulation Function.4 2.5 RAM Monitor Function.4 2.6 Break Functions .5 2.7 Source Level Debugging Function.5 2.8 On-Demand Method .5 3 PD79SIM PD79SIM Simulation Specifications 6 3.1 Main Differences to Actual MCU .6 3.2 Operation of Instructions .7 3.3 Resetting.8 3.4 Memory.8 3.5 Virtual Port Input Function .9 3.6 Virtual Port Output Function .9 3.7 Virtual Interrupt Function.9 3.8 GUI Input Function.10 3.9 GUI Output Function .10 3.10 I/O Script Function .10 3.11 Unique Simulator Functions .11 4 PD79SIM PD79SIM Input and Output Files 12 4.1 Input Files .12 4.2 Output Files.14 4.3 Temporary Files .15 SETUP 17 1 Setup 19 1.1 Installation .19 i PD79SIM PD79SIM User's Manual 1.2 Starting PD79SIM PD79SIM .19 1.3 pd79sim Setup .20 1.4 sim79 Setup .22 WINDOW FUNCTION 25 1 WINDOW FUNCTION OF PD79SIM PD79SIM 27 1.1 The PD79SIM PD79SIM Window .27 1.2 Program Window .33 1.3 Source Window .38 1.4 Register Window.41 1.5 Memory Window.43 1.6 Dump Window .45 1.7 RAM Monitor Window .47 1.8 ASM Watch Window.50 1.9 C Watch Window .53 1.10 Local Window .56 1.11 File Local Window .58 1.12 Global Window.60 1.13 Script Window .61 1.14 I/O Window .63 1.15 GUI Input Window .80 1.16 GUI Output Window.82 1.17 MR Window .84 1.18 Coverage Window .86 1.19 S/W Break Point Setting Dialog Box .89 1.20 H/W Break Point Setting Dialog Box .90 BASIC OPERATION 91 1 Loading and Displaying the Target Program 93 1.1 Downloading.93 1.2 To Reload the recent downloaded file.94 1.3 To download the target program automatically when updated .95 1.4 Changing Program Display Position Immediately After Downloading .95 1.5 Uploading .96 ii Contents 1.6 Saving Results of Disassembly .96 1.7 Continuing to Display a Selected Program Position .97 1.8 Changing the Program Display Position .97 1.9 Checking Source Programs in Other Directories .101 1.10 Mixing Source and Disassemble Displays .102 1.11 Displaying the Results of Disassembling .103 1.12 Changing Display Colors .104 2 Starting and Stopping Target Program Execution 105 2.1 Starting and Stopping .105 2.2 Step Execution.107 2.3 Returning from Current to Calling Routine.108 2.4 Program Execution to Specified Location.108 2.5 Resetting the Program .109 3 Checking and Setting Register Data and Memory Contents 110 3.1 Checking the Contents of Registers .110 3.2 Changing the Contents of Registers.111 3.3 Checking Changes in RAM During Target Program Execution.113 3.4 Checking the Value at a Specified Address.114 3.5 To switch scope .117 3.6 Setting Data at a Specified Address.117 3.7 Updating the Memory Display .119 3.8 Checking and Changing Memory Map Data .119 3.9 To change the acquisition mode of the memory .119 4 Software Breaks 120 4.1 Opening the S/W Break Point Setting Dialog Box .120 4.2 Setting a Break Point .121 4.3 Deleting a Break Point .122 4.4 Temporarily Disabling Break Points.122 4.5 Temporarily Enabling Break Points.123 4.6 Setting a Break Point from Program (Source) Window .123 4.7 Setting Breakpoints from the Toolbar.124 4.8 Saving Breakpoints .124 4.9 Loading Saved Breakpoints.124 5 Hardware Breaks 125 5.1 Opening the H/W Break Point Setting Dialog Box.125 iii PD79SIM PD79SIM User's Manual 5.2 Setting Hardware Breakpoints .126 5.3 Deleting a Hardware Breakpoint .129 6 CHECKING C VARIABLES 130 6.1 Checking C Variables .130 6.2 To change the value of a C variable.133 7 SCRIPT COMMANDS 134 7.1 Executing Script Commands .134 7.2 Logging the Results of Executing Script Commands.135 7.3 Executing Script Commands in Batch Mode.138 8 EXITING PD79SIM PD79SIM 140 8.1 Exiting PD79SIM PD79SIM .140 9 MISCELLANEOUS 141 9.1 Line Assemble.141 9.2 Starting Up Make.143 9.3 Searching for Character Strings in Target Program .144 9.4 Changing Window Proportions.145 9.5 Switching Over Active Windows .146 9.6 Displaying the Version of PD79SIM PD79SIM.146 9.7 To Configure the operation of the PD79SIM PD79SIM .146 9.8 To Open the Editor .147 HIGH-END DEBUGGING 149 1 Setting Virtual Port Inputs in I/O Window 151 1.1 Overview.151 1.2 Setting Cycle-synchronized Inputs.151 1.3 Setting Read Access-synchronized Inputs.154 1.4 Setting Interrupt-synchronized Inputs .156 2 Setting Virtual Port Outputs in I/O Window 159 2.1 Overview.159 2.2 Setting Virtual Port Outputs.159 3 Setting Virtual Interrupts in I/O Window 161 3.1 Overview.161 3.2 Setting Cycle-synchronized Interrupts.161 iv Contents 3.3 Setting Executed Address-synchronized Interrupts.164 4 Other Functions of I/O Window 166 4.1 Changing Setup Data of Virtual Port Inputs and Virtual Interrupts.166 4.2 Deleting Virtual Port Inputs, Virtual Port Outputs, Virtual Interrupts, or I/O Script Files Set.171 4.3 Changing Display Mode of Virtual Port Input, Virtual Port Output, or Virtual Interrupt.176 4.4 Changing Scale of Display Screen .177 4.5 Changing Colors of Display Screen .178 4.6 Searching for Display Data .179 4.7 Listing Registered I/O Script Files .180 4.8 Regarding Evaluation Timings of Virtual Port Inputs, Virtual Interrupts, and I/O Script Files Set .180 5 Setting GUI Input Window 181 5.1 Overview.181 5.2 Creating Buttons .181 5.3 Saving Buttons You've Created.183 5.4 Changing Button Position or Settings after Creating Button.184 5.5 Copying buttons.185 5.6 Deleting buttons .186 5.7 Displaying Grid Lines.186 6 Setting GUI Output Window 187 6.1 Overview.187 6.2 Creating Labels .188 6.3 Creating LEDs.190 6.4 Saving Parts You've Created.192 6.5 Changing Parts Position or Settings after Creating Parts.193 6.6 Copying Parts .193 6.7 Deleting Parts.194 6.8 Displaying Grid Lines.194 7 I/O Script Function 195 7.1 Overview.195 7.2 Method for Writing I/O Script .195 7.3 Composition of I/O Script .197 7.4 Method for Writing Right-side Expressions .201 v PD79SIM PD79SIM User's Manual 7.5 Method for Writing Left-side Expressions .204 8 Coverage Information 206 8.1 Referencing Coverage .206 8.2 Updating Coverage Display.206 8.3 Initializing Coverage .206 8.4 Saving/Loading Coverage Measurement Information.207 9 Customize Function 208 9.1 About Customize Function .208 REAL-TIME OS DEBUGGING 213 1 Executing MR79 Application Programs 215 1.1 Setting Timer Interrupts.215 2 Real-time OS Debugging Function 217 2.1 Checking Real-time OS Information .217 2.2 Measuring Sizes of System and Task Stacks Used .230 REFERENCE 235 1 Table of Script Commands 237 1.1 Input Format .237 1.2 Tables of Commands.238 2 Writing Script Files 253 2.1 Structural Elements of a Script File .253 2.2 Writing Expressions .255 3 C Expressions 259 3.1 Writing C Expressions.259 3.2 Display Format of C Expressions .262 4 Error Messages 267 INDEX 279 vi Introduction 1 2 PD79SIM PD79SIM Introduction 1 PD79SIM PD79SIM Introduction The PD79SIM PD79SIM is a simulator debugger for Windows, which simulates the 7900 series operation of 16-bit microcomputer and evaluates the target program. PD79SIM PD79SIM comprises the following software: 1. pd79sim(the simulator debugger front end) 2. sim79(the simulator engine) 3 P D 7 9 S I M U s e r 's M a n u a l 2 PD79SIM PD79SIM Features 2.1 Multi-Windowing Function PD79SIM PD79SIM supports multiple overlapping windows, enabling you to simultaneously view a wide range of data. Each window contains menus and buttons, allowing commands to be executed by clicking with the mouse. 2.2 I/O Simulation Function PD79SIM PD79SIM provides the following I/O simulation functions: l Virtual port input function Changes of the data that is input from external devices to memory can be defined in the I/O Window or a file. l Virtual port output function The data that is output to memory by a program can be recorded.Changes of the recorded data can be graphically displayed. 2.3 Interrupt Simulation Function Software interrupts can be defined. I/O Window or a file. You can define the interrupts you want to be generated in the 2.4 Simplified System Simulation Function l GUI Input function Key matrix can be defined by GUI. l GUI output function LEDs, etc. can be defined by GUI. 2.5 RAM Monitor Function PD79SIM PD79SIM supports a RAM monitoring function, making it possible to check the contents of memory while executing the target program. The memory area monitored by this function is called the RAM monitor area. The PD79SIM PD79SIM have a 1KB RAM monitor area, which can be mapped to any address. You can use the RAM Monitor Window to monitor the RAM monitor area. 4 PD79SIM PD79SIM Features 2.6 Break Functions PD79SIM PD79SIM has the following two break functions: 2.6.1 Software Break Software breaks allow program execution to be stopped before the command at the specified address. The point at which this break occurs is called the software breakpoint. You can set software breakpoints from the S/W Break Point Setting dialog box. You can also easily set them from the Program Window and Source Window. PD79SIM PD79SIM supports up to 64 software breakpoints. You can set and read in the software breakpoint file via the S/W Break Point Setting dialog box. 2.6.2 Hardware Break Hardware breaks allow program execution to be stopped on detection of data being written to memory, read from memory, or an instruction being fetched. The point at which this break occurs is called the hardware breakpoint. You can set hardware breakpoints from the H/W Break Point Setting dialog box. PD79SIM PD79SIM supports up to 64 hardware breakpoints. 2.7 Source Level Debugging Function You can display source files and perform source level debugging such as setting break points in the source lines and performing step execution. PD79SIM PD79SIM allows debugging at the C language level and at the assembly language level. l You can use the Program Window and Source Window to view source files. l You can use the C Watch Window, Local Window, File Local Window, and Global Window to view the C variables and C expressions in C source files. l You can use the ASM Watch Window to view labels and symbols in assembler source files. l You can use labels and symbols to specify the addresses of breakpoints, etc. First local, then global, labels and symbols are converted to values. When you specify variables (or functions) defined in a C source file, add the underbar (_) before the name of the variable (or function). In the case of functions whose arguments are passed via registers, specify "$". (See the Rules for Calling Functions in the nc79 User's Manual for specifications of functions whose arguments are passed via registers.) 2.8 On-Demand Method PD79SIM PD79SIM supports the "on-demand" method whereby a temporary file is created when a target program has been downloaded, and the required debugging information is read into memory as required. This method conserves memory. However, by default, pd79sim uses the "on-memory" method, in which all debugging information is stored in memory. Use the pd79sim setup to select the "on-demand" or "on-memory" method of storing debugging information. See Section 1.3, "pd79sim Setup" in the setup section of this manual for details. Temporary files are created with the filename pdb_xxxx.tmp (where xxxx is a 4-digit hexadecimal value) in the directory containing the downloaded files. Temporary files are deleted immediately before downloading and when you quit PD79SIM PD79SIM. Select the "on-memory" method if there is any file with the same name as the temporary file. Temporary files are created in the directory specified from the Init dialog box. If the specified directory contains a file of the same name as the temporary file, change the directory where you want the temporary file to be created or choose the "on-memory" method. 5 P D 7 9 S I M U s e r 's M a n u a l 3 PD79SIM PD79SIM Simulation Specifications 3.1 Main Differences to Actual MCU This section describes the main differences between PD79SIM PD79SIM and the actual MCU. See later sections for details. 3.1.1 Realtime Timings Time management by PD79SIM PD79SIM is performed in cycles. However, the following differs from the actual chip. Here, the number of cycles are indicated by values stipulated in 7900 Series Software Manual. l The bus width, queue, and wait states are not considered when measuring the number of cycles. l PD79SIM PD79SIM starts counting cycles immediately after a reset. (Cycles immediately after a reset are 0.) The number of cycles needed to execute one machine instruction are added on for each instruction executed. (See Figure 3.1 shown below.) If four cycles are required for the LDA instruction, cycles are added at this point in time. If two cycles are required for the CMP instruction, cycles are added at this point in time. LDA instruction CMP instruction 0 1 2 3 4 5 6 7 8 9 Execution cycles Figure 3.1 Method for measuring In the above example, no cycles are added while the LDA or CMP instruction is being executed. The cycles required for each instruction are added after instruction execution. Note that the virtual port input/output and virtual interrupt functions are processed after instruction execution is completed. 6 PD79SIM PD79SIM S i m u l a t i o n S p e c i f i c a t i o n s 3.1.2 Peripheral I/O Peripheral I/Os other than the CPU core on the actual chip, such as timers, DMAC, and serial I/Os are not supported. In PD79SIM PD79SIM, the SFR area (000000 16 to 0000FF 0000FF 16) to which peripheral I/Os are connected is handled as RAM. However, bit 1 of the processor mode register 1 (00005F 00005F 16) shown below is handled as a direct addressing mode select bit. Processor mode register 1 (00005F16 00005F16 ) b7 b6 b5 b4 b3 b2 b1 b0 b1 Direct addressing select bit 0 Only one line of DPR0 is used. 1 Four lines of DPR0-3 are used. When bit 1 is set to 1 in a program, addressing based on DPR0-3 is enabled. Other bits do not have any effect in PD79SIM PD79SIM. This register is initialized to "3C16 " when reset. For serial I/Os, the virtual port input/output function described later can be used as a pseudoserial I/O. 3.1.3 Memory Space There is no processor mode. If mapped for memory, the whole 16MB of memory from 000000 16 to FFFFFF 16 can be read from and written to as RAM. However, if you try to access an area which is not allocated to memory, an error occurs. If this occurs while a program is running, the program will stop with an illegal memory access error. Use the map function, described later, to map this part of memory. 3.1.4 Interrupts In the actual MCU, peripheral I/O (including external interrupt signals) are generating factors for interrupts. However, PD79SIM PD79SIM has nothing corresponding to peripheral I/O. PD79SIM PD79SIM provides another method in place of this, which allows you to generate interrupts in a simulated manner (virtual interrupt function). Virtual interrupts can be generated at any time, e.g., in a specified cycle or at an executed address. 3.2 Operation of Instructions 3.2.1 W I T , S T P Executed as an NOP instruction. Other instructions operate the same as those of the actual MCU. 7 P D 7 9 S I M U s e r 's M a n u a l 3.3 Resetting l The S register is initialized to 0FFF 16. For the PS register, only the I flag is set to 1. The reset vector is set to a value "C00016 C00016" immediately after startup, so that the program counter value immediately after PD79SIM PD79SIM has been invoked is 00C00016 00C00016. All other registers are initialized to 0. l The SFR area is nonexistent in PD79SIM PD79SIM , so the initialization as in the actual chip is not performed. l The cycle count is initialized to 0. Note that the device is reset when PD79SIM PD79SIM is invoked. 3.4 Memory 3.4.1 Types of Memory The whole memory area (000000 16 to FFFFFF 16) is processed as RAM. Areas except a space range from 00000016 to 00FFFF 00FFFF 16 and a space (64 KB) containing the interrupt vector area are not allocated to memory initially. Use the map function to map memory to this area. Specify the interrupt vector area in the MCU file. See Section 1.3, "pd79sim Setup" in the Setup for details of how to specify MCU file. 3.4.2 Memory Structure and Initial Values Immediately after Starting The memory is set up as follows immediately after starting PD79SIM PD79SIM . 00000016 to 0000FF 0000FF 16 (SFR area) 00005F 00005F 16 00010016 to 00FFFF 00FFFF 16 interrupt vector area reset vector area other area starting Filled with 0016 Set to 3C16 Filled with 7416 (NOP) Filled with 7416 (NOP) Set to C00016 C00016 No memory immediately after 3.4.3 The Map Function: MAP Command The PD79SIM PD79SIM simulator divides the memory between 000000 16 and FFFFFF 16 into 256 equal parts, so that the memory space can be mapped in 64KB blocks. Memory spaces which contain a map having the lowest-ordered addresses (00000016 and 00FFFF 00FFFF 16 ) and the interrupt vector area are allocated to memory when the simulator starts. Use the MAP command to map the simulator memory. Memory mapped using this command is initialized with the value 7416 (NOP) immediately after being allocated. When downloading a target program, the memory is mapped automatically. Note: Memory space that has been mapped cannot be deleted. 3.4.4 Accessing an Area Without Memory If you access an area which is not allocated to memory, the system issues an error of "Improper access to memory" and interrupts execution of a program or a command, whichever is specified. (Note that if this occurs when executing a program, no error is output although the program execution is suspended.) 8 PD79SIM PD79SIM Simulation Specifications 3.5 Virtual Port Input Function This function defines changes of the data that is input from external devices to a specified memory address. Using this function you can simulate data inputs to the ports defined in SFR. The following shows timings at which data can be input to memory: 1. When program execution has reached a specified number of cycles 2. When a specified memory location is accessed for read by a program 3. When a specified virtual interrupt is generated The input data at the above timings can be defined from the I/O Window. Furthermore, this function can be used in combination with the I/O script function, a function that allows you to define virtual port inputs and virtual interrupts. (For details, refer to "High-end Debugging" described later in this manual.) Using this I/O script function, you can specify more precise data input timings such as when the program fetches an instruction, when the program writes to memory, or when the program has executed instructions a specified number of times. 3.6 Virtual Port Output Function When a data write to some memory address by the program occurs, this function records the written data value and the cycle at which the data was written. The recorded data can be verified in graphic or numeric format from the I/O Window. The maximum number of data that can be recorded by this function is 30,000 entries counted from the beginning of program execution. 3.7 Virtual Interrupt Function This function defines interrupt generation. Using this function you can generate timer interrupts and AD conversion interrupts in a simulated manner without having to actually generate them. The following shows timings at which virtual interrupts can be generated: 1. When program execution has reached a specified number of cycles 2. When the program has executed a specified address Virtual interrupts at the above timings can be defined from the I/O Window. Furthermore, this function can be used in combination with the I/O script function, a function that allows you to define virtual port inputs and virtual interrupts. (For details, refer to "High-end Debugging" described later in this manual.) Using this I/O script function, you can specify more precise interrupt generation timings such as when the program reads or writes to memory or when the program has executed instructions a specified number of times. 9 P D 7 9 S I M U s e r 's M a n u a l 3.7.1 Differences between Virtual Interrupts and Interrupts in Actual Chip Virtual interrupts differ from interrupts in the actual chip in the following points: 1. About interrupt control register When a virtual interrupt is generated, the interrupt control register's interrupt request bit is not set to 1. The interrupt priority specified in the interrupt priority level bit is not referenced either.The priority of virtual interrupts can be specified when you set virtual interrupts from the I/O Window or in I/O script. Note that the I/O script function allows you to write statements to the effect that the interrupt request bit be set to 1 when an interrupt occurs. 2. Special hardware interrupts cannot be generated as virtual interrupts. Reset, NMI, DBC, watchdog timer, address match interrupts cannot be generated as virtual interrupts. 3. If virtual interrupts of the same priority occur simultaneously If in the actual chip, multiple interrupts of the same priority occur simultaneously, they are resolved according to the priority levels set in hardware so that an interrupt of the highest priority is accepted. For virtual interrupts, however, all interrupts belonging to one interrupt type (e.g., peripheral I/O interrupt) are handled as having the same priority. Therefore, if virtual interrupts of the same priority occur simultaneously, the order in which they are accepted is indeterminate. 3.8 GUI Input Function This function implements the user target system's simple key input panel (buttons) in a window. The key input panel is created in the GUI input window. By pressing a button created in the GUI input window, you can accomplish virtual port inputs and virtual interrupts. l Input data to a specified memory address (virtual port input) l Generate a specified virtual interrupt l Accomplish specified virtual interrupt and virtual port input simultaneously 3.9 GUI Output Function This function implements the user target system's simple output panel in a window. The output panel is created in the GUI input window. The following parts can be arranged on this output panel: l Character string User-specified character strings are displayed or erased when some value is written to a specified memory address or according to logic 1 or 0 in bits. l LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or 0 in bits. 3.10 I/O Script Function This function allows you to write virtual port input and virtual interrupt settings to a file in script form. Therefore, it provides a more flexible way to define virtual port inputs and virtual interrupts than can be set from the I/O Window. Specifically, this includes, for example, reading the divideby-N ratios you've set in the timer register and generating a timer interrupt periodically. For details about I/O scripts, refer to "High-end Debugging" described later in this manual. 10 PD79SIM PD79SIM Simulation Specifications 3.11 Unique Simulator Functions 3.11.1 Stack Utilization Monitor: The StackMonitor (SM) Command Use the StackMonitor command to check the maximum and minimum addresses of the stack, and to determine how much the program has used of what part of the stack. The stack monitoring continues from the time that a Go or GoFree command is invoked until it is interrupted, the maximum and minimum values being recorded for the two stack pointers (S and ISP registers). If, while the program is running, it causes a change in the value of a stack pointer, monitoring of stack utilization of that stack stops at that point. 3.11.2 Cycle Count Monitor Function: The CYcle (CY) Command Use the CYcle command to determine the number of cycles in a program that has been run. The number of cycles is obtained using the values described in the "7900 Software Manual". 11 P D 7 9 S I M U s e r 's M a n u a l 4 PD79SIM PD79SIM Input and Output Files 4.1 Input Files PD79SIM PD79SIM processes the following input files. 4.1.1 IEEE-695 IEEE-695 Absolute Format Files The IEEE-695 IEEE-695 absolute format files contain debugging information such as data on the variables used in the source files as well as line data, and machine language data. These files, which are generated by the nc79 C compiler, as79 relocatable macro assembler, and ln79 linkage editor, take the attribute ".x79". 4.1.2 Intel HEX-format Files The Intel HEX-format files store machine language data. These files, which are generated by the lmc79 load module converter supplied with the as79 relocatable assembler, take the attribute ".hex" (they are converted from IEEE-695 IEEE-695 absolute-format files). 4.1.3 Motorola S-format Files The Motorola S-format files contain machine language data. These files, which are generated by the lmc79 load module converter supplied with the as79 relocatable assembler, take the attribute ".mot"(they are converted from IEEE-695 IEEE-695 absolute-format files). 4.1.4 Register Information File The register information file, which is named "PD79SIM PD79SIM.rdf", contains information of MCU registers(register name and size, etc.). PD79SIM PD79SIM automatically reads this file and uses the information to display the register window (The register window does not open if this file does not exist). This file is supplied with PD79SIM PD79SIM. The user cannot edit it. 4.1.5 Script File The script file is for automatic execution of script commands. This file, which is read from the Script Window, takes the attribute ".scr". 4.1.6 Help File The help file contains help messages for PD79SIM PD79SIM. This file, which is supplied with PD79SIM PD79SIM, takes the attribute ".hlp". 12 PD79SIM PD79SIM I n p u t a n d O u t p u t F i l e s 4.1.7 Environmental Setup File The environmental setup file, which is automatically generated by PD79SIM PD79SIM and cannot be directly created or edited by the user, stores information about the environmental setup of PD79SIM PD79SIM. The filename is pd79sim.ini and sim79.ini. The environmental setup file is saved to the Windows directory (the directory in which you have installed Windows). 4.1.8 MCU File This file contains the information inherent to the target MCU. The MCU file is included with product. The file name is M379xx.MCU. 4.1.9 Coverage Measurement Information File This is a binary file that contains the results of coverage measurements. The file attribute is ".cov." This file can be saved and loaded from and into the coverage window. 4.1.10 ASM Watch Point Data File The ASM watch point data file contains data on the ASM watch point that is input from the ASM Watch window. The file extension is ".wpt" and the file itself can be read from the ASM Watch window. 4.1.11 C Watch Point Data File The C watch point data file, which is created automatically by PD79SIM PD79SIM, stores information on the C watch points recorded in the C Watch Window. The file attribute is ".cwp". This file is stored in the Windows directory (the directory in which you installed Windows). It cannot be created or edited by the user. 4.1.12 Software Breakpoint File The software breakpoint file, which takes the suffix ".brk", contains the software breakpoint settings. You can read in this file via the S/W Breakpoint dialog box to set the software breakpoints. 4.1.13 I/O Script File This file contains a description of virtual port inputs and virtual interrupts. file is read from the I/O Window. The file attribute is ".scr". The created I/O script 4.1.14 GUI Input File This file contains definitions of the key panel created in the GUI input window that have been saved to a file. The file attribute is ".btn." By reading this file from the GUI input window, you can set up the panel key you've created newly again. 4.1.15 GUI Output File This file contains definitions of the output panel created in the GUI output window that have been saved to a file. The file attribute is ".gof." By reading this file from the GUI output window, you can set up the output panel you've created newly again. 13 P D 7 9 S I M U s e r 's M a n u a l 4.2 Output Files PD79SIM PD79SIM outputs the following files. 4.2.1 Intel HEX-format Files The Intel HEX-format files store machine language data. These files, which are saved using PD79SIM PD79SIM's upload function, take the attribute ".hex". Files saved in the Intel HEX format can be downloaded by PD79SIM PD79SIM. 4.2.2 Motorola S-format Files The Motorola S-format files contain machine language data. These files, which are saved using PD79SIM PD79SIM's upload function, take the attribute ".mot". Files saved in the Motorola S-format can be downloaded by PD79SIM PD79SIM. 4.2.3 Disassemble Files Disassemble files store the results of disassembling program memory. These files, which are reference text files, take the attribute ".txt". Disassemble files cannot be reassembled or downloaded. 4.2.4 Log File The log file is a text file containing the results of executing the script commands. This file, which takes the attribute ".log", contains the results from the logon point to the logoff point. 4.2.5 View File The view file is a text file that contains the contents of the script window. In PD79SIM PD79SIM, the last 1000 lines of the results of executing the script commands are stored in the view buffer. The view file, which takes the attribute ".viw", contains the contents of the view buffer. 4.2.6 Coverage Measurement Information File This is a binary file that contains the results of coverage measurements. The file attribute is ".cov." This file can be saved and loaded from and into the coverage window. 4.2.7 ASM Watch Point Data File The ASM watch point data file contains data on the ASM watch point that is input from the ASM Watch window. The file extension is ".wpt" and the file itself can be read from the ASM Watch window. 4.2.8 Software Breakpoint File The software breakpoint file, which takes the suffix ".brk", contains the software breakpoint settings. You can save this file via the S/W Breakpoint dialog box to set the software breakpoints. 14 PD79SIM PD79SIM I n p u t a n d O u t p u t F i l e s 4.2.9 I/O Script File This file contains definitions of virtual port inputs and virtual interrupts set or created in the I/O Window that have been saved to a file. 4.2.10 GUI Input File This file contains definitions of the key panel created in the GUI input window that have been saved to a file. The file attribute is ".btn." This file is saved from the GUI input window. 4.2.11 GUI Output File This file contains definitions of the output panel created in the GUI output window that have been saved to a file. The file attribute is ".gof." This file is saved from the GUI output window. 4.2.12 Virtual Port Output File This file contains the results of virtual port outputs specified in the I/O Window that have been saved to a file. This file is referenced by PD79SIM PD79SIM when it displays the results of virtual port outputs in the I/O Window. 4.3 Temporary Files 4.3.1 Files Created When Using On-Demand Method A temporary file is created when you specify on-demand reading of debugging information when downloading a target program. Temporary files are created with the filename pdb_xxxx.tmp (where xxxx is a 4-digit hexadecimal value) in the directory containing the downloaded files. Temporary files are deleted immediately prior to downloading and when you quit PD79SIM PD79SIM. 4.3.2 Files Created in I/O Window Temporary files are created when you set virtual port inputs or virtual interrupts or I/O script files in the I/O Window. PD79SIM PD79SIM creates these temporary files in the directory in the files that contain virtual port input or virtual interrupt settings are stored or the directory in which the I/O script files are stored. Therefore, unless these directories are permitted for access, an error may occur when an attempt is made to read files from the directory using the I/O Window menus [Option] -> [Load]. 15 P D 7 9 S I M U s e r 's M a n u a l [ MEMO ] 16 Setup 17 18 Setup 1 Setup 1.1 Installation See the Release Notes provided with the product for how to install PD79SIM PD79SIM . 1.2 Starting PD79SIM PD79SIM Click the start button, then select program (P)-> [ RENESAS - TOOLS ] -> [ PD79SIM PD79SIM V.X.XX Release X ] -> [ PD79SIM PD79SIM ] This operation starts pd79sim (the simulator debugger front end), and simultaneously starts sim79 (the simulator engine). If sim79 is already running, only pd79sim starts. 19 P D 7 9 S I M U s e r 's M a n u a l 1.3 pd79sim Setup When you start pd79sim, the Init dialog box is displayed, allowing you to set up the operating environment. 1.3.1 Init Dialog Box Screen Configuration Area for specifying MCU file Area for specifying script file to be executed at startup Area for setting of default tab value Area for setting og default font size Selection of "On Memory" or "On Demand" methods of downloading Area to set the directory where a temporary file is created Switches of Init dialog box ON/OFF of restarting ON/OFF of an automatic download function at restart ON/OFF switching of an ending-state resume function 1.3.2 Environment Setup Specifying the MCU file Specify the MCU file for the target MCU. Click the "Refer" button to open the file selection dialog box and select the MCU file. When the corresponding MCU file does not exist, it is necessary to make the MCU file newly. Please refer to item "Method of making the MCU file" of the release note appended to this product package for the method of making the MCU file. Specifying the script file to be executed at startup Specify a script file if you want to execute script commands at startup. These commands must have been saved as a script file. Click the "Refer" button to open the file selection dialog box, then use the mouse to select the script file to be executed at startup. The selected script file is displayed after InitFile: in the Init dialog box. Setting of default TAB values Specify the default tab values for the Program Window, Source Window. You can specify TAB values between 1 and 32. Note: You can set the tabs independently in each window. With the target window active, select [Option] -> [TAB] from the menu in the PD79SIM PD79SIM Window to open the TAB Setting dialog box. You can now set the tabs for the active window. Setting of default font size pd79sim Specify the default font for the characters displayed by pd79sim. Click the "Font" button to open the Font dialog box, then specify the font and the font size. Note: You can set the font size independently in each window. With the target window active, select [Option] -> [Font] from the menu in the PD79SIM PD79SIM Window to open the Font Setting dialog box. 20 Setup You can now set the font size for the active window. Selection of "On Memory" or "On Demand" method of downloading This selection determines whether the debugging information is fetched using the "On Memory" or "On Demand" method when a target program has been downloaded. When you select "On Memory", all the debugging information is stored in memory. When you select "On Demand", a temporary file is created when you download the target program, and the required debugging information is read from that file into memory as it is required. When you select [Environ] -> [Init] from the PD79SIM PD79SIM and select "On Memory" or "On Demand" from the Init dialog box, the specified method is valid from the next time you download a target program. Specifying temporary directory in on-demand mode PD79SIM PD79SIM creates a temporary file when the target program has been downloaded using the ondemand method. This temporary file is created in a specified directory. If no directory is specified, the temporary file is created in the directory where the downloaded file exists. Switches of Init dialog box ON/OFF of restarting Specify whether the Init dialog box should be opened when restarting PD79SIM PD79SIM . Check "Next Hide" to stop the Init dialog box being opened when you next start pd79sim. If you want to display the Init dialog box when you next start pd79sim, select [Init] -> [Environ] from the PD79SIM PD79SIM Window menu, then uncheck "Next Hide" in the Init dialog box. You can also force the Init dialog box to be displayed when you start up by pressing and holding the Ctrl key when starting pd79sim. ON/OFF of Ending-State Resume Function Specify whether or not you want PD79SIM PD79SIM to be started up in its previously terminated window display state. If you check Resume check box, PD79SIM PD79SIM starts up in the same window display state as it was terminated previously. Automatic Download Function at Restart Specify whether or not you want the last target program previously loaded into the simulator to be loaded again when starting up PD79SIM PD79SIM . If you check AutoLoad check box, the target program is automatically loaded when PD79SIM PD79SIM starts up. 21 PD79SIM PD79SIM U s e r 's Manual 1.4 sim79 Setup When sim79 starts up, it is registered in the system tray. 1.4.1 sim79 When Running Right-clicking on the running sim79 and selecting [Version.] from the menu bar will open up the Version Information dialog box. 1.4.2 Structure of Version Information Dialog Box Communication connection status sim79 version information Auto exit switch Simulator MCU Status(RUN/STOP) 22 OK button Exit button Setup 1.4.3 Setting Up Auto Exit Switch Setting Check the Auto exit checkbox to automatically exit sim79 when you exit pd79sim. Communications Connection Status CONNECT is displayed when connected to pd79sim. CUT is displayed when there is no connection. Simulator MCU Status(RUN/STOP) RUN is displayed when the simulator MCU is running, STOP when stopped. OK button Closes the Version Information dialog box. Exit button Exits sim79. Note that you cannot exit sim79 while connected to pd79sim. 23 P D 7 9 S I M U s e r 's M a n u a l [ MEMO ] 24 Window function 25 26 Window function of PD79SIM PD79SIM 1 Window function of PD79SIM PD79SIM 1.1 The PD79SIM PD79SIM Window The PD79SIM PD79SIM Window is the main window for PD79SIM PD79SIM. This window displays the main commands on a toolbar. You can click on the buttons on this toolbar to run the target program in normal or one-step mode. The main display area accommodates windows such as the Target Program Window. 1.1.1 PD79SIM PD79SIM Window Screen Configuration Menu for executing commands Main display area Toolbar with main command buttons Sub windows Displays help on how to use windows and menus Displays status of execution of target program 27 P D 7 9 S I M U s e r 's M a n u a l 1.1.2 PD79SIM PD79SIM Window Toolbar Go button Executes target program Step button One-step execution of target program Break button Sets the position of the cursor in the window as the software breakpoint SW button Sets a software breakpoint Return button Runs the program up to the higher routine Stop button Com button e Stops execution of the Executes the target program HW button target program from the value in the program Sets a hardware counter to the position of the breakpoint cursor in the window Over button Reset button Step over Resets the target program function/subroutine call 1.1.3 PD79SIM PD79SIM Window Menu The menus in the PD79SIM PD79SIM Window can be classified as basic menus and extended menus. Edit menu File m enu Environment menu View menu Debugging menu (optional item s ) Debugging menu (basic debugging) Optional Window menu W indow menu Basic Menus and Extended Menus The sub-menu items of the optional menus in PD79SIM PD79SIM automatically change according to which window is active in the main display area of the PD79SIM PD79SIM window. The optional menus are called extension menus. In contrast, the items on all menus other than the optional menus remain the same no matter which window is active. These are called basic menus, and provide the items for the basic operation of PD79SIM PD79SIM and debugging. Below, we look at the functions of each item on the basic menus. The functions of the items on the extended menus are described under the respective windows. 28 Help menu Window function of PD79SIM PD79SIM 1.1.3.1 File operation The [File] menu in PD79SIM PD79SIM contains the items required for file operation such as including files, saving files, and terminating PD79SIM PD79SIM. Menu Menu options Function File Download Download target program. Load Module. Shortcut keys Download machine language data and -Shift + F.1 debugging information. Memory Image. Download only machine language data. - Symbol. Download only debugging information. - Reload Reload target program. - Upload. Upload target program. - AutoDownLoad. Automatically download when the target program is updated. - Save Disasm. Save disassembly result. - File Name List the file name of target program downloaded. - Exit Terminate PD79SIM PD79SIM. - 1.1.3.2 Editing The [Edit] menu in PD79SIM PD79SIM contains the items required for editing operation such as character strings copy, paste, and search. Menu Menu options Function Shortcut keys Edit Copy Copy character strings specified to clipboard. Ctrl + C Paste Paste character strings of clipboard. Ctrl + V Find. Find character strings. - 1.1.3.3 Display The [View] menu in PD79SIM PD79SIM contains the items required for switching display of the tool bar and status bar. Menu Menu options Function Shortcut keys View Tool Bar Switch display or non-display of tool bar. - Status Bar Switch display or non-display of status bar. - 29 P D 7 9 S I M U s e r 's M a n u a l 1.1.3.4 Setup The [Environ] menu in PD79SIM PD79SIM contains the items required for setting up the operating environment. Menu Menu options Function Shortcut keys Environ Init. Environment setup - Path. Source file search path - Start Up. Startup function settings - Customize. Open Customize dialog box. - 1.1.3.5 Debugging (Basic) The [Debug] menu in PD79SIM PD79SIM contains the items for basic debugging such as starting and stopping and one-step execution of the target program. Menu Menu options Function Shortcut keys Debug Go Start target program. Go Run from current program counter. Go Option. Run from specified address. GoFree Free-run target program. Come Run to cursor position. Step Step execution. Step Execute one step. Step Option. Execute specified No. of steps. Over Over-step execution. Over Execute one over-step. Over Option. Execute specified No. of over-steps. Return Execute until return from current subroutine. Break Point Set break point. - F.1 - - F.2 - F.3 - - F.4 - F.5 - S/W Break Point. Open S/W Break Point Setting dialog box. F.7 H/W Break Point. Open H/W Break Point Setting dialog box. Shift + F.7 Break Set/cancel software break at cursor. - Reset Reset target program. F.8 Stop Stop target program. - Scope. Open Scope Setting dialog box - Entry. Entry makefile - Make Make target program - 30 Window function of PD79SIM PD79SIM 1.1.3.6 Debugging (Option) The extended menus in PD79SIM PD79SIM contains the items for operating the various PD79SIM PD79SIM windows. The items on the extended menus differ according to which window is active. The functions of the items on the extended menus are described under the respective windows. Menu Menu options Option Function Shortcut keys (This menu contains the extended menus for the various PD79SIM PD79SIM windows.) - 1.1.3.7 Window Operations The [BasicWindow] menu has assigned to it the menus which among PD79SIM PD79SIM functions, are used to control the display mode of each window provided by PD79SIM PD79SIM and to open the basic windows of PD79SIM PD79SIM. Menu Menu options Function Shortcut keys BasicWindow Cascade Cascade windows. - Tile Tile windows. - Arrange Icon Arrange icons. - Program Window Make Program Window active. - Source Window Open Source Window. - Register Window Open Register Window. - Memory Window Open Memory Window. - Dump Window Open Dump Window. - RAM Monitor Window Open RAM Monitor Window. - ASM Watch Window Open ASM Watch Window. - C Watch Window Open C (language-level) Watch Window. - C Watch Window Open C Watch Window. - Local Window Open Local Window. - File Local Window Open File Local Window. - Global Window Open Global Window. - Script Window Open Script Window. 31 - P D 7 9 S I M U s e r 's M a n u a l The [OptionalWindow] menu has assigned to it the menus which among PD79SIM PD79SIM functions, are used to open windows of greater functionality. Menu Menu options Function Shortcut keys Open IO Window. - GUI Input Window Open GUI input Window. - GUI Output Window Open GUI Output Window. - MR Window Open MR Window. - Coverage Window Open Coverage Window. - OptionalWindow IO Window - Custom Window Option Entry Custom Window - User definition menu Open the custom window - 1.1.3.8 Help The [Help] menu contains the items for displaying PD79SIM PD79SIM help messages and the PD79SIM PD79SIM version No. Menu Menu options Function Shortcut keys Help Index Display help. - About. Display version information about PD79SIM PD79SIM. - 32 Window function of PD79SIM PD79SIM 1.2 Program Window The Program Window displays the machine code at the current program counter. The line at the program counter is highlighted in yellow. The Program Window is automatically opened in the main display area of the PD79SIM PD79SIM Window when you start PD79SIM PD79SIM. The Program Window can be used for executing the target program up to the cursor position, set or cancel software breakpoints using the mouse, and displaying reverse assembles of the target program, etc. Double-click the software breakpoint display/setting area to set or cancel software breakpoints. By choosing menus [Option] -> [Line Assemble] after clicking on a program display area, you can perform line assemble beginning with the position you have clicked. 1.2.1 Structure of Program Window The Program Window has three display modes: source, disassemble, and mixes source with disassemble. The structure of the Program Window is described for each display mode below. 1.2.1.1 Structure of Program Window in Source Display Mode The source display mode is provided for debugging at the source level. You can check the source files of the target program in source display mode. File name display Source line display area Toolbar Current program counter Software breakpoint display/setting area Program display area Address display area The line No. display area and address display area can be displayed or hidden by selecting or canceling [Option] -> [Layout] -> [Line Area] and [Option] -> [Layout] -> [Address Area]. Note that, by default, the address display area is hidden. l Double-click the line No. display area to change the display source file. l Double-click the address display area to change the display starting address or the display starting line. l The value of the C variable is displayed, when the mouse cursor stand still (about 0.5 seconds) on the strings of the variable in the Program display. l The result of the Coverage measurement is displayed by selecting [On] in the Menu [Option] -> [Coverage]. l 33 P D 7 9 S I M U s e r 's M a n u a l 1.2.1.2 Structure of Program Window in MIX Display Mode In MIX display mode, the source program is displayed with the results of its disassembly. The source program is displayed in a different color from the results of disassembly. File name display Source line display area Toolbar Current program counter Object code display area Software breakpoint display/setting area Address display area Program display area The line No. display area, address display area, and object code display area can be displayed or hidden by selecting or canceling [Option] -> [Layout] -> [Line Area], [Option] -> [Layout] -> [Address Area], and [Option] -> [Layout] -> [Code Area]. Note that, by default, the address display area is hidden. l Double-click the line No. display area to change the display source file. l Double-click the address display area to change the display starting address or the display starting line. l The result of the Coverage measurement is displayed by selecting [On] in the Menu [Option] -> [Coverage]. l 34 Window function of PD79SIM PD79SIM 1.2.1.3 Structure of Program Window in Disassemble Display Mode The disassemble display mode is provided for debugging at the instruction level. You can check the results of disassembling the target program in disassemble display mode. Toolbar Current program counter Label display area Address display Object code display area area Software breakpoint display/setting area l l l l l Program display area The address display area and object code display area can be displayed or hidden by selecting or canceling [Option] -> [Layout] -> [Address Area] and [Option] -> [Layout] -> [Code Area]. Note that you cannot scroll backwards vertically until you have scrolled forwards. When you scroll forwards, the previous display address is stored in the internal buffer. This address information is used when you scroll backwards. Note that the internal buffer is cleared if you execute a command that changes the first line address. If you disassemble an area (data or empty area, etc.) other than the program, the contents of memory are interpreted as instruction code and displayed in disassembled format. In this case, "?" is displayed for undefined instructions and operands. Double-click the address display area to change the display starting address. The result of the Coverage measurement is displayed by selecting [On] in the Menu [Option] -> [Coverage]. 35 P D 7 9 S I M U s e r 's M a n u a l 1.2.2 Shortcut Menus of the Program Window When you click the right mouse button in the Program Window, the shortcut menu opens. And you can display the source file that contains the selected function, or you can register the selected variable as C watch point. Menu Menu options Function Shortcut keys Display the selected function - Open Source Window Open Source Window Display the selected function (opening the new Source Window) - Add C Watch. Register the C watch point of the selected variable - Add C Watch Pointer. Register the C watch point of the selected variable's pointer. - Add ASM Watch. Register the ASM watch point of the selected symbol. - BitAdd ASM Watch. Register the ASM watch point of the selected bit symbol. - Open Editor Open the source file by the editor. - Entry Editor. Register the editor to open the source files. - Line Assemble. Open the Line Assemble Dialog Box. - Right Clicking Jump to function 1.2.3 Program Window Toolbar SRC button Displays the program in source mode. MIX button Displays the program in MIX mode. DIS button Displays the program in disassemble mode. View button Changes the part of the program being displayed. You can specify a source file, a function, an address, or the position of the program counter. 36 Window function of PD79SIM PD79SIM 1.2.4 Extended menu in the Program Window When the Program Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Font. Change font. - TAB. Set source file display tabs. - Color. Change display color - View Change contents of display. - Source. Display from specified source file or function. - Address. Display from specified address or line No. - Program Counter Display from current program counter. - Mode Switch display mode. - Source mode Switch to source display mode. Ctrl + R Mix mode Switch to MIX display mode. Ctrl + R Disasm mode Switch to disassemble display mode. Ctrl + R Layout - Set layout. Line Area Turn on/off line No. area. - Address Area Turn on/off address area. - Code Area Turn on/off object code area. - Line Assemble. Open Line Assemble dialog. Coverage Set Coverage measurement . Ctrl + L - On/Off Turn on/off Measurement result. - Clear Initialize coverage measurement result - Refresh Update display of coverage measurement result - 37 P D 7 9 S I M U s e r 's M a n u a l 1.3 Source Window The Source Window is provided for dedicated display of the program being checked. The line at the program counter is highlighted in yellow. In contrast to the Program Window, which follows the program counter, the Source Window is not updated until you specify. Use the Source Window to check what is happening in specific subroutines and tasks. You can open up to 10 Source Windows. Other functions are the same as in the Program Window. 1.3.1 Structure of Source Window The Source Window has three display modes: source, disassemble, and mixes source with disassemble. The structure of the Source Window is described for each display mode below. The Source Window has the same structure as the Program Window. See Section 1.2.1, "Structure of Program Window" under Window Functions for details. 1.3.1.1 Structure of Source Window in Source Display Mode The source display mode is provided for debugging at the source level. You can check the source files of the target program in source display mode. Toolbar File name display Source line display area Software breakpoint display/setting area Address display area Program display area 38 Window function of PD79SIM PD79SIM 1.3.1.2 Structure of Source Window in MIX Display Mode In MIX display mode, the source program is displayed with the results of its disassembly. The source program is displayed in a different color from the results of disassembly. File name display Toolbar Label display area Source line display area Object code display area Software breakpoint display/setting area Address display area Program display area 1.3.1.3 Structure of Source Window in Disassemble Display Mode The disassemble display mode is provided for debugging at the instruction level. You can check the results of disassembling the target program in disassemble display mode. Toolbar Address display area Label display area Object code display area Software breakpoint display/setting area 39 Program display area P D 7 9 S I M U s e r 's M a n u a l 1.3.2 Shortcut menus in the Source Window The Source Window shortcut menus is similar to that of the Program Window. See Section 1.2.2, " Shortcut Menus of the Program Window" under Window Functions for details. 1.3.3 Source Window Toolbar The Source Window toolbar is the same as that in the Program Window. See Section 1.2.3, "Program Window Toolbar" under Window Functions for details. 1.3.4 Extended Menus in the Source Window When the Source Window is active in the PD79SIM PD79SIM main display area, extended menus for the Source Window are allocated to the [Option] menus. The extended menus of the Source Window are identical to those of the Program Window. See Section 1.2.4, "Extended menu in the Program Window" under Window Functions for details. 40 Window function of PD79SIM PD79SIM 1.4 Register Window The Register Window shows the contents of the registers and flags. The display is updated after each command is executed. You can click the buttons corresponding to registers in the Register Window to quickly change the values of the registers and flags. 1.4.1 Structure of Register Window Register names The value of the registers Radix of the values Register Display Area You double-click to change register values. Display the shot-cut menu when clicked the right button of the mouse. Flag display area You can click these buttons to change flag. 1.4.2 Extended Menus in the Register Window When the Register Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Hide DPR1-3 Turn on/off DPR1-3 registers display area. - Layout Set layout - Hide Radix Turn on/off radix. - Hide FLAGs Turn on/off flags display area. - Font. - Change font. 41 P D 7 9 S I M U s e r 's M a n u a l 1.4.3 Shortcut Menu of the Register Window Press the right button of the mouse on the register display area in Register Window to display shortcut menu. Menu Menu options Function Shortcut keys Right click Hex Display in hexadecimal. - Dec Display in decimal. - Bin Display in binary. - Hide DPR1-3 Turn on/off DPR1-3 registers display area. - Layout Set layout. - Hide Radix Turn on/off radix. - Hide FLAGs Turn on/off flags display area. - Font. l - Change font. The value changed is displayed in red. 42 Window function of PD79SIM PD79SIM 1.5 Memory Window The Memory Window displays the contents of contiguous memory in "address", "label", and "data (contents of memory)" formats. The display is updated after each command is executed. Data can be displayed in binary, decimal, hexadecimal, and ASCII. You can open up to 10 Memory Windows. You can use the Memory Windows to modify the contents of memory, and also to fill and move specified blocks of memory. 1.5.1 Structure of Memory Window Toolbar Displayed when the address is S or DPR Address display area Contents of memory display area Label display area l l l Double-click the address display area to change the display starting address. Double-click a label or the memory display area to change the contents of memory. The start and end address in the FILL and MOVE Dialog Box can be specified by selecting data in the data display area. After the selecting, when selecting the menu [Option] -> [Debug] -> [Move] or [Option] -> [Debug] -> [Fill],the start and end address of selected area are set in the MOVE or FILL Dialog Box. 1.5.2 Memory Window Toolbar Hex button Displays data in hexadecimal (default) Bin button Displays data in binary Dec button Displays data in decimal SJIS button Displays data in SJIS code Refresh button Refresh display. JIS button Displays data in JIS code ASCII button Displays data in ASCII code 43 Cache button Use the cache of memory P D 7 9 S I M U s e r 's M a n u a l 1.5.3 Extended Menus in the Memory Window When the Memory Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Font. Change font. - View Change contents of display. - Scroll Area. Specify scroll range. - Address. Specify display starting address. - S Change display starting address to value of - S register. DPR0 Change display starting address to value of - DPR0 register. DPR1 Change display starting address to value of DPR2 Change display starting address to value of - DPR1 register. - DPR2 register. DPR3 Change display starting address to value of - DPR3 register. Data Length Specify data length. - Byte Display in 1-byte units. - Word Display in 2-byte units. - Dword Display in 4-byte units. - Radix Specify radix. - Bin Display in binary. - Dec Display in decimal. - Hex Display in hexadecimal. - Ascii Display as ASCII characters. - SJIS Display as SJIS code. - JIS Display as JIS ccode. - Refresh Debug Refresh display. - Set memory contents. - Set. Set data at specified address. - Fill. Fill specified memory block with data. - Move. Move specified memory block to specified - address. Cache On Use the cache of memory 44 - Window function of PD79SIM PD79SIM 1.6 Dump Window The Dump Window displays the contents of contiguous memory in dump format. The display is updated after each command is executed. You can open up to 10 Dump Windows. You can use the Dump Windows to modify the contents of memory, and also to fill and move specified blocks of memory. 1.6.1 Structure of Dump Window Toolbar Address display area l l l Contents of memory display area ASCII code corresponding to data Double-click the address display area to change the display starting address. Double-click a label or the memory display area to change the contents of memory. The start and end address in the FILL and MOVE Dialog Box can be specified by selecting data in the data display area. After the selecting, when selecting the menu [Option] -> [Debug] -> [Move] or [Option] -> [Debug] -> [Fill],the start and end address of selected area are set in the MOVE or FILL Dialog Box. 1.6.2 Dump Window Toolbar Hex button Displays data in hexadecimal (default) SJIS button Displays data in SJIS code Dec button Displays data in decimal Refresh button Refresh display. JIS button Displays data in JIS code ASCII button Displays data in ASCII code 45 Cache button Use the cache of memory P D 7 9 S I M U s e r 's M a n u a l 1.6.3 Extended Menus in the Dump Window When the Dump Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Font. Change font. - View Change contents of display. - Scroll Area. Specify scroll range. - Address. Specify display starting address. - Data Length Specify data length. - Byte Display in 1-byte units. - Word Display in 2-byte units. - Dword Display in 4-byte units. - Radix Specify radix. - Dec Display in decimal. - Hex Display in hexadecimal. - Ascii Display as ASCII characters. - SJIS Display as SJIS code. - JIS Display as JIS code. - Refresh Debug Refresh display. - Set memory contents. - Set. Set data at specified address. - Fill. Fill specified memory block with data. - Move. Move specified memory block to specified - address. Cache On Use the cache of memory 46 - Window function of PD79SIM PD79SIM 1.7 RAM Monitor Window The RAM Monitor Window displays the contents of memory in the RAM monitor area in dump format. The display is updated at constant intervals (default = 100ms) during execution of the target program. The PD79SIM PD79SIM have 1KB of RAM monitor memory area. You can set any contiguous address area as the RAM monitor area. 1.7.1 Structure of RAM Monitor Window Toolbar Address display area Data display area ASCII code corresponding to data l Double-click the address display area to change the display starting address. If the specified starting address is outside the RAM monitor area, the RAM monitor area also changes. l The refresh rate during execution of the target program is displayed in the refresh rate display area ("Address" is displayed when the target program is not running). Note that, due to the operating conditions, the refresh rate may be slightly slower than that specified. The following items have a great influence on the refresh rate: Performance of and load on the host computer Window size (amount of memory display) The number of rewrites required (the number of memory addresses at which values have been changed) l The background color for the display of data and ASCII code changes according to the access attribute, as follows (the background color is white if there is no access): Areas accessed by READ: Green Areas accessed by WRITE: Red You can change the background color by selecting [Option] -> [Color]. The display of access attributes is cleared (the addresses are displayed as if not accessed) when you select [Option] -> [View] -> [Clear] and after downloading a target program. 47 P D 7 9 S I M U s e r 's M a n u a l Note: l The real-time RAM monitor function acquires the data of the bus access. Therefore, changes in the RAM/SFR area without the access by the target program are not reflected. l If you are displaying data in the RAM monitor area in 2-byte or 4-byte units (by selecting Word or Dword under [Option] -> [View] -> [Data Length]), the memory access attribute may differ for each of the bytes. If there are such mismatches in the access attributes within one data item, the data item is displayed in parentheses, as shown below. Note that the memory display background color is set to the color for the access attribute of the 1st byte. Display when access attribute is identical for all bytes of the data. Display when access attributes are mismatched between different bytes of the data. 1.7.2 RAM Monitor Window Toolbar JIS button Displays data in JIS code Hex button Displays data in hexadecimal (default) Dec button Displays data in decimal SJIS button Displays data in SJIS code ASCII button Displays data in ASCII code Clear button Clear access attribute. Refresh button Refresh display. Area button Set RAM monitor area. 48 Window function of PD79SIM PD79SIM 1.7.3 Extended Menus in the RAM Monitor Window When the RAM Monitor Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Font. Change font. - View Change contents of display. - Address. Display from specified address. - Data Length Specify data length. - Byte Display in 1-byte units. - Word Display in 2-byte units. - Dword Display in 4-byte units. - Radix Specify radix. - Dec Display in decimal. Hex Display in hexadecimal. - Ascii Display as ASCII characters. - SJIS Display as SJIS code. - Display as JIS code. - JIS - Refresh Refresh display. - Clear Clear access attribute. - Layout Ascii Set layout. - Turn on/off ASCII strings. - RAM Monitor Area. Set RAM monitor area. - Color. Set color of access attribute display. - Sampling period. Set sampling period for RAM monitor. - 49 P D 7 9 S I M U s e r 's M a n u a l 1.8 ASM Watch Window The ASM Watch Window allows you to check the values at any specified address. You can specify the point to watch as an address (symbol or global variable), as an address and bit No., or as a bit symbol. The display is updated after each command is executed. 1.8.1 Structure of ASM Watch Window Data display area Toolbar Expression display area Address/Bit No. display area Radix display area Data length display area l The cursor position is indicated by a red mark in the address display area and data display area. Click either area or use the "up" and "down" cursor keys to move the cursor. l Double-click the radix (Rdx) display area to switch the current radix for the data displayed in that area as follows: -> hex -> decimal -> binary -> hex -> l Provided the watchpoint is within the RAM monitor area, the contents of the display are regularly updated while the target program is executing. l Information about set watchpoints is stored in the Init file when you close the ASM Watch Window or exit PD79SIM PD79SIM. When you re-open the ASM Watch Window, the previously set watch points are automatically restored. l In the case of the ASM Watch Window, the addresses of any previously set watchpoints are recalculated when you download a target program and the memory referenced using the new addresses. Thus there is no need to respecify the watchpoint addresses even when they change as a result of changes in the program. When the addresses of inactive watchpoints (indicated by "-") are recalculated and the result is a valid address, the watchpoints automatically become active again. 50 Window function of PD79SIM PD79SIM 1.8.2 ASM Watch Window Toolbar Add button Adds a watch point(address) Dec button Displays watch point in decimal Set button Sets specified watch point Del button Deletes specified watch point Bin button Displays watch point in binary BitAdd button Adds a watch point(bit) Hex button Displays watch point in hexadecimal DelAll button Deletes all watch points 51 P D 7 9 S I M U s e r 's M a n u a l 1.8.3 Extended Menus in the ASM Watch Window When the ASM Watch Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Font. Change font. Watch Register / delete watch point. - Add. Register watch point. Ctrl + A Bitadd. Register bit-level watch point. Ctrl + B Set. Set new data to be written to selected watch Ctrl + S point. Del Delete selected watch point. DelAll Delete all watch points. Radix Change display radix. Ctrl + D - Bin Display value at selected watch point in binary. - Dec Display value at selected watch point in decimal. - Hex Display value at selected watch point in hexadecimal. - Layout Set layout. - Address Area Turn on/off address/bit area. - Size Area Turn on/off data size area. - RAM Monitor Display RAM monitor. - Sampling period. Set sampling period for RAM monitor. - Color. Set color of access attribute display. - File Watch point save/load. - Save. Watch point save. - Load. Watch point load. - 52 Window function of PD79SIM PD79SIM 1.9 C Watch Window The C Watch Window displays C expressions and their values (results of calculations). The C expressions displayed in the C Watch Window are known as C watchpoints. The displays of the results of calculating the C watchpoints are updated each time a command is executed. 1.9.1 Structure of C Watch Window Toolbar Display of variable type C watch point display area Dispaly of variable value Dispaly of variable name l You can use the following as C watchpoints: C symbols Variable names and function names defined in the C source program. Expressions including C symbols (C expressions) For details of tokens that can be used in C expressions, see Section 3.1, "Writing C Expressions" in the Reference part. l If a C expression cannot be correctly calculated (it includes an undefined symbol, for example), it is recorded as an inactive C watchpoint. Inactive C watchpoints are not included in the display of calculated results. However, if an inactive C watchpoint is recalculated and the result is valid, it becomes an active C watchpoint. l Note that values cannot be assigned in the following C watchpoints: Floating point type variables Bit field type variables Register variables C watchpoints that do not indicate addresses l Double-click the radix (Rdx) display area to switch the current radix for the data displayed in that area as follows: . -> hex -> decimal -> binary -> hex -> . l When RAM monitor function is effective and the C watch points are within the RAM monitor area, the displayed values are updated during execution of the target program. And the values of the accessed variables are colored. The selecting the menu [Option] -> [RAM Monitor] -> [Enable] makes RAM monitor function effective or not. 53 P D 7 9 S I M U s e r 's M a n u a l l Information about set C watchpoints is stored in the C watchpoint information file when you close the C Watch Window or exit PD79SIM PD79SIM. When you re-open the C Watch Window, previously set C watchpoints are automatically restored. A C watchpoint information file is created for each loaded object file (and includes information on the name of the loaded object file). When you set a new C watchpoint, the program first searches for a C watchpoint information file with information on a file with the same name as the currently loaded object file. If an appropriate file is found, C watchpoints are restored from the information in that file. 1.9.2 C Watch Window Toolbar Set button Sets specified C watch point Add button Del button Adds a C watch point Deletes specified C watch point Add* button Adds a C watch point by pointer Cancel button Cancels specified C watch point DelAll button Delete all C watch points Radix button Switch of display cardinal number l You can delete or set new values for C watchpoints selected by clicking in the C watchpoint display area. You cannot delete only additional information such as the members of structures displayed when recording C watchpoints. l The addresses for pointers, etc., are displayed in hexadecimal regardless of the display radix. See Section 3.2, "Display Format of C Expressions" in the Reference part for details of display formats. 54 Window function of PD79SIM PD79SIM 1.9.3 Extended Menus in the C Watch Window When the C Watch Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Shortcut keys Option Font. Change font. - Watch Register/delete C watch point. - Add. Register C watch point. - Add Pointer. Register C watch point (pointer). - Del Delete selected C watch point. - Set. Set new value for selected C watch point. - Cancel Cancel selection of C watch point. - Del All Delete all C watch points. - View Change contents of display. - Radix Change radix. - Layout Turn on/off type name. - Sort Sort. - Display String Display the string / Display character. - RAM Monitor Display RAM monitor. - Enable Turn on/off RAM monitor area. - RAM Monitor Area. Set RAM monitor area. - Color. Set color of access attribute display. - Sampling period. Set sampling period for RAM monitor. - Clear Clear access attribute. - 55 P D 7 9 S I M U s e r 's M a n u a l 1.10 Local Window The Local Window lists local variables in the C function with their values. The display is updated after each command is executed. 1.10.1 Structure of Local Window Function name which contains program counter Toolbar Display of variable type File name which contains program counter Dispaly of variable value Scope display area Data display area Dispaly of variable name l When performing step execution, etc., and there is a change in the function that includes the address specified by the program counter, previously displayed variables are cleared and the local variables in the new function are automatically displayed. 56 Window function of PD79SIM PD79SIM 1.10.2 Local Window Toolbar Cwatch button Adds specified variable name to C watch window Set button Sets specified watch point Cwatch* button Radix button Switch of display cardinal number Cancel button Cancels specified watch point Adds specified variable name to C watch window by pointer l You can register variables selected by clicking in the data display area as C watchpoints in the C Watch Window, or change their values. You can use C expressions to set the values. For details of tokens that can be used in C expressions, see Section 3.1, "Writing C Expressions" in the Reference part. l The addresses for pointers, etc., are displayed in hexadecimal regardless of the display radix. See Section 3.2, "Display Format of C Expressions" in the Reference part for details of display formats. 1.10.3 Extended Menus in the Local Window When one of the Local Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Option Font. Change font. - Watch Operations related to C-function. - Cwatch Shortcut keys Register selected C variable as C watch - point. Cwatch Pointer Register pointer of selected C variable as - C watch point. Set. Set new value for selected C variable. - Cancel Cancel selection of C variable. - View Change contents of display. - Radix Change radix. - Layout Turn on/off type name. - Sort Sort. - Display String Display the string / Display character. - 57 P D 7 9 S I M U s e r 's M a n u a l 1.11 File Local Window The File Local Window lists local variables in the C file with their values. The display is updated after each command is executed. 1.11.1 Structure of File Local Window File name which contains program counter Display of variable type Toolbar Dispaly of variable value Scope display area Data display area Dispaly of variable name l When performing step execution, etc., and there is a change in the file that includes the address specified by the program counter, previously displayed variables are cleared and the local variables in the new source file are automatically displayed. 1.11.2 File Local Window Toolbar The File Local Window toolbar is the same as that in the Local Window. See Section 1.10.2, "Local Window Toolbar" under Window Functions for details. 58 Window function of PD79SIM PD79SIM 1.11.3 Extended Menus in the File Local Window When one of the File Local Window is active in the PD79SIM PD79SIM main display area, the [Option] menu contains the following items: Menu Menu options Function Option Font. Change font. - Watch Operations related to C-function. - Cwatch Shortcut keys Register selected C variable as C watch - point. Cwatch Pointer Register pointer of selected C variable as - C watch point. Set. Set new value for selected C variable. - Cancel Cancel selection of C variable. - View Change contents of display. - - Radix Change radix. Layout Turn on/off type name. Sort Sort. - Display String Display the string / Display character. - RAM Monitor Display RAM monitor. - Enable Turn on/off RAM monitor area. - RAM Monitor Area. Set RAM monitor area. - Color. Set color of access attribute display. - Sampling period. Set sampling period for RAM monitor. - Clear Clear access attribute. - 59 P D 7 9 S I M U s e r 's M a n u a l 1.12 Global Window The Global Window lists C global variables and their values. The display is updated after each command is executed. 1.12.1 Structure of Global Window Mojule name Toolbar Scope display area Display of variable name Data display area Display of variable type Display of variable value 1.12.2 Global Window Toolbar The Global Window toolbar is the same as that in the Local Window. See Section 1.10.2, "Local Window Toolbar" under Window Functions for details. 1.12.3 Extended Menus in the Global Window When the Global Window is active in the PD79SIM PD79SIM main display area, extended menus for the Global Window are allocated to the [Option] menus. The extended menus of the Global Window are identical to those of the Local Window. See Section 1.11.3, "Extended Menus in the File Local Window" under Window Functions for details. 60 Window function of PD79SIM PD79SIM 1.13 Script Window The Script Window displays the execution of text-format script commands and the results of that execution. Script commands can be executed using a script file or interactively. You can also write script commands in the script file so that they are automatically executed. The results of script command execution can also be stored in a previously specified log file. 1.13.1 Structure of Script Window Script file name display area Toolbar Log file name display area Execution result display area Command input area Command history display area/Script file display area l The Script Window has a view buffer that stores the results of executing the last 1000 lines. The results of execution can therefore be stored in a file (view file) without specifying a log file. l When a script file is opened, the command history area changes to become the script file display area and displays the contents of the script file. When script files are nested, the contents of the last opened script file are displayed. The script file display area shows the line currently being executed in inverse vide. l When a script file is open, you can invoke script commands from the command input area provided the script file is not being executed. l The Script Window can record the history of the executed commands to a file. This function is not the same as the log function. This function records not the result but only the executed commands, so the saved files can be used as