Home
M3T-PD38SIM V.2.10 User`s Manual
Contents
1. Step button One step execution of target program Return button SW button Runs the program up to Sets a software breakpoint the higher routine J mi Jeer D Stop button Stops execution of the target program 4 Come button Executes the target program from the value in the program counter to the position of the cursor in the window HW button Sets a hardware breakpoint Reset button Over button Resets the target program Step over function subroutine call 1 1 3 PD38SIM Window Menu The menus in the PD38SIM Window can be classified as basic menus and extended menus Edit menu Environment menu Debugging menu e menu File Edit View Environ Debug Option BasicWindow OptionalWindow Help t ft t t t File menu View menu Debugging menu Window menu Optional Window menu Basic Men nd Exten Men The sub menu items of the optional menus in PD38SIM automatically change according to which window is active in the main display area of the PD38SIM 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 PD38SIM and debugging Below we look at the functions of each item on the basic menus The functions of the i
2. Funct ion Start Erd Cowerane Main OSOA 64 293 Doubleclick on the line of the init EI Ti ID UU 2 P debueft MSI 100 00 3 function you want to check debuslt d sch 0 00 2 A coverage source window will open debus 01810 70 00 2 buet oI oa up d et Sait Mo Soweto rd aart debus 0182 Line iddr cs Soros naint DICH ink is D I pn 11904 mu ee 1 OODT 01308 00012 01801C 0003 018020 DD 01902E CREAR CODE Mat SE 2 DDI MIIE dabus D IN else Coverage source window for checking for each line whether the 8 2 Updating Coverage Display When the target program is executed using a GO or STEP command the coverage display area of the coverage window changes to The display is not automatically updated If you want to update it press the Refresh button on the toolbar or select Option gt Refresh from the menu The display of the coverage source window is automatically updated when the program has stopped 8 3 Initializing Coverage To initialize the coverage measurement information press the Clear button on the toolbar or select Option gt Clear from the menu All coverage figures are cleared to 0 205 PD38SIM User s Manual 8 4 Saving Loading Coverage Measurement Information The coverage measurement information can be saved to a file and the saved information can be loaded from a file into the computer In this way measurement can
3. 46 Window function of PD38SIM 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 PD38SIM 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 UUI Dal Read access area Green Write access area Red ASCII SJIS JIS Area Clear Refresh eebe 6 jel et Jr is f FF 00 FF FF 00 FF 00 FF 00 FF 00 LS i FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 Address display area Data display area ASCII code corresponding to data 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 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 The background col
4. 1 2 10 StackM onitor Command Command format 2 StackMonitor ON OFF 2 Turns the stack monitor on off 1 2 11 Cycle Count Command Command format CcYde CY 1 CYcle 1 Checks the cyde count mode 2 CYcle ON OFF CYCLE OFF The number of total execution cycles is displayed CYCLE ON The number of accumulation execution cycles from the CYCLE ON specification is displayed 2 Turns the cyde count on off 216 Table of Script Commands 1 2 12 Script Log File Commands Command format SCRIPT SCRIPT filename Open script file EXIT EXIT Close script file WAIT WAIT BREAK Wait for command input until target program stops PAUSE PAUSE MESSAGE Display specified message in Pause dialog box and wait for user to press button number of Che LOGON LOGON Filename file attribute Open logfile sY log file LOGOFF LOGGOFF Close log file 1 2 13 Program Window Control Commands Command Command format Summar PATH PATH search pass search pass Set source file path 2 FILE source filename 2 Display specified source file 1 2 14C Language Debugging Commands Command format PRINT variable expression Check value of specified C variable expression SET variable expression value Set specified data in specified C variable expression 1 2 15Custom Command Program Custom Window Program Command format 1 MACRO 1 Refrence a list of added custom command and 2
5. Add Eer E Specify the C expression 3 Click the OK button Method 2 Registering a C Watch Point from the Local File Local or Global Window You can register variables displayed in the Local Window File Local Window and Global Window as C watch points Click the variable to be registered then click the Cwatch button on the toolbar To register the variable as a pointer click the Cwatch button 2 Click the Cwatch button Func main Filename rmon c unsigned char i OxB Cunsigned char j Di D 1 Click the C variable to be registered Note Thereis a possibility that compiler arranges a different variable in the same address for optimization 129 PD38SIM User s Manual 6 2 To change the value of a C variable You can change the values of C variables in the Local Window File Local Window Global Window or C Watch Window Click the variable to be changed then click the Set button on the toolbar to open the Set dialog box Enter the new value for the variable L Specify the new value 2 Click the OK button Note Thereis a possibility that compiler arranges a different variable in the same address for optimization 130 Script Commands 7 Script Commands 7 1 Executing Script Commands Script commands are executed from the Script Window To open the Script Window select the following from the PD38SIM Window menu Basic Window gt
6. Note If there is no source line data in the first line in the program display area of the Program or Source Window you cannot switch from disassemble display mode to source display mode or MIX mode the SRC and MIX buttons are invalid In this case use the vertical scrollbar or Up Down cursor keys to move the starting address of the program display area to a position where there is source line data 102 Loading and Displaying the Target Program 1 12 Changing Display Colors To change display colors in the Program Window when you select the menu Option gt Color the Color Setup Dialog Box open Note that this setting have effect on all Source Windows Character color Text ackground color Text Mix PC line r Coverage Execution 1 12 1 The functions of Color Setup Dialog Box Pushing the button to the left of each color box make the Color Setup Dialog Box open You can change the display colors in this dialog box Pushing the Reset button set the colors default 103 PD38SIM User s Manual 2 Starting and Stopping Target Program Execution 2 1 Starting and Stopping To start the target program Click the Go button on the PD38SIM Window toolbar You can also press the F 1 key AU Asia j Zei on Click the Go button You can also start the target program by selecting the following from the PD38SIM Window menu Debug gt Go The ta
7. Theinput panel you ve created can be saved to a file GUI input file 80 Window function of PD38SIM 1 15 2 Tool Bar of GUI Input Window Grid button Shows hides grid line Make button Save button Creates button Saves GUI input file lal mae Set button Load button Edits or moves button Loads GUI input file 1 15 3 Extended Menu of GUI Input Window If the GUI Input Window is active among the windows brought up in the main display area of PD38SIM the Option menu has the following menu items assigned to it Sais a ermen E w pesem EE w oe S a ee Vespa eebe 1 EE EC EE Lei Leonie 1 Se eiert le 81 PD38SIM User s Manual 1 16 GUI Output Window This window allows you to implement a simple output panel of the user target system in a window The following parts can be arranged in this output panel Label 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 Oin a bit e LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or Oin a bit For details on how to create and set up an output panel refer to High end Debugging described later in this manual The screen configuration tool bar and menus of the GUI Output Window are explained here 1 16 1 Screen Configuration of GUI Output Window ES GUI Output Window h Label LED Grid
8. Basic Window gt C Watch Window gt Global Window The C Watch Window displays the values of any variables To open the C Watch Window select the following from the PD38SIM Window menu Basic Window gt C Watch Window gt C Watch Window You cannot select the referenced C variables in the Local Window File Local Window or Global Window The variables displayed in the respective windows change with the current position of execution of the target program Local Window The variables displayed change according to the function currently being executed File Local Window The variables displayed change according to the currently executing source file Global Window This lists the C global variables regardless of the execution position Use the C Watch Window to check C variables 128 Checking C Variables Toregister the C watch point Method 1 Registering a C Watch Point from the C Watch Window Click the Add button on the toolbar in the C Watch Window to open the Add dialog box then enter the C language expression C variables expressions etc To register a C expression as a pointer click the Add button on the toolbar in the C Watch Window This registers the C expression as a C watch point 1 Click the Add button to register the C watch point j _ Add Addx Del DelAll Set Cancel Radix t 1 Click the Add button to register the C watch point as a pointer
9. 213 PD38SIM User s Manual 1 2 Tables of Commands In the following tables of commands commands shown with half tone screening can be executed at run time The abbreviated forms of commands are shown in parenthesis after the full command See the PD38SIM on line help for details of each command To display on line help enter the following from the PD38SIM Window menu Help gt Index 1 2 1 Execution Commands STATUS STATUS Display status of target program execution Step S Step number of steps Step execution at source level Stepl nstruction S StepInstruction number of steps Step execution at machine language level OverStep number of steps Over step execution at source level Se Se Ol OverStepI nstruction number of steps Over step execution at machine language level RETurn RET Return execution at source level RETurntnstruction RET RETurnInstruction Return execution at machine language level RESET RESET Reset target program 1 2 2 File Operation Commands UploadH ex UH UploadH ex start address end address filename Output contents of specified memory area to hex file 1 2 3 Register Operation Commands Command format 2 Register register name set value 2 Set value of specified register 1 2 4 Memory Operation Commands Command Command format Summar DumpByte DB DumpByte_ start address end address Display contents of memory in 1 byte units SetM emoryB yte M B se
10. Contents Contents 1PD38SIM INTRODUCTION 3 2 PD38SIM FEATURES 4 2 1 Multi Windowing Eundion ee eeeaaeeeeeeaaeeeeteaaeeeeneaaeees 4 22 VO Simulations FUNG N jist heatie natin a atin Actinic tacts 4 2 3 nterrupt Simulation FUNCION rririk a EE ESA EK 4 2 4 Simplified System Simulation FUNCCION 0 cece eee eenee eee teeeeeeteaeeeetenaeeeeeeaee 4 2 5 RAM Monitor FUNCION 0000 eee eee ee eece eee cece ee ee teaae eee eeaeeeeeecaaeeeetcaaeeeeneaeeeeneaes 4 2 0 Break nl de E 5 2 7 Source Level Debugging Function 20 0 ENEE 5 2 8 On Demand Method meree e A A AAE E E 6 3 PD38SIM SIMULATION SPECIFICATIONS 7 3 1 Main Differences to Actual MCL 7 3 2 Operation of Instrucions nnne n 8 3 3 Resetting irian n ninaa an a a an a aaa 8 ZAMANOV An A A A A AA aaaea 9 3 5 Virtual Port Input Funcion nnne 9 3 6 Virtual Port Output FUNCCION sssssssssssssssrrssssrrrssrrrrssrrnnsstinnssttnnsnnnnnnnnnnsnnnn nnen nn n 9 3 7 Virtual Interrupt Diego EE 10 SREL Rule fue Vi due NEE 10 39 GUI Output FUNGEON ceser ereere E AEAEE Aaa 11 3 10 lO Script EL Le EE 11 3 11 Unigue Simulator FUNGHONS reie oti dS 11 4PD38SIM INPUT AND OUTPUT FILES 12 ATTA PUE PUGS vive ce ee ed eee 12 42 QULPUL TEE 14 43 Temporary UE 15 SETUP PD38SIM User s Manual 1SETUP 19 LL nstallationics such gek A A KENE AAR ARA a AAR e 19 1 2 Starting PD38SIM 0 cccccsceecseeeceneeeeseeeceeeeseaeeeeaeeseaeeeseaeeseaaeeseeeeseaeeseneeeseeeess 19 t3 EIN e GE
11. SS button Output panel display area Drag the cross cursor to determine the size of the LED When a frame in which to display the LED appears double click somewhere in the frame CAUTION Before double clicking on the LED you ve created check to seethat thearrow on the tool bar is selected If not selected choose the arrow before double clicking on the LED you ve created 189 PD38SIM User s Manual 5 A dialog box for setting an LED like the one shown below will appear Here you can specify one of the following two methods for monitoring outputs Turn on LED according to logic 1 or 0 in memory bit Turn on LED when some value is output to memory 1 For turning on LED according to logic 1 or 0 in memory bit GUI LED Dialog Input the desired memory address Bit Or Data Select Bit ___p pit Bit Nun C Data Memory bit number Select color for the LED that is displayed when memory bit 1 or O if you selected Negative Specify Positive _ _ Positive Negative or Negative Vata OK Cancel Select color for the LED that is displayed when memory bit 0 or 1 if you selected Negative 190 Setting GUI Output Window 2 For turning on LED when some value is output to memory GUI LED Dialog Address Bart Or Data CBit Bit Num e Select Data gt Data Colorl Color2 logic Positive
12. 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 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 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 the Interrupt Control and Interrupt Request Registers When a virtual interrupt is generated PD38SIM looks up the Interrupt Control Register s interrupt control bit as it simulates virtual interrupt generation If a virtual interrupt occurs when interrupt generation is disabled the interrupt request is saved inside the simulator so that a virtual interrupt is generated after interrupt generation is enabled However since the interrupt request bit is not simulated the interrupt request bit is not set even when an interrupt request is saved Nor can the virtual
13. You can use the following as C watchpoints C symbols Variable names and function names defined in the C source program Expressions induding 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 e Ifa 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 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 Doubleclick the radix Rdx display area to switch the current radix for the data displayed in that area as follows gt hex gt decimal gt binary gt hex gt e 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 gt RAM Monitor gt Enable makes RAM monitor function effective or not 53 PD38SIM User s Manual Information about set C watchpoints is stored in the C watchpoint information file when you dose the C
14. An asterisk is deleted 4 6 Setting a Break Point from Program Source Window You can also set break points in the Program or Source Window To do so double click the break point setting display area BRK column indicated by for the line in which you want to set the break BRK Source maint static char i j while 1 forl i O i lt OxFF i forl j 0 j lt OxFF j subl B Double click here Lines in which a software break point have been set are marked by a B in place of be in the break point setting display area BRK column You can delete the break point by double clicking again in the BRK column 120 Software Breaks 4 7 Setting Breakpoints from the Toolbar You can set breakpoints from the toolbar in the PD38SIM Window In the Program Source Window click the program display area of the line in which you want to set the break lines for which is displayed in the corresponding breakpoint display area To set the breakpoint click the Break button in the PD38SIM Window toolbar Sie lSlAl m zer sall Click the Break button You can also set a breakpoint by selecting the following from the PD38SIM Window menu Debug gt Break Point gt Break The mark on the lines set as software breakpoints changes from to B in the breakpoint display area of the window You can cancel a software breakpoint by again clicking the line indicated
15. Enable Turn on off RAM monitor area RAM Monita Aree Set RAM monitor area Cda Set color of access attribute display Sampling pericd Set sampling period for RAM monitor Clear Clear access attribute 59 PD38SIM User s Manual 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 Module name Tool bar Scope display area d 0 signed short int w 0 unsigned char sc A unsigned char 10 scary Ox4E6E AAA unsigned char 5 5 gcary Ox4FA4 Weise char x Zc Ox4E4F ABC Us aaa aba e Eu maa CD COnp Display of variable type Dispaly of variable value Data display area Dispaly of variable name 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 PD38SIM 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 Local Window under Window Functions for details 60 Window function of PD38SIM 1 13 Script Window The Script Window displays the execution of text format script commands and the resul
16. OOFFFF Funct ion Start End main QOBDOB _demo_two 00BD1 A _func_demol 00BD48 _stunc OOBD61 _garytunc QOBDFD _gary2 func QOCOB8 _sptunc 00C6D2 _gppfunc 00C74B _gparyfunc 00C7C4 F unction scope 00BD19 OOBD4 OOBDED OOBDFC OOCOB 00C6D1 00C74A 00C7C3 00C83C Functiion name display area display area r SL SL SL SL SL FL SL FL SL Coverage display area When the target program is executed using a GO or STEP command the display in the Coverage column changes to To update the display press the Refresh button on the toolbar or select Option gt Refresh from the menu The coverage source window that allows you to reference for each source line whether the target program has been executed or not can be opened by double clicking on any desired line in the Function column The function scope display area can be turned on or off by selecting or deselecting Option gt Layout gt Address Area from the menu Window function of PD38SIM 1 17 1 2 Structure of Coverage Source Window Program display area Coverage Window demo c Line Source 00031 void mainvoid 00032 00033 int i 00034 while 1 00035 00036 demo Foot int i func_demo6 func_demo7 func_demo8 Line No display area Address display area Thelines that have already been executed are displayted in blue The lines for which there is no line debug information availa
17. To use custom command and custom window programs Register the custom command and custom window programs created with CB38SIM from the Script Window usinga MACRO command Specify as the parameter the custom command and custom window program file names with the extension p omitted when registering the programs to PD38SIM This makes the programs usable Example gt MACRO custom lt RET gt For the custom command and custom window programs registered to PD38SIM by a MACRO command you can execute the program and open the window using the same procedure as used to execute a script command To execute the program registered by a MACRO command use its file name as the command name as shown below Example gt custom lt RET gt The custom command and custom window programs registered by a MACRO command remain intact until they are deleted from PD38SIM by a DELMACRO or DELMACROALL command They are retained even when you quit PD38SIM To find the custom command or custom window program thus registered PD38SIM searches its current directory one that has been set by a script command CD If these programs are stored in some other directory specify that directory according to an explanation of the search directory in the later section of this manual To delete custom command and custom window programs To delete the custom command and custom window programs registered to PD38SIM by a MACRO command use a DELMACRO command by specifying
18. gt Display Grid Line or the Grid button When selected grid lines like the one shown below are displayed ES GUI Output Window h Label LED Gria Load Save Grid lines BERR JENNE A W KR TTT TT Tt ti Tt tt hy 194 1 0 Script Function 7 1 0 Script Function 7 1 Overview Settings of virtual port inputs or virtual interrupts can be written to a file in script form This script is called the I O script Also the files that contain a description of I O scripts are called the I O script file Using I O scripts you can set virtual port inputs and virtual interrupts in a more flexible manner than can be set from the I O Window For example you can make the following settings that cannot be made from the O Window f you want to generate a cyclic virtual interrupt like timer interrupts you can use the while statement to specify a repetition of virtual interrupt generation You can specify that the priority levels set in the interrupt control register s interrupt priority level select bits be referenced to resolve the interrupt priority of virtual interrupts generated As conditions for entering virtual port inputs or generating virtual interrupts you can specify a combination of program fetch memory access for read write or memory comparison In addition to the above various other I O settings are possible 7 2 Method fo
19. 140 160 180 200 220 240 260 280 300 3 0 screen Interrupt cycle Cycle Virtual interrupt Vec DRA E a TA screen FFFA Each screen is detailed in the pages to follow 68 Window function of PD38SIM 1 14 5 Structure of Virtual Port Input Screen 1 14 5 1 Screen structure for cycle synchronized inputs If you ve set virtual port inputs that are synchronized to machine cycles they can be displayed in one of the three modes shown below The display modes can be changed from the Mode menu 1 Chart mode displayed in units of bits The virtual port input that has been set is displayed in chart mode in units of bits Cycle 0000000030 Data 0x30 6 7 3 9101 112131415161 71819202 122292495062 7282930 Cycle count display area A Address Bit number Input data display area display display area area Address display area It displays the memory address to which a virtual port is input Bit number display area It displays bit numbers of memory to which a virtual port is input Input data display area It displays the virtual port input data that has been set in chart mode in units of bits oo S This means that memory bits are in the state of logic 1 This means that memory bits are in the state of logic 0 The short white lines appearing at the bottom of the input data display area indicate points at which data are input To reference data values
20. 151 PD38SIM User s Manual A dialog box for saving the virtual port input data you ve set to a file virtual port input file will appear Save Data Save in q10_Samples z El cel ks Ss File name finput scr Save as type Script Files scr 7 Cancel Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished setting the read access synchronized virtual port inputs 1 4 Setting Interrupt synchronized Inputs Toset interrupt synchronized virtual port inputs choose the I O Window menus Option gt Setup or the Setup button The dialog box shown below will appear Selle Tops H Set Virtual Port Input Set this item Set Virtual Port Output C Set Virtual Interrupt 152 Setting Virtual Port Inputs in 1 0 Window Here choose the item Set Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual port input timings will appear Setup Dialog Data Input Timing Read Access Cycle Interrupt Expressions can be input Input Address k 4 ere Read Address Stari Cycles Ena Oycler Vector lt Prev Next gt Ca
21. CWeeative Data Display Display Colori Colora Input the desired memory address Select color for the LED that is displayed when memory value coincides with the one specified for Display Color1 in the Data column Select color for the LED that is displayed when memory value coincides with the one specified for Display Color2 in the Data column The LED is lit in the color selected in the Color1 column when the data specified here is output The LED is lit in the color selected in the Color2 column when the data specified here is output D When you press the Color1 or Color2 button a dialog box for selecting LED colors appears BER gt gt zept Here choose colors in which you want the LEDs to be displayed and press the OK button 7 Thus you ve finished creating and setting an LED 8 To create another LED repeat steps 1 to 7 described above 191 PD38SIM User s Manual 6 4 Saving Parts You ve Created When you ve finished creating parts you can save the data setup contents and layout of the parts you ve created toa file GUI output file The saved GUI output file can be loaded into PD38SIM back again by using the menus Option gt Load to reproduce the saved parts Follow the procedure below to save the parts data Choose the GUI Output Window menus Option gt Save or the Save button When selected the dialog box shown below will appear Save
22. Exits from the innermost loop Comment statements You can include comments in a script file The comment statements are ignored when the script commands are executed Specify only one statement on each line of the script file You cannot specify more than one statement on a line or write statements that span two or more lines 2 1 1 Script Commands You can use the same script commands that you enter in the Script Window You can also call script files from within other script files nesting up to 5 levels 2 1 2 Assign Statements Assign statements define and initialize macro variables and assign values The following shows the format to be used macro variable expression You can use alphanumerics and the underscore _ in macro variable names However you cannot use a numeric to start a macro variable name You can specify any expression of which the value is an integer between De and FFFFFFFF ie to be assigned in a macro variable If you specify a negative number it is processed as twos complement You can use macro variables within the expression Always precede macro variables with the sign 223 PD38SIM User s Manual 2 1 3 Conditional Statements if endi else In a conditional statement different statements are executed according to whether the condition is true or false The following shows the format to be used if expression statement 1 else statement 2 endi If the expression is true
23. Load Save Output panel display area You can create edit or move labels and LEDs in the output panel display area The output panel you ve created can be saved to a file GUI output file 82 Window function of PD38SIM 1 16 2 Tool Bar of GUI Output Window Grid button Shows hides grid line Label button Save button Creates label Saves GUI output file l 4 b Label LED Grid Load Save Set button Load button Edits or moves parts Loads GUI output file LED button Creates LED 1 16 3 Extended Menu of GUI Output Window If the GUI Output Window is active among the windows brought up in the main display area of PD38SIM the Option menu has the following menu items assigned to it Sais a fermer B oo ess C e w osm SS pate pasts uea ee 1 Make LED eg JI Day Grd tne ott 1 EE a sae O OOOO 83 PD38SIM User s Manual 1 17 Coverage Window This window is used to measure the coverage CO coverage of each function in the currently downloaded C language program There are two types of coverage windows a coverage window that allows you to reference the start end addresses and the coverage of each function and a coverage source window that allows you to reference for each source line whether the target program has been executed or not 1 17 1 Structure of Coverage Window 1 17 1 1 Structure of Coverage Window Toolbar Coverage scope display area Coverage Base Address 000000
24. 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 File name display Toolbar ES Source Window GOLED 474 L 91 View MIX DIS 2222n 2j oor cS ol 2 SISS e e S Sa co f o gt f Sj S S cl kl DATAS 0 JOR SUBS SSS lolle DATA2 0 a aF R x S Software breakpoint display setting area Source line display area Program display area Address display area 38 Window function of PD38SIM 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 ES Source Window GOLED 474 Bel x View SRC J MIX DIS Line Address BK Objcode Label Source Mnemon ic Label display area Object code display area Source line i display area Software breakpoint display setting area Address display area Program
25. after starting PD38SIM you open and close a log file then re open it the new data is appended to the data already in that file However if you re open a log file that was created before starting PD38SIM the contents of that file will be overwritten The file list in the File Selection dialog box starts with files with the log attribute However you can enter a full filename including the attribute directly into the filename input area to open a log file with an attribute other than log You can nest log files up to 8 levels To quit logging the results of executing script commands Click the LogOff button on the toolbar of the Script Window Click LogOff to stop logging Log0n Lo FF You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Log gt Off When log files are nested output to the current log file stops but output to the next higher level log file resumes 132 Script Commands To save the results of executing script commands after execution PD38SIM has a View Buffer that stores the results of executing the last 1000 lines of command results To save the contents of the view buffer click View on the toolbar of the Script Window Clicking View opens the File Selection dialog box Specify the name of the file to be saved The default file attribute if omitted is viw Bun Step Open Close
26. button cannot be clicked if no debugging information has been read in The Source dialog box shows the file structure of the downloaded target program plus data on functions Click the name of the file and the function name to be changed 1 Select the file name 3 Click the OK button To open the Source dialog box select the following from the PD38SIM Window menu Option gt View gt Source You can also double click the line No display area of the Program Source Window to open the Source dialog box 98 Loading and Displaying the Target Program Changing the display position at the address level When the Program Source Window is in disassemble display mode click the Address button from the Disp Area dialog box Click the Address button to open the Disp Address dialog box 1 Specify the address 2 Click the OK button When the Program Source Window is in source display mode or in mixed display mode the Address dialog box see below is open Click the Address button in the Address dialog box to enter the new address 1 Click the Address button 2 Specify the address 3 Click the OK button To open the Disp Address dialog box select the following from the PD38SIM Window menu Option gt View gt Address You can also double click the address display area of the Program Source Window to open the Disp Address dialog box 99 PD38S
27. changes during program execution can be monitored from the ASM Watch Window See Section 1 8 ASM Watch Window in the Window Functions for details of the ASM Watch Window 111 PD38SIM User s Manual Toregister a watch point Click the Add button in the menu bar in the ASM Watch Window to open the Add dialog box Input the address to monitor You can register the watch points also in the pop up menu Add ASM Watch of the Program Window 1 Click the Add button to open the following dialog box Add BirAaa Set Del DeiAn Hex Dec Bin Add sl Address 2 Specify the address to monitor 3 It is possible to select either the Symbol Global Local assembler s global symbol or local symbol Size Byte Je Select the data length Radix Hex Dec Bin 5 Select the data radix E 6 Click the OK button The registered watchpoint is added at the current cursor position in the ASM Watch Window The cursor position is indicated by a red mark in the address display area and data display area You can move the cursor by clicking on either area or using the Up and Down keys Toregister a specific bit as a watch point Click the BitAdd button in the menu bar in the ASM Watch Window to open the BitAdd dialog box Input the bit symbol or the address and bit No to monitor You can register the watch points alsoin the pop up menu BitAdd ASM Watch of the P
28. eee 67 161 EXIT aaaea 137 File Local Window 5 58 128 NS 21 GO DUTTON dirinin 104 Global label ovb 226 Global Window ssss 5 60 128 GUI Input eee renee 10 GUI Input File ee 15 GUI Input Window 80 179 GUI Output 11 GUI Output File ee 15 GUI Output Window 82 185 H W Break Point Setting dialog box Leederen eieiei E 89 122 Hardware Break sesecscs 5 122 Hardware break point see 89 PD38SIM User s Manual help plein ENEE 12 FAG RN ee 11 195 1 0 Script Eilen 14 Breet EE 63 IEE E 695 Absolute Format File12 93 if 199 Init dialog ee eeeeeteeeeesteeeeesseeeeees 20 Init Dialog BOX cee 20 136 Installation weer 19 Int statement ee 198 Intel HEX format File 12 14 97 Interrupt synchronized input65 152 kabe en 5 226 Left side expressions s s 203 Line Assemble 139 MEN Oraa saaa 228 Local label ovb 226 Local WINndowW see 5 56 128 de e UI 14 61 Logging function sses 132 Loop Gtaterment eee 224 Macro variable 201 204 227 Main command 27 Memory WIndowW s es 43 114 memory variables 201 204 M ulti Windowing F unction 4 OverDUttON ren anniari 015 ODperator 202 229 Over step eveCution 105 pass statement AA 199 PD38SIM setup 20 PD38SIM verston 143 PD38SIM Window EE 27 Program COUNTED rreren 33 38 Program Window21 33 93 97 98 141 Brocechure inn
29. example for virtual interrupt gt Beginning of procedure 1 while 1 gt while statement waitc 0x0021 1 gt Keeps execution of I O script waiting for the number of cydes equal to the divide by ratio that is set for timer1 int OXF FEE gt Generates a timer 1 virtual interrupt gt Terminates procedure 1 Definition of procedure 2 example for virtual port input gt Beginning of procedure 2 waitc 10000 gt K eeps execution of I O script waiting for 10 000 cycles set 0x0 0x20 gt I nputs 0x20 in address 0x0 waitc 10000 set 0x0 0x30 gt Inputs 1 byte data 0x30 from address 0x0 gt Terminates procedure 2 7 3 Composition of 1 O Script Following statements can be written in I O script Procedure 1 0 script statement Judgment if else Execution statements are branched off by judging the evaluation result of expression Repeat statement while and Break statement Statements are executed repeatedly by judging the evaluation result of expression Comment statement Comments can be written in I O script Comment statements are ignored when executing I O script When creating I O scripts write one statement in one line You cannot write multiple statements in one line or one statement in multiple lines 196 1 0 Script Function 7 3 1 Procedure Procedures specify a definition block of an I O script Multiple procedures can be written in one file However the number of procedures
30. gt Move When the M ove dialog box opens enter the starting and ending addresses of the source area and the starting address of the destination area When the M ove Dialog Box open after selecting the area by mouse in the Memory Window or in the Dump Window the start and end address of the area are set in this Dialog box Start Address End Address 1 Enter the starting address of the source area 2 Enter the ending address of the source area 3 Enter the starting address of the destination Move Address 4 Click the OK button 3 7 Updating the Memory Display When you execute a command setting filling moving memory stopping execution or step execution etc that changes the contents of memory the memory display in the Memory Window and Dump Window is automatically updated However if an area such as I O which is changed without any relationship to MCU execution is displayed there may bea discrepancy between the data displayed and the actual contents of memory In this case you can display the latest contents of memory in the Memory Window by clicking the Refresh button on the toolbar in the Memory Window or making the Memory Window the active window then selecting the following from the PD38SIM Window menu Option gt View gt Refresh To display the latest contents of memory in the Dump Window click the berech button on the toolbar in the Dump Window or make the
31. 1 and 32 Note You can set the tabs independently in each window With the target window active select Option gt TAB from the menu in the PD38SIM Window to open the TAB Setting dialog box You can now set the tabs for the active window Setting of default font size Specify the default font for the characters displayed by PD38SI M 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 gt F ont from the menu in the PD38SIM Window to open the Font Setting dialog box You can now set the font size for the active window Selection of On Memory or On Demand method of downloadin 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 gt Init from the PD38SIM 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 PD38SIM creates a temporary file when the t
32. A dialog box for saving the virtual interrupts you ve set toa file virtual interrupt file will appear Save Data Save in ja 0_Samples x c bs Deng Z ipn File name intr scr Save as type Script Files scr x Cancel 160 Setting Virtual Interrupts in 1 0 Window Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the I O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished setting cycle synchronized virtual interrupts 3 3 Setting Executed Address synchronized Interrupts To set executed address synchronized virtual interrupts choose the I O Window menus Option gt Setup or the Setup button The dialog box shown below will appear Select Type Set Virtual Port Input Select this item Set Virtual Port Output o t Here choose the item Set Virtual Interrupt and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual interrupt timings will appear Setup Dialog Interrupt Generation Timing Executed Address Cycle Executed Address fe000 Expression can be input here Vector Priority Prev Next gt lt Next gt Cancel 161 PD38SIM User s Manual First choose Ex
33. AutoDownLoad Cancel 136 Exiting PD38SIM 8 Exiting PD38SIM 8 1 Exiting PD38SIM Select the following from the PD38SIM Window menu File gt Exit A confirmation dialog box is displayed Click OK to exit K Do you really want to exit i i Cancel Click the OK button 137 PD38SIM User s Manual 9 Miscellaneous 9 1 Line Assemble There are two methods for line assembling the source program one using a line assemble dialog box and one using a script command 9 1 1 Line Assembling from Dialog Box Click on a position in the Program Source Window that you want to be line assembled and choose menus Option gt Line Assemble A line assemble dialog box like the one shown below will appear If you do not specify a position input the desired address in this dialog box after it is open Warning output M WEN ____ NOP insertion Program M NOP ADDRESS ae Address input field Code input field lt _ Program display area Input the address you want to be line assembled and the assemble instruction in the address input and the code input fields then hit the return key The line that is highlighted in the program display area of this dialog box is the address to be line assembled Ifthe number of instruction bytes input is fewer than that of instruction bytes before the change insert a NOP instruction to make the number of bytes matched If
34. Chart mode displayed in units of bits Virtual port output results are displayed in chart mode in units of bits Output cycle Cycle 0000000315 Data Ox0F Address Bit 82 100 120 140 160 180 200 220 240 260 280 300 38 yde Saint H7 display area D 5 AA 3 2 1 0 4 t gt Address Bit number I display display area area Output data display area Address display area It displays the address to be monitored for virtual port output Bit number display area It displays bit numbers of memory being monitored for virtual port output Output data display area It displays the data as virtual port output results in chart mode in units of bits IL This means that memory bits are in the state of logic 1 This means that memory bits are in the state of logic 0 The short white lines appearing at the bottom of the output data display area indicate points at which data are output To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cyde count display area Cycle count display area It displays cycle counts 14 Window function of PD38SIM 2 Graphic mode displayed in units of bytes Virtual port output results are displayed in graphic mode in units of bytes Output cycle Cycle Address 1821 240 480 720 960 1200 1440 1680 1920 Ze Gre wii displa
35. Connection to the target system was lost during communication with the target system 1713 Communication ERROR A communications error occurred while sending data to the target system 1714 Communication ERROR A communications error occurred while data to the target system 1717 Can t find Simulator Engine 2400__ Address value is out of range fT O 2401 _ Data value is out of range po 2402 Start Address value is out of range You specified an ending address that is less than the starting address 2403 Valueis under num Specify a value of num or more 2404 Data value is out of range fe ee 5702 Address value is out range for scroll area The address specified as the scroll range is greater than the MCU s maximum address 5800 Sampling period value is out of range Po 5802 Cant change RAM monitor area when the Stop target program then change the RAM target program is running monitor area 244 Error Messages 5901 Script File filename is already opened nt 5903 Cant open Log File filename _ 5907 Cant open View File lename fernewadd 6000 Cannot find source file filename PO 6001 The number of lines of source file filename is over the limit limit 6002 The address value is out of range ee 6006 Cannot read the file saved by emulator debugger 10800 value is out of range es 10801 Can t find the register information file es 10802 There s incorrect line
36. GUI Output Files Save in a 10_Samples x ei cel ks zz File name output gof Save as type Jeu Output Files gof 7 Cancel Here enter the directory and file names in which you want the parts data to be saved When you ve input a file name press the Save button 6 5 Changing Parts Position or Settings after Creating Parts After creating parts you can change their positions or setup contents 1 To change the position of a part Choose the GUI Output Window menus Option gt Set or the button Then point to the part whose position you want to be changed and click the left mouse button Sy GUI Output Window OI ES h rabei LED Gezai Load Save The button is placed in a selected state when you ve dicked as shown above When in this state hold down the left mouse button while you drag the part to a position where you want it 192 Setting GUI Output Window 2 To change the setup contents of a part Choose the GUI Output Window menus Option gt Set or the button as in 1 above Then point to the part whose setup contents you want to be changed and double click the left mouse button The dialog box you ve used when creating parts will appear Use this dialog box to change the settings of the selected part 6 6 Copying Parts Follow the procedure below to copy parts 1 Choose the GUI Output Window menus Option gt Copy 2 Next move the mouse cursor into the GUI Outp
37. Log0n Log0ff View Clear RecOn iecii Click View to save the contents of the view buffer You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt View gt Save When you specify an existing filename the contents of the view buffer are appended to the existing file The file list in the File Selection dialog box starts with files with the viw attribute However you can enter a full filename including the attribute directly into the filename input area to open a view file with an attribute other than viw To clear the results of execution from the screen Click the Clear button on the menu in the Script Window to clear the contents of the command display Note that the contents of the View buffer are cleared at the same time as the command display Run Step Open Close Lotte View Clear RecOn iec0ii Click the Clear button to clear the command display You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt View gt Clear 133 PD38SIM User s Manual To record the executed commands PD38SIM have the function recording the history of executed commands to a file This function records not the result but only the executed commands so the saved files can be used as the script files To record the executed commands dick the R
38. Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers office
39. Script Window Enter script commands in the Command input area in the Script window Click the Command input area to locate the cursor in that field then enter the script command After executing the command the results are output to the execution result display area Run Step Open Close LogOn Loz0it View Clear RecOn Rec ff Script Log gt Execution result display area Command history display area Script file display area 4 Enter Command Command input area Tore execute a previously executed command The history of command execution is displayed in the command history display area Double click the command you want to execute again To quit a script command that is executing Click the STOP button which is displayed only while the command is being executed Running script 131 PD38SIM User s Manual 7 2 Logging the Results of Executing Script Commands Use the logging function to log the results of executing script commands Before executing the script command click the LogOn button on the toolbar of the Script Window Clicking the LogOn button opens the File Selection dialog box Specify the name of the file to be saved The default file attribute if omitted is log Click LogOn to start logging LogOn LogOff You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Log gt On e f
40. Virtual Port Input 9 63 Virtual Port Output 9 66 156 Virtual Port Output File e 15 Virtual Port Output function 156 wait statement eee 197 waitc statement 197 Index PD38SIM User s Manual MEMO 254 M3T PD38SIM V 2 10 Users Manual Rev 1 00 May 1 2003 REJ10J0047 0100Z COPYRIGHT 2003 RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION ALL RIGHTS RESERVED M3T PD38SIM V 2 10 User s Manual 2tENESAS Renesas Electronics Corporation 1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan REJ10J0047 0100Z
41. address display area to change the display starting address Theresult of the Coverage measurement is displayed by selecting On in the Menu Option gt Coverage 35 PD38SIM User s Manual 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 __ Menuoptions unge Shortcut Keys Right Clicking umptofundion Display the sdected funcio Open SourceWindow Displaythesdected function Qpaningthenew SourceWindow AddC Watch Register theC watch pant ofthesdected variable AddC Watch Panter Register theC watch paint of thesdected variables panter AdcdASM Watch Register theASM watch pant of thesdected symbd BitAdd ASM Watch Register theASM watch pdt of thesdected bit art Open thesourcefileby theeditor Register theeditar toqoe thesourcefiles Open theLineAssarbleDialagBax 1 2 3 Program Window Toolbar button Displays the program in source mode MIX button Displays the program in MIX mode View SRC MIX DIS is button Displays the program in disassemble mode button Changes the part of the program being displayed You can specify a source file a function an address or the position of Window function of PD38SIM 1 2 4 Extended menu in the Program Window When t
42. and virtual interrupt settings toa filein 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 divide by 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 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 stack pointer S register 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 CY cle 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 740 Software M anual The number of cycles is counted when the program is run with the cycle count monitor mode ON They are not monitored when the mode is OFF The results of monitoring the cycles are initiali
43. be generated When you finished setting all virtual interrupts press the Next button 162 Setting Virtual Interrupts in 1 0 Window A dialog box for saving the virtual interrupts you ve set toa file virtual interrupt file will appear Save Data Save in ja 10_Samples c File name Jintr scr Save as type Script Files scr x Cancel Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished setting executed address synchronized virtual interrupts 163 PD38SIM User s Manual 4 Other Functions of O Window 4 1 Changing Setup Data of Virtual Port Inputs and Virtual Interrupts The data for virtual port inputs or virtual interrupts you ve set using the Setup menu can be changed 4 1 1 Changing Setup Data of Virtual Port Inputs To change the setup data choose the menus Option gt Modify or the Modify button A dialog box like the one shown below will appear Modify Dialog Select this item Select Type G Modify Virtual Port Input C Modify Virtual Interrupt Cancel 164 Other Functions of 1 0 Window Here choose the item Modify Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the ses
44. by B then clicking the Break button 4 8 Saving Breakpoints Click the Save button in the S W Break Point setting dialog box to open the file selection dialog box Specify the name of the file in which to save the break points The default filename suffix if not specified is ork 4 9 Loading Breakpoints Click the Load button in the SW Break Point setting dialog box to open the file selection dialog box and load breakpoints from a saved file Specify the name of the file to be loaded The breakpoints loaded from the file are added to any currently set breakpoints If the number of software breakpoints exceeds 64 the excess are ignored 121 PD38SIM User s Manual 5 Hardware Breaks Use hardware breaks to break target program execution when memory is accessed Use the H W Break Point Setting dialog box to set a hardware break point Hardware breaks are effected when data is written to or read from memory or an instruction is fetched You can set up to 64 hardware break points If you set multiple hardware break points the target program stops as soon as execution reaches any of the hardware break addresses 5 1 Opening the H W Break Point Setting Dialog Box Click the HW button on the PD38SIM Window toolbar Press function key Shift F 7 to open the hardware breakpoint setting dialog box sit elal m See Click the HW button You can also open the H W Break Point Setting dialog box by sele
45. custom window is chosen with the custom window launcher dialog and it clicks on the Run button To use custom command and custom window programs Register the custom command and custom window programs created with CB38SIM from the Script Window usinga MACRO command Specify as the parameter the custom command and custom window program file names with the extension p omitted when registering the programs to PD38SIM This makes the programs usable Example gt MACRO custom lt RET gt For the custom command and custom window programs registered to PD38SIM by a MACRO command you can execute the program and open the window using the same procedure as used to execute a script command To execute the program registered by a MACRO command use its file name as the command name as shown below Example gt custom lt RET gt The custom command and custom window programs registered by a MACRO command remain intact until they are deleted from PD38SIM by a DELMACRO or DELMACROALL command They are retained even when you quit PD38SIM To find the custom command or custom window program thus registered PD38SIM searches its current directory one that has been set by a script command CD If these programs are stored in some other directory specify that directory according to an explanation of the search directory in the later section of this manual To delete custom command and custom window programs To delete the custom command and custo
46. dialog box 171 PD38SIM User s Manual 4 2 3 Deleting Virtual Interrupt After selecting Delete Virtual Interrupt press the Next button to bring up the dialog box shown below Delete Dialog 3E VectorLFFF6 J First choose the type of virtual interrupt you want to be deleted in the Interrupt Generation Timing column When selected the currently set virtual interrupts are listed in the Select Data column Here choose the virtual interrupt you want to be deleted Then press the Delete button Or press the Prev button here if you want to return to the previous dialog box Thus the virtual interrupt is deleted Press the Close button to close the dialog box 172 Other Functions of 1 0 Window 4 2 4 Deleting 1 0 Script File After selecting Delete I O Script File press the Next button to bring up the dialog box shown below Delete Dialog OSIM test ing ioscrt Here choose the I O script file you want to be deleted from registration Then press the Delete button Or press the Prev button here if you want to return to the previous dialog box Thus thel O script file is deleted Press the Close button to close the dialog box 173 PD38SIM User s Manual 4 3 Changing Display Mode of Virtual Port Input Virtual Port Output or Virtual Interrupt The display modes of the virtual port inputs virtual port outputs or virtual interrupts you ve set using the Setup menu can be changed Tochange the di
47. e J 9 HAW Break Point Label Addr Cnt Size Data Type Dm 04E40 001 BYTE 0056 WRITE gt Del d O4E4B 005 BYTE 0012 WRITE w 04E4D 002 BYTE 0012 READ Del AIl gc 04E4F 002 BYTE ox READ main OBDOB 001 ma KKK FETCH zl mm 8 Close d 2 Click the Close button 125 PD38SIM User s Manual 5 3 Deleting a Hardware Breakpoint Make the following settings in the H W Break Point dialog box HAW Break Disable C Enable Address Pass Count 1 Access Type Read D Length Byte 7 Data Compare M Not Specify Datar HAW Break Point Label Addr Cnt Size Data Type Cmp 04E40 001 BYTE 0056 WRITE gt 2 Click the Del button O4E4B 005 BYTE 0012 WRITE F O4E4D 002 BYTE 0012 READ Del All 1 Click the breakpoint es MEE 002 EVIE was PEAD Daal to be deleted i OBDOB O01 xkkk a FETCH sl Close 3 Click the Close button Click the Del All button to delete all breakpoints You can also click the breakpoint to be deleted then press the Delete key 126 Checking C Variables 6 Checking C Variables 6 1 Checking C Variables 6 1 1 Checking C Variables in Source Program display 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 PD38SIM C Usr mina PD PD38sim Sample ieee_test Test 695 File Edit View Environ Debug Option BasicWindow OptionalWi
48. equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under c
49. file Area for specifying script file to be run at start up Area for setting default tab values Font FixedSys Size 11 Area for setting size of default font Debug Information Selection of On Memory or On Demand On Memory On Demand Eed Eet Temp Dir JO TEMP Area to set the directory where a temporary fileis created H Resume Switches Auto Downloading ON OFF when restarting T Next Hide Switches Resume ON OFF Switches Init dialog box ON OFF when restarting 20 Setup 1 3 2 Environment Setup Specifying the SFR file Specify the SFR file for the target MCU Click the Refer button to open the file selection dialog box and select the SFR file When the corresponding SFR file does not exist it is necessary to make the SFR file newly Please refer to item Method of making the SFR file of the release note appended to this product package for the method of making the SFR 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
50. for the conditional expression 199 PD38SIM User s Manual The conditional expressions written in I O script are calculated as unsigned type Therefore if negative values are compared in an while statement the operation to be performed by PD38SIM is indeterminate 7 3 5 Comment Statements Comment statements are used to write comments in I O script The following shows a description format character string A comment statement starts from a semicolon A range of statement from the semicolon till the end of the line is handled as a comment Lines of comment statements are ignored when executing I O scripts 7 4 Method for Writing Right side Expressions Right side expressions can be used to write the number of machine instructions or cycles vector address input values conditional expressions or pass counts in I O script statements as well as write expressions in if and while statements The following shows an example of an I O script statement written using right side expressions waitc LABEL waiti 0x800 20 if Ox1ff 0x30 while isfetch 0xf000 7 4 1 Composition of Right side Expressions Right side expressions may be composed of the following Constant Symbol and label Macro variable Memory variable Character constant Operator isfetch Hsint Asread Hswrite Each part of right side expressions are described below 7 4 2 Constants Binary decimal and hexadecimal numb
51. format of the string or a character in the menu Option gt View gt Display String string types unsigned char str 0x1234 Japan all Radices character types unsigned char str 0x1234 74 J all Radices 234 C Expressions When the result of calculation is a char type it is displayed as follows unsigned char str 0x1234 Japan all Radices If the string contains a non printing code prior to the code to show the end of the string 0 it is displayed up to the non printing character and the closing quote mark is not displayed unsigned char str 0x1234 Jap all Radices Also if the string contains more than 80 characters the closing quote mark is not displayed When the C expression is an pointer type a is displayed to the left of the type name indicating pointer type Te Watch Window Add Add Del Delai Set Cancel Radix FAfunsigned char x ecpp Ox4E4F ABC signed short int gsho 32768 signed char x gscp 0x4E51 C signed long gl 2147483647 unsigned char gcp CIA struct _GSDATA sch 0x5D59 unsigned char sc 71 unsigned char guc signed char gsc 73 3 You can double click on lines indicated by a to see the members of that structure or union The changes to a while the members are displayed To return to the original display double click the line now indicate
52. 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 gt Debug gt Move or Option gt Debug gt 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 hexadedmal default SJ IS button Refresh button Displays data in SJ IS code Refresh display Dec Hex ASCII SJS JIS Refresh Cache Dec button J IS button Cache button Displays data in dedmal Displays data in J IS code Usethecacheof memory ASCII button Displays data in ASCII code 45 PD38SIM User s Manual 1 6 3 Extended Menus in the Dump Window When the Dump Window is active in the PD38SIM main display area the Option menu contains the following items View Change contents of display Saal Area Specify scroll range Address Specify display starting address DataLength Specify data length Byte Display in 1 byte units Wad Display in 2 byte units Specify radix Display in decimal Display in hexadecimal Display as ASCII characters Display as SJ IS characters Display as J IS characters Refresh display Set memory contents Set data at specified address Fill specified memory block with data Move specified memory block to specified address Usethecachedf memay
53. interrupts that have been saved be deleted by clearing the interrupt request bit The virtual interrupts saved in the simulator are deleted when the device is reset Note that you can use the I O script function to write a statement to the effect that the interrupt request bit is set when an interrupt occurs 2 Reset interrupts cannot be generated 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 Input data to a specified memory address virtual port input Generate a Specified virtual interrupt Accomplish specified virtual interrupt and virtual port input simultaneously 10 PD38SIM Simulation Specifications 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 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 e 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
54. is displayed for 50 cycles in one screen Note however that when displayed in numeric form the maximum scale is 50 175 PD38SIM User s Manual 4 5 Changing Colors of Display Screen The colors of the virtual port input virtual port output or virtual interrupt display screen can be changed You can change four colors in each data display area grid lines graph lines text and background Graph line Grid line Input cycle Cycle 0000000036 Data 0x30 Address Bit EE 3 14 A OC P2202 PP POSE B33388 389 TAG Aga Aas 7 6 5 4 3 um Output cycle Cycle dress 0090 7 Text display characters 00 Background To change the display colors choose the menus Option gt Color or the Color button A dialog box like the one shown below will appear Color Dialog Reset to default color SE SE E E oi Graph line color at GG P Line E Line Text color Text E Text u Text a Jm agang Bac WW Bac Bac color OK Cancel do Other Functions of 1 0 Window The following explains how to change colors in each display screen L To change the colors of the virtual port input display screen Press the button for the item whose color you want to be changed in the Input column A dialog box for selecting colors will appear Use this dialog box to choose your desired colors To change the colors of the virtual port outp
55. line No display area to change the display source file Doubleclick the address display area to change the display starting address or the display starting line Thevalueof theC variable is displayed when the mouse cursor stand still about 0 5 seconds on the strings of the variable in the Program display Theresult of the Coverage measurement is displayed by selecting On in the Menu Option gt Coverage 33 PD38SIM User s Manual 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 Toolbar E Program Window GOLED 474 View SRC MIX DIS H BR kK Obi cade Label display area Object code display area Source line display area S0ftware breakpoint display setting area Address display area Program display area Theline No display area address display area and object code display area can be displayed or hidden by selecting or canceling Option gt Layout gt Line Area Option gt Layout gt Address Area and Option gt Layout gt Code Area Note that by default the address display area is hidden Doubleclick the line No display area to change the display source file Doubleclick the address display area to change
56. not the result but only the executed commands so the saved files can be used as the script files 6l PD38SIM User s Manual 1 13 2 Script Window Toolbar button button Closes script file Clears view buffer button button button ape script file ely log file Stop Recording the executed commands Run Step ep Chore Close PA Log0ff View Clear RecOn eclit Open button utton Opens script file Gd view buffer RecOn button button Log button p the executed commands to a file Step executes script file u log file 1 13 3 Extended Menus in the Script Window When the Script Window is active in the PD38SIM main display area the Option menu contains the following items Script file operations Open script file Run script file Stop execution of script file One step execution of script file Close script file View buffer operations Save view buffer file Clear view buffer Log file operations Open log file start output to file Close log file stop output to file Record theexeauted cammancs Record theexeauted cammancs toa file Stop Recording the executed cammands 62 Window function of PD38SIM 1 14 1 0 Window This window is used to set and display virtual port input outputs or virtual interrupts Virtual port inputs virtual interrupt settings and virtual port output results can be displayed for your reference in numeric or graphic mode For details about virtual port input outputs and on how to set
57. 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 typogra
58. or virtual interrupt Changssd vital portinta irder Ddde Ddetes set virtual pat input virtual port output or Virtual interrupt or user created I O script file Lead Loads saved virtual port input virtual port output ar Virtual interrupt or user created I O script file ue Wee earet EECH zeit egs eiazch EE EE EC 19 PD38SIM User s Manual 1 15 GUI Input Window This window allows you to create a simple key input pane buttons of the user target system in a window and execute virtual port input or virtual interrupt by pressing one of the buttons you ve created For details on how to create and set up a key input panel refer to High end Debugging described later in this manual The screen configuration tool bar and menus of the GUI Input Window are explained here One of the following three operations can be executed by pressing a button you ve created in the key input panel of the GUI Input Window Virtual port input Virtual interrupt generation Simultaneous generation of virtual interrupt and virtual port input 1 15 1 Screen Configuration of GUI Input Window g GUI Input Window iol x Input panel display area You can create edit and move buttons in the input panel display area The buttons you ve created can be assigned labels button names By pressing the buttons you ve created you can generate virtual port input virtual interrupt or virtual port input plus virtual interrupt
59. other than 0 statement 1 is executed If false 0 statement 2 is executed You can omit the else statement If omitted and the expression is false execution jumps to the line after the endi statement if statements can be nested up to 32 levels 2 1 4 Loop Statements while endw and Break Statement In loop statements execution of a group of statements is repeated while the expression is true The following shows the format to be used while expression statement endw f the expression is true the group of statements is repeated If false the loop is exited and the statement following the endw statement is executed You can nest while statements up to 32 levels Usethe break statement to forcibly exit a while loop If while statements are nested break exits from the innermost loop 2 1 5 Comment statements You can include comments in a script file Use the following format character string Write the statement after a semicolon You can include only spaces and tabs in front of the semicolon Lines with comment statements are ignored when the script file is executed 224 Notes Writing Script Files You cannot include comments on the same lines as script commands You can nest script files up to five levels You can nest if statements and while statements up to 32 levels If statements must be paired with endi statements and while statements with endw statements in each scri
60. previously displayed variables are cleared and the local variables in the new function are automatically displayed 56 Window function of PD38SIM 1 10 2 Local Window Toolbar button Adds specified variable name to C watch window button button Sets Sie watch point a of display cardinal number Cwatch Cwatch ge Cance iy Cancel button canca specified watch point button Adds specified variable name to C watch window by pointer 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 The addresses for pointers etc are displayed in hexadecimal regardless of the display radix See Section 3 2 Display F ormat 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 PD38SIM main display area the Option menu contains the following items Operations related to C function oo Register selected C variable as C watch point Cwatch Panter Register pointer of selected C variable as C watch point Set new value for selected C variable Cancel selection of C variable Change contents of display Change radix Layout Turn on off type name Sort Display String Displa
61. read For example this method can be used in cases where you want a variable e g global variables located at fixed addresses to be assigned a value when it is read In this case set read access synchronized inputs 3 Ifyou want data to be input when some virtual interrupt occurs Data can be input when a specified virtual interrupt is generated For example this method can be used in cases where memory for the SFR is referenced in an interrupt handler In this case set interrupt synchronized inputs 1 2 Setting Cycle synchronized Inputs To set cycle synchronized virtual port inputs choose the I O Window menus Option gt Setup or the Setup button The dialog box shown below will appear Select Type Set Virtual Port Input Set this item C Set Virtual Port Output Set Virtual Interrupt Cancel 147 PD38SIM User s Manual Here choose the item Set Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual port input timings will appear Setup Dialog Data Input Timing C Read Access amp Cycle C Interrupt Expressions can be input Input Address 3e0 here kead Address Start Cycle End Cycle VECiOn a First choose Cycle in the Data Input Timing column Next enter an address for virtual port input in the Input Address column the address to which you want dat
62. s Manual MEMO 248 Index 250 sfetch evtpreeelcomn 202 Meint expression seser 203 sread expression sses 203 iswrite expression ce 203 ASM Watch Window 5 50 111 Assign Statement 223 AutoDownL od 95 Break Fundions 5 Break Gtatemment A 224 Come button ceee 107 C expression nsise 53 230 233 C language evptreeslon 129 C variable wo eee 127 129 C Watch Window 5 53 128 C watchpoint esssssrrsserrresrrrrseern 53 C watchpoint data file 0 13 CB SBS iM ai e atanena i 207 Character oonstant 202 229 Come Execution se 107 COMMENE ossssssssssssesrrssrrrsrrrsrrnesrnena 200 Comment statement s s 224 Composition of 1 0 Script 196 Conditional Statement 224 Constant eee eeeeeeeeees 200 226 Coverage measurement information teh ce RR Ron chi Gn ce tact at 205 coverage measurement information EE EE 13 14 Coverage Source Window 84 Coverage Window esce 84 Customize Dialog Bo 144 Customize Function eee 207 251 Index Crcdecoommmand un 11 Cycle synchronized input 63 147 Cycle synchronized interrupt66 158 Disassemble 102 Disassemble nie 14 Downloading cccccesseeesseteeeeees 193 Dump Wimdow 93 Gelee EE 144 Eliette uf eene ee 224 QVC EE 224 CHOW SSS een Gus ats 224 environmental setup file 13 Error Messages ceeeeeeeteeeeeees 238 Executed address synchronized Interrupt
63. that can be defined is limited to 20 If procedures are defined in multiple files this limit means that up to 20 of such procedures can be defined The following shows a description format Statements Statements In the same way multiple procedures can be defined below 7 3 2 1 0 Script Statements Following five statements can be used in I O script 1 waiti statement Format waiti number of machine instructions Function Execution of the next statement is kept waiting for a specified number of machine instructions Right side expressions can be used to specify the number of machine instructions Specification of right side expressions is described later For example if following statements are written waiti 100 set 0x800 0x10 the set statement is executed only after executing 100 machine instructions 2 waitc statement Format waitc number of cycles Function Execution of the next statement is kept waiting for a specified number of cycles Right side expressions can be used to specify the number of cycles Specification of right side expressions is described later For example if following statements are written waitc 10000 set 0x800 0x10 the set statement is executed only after executing the program 10 000 cycles 197 PD38SIM User s Manual 3 int statement Format int vector address Function The virtual interrupt of a specified vector address is generated Right side expressi
64. the ASM Watch window 4 2 7 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 4 2 8 1 0 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 14 PD38SIM Input and Output Files 4 2 9 GUI Input File This file contains definitions of the key panel created in the GUI input window that have been saved toa file The file attribute is btn This file is saved from the GUI input window 4 2 10 GUI Output File This file contains definitions of the output panel created in the GUI output window that have been saved toa file The file attribute is gof This file is saved from the GUI output window 4 2 11 Virtual Port Output File This file contains the results of virtual port outputs specified in the I O Window that have been saved toa file This file is referenced by PD38SIM when it displays the results of virtual port outputs in the 1 0 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
65. the fetch address the address where the program is executed at which time a virtual interrupt is generated Vector number display area It displays the vector number of a virtual interrupt Priority level display area It displays the priority level of a virtual interrupt Virtual interrupt display area It displays timings by an asterisk at which the virtual interrupt you ve set is generated When an asterisk is indicated it means that a virtual interrupt is generated When an asterisk is not indicated it means that a virtual interrupt is not generated Execution count display area It displays execution counts or a number of times the program has executed a specified address 78 Window function of PD38SIM 1 14 8 1 0 Window Tool Bar Delete button Deletes setup data Modify button Mode button Color button Changes setup data Changes display mode Changes display color 4 aa Setup Modif Del Load Mode Scale Color I O Script File z Setup button Load button Scale button 1 0 script button Sets virtual port input Loads saved setup data Changes scale Lists registered I O virtual port output or I O script file script files or virtual interrupt 1 14 9 Extended Menu of I O Window If the 1 O Window is active among the windows brought up in the main display area of PD38SIM the Option menu has the following menu items assigned to it Sais SE aan part input virtual part output
66. the procedure below to delete buttons 1 Choose the GUI Input Window menus Option gt Del 2 Next move the mouse cursor into the GUI Input Window s input panel display area at which time the mouse cursor will have its shape changed to a cross 3 Whilein this state point to the button you want to delete and click the left mouse button Or choose the GUI Input Window menus Option gt Set or the lt button After choosing the menu point to the button you want to delete and click the left mouse button to select it Then press the Delete key 5 7 Displaying Grid Lines The GUI Input Window has a function to display grid lines at a position where buttons can be located Usethis function when you place buttons Todisplay grid lines choose the menus Option gt Display Grid Line or the Grid button When selected grid lines like the one shown below are displayed GUI Input Window Grid line 184 Setting GUI Output Window 6 Setting GUI Output Window 6 1 Overview The GUI Output Window allows you to implement the user target system s simple output panel in a window The following parts can be arranged in this output panel Label character string User specified character strings are displayed or erased when some value is written to a specified memory address or
67. virtual interrupts refer to HI gh end Debugging described later in this manual The functions screen configuration tool bar and menus of the I O Window are explained here e Up toa total of 20 virtual port inputs and virtual interrupts can be set Up to 20 virtual port outputs can be set 1 14 1 Virtual Port Input Virtual Port Input refers to a function that defines changes in the data that is input from external sources to a specified memory address Useof this function makes it possible to simulate data inputs to the ports defined in the SFR The defined input data can be referenced by displaying it in chart numeric hexadecimal or graphic mode There are following three types of virtual port inputs 1 Cycle synchronized input The input data can be written to memory when program execution has reached a specified number of cycles The data size that can be input is one byte The diagram below shows an example of a virtual port input that is synchronized to machine cycles Example where data is input to address 0 Data 20 is input Data FF is input Data 1D is input in the 2 000th in the 5 000th in the 9 000th cycle cycle cycle 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Number of cycles executed As shown above data can be input to memory address 0 in any desired cycle as specified by the user 63 PD38SIM User s Manual 2 Read access synchronized input Data can be input when the progr
68. windows of PD38SIM me Beate oo araneon farani JI rogram Window Make Program Windowaaive 1 source Window Open Source window 1 Register Window Open Register window Memory Window Open Memory window Bump Window Open Dump window RAM Monitor Window Open RAM Monitor Window aa ASM Watch Window Open ASM Watch Window aaa C Watch Window Open C language level Watch Window C Watch Window Open C Watch Window Local Window Open Local Window Eile Local Window Open File Local Window Global Window Open Global Window Script Window Open Script Window 31 PD38SIM User s Manual The Optional Window menu has assigned to it the menus which among PD38SIM functions are used to open windows of greater functionality OptionalWindow VO Window Open 10 Window fee GUI Input Window Open GUI input Window WEEN GUI Output Window Open GUI Output Window Coverage Window Open Coverage Window ee E Custam Window Option User definition menu 1 1 3 8 Help The Help menu contains the items for displaying PD38SIM help messages and the PD38SIM version No Display version information about PD38SIM wee ss 32 Window function of PD38SIM 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 PD38SIM Window when you start PD
69. 0 00 00 00 Q 8030 00 00 00 00 00 00 00 00 00 00 00 00 00 8040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 gt a 8000 ADDRESS gt LABEL PROGRAM 8000 db 8000 a db 8000 ed oat Enter command data l Mnemonic input field To exit the line assemble mode Specify Enter in the mnemonic input area The Script Window changes back to the status in which it waits for a script command to be entered 139 PD38SIM User s Manual 9 2 Starting Up Make The operation conventionally used to Make the target program after entering commands from the DOS window can be performed from PD38SIM The following shows the procedure for performing Make in PD38SIM 1 Create a pif file Follow the procedure below to create the pif file a b LO Create a keyboard shortcut for command com located in the Windows directory For the keyboard shortcut thus created assign a file name xxxx pif xxxx denotes a name specified by the user and copies the file into the directory that contains makefile This file becomes a pif file Don t specify a suffix pif when changing a file name Open a property dialog box for this file and input the same command in the command line of this dialog box that was input from the DOS window MS DOS Prompt Properties 2 xi P
70. 20 Na ER e EE 23 WINDOW FUNCTION 1 WINDOW FUNCTION OF PD38SIM 27 1 1 The PD38SIM Window isenana naaa aa aAa aa aaa ai Earra eaa 27 RSA Program dd ale EE 33 RE SOURGE WiINKOW EE 38 1 4 Register Windows eu AEN AEN AE AR net 41 1 5 Memory Window aeaaeae aaaeeeaa aeaa e a i akaaka a aea a atari 43 LO DUMP WIN COW rererere eaaeo Tere aa er Eaa Aeae EEEa aat 45 1 7 RAM Monitor Window 47 SAM Wate WINd W oiin A a a ie 50 T9 C Watch WiINdOW ceccie cteschecstccetecctecebecstenebecatenetecstanedesbenebeautepetesctereteastuaetestane tone 53 ATO CR lach EE 56 KIT Fes Be e WIN ee 58 1 12 Global ele EE 60 1 13 Seri pt WIM GOW E 61 LITA VOW OW 55 e AE AER aoe AE EE dE eege ACEN a eR ato A 63 LSG Input Wun EE EE AN T 80 1 16 GUI Output WINdOW 3 matinis adnan a a 82 1 17 Coverage WINAOW bk 84 1 18 S W Break Point Setting Dialog Bon 87 1 19 H W Break Point Setting Dialog Bo 89 BASIC OPERATION 1 LOADING AND DISPLAYING THE TARGET PROGRAM 93 Re Ate Ze Tale DEE 93 1 2 To Reload the recent downloaded nle AA 95 1 3 To download the target program automatically when update 95 1 4 Changing Program Display Position Immediately After Downloading 96 Contents LIB WI elle Cie LING E 97 1 6 Saving Results of Disassermblv cence eee eeceeeeeeeaeeeeeeaaeeeeteaeesetecaaeeeeneaaeees 97 1 7 Continuing to Display a Selected Program Poeition 97 1 8 Changing the Program Display Position cccccececeeeeeeeneeeeeteceeeeeeeae
71. 225 3 C EXPRESSIONS 230 3 1 Writing C Gelee NEEN 230 3 2 Display Format of C Exvpreelons 233 4 ERROR MESSAGES 238 vi Introduction PD38SIM Introduction 1 PD38SIM Introduction The PD38SIM is a simulator debugger for Windows which simulates the 740 family operation of 8 bit microcomputer and evaluates the target program PD38SIM comprises the following software 1 pd38sim the simulator debugger front end 2 sim38 the simulator engine PD38SIM User s Manual 2 PD38SIM Features 2 1 Multi Windowing Function PD38SIM 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 1 0 Simulation Function PD38SIM provides the following I O simulation functions Virtual port input function Changes of the data that is input from external devices to memory can be defined in the IO Window or a file 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 You can define the interrupts you want to be generated in the I O Window or a file 2 4 Simplified System Simulation F unction GUI Input function Key matrix can be defined by GUI GU output function LEDs etc can be defined by GUI 2 5 RAM Monitor
72. 38SIM 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 gt 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 Toolbar Current program counter E Program Window GOLED A74 View SRC MIX DIS Address BRK Source DATAS 0 JSR SUB3 do Source line Software breakpoint display setting area display area Address display area Program display area Theline No display area and address display area can be displayed or hidden by selecting or canceling Option gt Layout gt Line Area and Option gt Layout gt Address Area Note that by default the address display area is hidden Doubleclick the
73. A dialog box for saving the virtual port input data you ve set to a file virtual port input file will appear Save Data AEG Save in a l0_Samples D ei cl ii File name finput scr Save as type Script Files scr x Cancel 149 PD38SIM User s Manual Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the I O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished setting the cyclesynchronized virtual port inputs 1 3 Setting Read Access synchronized Inputs To set read access synchronized virtual port inputs choose the I O Window menus Option gt Setup or the Setup button The dialog box shown below will appear Select Type Set Virtual Port Input Set this item C Set Virtual Port Output C Set Virtual Interrupt Prev Cancel Here choose the item Set Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual port input timings will appear Setup Dialog pooo oeae Read Access C Cycle C Interrupt Expressions EE cam be input Input Address here Read Address tart elo 150 Setting Virtual Port Inputs in 1 0 Window First choose Read Access in the Data Input Timing co
74. Dump Window the active window then select the following from the PD38SIM Window menu Option gt View gt Refresh 3 8 To change the acquisition mode of the memory The Memory Window and the Dump Window have internal cache storing the 512 Kbytes memory data for quick displaying When the window is resized or scrolled within this 512 Kbytes memory area the memory of the area is not accessed To disable this caching click the Cache button or select the menu Option gt CacheOn When the memory cache is disabled the memory out of the display is not accessed and if the display area changes by scrolling and resizing the memory is accessed 116 Software Breaks 4 Software Breaks Use a software break to break target program execution at a specified line address Use the S W Break Point Setting dialog box to set a software break point When you set a software break execution of the target program stops immediately before the software break point You can set up to 64 software break points If you set multiple software break points the target program stops as soon as execution reaches any of the software break addresses 4 1 Opening the S W Break Point Setting Dialog Box Click the SW button on the PD38SIM Window toolbar Press function key F 7 to open the software breakpoint setting dialog box Alz Asa zi zl se Click the SW button You can also open the S W Brea
75. Function PD38SIM 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 PD38SIM havea 1KB RAM monitor area which can be mapped to any address You can usethe RAM Monitor Window to monitor the RAM monitor area PD38SIM Features 2 6 Break Functions PD38SIM has the following four 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 PD38SIM 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 Y ou can set hardware breakpoints from the H W Break Point Setting dialog box PD38SIM supports up to 64 hardware breakpoints 2 7 Source Level Debugging F unction You can display source files and perform source level debugging such as setting break points in the source lines and perf
76. H ow to register for the menu To register the custom window in the menu select the following from the PD38SIM Window menu Optional Window gt Custom Window gt Option Then the following dialog opens Custom Window Option regs_win 1 Open the custom window registration dialog Delete H al 2 lnput the program file name with the extension p of the custom window with absolute pass File path Title 3 Input the title of menu M Se ee 4 Choose display non display to the menu 5 Click Ok button Custom window registration dialog The change of contents of registration To change contents of registration open the custom window registration dialog with the following process Then change contents of registration Custom Window Option 1 Select the custom window which changes contents of registration 2 Open the custom window registration dialog Click the Delete button to remove registration Up Down Change the turn of the display of the menu 208 Customize Function The open of custom window The menu to open the custom window when it is registered is added SSS SSS Sei w OptionalWindow Help 10 Window GU Input Window Ei GUI Output Window Coverage Window Custom Window Option 1 Choose the custom window to v 1 Program Window reg win open The custom window can be opened when the
77. IM User s Manual Changing the display position at the line No level When the Program Source Window is in source display mode click the Address button from the Disp Area dialog box Click the Address button to open the Address dialog box Click the Line button in the Address dialog box to enter the new line No 1 Click the Line button 2 Specify the line No Cancel 3 Click the OK button To open the Address dialog box select the following from the PD38SIM Window menu Option gt View gt Address You can also double click the address display area of the Program Source Window to open the Address dialog box Changing the position of the program counter Click the PC button in the Disp Area dialog box When you click the PC button the display position changes to the position of the program counter Change the position of the program counter select the following from the PD38SIM Window Option gt View gt Program Counter 1 9 Checking Source Programs in Other Directories You can specify the search path for source files This is helpful when the source files for target programs are stored in multiple subdirectories or not in the current directory This function allows you to check these source files and set software breakpoints etc from the Program or Source Window To open the Path dialog box and set the search path select the following from the PD38SIM Window men
78. M main display area the Option menu contains the following items Rese se C watch point ES Register C watch point Add Pante Register C watch point pointer Delete selected C watch point Set new value for selected C watch point Cancel selection of C watch point Delete all C watch points Change contents of display Change radix Layout Turn on off type name Sort Display String Display the string Display character RAM Monito Display RAM monitor Enable Turn on off RAM monitor area RAM Monita Aree Set RAM monitor area Cda Set color of access attribute display Sampling pericd Set sampling period for RAM monitor Clear Clear access attribute 55 PD38SIM User s Manual 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 File name which contains contains program counter Toolbar program counter Scope display area el Local Window unsigned char c A unsigned char uc P signed char sc C o 32768 Le ebe Sc signed short int s signed short int i 32767 unsigned short int usho 65535 Display of variable type Dispaly of variable value Data display area Dispaly of variable name When performing step execution etc and there is a change in the function that includes the address specified by the program counter
79. MACRO custom Commande programname custom window programs custom window s program 2 Add a specified custom command and custom window program custom window s program ccustom window program ccustom window programs MACROPATH MPATH 1 MACROPATH 1 Refrence the search directory that is set 2 MACROPATH directory_name 2 Set the directory where to search for custom command and custom window programs 217 PD38SIM User s Manual 1 2 16 Utility Commands Command Command format Summar RADIX 1 RADIX 1 Check radix for input of constants 2 RADIX 2 8 10 16 2 Set radix for input of constants ALIAS 1 ALIAS 1 Check definition of command alias 2 ALIAS new name command name 2 Define command alias UNALIAS UNALIAS new name Delete specified alias UNALIASALL UNALIASALL Delete all aliases VERsion VER Display PD38SIM versions DATE DATE Display current date and time yymmdd and time ECHO ECHO MESSAGE Display specified parameter QUIT QUIT Quit PD38SIM CD 1 CD 1 Checks the current directory 2 CD directory name 2 Sets the current directory 218 Table of Script Commands 1 2 17 Supplementation explanation of Script Commands H ardwareBreak HB Setting and Checking Hardware Breaks Input format Format 1 HardwareBreak Format 2 HardwareBreak address FETCH passes Format 3 HardwareBreak address access condition passes Format 4 HardwareBreak address access condition pas
80. To our customers Old Company Name in Catalogs and Other Documents On April 1 2010 NEC Electronics Corporation merged with Renesas Technology Corporation and Renesas Electronics Corporation took over all the business of both companies Therefore although the old company name remains in this document it is a valid Renesas Electronics document We appreciate your understanding Renesas Electronics website http www renesas com April 17 2010 Renesas Electronics Corporation Issued by Renesas Electronics Corporation http www renesas com Send any inquiries to http www renesas com inquiry w N E SAS 8 10 11 12 Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is gran
81. Toreset the target program click the Reset button on the PD38SIM Window toolbar Y ou can also press F8 tit jajaj sl REES Click the Reset button You can also reset the target program by selecting the following from the PD38SIM Window menu Debug gt Reset 107 PD38SIM User s Manual 3 Checking and Setting Register Data and Memory Contents 3 1 Checking the Contents of Registers Open the Register Window to check the contents of the registers The Register Window which lists the CPU registers is opened from the PD38SIM Window menu by selecting the following Basic Window gt Register Window See Section 1 4 Register Window in the Window Functions for details of the Register Window To Change the Display Radix of the Register Value The display radix can be changed for each register This is done with the following procedure 1 Click the right mouse button on the Name of the register whose display radix you want to change 2 Select the radix you want displayed from the menu A register valuein HEX A register valuein DECIMAL el Register Window fe sl Name Value Radix ba Register Window fl Eg Name Value Radix 108 Checking and Setting Register Data and Memory Contents 3 2 Changing the Contents of Registers To Change the Register Value Register contents can be changed with the following procedure 1 Either double click on the registe
82. Try to change your selected display mode on the program window when stop 9 8 To Open the E ditor The following show how to open the editor which you usually use 1 Registering the Editor Select the pop up menu Entry Editor in the Program window and specify the editor program and their parameters in the following dialog box You can specify the parameters of F asthefilenameand L as the line number to the editor if the editor is possible About parameters of the editor you use refer the manual of the editor Editor Option Editor C Program Files MEGASOFT MIW Miw exe Bai Specify the editor Parameter Pe A Specify the parameter PER F Number L Cancel 2 Opening the Editor Select the pop up menu Open Editor in the program window 144 High end Debugging 146 Setting Virtual Port Inputs in 1 0 Window 1 Setting Virtual Port Inputs in 1 0 Window 1 1 Overview The Virtual Port Input function allows you to simulate data inputs and similar other operations performed on the ports defined in the SFR Data can be input to memory at one of the following timings 1 Ifyou want data to be input to some memory location with the lapse of time Data can be input when program execution has reached a specified number of cycles In this case set cycle synchronized inputs 2 Ifyou want data to be input when some memory location is read Data can be input when the program accesses a specified memory location for
83. Unary plus unary minus unary logical Level 2 negation Binary multiplication binary division Binary addition binary subtraction Shift right shift left l Binary comparison st Level 7 Binarylogical ORs Levee 10 UL LLoteop Legd 12 7 4 8 isfetch ent isread iswrite These statements are used in conditional expressions of I O script statements and if and while statements 1 isfetch expression Format isfetch address Function The value of the expression becomes true 1 when the program s PC value goes toa specified address Otherwise the expression is false 0 For example the if statement below if isfetch Oxfc00 becomes true 1 when the program s address PC value becomes Oxfc00 202 1 0 Script Function 2 isint expression Format isint vector address Function The value of the expression becomes true 1 immediately after a virtual interrupt of a specified vector address is generated Otherwise the expression is false O For example the if statement below if Asint Oxffee becomes true 1 if a virtual interrupt of vector address Oxffee had occurred immediately before the if statement was evaluated 3 isread expression Format sread address Function The value of the expression becomes true 1 immediately after a specified memory address is accessed for read to read data from memory Otherwise the expression is false 0 For example the if statem
84. Up Down Cj Ee 4s a 8 9 E X X 1K 1K 1K 1K E i Here change the data for the selected virtual interrupt as necessary Data can be changed in the same way that data is set Refer to Section 3 Setting Virtual Interrupts in I O Window After changing the data press the N ext button A dialog box for saving the virtual interrupt data you ve set virtual interrupt file will appear ipn File name hen se Save as type Script Files scr 7 Cancel Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished changing virtual interrupt data 168 Other Functions of 1 0 Window 4 2 Deleting Virtual Port Inputs Virtual Port Outputs Virtual Interrupts or 1 0 Script Files Set The virtual port inputs virtual port outputs virtual interrupts or I O script files you ve set using the Setup menu can be deleted To delete one of these settings choose the menus Option gt Delete or the Delete button A dialog box like the one shown below will appear Delete Dialog ooo Delete Virtual Port Input C Delete Virtual Port Output Delete Virtual Interrupt C Delete I O Script File Todelete virtual port inputs that have been set choose Del
85. Variables Memory variables are used when using memory values in expressions The following shows a format of memory variables address data size Expressions can be written in address Memory variables also can be used Specify data size as shown in the table below For word 2 byte size If specification of data size is omitted the data size is assumed to be byte long Example 1 To reference memory contents at address 800016 in bytes 0x8000 B or 0x8000 Example 2 To reference memory contents at address 800016 in words 0x8000 w 201 PD38SIM User s Manual 7 4 6 Character Constants Specified characters or character strings are handled as constants after being converted into ASCII code Characters must be enclosed with single quotations Character strings must be enclosed with double quotations Character strings must be within 2 characters 16 bits in length If a character string consists of more than two characters only the last two characters written in the string are operated on For example if you write ABCD only the last two characters in this string i e CD are operated on the value of which is 434416 7 4 7 Operators The following lists the operators that can be written in expressions The priorities of operators are such that level 1 is the highest and level 12 the lowest If operators in an expression have the same priority they are calculated sequentially from left to right ha
86. Watch Window or exit PD38SIM When you reopen 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 button button Adds a C watch point Deletes specified C watch point Cancels specified C watch point _ Add Addx Del DelAll Set Cancel Radix t button j Del All button button Adds a C watch point by pointer Delete all C watch points Switch of display cardinal number 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 The addresses for pointers etc are displayed in hexadecimal regardless of the display radix See Section 3 2 Display F ormat of C Expressions in the Reference part for details of display formats 54 Window function of PD38SIM 1 9 3 Extended Menus in the C Watch Window When the C Watch Window is active in the PD38SI
87. a Cycle count display area It displays cycle counts 76 Window function of PD38SIM 1 14 7 Structure of Virtual Interrupt Screen 1 14 7 1 Screen structure for cycle synchronized interrupts When you ve set virtual interrupts that are synchronized to machine cycles a display screen configured as shown below will appear Interrupt cycle Cycle 0000000006 l yec ON SGA A Cude count display area qe Vector Virtual interrupt display area address display area Vector number display area It displays the vector number of a virtual interrupt Priority level display area It displays the priority level of a virtual interrupt Virtual interrupt display area It displays timing at which the virtual interrupt you ve set is generated fJ L This means that a virtual interrupt is generated This means that a virtual interrupt is not generated Cycle count display area It displays cycle counts 771 PD38SIM User s Manual 1 14 7 2 Screen structure for executed address synchronized interrupts When you ve set virtual interrupts that are synchronized to executed addresses a display screen configured as shown below will appear Interrupt address Number of times Address Sec 2134 5 67 8g lite Execution 803E_ FFF6 D X xix ox count display area aa Ai Virtual interrupt display area address address display display area area Executed address display area It displays
88. a Nanel Name2 Input the desired memory address Input the character string to be displayed when memory value coincides with the one specified for Display Namel in the Data column Input the character string to be displayed when memory value coincides with the one specified for Display Namez2 in the Data column Logic Positive CWeeative Data Display Namel Display Name2 The character string in the Namel column is displayed when the data specified here is output The character string in the Name2 column is displayed when the data specified here is output 6 Press the OK button in the dialog box Thus you ve finished creating and setting a label 7 Tocreate another label repeat steps 1 to 6 described above 188 Setting GUI Output Window 6 3 Creating LEDs Follow the procedure below to create LE Ds 1 2 3 Choose the GUI Output Window menus Option gt Make LED or the LED button Next move the mouse cursor into the GUI Output Window s output panel display area at which time the mouse cursor will have its shape changed to a cross While in this state click the left mouse button at a position where you want to create an LED Hold down the left mouse button while you move the mouse cursor to expand its size and release the left mouse button where the size is what you want E GUI Output Window Le Label LED Grid Load Save Choose this
89. a to be input using a hexadecimal number Then enter the cycles at which you want the virtual port input to be started and ended for Start cycle and End cycle respectively using decimal numbers Then press the Next button Or press the Prev button here if you want to return to the previous dialog box 148 Setting Virtual Port Inputs in 1 0 Window A matrix dialog box for setting the virtual port input data will appear Setup Dialog Finds the previous data you ve set UP or the next data DOWN Up Down OERA eS ee a el ee se E 1 ee ee ES ans sd 0 a ee ee Me III Ui The setup example 100307 33 i i i i i i i i in this element paT specifies that data IO gg 0x22 be set at the Spy Bed 10 016th cycle 10090 Double click on an element you want and set the desired input value in it lt Prev Cancel In this dialog box set the data you want to be actually input to memory F ollow the procedure below to set data 1 Move the mouse cursor to the cycles location called an element where you want data to be set then double click the left mouse button Or you can scroll the screen to go to the desired location 2 Input data in the selected place using a hexadecimal number The data size that can be input is one byte from 0x0 up to OxF F 3 Repeat steps 1 and 2 as many times as the number of data you want to set When you finished entering all data press the Next button
90. according to logic 1 or Oin a bit e LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or Oin a bit Maximum number of parts that can be arranged Thetotal number of addresses that can be set for the parts created is 20 including addresses of all parts Therefore if the addresses set for each part all are different the maximum number of parts that can be arranged in the output panel is 20 e f the number of addresses set for each part is less than 20 there is in effect no limit to the maximum number of parts that can be arranged The following explains how to create parts for the GUI Output Window 6 2 Creating Labels Follow the procedure below to create labels 1 Choose the GUI Output Window menus Option gt M ake Label or the Label button 2 Next move the mouse cursor into the GUI Output Window s output panel display area at which time the mouse cursor will have its shape changed to a cross 185 PD38SIM User s Manual 3 Whilein this state click the left mouse button at a position where you want to createa label Hold down the left mouse button while you move the mouse cursor to expand its size and release the left mouse button where the size is what you want ES GUI Output Window Choose this abel LED Grid Load Save button Output panel display area Drag the cross cursor to determine the size of the label 4 When a frame in which
91. advance the program counter to the function you specified in the StartUp dialog box perform Come execution See Section 2 4 Program Execution to Specified Location in the Basic Operation for details Note This setting is ignored if there is source line data at the position of the program counter immediately after downloading 1 Specify the name oi 96 Loading and Displaying the Target Program 1 5 Uploading From the PD38SIM Window menu select File gt Upload to open the Upload dialog box Enter the upload area and the name of the file to be saved You can specify files in the Intel HEX format To save a filein the Intel HEX format specify the hex attribute If you specify an existing filename that file is overwritten 1 Specify the starting address Memory Save Area MM tg 2 Specify the end address Save filename 3 Specify the name of the file to be saved Refer Cancel 4 Click the OK button 1 6 Saving Results of Disassembly From the PD38SIM Window menu select File gt Save Disasm to open the Save Disasm dialog box Enter the area to be saved and the filename You can specify any filename and attribute If you specify an existing filename that file is overwritten 1 Specify the starting address Memory Save Area 2 Specify the end address Save Filename 3 Specify the name of the file to be saved Refer Cancel 4 Click the OK butt
92. ai Monadic positive monadic negative Level 2 monadic logical NOT Dyadic multiply dyadic divide ES as CE dyadic exclusive OR Dyadic comparison Level 8 229 PD38SIM User s Manual 3 C Expressions 3 1 Writing C Expressions You can use C expressions consisting of the tokens shown below for registering C watchpoints and for specifying the values to be assigned to C watchpoints Token Xample O Z _ _ _ O SS O nnere SS S S Parentheses Arrays Casting to basic Wes Casting to typedef type Variable names and function names var i j func Character constants Character string literals abcdef I am a boy 3 1 1 Immediate Values You can use hexadecimals decimals and octals as immediate values Values starting with Ox are processed as hexadecimals those with 0 as octals and those without either prefix as decimals Notes You cannot register only immediate values as C watchpoints Immediate values are valid only when used in a C expression that specifies a C watchpoint and when specifying a value to be assigned 230 C Expressions 3 1 2 Mathematical Operators You can use the addition subtraction multiplication and division mathematical operators The following shows the order of priority in which they are evaluated 7 gt Note There is no support currently for mathematical operators for floating point numbers 3 1 3 Pointe
93. al 900 sym BOL file is illegal Error in format of load module file 902 Cent find SYMBOL file filename No load module file exists 903 Can t get enough memory Insufficient memory Quit other applications or increase memory 904 Cannot open temporary file The temporary file for downloading using the on demand method could be opened 1002 eege orexoressionismega 1 poo cantina sma S en rignt hand side of tne pression isea 1 en rne Type of structure union yarenctsame oO y er Kate O DEELER e The operation does not beallowedtopcinters 1014 The operation does not be allowed to the pointer 1018 Type information is broken Error in symbol information in load module file 1020 Left value must be a structure or an union ee 1022 Left value must be reference of a structure or an union 1024 The operand must be a value ei 1005 erer isone toe oeie oOo 240 Error Messages Lee feont oa saaressa S er frnearray variabieis iea OOOO 1028 The essantil number ot array isna 1 1029 The operand must bean adoress value 1030 Type casting for register variable is not be supported 1032 Typecasting for that type is not be supported ee 1033 This expression can not be exchanged for some address value 1100 Address value is out of range Specified address exceeds MCU s maximum address ior Description of Assanbiy anguageisiiegat 1 e Adress value tor JUMP isoutofrange SS mos operand valueis
94. alculation within an expression 3 1 9 Arrays You can usethe and tospecify the elements of an array You can code arrays as follows variable name elenent_Noor variable variable name element Noor variable element Noor variable etc 3 1 10 Casting to Basic Types You can cast to C basic types char short int and long and cast to the pointer types to these basic types When casting to a pointer type you can also use pointers to pointers and pointers to pointers to pointers etc Note that if signed or unsigned is not specified the default values are as follows Basic type Default Notes You cannot cast to floating point C basic types float and double You cannot cast register variables 3 1 11 Casting to typedef Types You can use casting to typedef types types other than the C basic types and the pointer types to them When casting to a pointer type you can also use pointers to pointers and pointers to pointers to pointers etc Note You cannot cast to struct or union types or the pointers to those types 232 C Expressions 3 1 12 Variable Names and Function Names As defined in C variable and function names are character strings that start with a letter They can consist of up to 255 characters 3 1 13 Character Constants You can use characters enclosed in single quote marks as character constants F or example A b etc These character con
95. am accesses a specified memory location for read The data size that can be input is one byte The diagram below shows an example of a virtual port input that is synchronized to memory accesses for read Shown in the sample program below is a function that reads data from portO address0 T_PORTO READ PORT A T_PORTO This function aims to assign the value of port 0 to accumulator In such a case a value can be assigned to accumulator by entering it to port 0 when the program accesses port 0 address 0 for read To support processing of functions like this PD38SIM provides a function that allows you to define the data to be input according toa number of times the specified memory address is read a virtual input port synchronized to memory accesses for read By using this function you can perform an operation where data 0x10 is input to memory address 0 when address 0 is read first and data 0x20 is input to said memory address when the address is read next Number of times the address 0 Data input to is read address 0 Third 0x30 64 3 Window function of PD38SIM Interrupt synchronized input Data can be input to a specified memory location when a virtual interrupt occurs The data size that can be input is one byte The diagram below shows an example of a virtual port input that is synchronized to interrupts Shown in the sample program below is the case where data is read from port 1 address 2 u
96. arget program has been downloaded using the on demand 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 21 PD38SIM User s Manual Switches of Init dialog box ON OFF of restarting Specify whether the Init dialog box should be opened when restarting PD38SIM Check Next Hide to stop the I nit dialog box being opened when you next start PD38SIM If you want to display the Init dialog box when you next start PD38SIM select I nit gt Environ from the PD38SIM Window menu then uncheck Next Hide in the I nit dialog box You can also force the I nit dialog box to be displayed when you start up by pressing and holding the Ctrl key when starting PD38SIM Switches of Resume ON OFF You can specify whether when you restart PD38SIM the windows are restored to their status when you last quit the program Check the Resume box to do so Selection of Auto downloading at startup You can specify whether when you restart PD38SIM the program automatically fetches the last read target program Check the Auto Download box to do so 22 Setup 1 4 sim38 Setup When sim38 starts up it is registered in the system tray 1 4 1 sim38 When Running Right clicking on the running sim38 and selecting Version from the menu bar will open up the Version Information dialog box 1 4 2 Structure of Version Information Dialo
97. be started immediately following the previous one To save coverage measurement information To save coverage information select the following from the PD38SIM window menu when the coverage window is active Option gt File gt Save A coverage save dialog box will appear when the above are selected from the menu A path can be added to the file name that is specified here If a file name extension is omitted the default file extension cov is added If an existing file name is specified for the file name here the file will be overwritten A file selection dialog box appears when you click on the lt Refer gt button A file name can be specified in this dialog box also The coverage information is saved to the specified file when you click lt OK gt To load coverage measurement information Toload data from a file that contains the coverage measurement results saved by the Save menu command into the computer select the following from the PD38SIM window menu when the coverage window is active Option gt File gt Load A file selection dialog box will appear when the above are selected from the menu When the file is loaded into the computer the coverage RAM base address is automatically changed to one that was the base address when saved A path can be added to the file name that is specified here If a file name extension is omitted the default file extension cov is added e After entering a
98. ble e g comment lines are displayed in white Unexecuted lines are displayed in gray The executed non executed information in the program display area is automatically updated when the program has stopped If you want to see some other function double click on the desired function in the coverage window The window can be scrolled through functions providing that they exist in the same source file Theline No display area and address display area can be displayed or hidden by selecting or canceling Option gt Layout gt Line Area and Option gt Layout gt Address Area Note that by default the address display area is hidden 1 17 2 Coverage Window Toolbar button Update displayed coverage measurement Refresh Clear button Initialize coverage measurement 85 PD38SIM User s Manual 1 17 3 Extended Menus in the Coverage Window 1 17 3 1 Extended Menus in the Coverage Window When the Coverage Window is active in the PD38SIM main display area the Option menu contains the following items Menu Menu options Taste Barerta G Change fot a pa Lemmer O o KEE aa Input output coveragemeasurement result files Savecoverage measurement result file Load average mesurament result file Set layout ee Turn on off address area 1 17 3 2 Extended Menus in the Coverage Source Window When the Coverage Source Window is active in the PD38SIM main display area the Option menu contains the fo
99. ble mode each instruction is executed step by step You can also start step execution by selecting the following from the PD38SIM Window menu Debug gt Step gt Step To execute subroutines as single instructions in sten mode Executing subroutines as single instructions in step mode is called as over step execution Click the Over button on the PD38SIM Window toolbar Or press F 4 Al Asia zl zl ziel Click the Over button 105 PD38SIM User s Manual You can also start over step execution by selecting the following from the PD38SIM Window menu Debug gt Step gt Over To specify the time of steps Select the following from the PD38SIM Window menu Debug gt Step gt Step Option For over step execution select Debug gt Over gt Over Option Specify the time of steps in the displayed Step or Over dialog box To stop step execution Click the Stop button on the toolbar You can also stop step execution by selecting the following from the PD38SIM Window menu Debug gt Stop This also applies to over step execution 2 3 Returning from Current to Calling Routine Click the Return button on the PD38SIM Window toolbar called as Return execution You can also press F5 UI alela j zl sw Click the Return button You can also return to a calling routine by selecting the following from the PD38SIM Window menu D
100. cimals The prefix or suffix symbol attached to the numerical value indicates which radix is used Suffix None one Examples a 24 234 E Be AB24h 10010b 1Y ou can only specify when the predetermined radix is hexadecimal If you are inputting a radix that matches the predetermined radix you can omit the symbol that indicates the radix excluding binary Use the RADIX command to set the predetermined value of a radix However in the cases shown below the radix is fixed regardless of what you specify in a RADIX command EE Line No No of executions No of passes No of limits 2 2 3 Symbols and labels You can include symbols and labels defined in your target program or symbols and labels defined using the Assemble command You can include alphanumerics the underscore _ period and question mark in symbols and labels However do not start with a numeric Symbols and labels can consist of up to 255 characters Uppercase and lowercase letters are unique You cannot indude the assembler sra74 structured instructions pseudo instructions macro instructions operation code or reserved words SECTION BYTE switch if etc You cannot use strings that start with two periods for symbols or labels Note 1 Local label symbol and scope PD38SIM supports both global label symbols which can be referenced from the whole program area and local label symbols which can only be referenced wit
101. 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 PD38SIM stores information on the C watch points recorded in the 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 ork 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 1 0 Script File This file contains a description of virtual port inputs and virtual interrupts The created 1 0 script file is read from the I O Window The file attribute is ec 4 1 14 GUI Input File This file contains definitions of the key panel created in the GUI input window that have been saved toa 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 toa file The file attribute is gof By reading this file from the GUI output window you can set up the output panel you ve creat
102. count display area Read access count display area It displays read access counts 12 Window function of PD38SIM 1 14 5 3 Screen structure for interrupt synchronized inputs When you ve set virtual port inputs that are synchronized to virtual interrupts a display screen configured as shown below will appear Input interrupt ber of times lt q Virtual interrupt occurrence count display area Address Vector Input data display area display number area display area Address display area It displays the memory address to which a virtual port is input Vector number display area It displays the virtual interrupt vector number to be monitored Input data display area It displays the virtual port input data that has been set by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the virtual interrupt occurrence count of the data at which the cursor is positioned will be displayed in the virtual interrupt occurrence count display area Virtual interrupt occurrence count display area It displays virtual interrupt occurrence counts Virtual interrupt occurrence count display area It displays virtual interrupt occurrence counts 73 PD38SIM User s Manual 1 14 6 Structure of Virtual Port Output Screen Virtual port output results can be displayed in one of the three modes shown below The display modes can be changed from the M ode menu 1
103. cting the following from the PD38SIM Window menu Debug gt Break Point gt H W Break Point See Section 1 19 H W Break Point Setting Dialog Box in the Introduction for the structure of the SW Break Point Setting dialog box 122 5 2 Setting Hardware Breakpoints Hardware Breaks To break when the instruction at a specified address is executed The following example shows how to break when the instruction at address BDOB s is executed Make the following settings in the HW Break Poi HAW Break C Disable 1l Pass Count lengi 2 Enter address BDOB 3 Select F etch Address bdOb Access Type Fetch zl Data Compare FK Not Sp nt setting dialog box Enable lt L Select Enable HAW Break Point Label Addr Cnt Size Data Type Dm Close Aaa 4 4 Click the Add button De SE 5 Click the Close button To break when data is read from the specified address The following example shows how to break when data has been read twice from address 4E 4F 16 Make the following settings in the H W Break Point setting dialog box HAW Break C Disable 2 Enter address 4E 4F 3 Select Read Address edt Access Type JRead gt Data Compare Not Specify p cl rc Length Daia c Enable 1 Select Enable Pass Count P lt lt Byte z 4 Enter a pass count of 2 HAW Break Point Label Addr Cnt S
104. d by the 3 2 4 Array Types When the result of calculation is an array type other than a char type the starting address is displayed in hex as follows signed int 10 z 0x1234 all Radices When the result of calculationisachar type it is displayed as follows unsigned char 10 str 0x1234 Japan all Radices If the string contains a non printing code prior to the code to show the end of the string 0 it is displayed up to the non printing character and the closing quote mark is not displayed unsigned char 10 str 0x1234 Jap all Radices Also if the string contains more than 80 characters the closing quote mark is not displayed When the C expression is an array type as same as pointer type a is display to the left of the type name You can see the elements of the array by using this indicating for the details refer 3 2 4 Pointer types 235 PD38SIM User s Manual When the number of the array elements is more than 1000 the following dialog box open Specify the number of the elements in the dialog box Set Array Size Please set array area Start a 1000 The elements from the index specified in Start to the index specified in E nd are displayed If you specify the value more than the max index of the array the value is regarded as max index of the array When you click the Cancel button the elements are not displayed 3 2 5 Function Types Wh
105. d in SFR The following shows timings at which data can be input to memory L 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 PD38SIM User s Manual 3 7 Virtual Interrupt Function This function defines interrupt generation Using this function you can generate timer interrupts and key input interrupts in a simulated manner without having to actually generate them
106. d nas noyat supported 1 Lei cant search moreonthestac OOOO Log Specified times of number is over tran 65535 SOS puso address valueiscutofrange 242 Error Messages No Error Message Notes and Action 1500 There was sent undefined data from simulator 1501 Can t read write because there are no memory at that area 1502 Number of points exceeds the limit limit OOOO O 1505 No hardware breakpoint set at specified address 1506 Can t get enough memory o 1507 Cant set more O sniene OOOO S 1508 Can t set more virtual output Max20 SSS 1509 Specified vector No out of range J ooo 1510 Specified level of priority out of range E E E 1551 Bit number is out of range oo o 1552 Fletes O O 1553 Kant giei ereel Jl 1554 Cant findsub routineinformation JL 1555 illegal character inthestrings Jl 1557 Cantfindthatlinenumber JL 1558 Multiple definition of symbolfabel JL 1559 Theearenocadeatthatling JL Can t find section information 1563 Can t find source lines which correspond to that address 1564 Can t find symbol symbol 1565 Can t find the scopes which include that address 566 Loading is canceled 1569 The register name is wrong 243 PD38SIM User s Manual 1704 The connection with the target isn t created ee 1705 ant connect with the target DEE 1707 Time Out ERROR A time out error occurred in communication with the target system Communication ERROR
107. data press the Next button A dialog box for saving the virtual port input data you ve set to a file virtual port input file will appear File name finput ser Save as type Script Files scr 7 Cancel 154 Setting Virtual Port Inputs in 1 0 Window Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the I O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished setting the virtual interrupt synchronized virtual port inputs 155 PD38SIM User s Manual 2 Setting Virtual Port Outputs in 1 0 Window 2 1 Overview The Virtual Port Output function allows data values written to some memory address by a program to be recorded along with cycles at which data was written The recorded data can be displayed for verification in graphic or numeric form The maximum number of data that can be recorded by this function is 30 000 entries counted from the beginning of program execution 2 2 Setting Virtual Port Outputs To set virtual port outputs choose the I O Window menus Option gt Setup or the Setup button The dialog box shown below will appear Setup Dialog e EE C Set Virtual Port Input Select this tem Set Virtual Interrupt Cancel 156 Setting Virtual Port Outputs in 1 0 Window Here choose the item Se
108. de variables with for use as macro variables You can specify alphanumerics and or the underbar _ in the variable name following the percent sign However do not start the names with a numeric You cannot use the names of registers as variable names Uppercase and lowercase letters are differentiated in variable names You can define a maximum of 32 macro variables Once defined a macro variable remains valid until you quit PD38SIM Macro variables are useful for specifying the number of iterations of the while statement 227 PD38SIM User s Manual 2 2 5 Register variables Register variables are used for using the values of registers in an expression Precede the name of the register with to use it as a register variable Use the following format register name You can use the following registers A X Y S PC F Uppercase and lowercase letters are not unique in register names You can specify either 2 2 6 Memory variables Use memory variables to use memory values in expressions The format is as follows address data size You can specify expressions in addresses you can also specify memory variables The data size is specified as shown in the following table Byte length Word 2 byte length Thedefault data size is word if not specified Example 1 Referencing the contents of memory at address 800016 in bytes 8000h B Example 2 Referencing the contents of memory at address 800016 in w
109. ded the symbol file of this name is read The file attribute of the symbol file is sym You can also press Shift F 1 to open the File Selection dialog box for downloading files 1 Find the directory a cexpr8 695 fa 10300695 a 10900 695 a cexpr9 695 a 10400 695 a Test hex a 10100695 a 10500 695 a uelt hex zl cexpr5 695 el 0100 hex al 0600 695 E uplO1 mothex d 9 a cexpr6 695 fa t0200 695 fa 10700 695 fa uplO2hex 2 Doubleclick the file name a Z 2 expr 7 69 09 hex tga 08 9 aj upl02 mothe a 0300 6 x gt miewa rainen EEE 805 Vex Fies 805 ed geen _ Note If you download the file but the Program and Source Window does not switch to Source Program mode the file may not contain source line information Check the options that you specified when compiling assembling and linking 93 PD38SIM User s Manual To download only machine language data To download only machine language data select the following from the PD38SIM Window menu File gt Download gt Memory I mage The File Selection dialog box opens Select the HE X file or the 695 file then download the machine language data To download only symbol data To download only symbol data select the following from the PD38SIM Window menu File gt Download gt Symbol Select 695 file or sym file from the file Selection dialog box then download the symbol data When you download only symbol data only t
110. display area 1 3 1 3 Structure of Source Window in Disassemble Display M ode 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 Object code display area area Software breakpoint display setting area Program display area 39 PD38SIM User s Manual 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 PD38SIM 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 PD38SIM 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
111. 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 iano Eo eo eg A Displayed when the address is SP 108 Address display area Label display area Contents of memory display area Doubleclick 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 gt Debug gt Move or Option gt Debug gt Fill the start and end address of selected area are set in the MOVE or FILL Dialog Box 1 5 2 Memory Window Toolbar H ex button Displays data in hexadedmal default Bin button SJ IS button Refresh button Displays data in binary Displays data in SJ IS de Refresh display J 4 Bin Dec J Hex ASCII SIS TE Refresh Cache J IS button Displays data in J 1S code Dec button Displays data in dedmal ASCII button Cache button Displays data in ASCII code Use the cache of memory 43 PD38SIM User s Manual 1 5 3 Extended Me
112. duce in whole or in part these materials el 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 PD38SIM is a simulator debugger for Windows which simulates the 740 family operation of 8 bit microcomputer and evaluates the target program This user s manual describes the PD38SIM 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 PD38SIM program can only be used for the purposes of product development by the user and cannot be used for any other purposes Note alsothat the information in this manual does not convey any guarantee or license for the use of software MEMO
113. e Running script dialog box Execution of the script file stops before the next line 135 PD38SIM User s Manual To independently execute each command in a script file Click the Step button on the Script Window toolbar for step execution of the script A command is executed each time you click the Step button Click the Step button for step execution of the script file You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Script gt Step To close a script file Click the Close button on the Script Window toolbar Run Step Open Close Loz0n Loz0ft View Clear RecOn fied Click the Close button to close the script file You can also close a script file by selecting the following when the Script Window is active from the PD38SIM Window menu Option gt Script gt Close e fthescript files are nested the current script file is closed and the next higher level script file is opened To execute a script file on PD38SIM startup Specify the name of the script file to be executed on startup in the I nit dialog box which is displayed when you start PD38SIM MCU M38000 H Specify the name of the script file Init File Refer to be executed on startup TAB 1 82 8 Font FixedSys Size 11 Font Debug Information On Memory C On Demand Temp Dir C TEMP F Next Hide M Resume F
114. e Windows PD38SIM requires that the window to be operated on is active In addition to using the mouse to switch over the active windows by clicking on a desired window you can switch over the active windows from the keyboard To switch over the active windows from the keyboard enter the keys as follows Ctrl TAB Hold down the Shift key while you enter the above keys and the active windows will be switched over in reverse order 9 6 Displaying the Version of PD38SIM Select the following from the PD38SIM Window menu Help About The About dialog box which shows the PD38SIM version is displayed PD38SIM Version PD38SIM Ver 2 10 COPYRIGHT C 1998 1999 2003 RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION ALL RIGHTS RESERVED Press OK to close the About dialog box 143 PD38SIM User s Manual 9 7 To Configure the operation of the PD38SIM Select the following from the PD38SIM Window menu Environ gt Customize The Customize dialog box to configure the operation of the PD38SIM Customize M Open the confirmation dialog box when exit M Exit debugger when the error occurs k Display full path file name in Program Source Window F Try to change your selected display mode on the program window when stop Cancel Open the confirmation dialog box when exit Exit debugger when the error occurs Display full path name in Program Source Window
115. e cannot be found Can t find source file filename Specified source file was not found Use the PATH command or the Environ Path menu items to specify the directory containing the source file Can t find search string name The specified search string was not found between the starting position and end Line number of Source File filename is over Because the source file has more lines than can be displayed the file cannot be displayed in the Source Window Switch to disassemble display mode 238 Error Messages 300 Illegal endi filename line There is no if statement paired with the end statement 301 Illegal endw filename line There is no while statement paired with the endw statement 304 Can t find endi filename line There is no endi statement paired with the if statement 305 Line length is overflow filename line The number of characters exceeds the maximum permissible for one line B06 Neiva isoveriow fenametine OOOO Bor _ Cantfind Script File filename Jl eats read eels File EE Description isillegel filenameliney JL GE find endw filename line There is no endw statement paired with while Dee 311 The nest level exceeds the limit limit 313 ed break filename line a Can t add new watch point because it exceeds limit of watch point number Max number is num en There are no symbol information Load module file not loaded 239 PD38SIM User s Manu
116. e double clicking on the button you ve created 6 A dialog box for setting the action to be performed by the button like the one shown below will appear For this button action set one of virtual port input virtual interrupt or virtual port input plus virtual interrupt Set Button Dialog Input a butt Button Name Key SE Select Button Type Specify the action to be C Input C Interrupt R when you press the utton m Input Input the address to which Address virtual port is input Input data for virtual port Data input Interrupt Input the vector address of Vector virtual interrupt 180 Setting GUI Input Window 1 Assign the button a name Input your desired namein the Button Name column 2 Specify the action to be performed when you press the button in the Select Button Type column Choose Input for virtual port input Choose Interrupt for virtual interrupt Choose Input and interrupt for simultaneous generation of virtual port input and virtual interrupt 3 If you ve selected virtual port input enter the address to which you want data to be input and the data to be input in the Input column If you ve selected virtual interrupt enter the vector address of the virtual interrupt in the Interrupt column 7 Press the OK button in the dialog box Thus you ve finished creating and setting a button 8 Tocreate another button repeat steps 1 to 7 above 5 3 Saving Buttons You ve Cr
117. ea Address Address display area Input data display area Address display area It displays the memory address to which a virtual port is input Input data display area It displays the virtual port input data that has been set by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cyde count display area Cycle count display area It displays cycle counts 71 PD38SIM User s Manual 1 14 5 2 Screen structure for read access synchronized inputs When you ve set virtual port inputs that are synchronized to memory accesses for read a display screen configured as shown below will appear Input read Number of times j Read access count Address Read 1 2 3 4 5 D 7 8 9 display area 1000 10090 02 03 04 05 06 07 08 Address Read address display Input data display area display area area Address display area It displays the memory address to which a virtual port is input Read address display area It displays the address to be monitored for read access Input data display area It displays the virtual port input data that has been set by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the read access count of the data at which the cursor is positioned will be displayed in the read access
118. eated When you ve finished creating buttons you can save the data setup contents and layout of the buttons you ve created to a file GUI input file The saved GUI input file can be loaded into PD38SIM back again by using the menus Option gt Load Follow the procedure below to save the button data Choose the GUI Input Window menus Option gt Save or the Save button When selected the dialog box shown below will appear Save ButtonFile Save in fa 10_Samples x ei cel E File name inpanel btr Save as type Button Files btn x Cancel Here enter the directory and file names in which you want the button data to be saved When you ve input a file name press the Save button 181 PD38SIM User s Manual 5 4 Changing Button Position or Settings after Creating Button After creating buttons you can change their positions or setup contents 1 To change the position of a button Choose the GUI Input Window menus Option gt Set or the button Then point to the button whose position you want to be changed and click the left mouse button end GUI Input Window The button is placed in a selected state when you ve clicked as shown above When in this state hold down the left mouse button while you drag the button to a position where you want it 182 Setting GUI Input Window 2 Tochange the setup contents of a button Choose the GUI Input Window menus Option gt Set or the but
119. ebug gt Return To stop return execution Click the Stop button on the toolbar You can also stop return execution by selecting the following from the PD38SIM Window menu Debug gt Stop 106 Starting and Stopping Target Program Execution 2 4 Program Execution to Specified Location Torun the target program to the specified position known as Come Execution first click the line at which you want the program to stop in the program display area of the Program Source Window to specify the cursor position Note however that Come Execution cannot be carried out if the cursor is positioned on a line in which no software breakpoint can be set comment lines and data definition lines etc Line Address BRK Source 00001 section P 0002 org e000 00006 E001 a nop 00007 E002 nop 0008 E003 S nop l jmp loop D E004 Cursor position set by clicking the mouse To start Come execution click the Come button on the PD38SIM Window toolbar You can also press F 2 A laj zl Ziel sw pnw Click the Come button You can also start Come execution by selecting the following from the PD38SIM Window menu Debug gt Come To stop come execution Click the Stop button on the toolbar You can also stop Come execution by selecting the following from the PD38SIM Window menu Debug gt Stop 2 5 Resetting the Program
120. ecOn button in the Script Window toolbar Clicking RecOn opens the File Selection dialog box Specify the name of the file to be saved The default file attribute if omitted is scr Run Step Open Close Log0n Loz0ff View Clear RecOn Rec0fi Click RecOn to record the executed commands You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Record gt On The file list in the File Selection dialog box starts with files with the scr attribute However you can enter a full filename including the attribute directly into the filename input area to open a view file with an attribute other than scr To stop recording the executed commands To stop recording the executed commands dick the RecOff button in the Script Window toolbar Clicking the RecOff button make the commands saved file closed Run Step Open Close Log0n Loz0ff View Clear RecOn RecOff Click RecOff to stop recording the executed commands You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Record gt Off 134 Script Commands 7 3 Executing Script Commands in Batch Mode You can execute script commands in batches To do so use an editor to write the commands to be executed in a script file Script files take the scr attribute Script files are open
121. ecuted Address in the Interrupt Generation Timing column Next specify the executed address i e the address at which a virtual interrupt is generated when it is executed for Executed Address Then specify the vector adress of the virtual interrupt to be generated for Vector Address using hexadecimal numbers Then press the Next button Or press the Prev button here if you want to return to the previous dialog box A matrix dialog box for setting virtual interrupts will appear Setup Dialog Finds the previous data you ve set UP or the next data DOWN The setup example in this element specifies that virtual interrupt be generated when a specified address is executed 7 times Point to the desired element and click the mouse button The selected element is lt Prey Cancel marked by an asterisk In this dialog box set the virtual interrupts you want to be actually generated F ollow the procedure below to set virtual interrupts 1 Movethe mouse cursor to the cycles location called an element where you want a virtual interrupt to be generated then click the left mouse button Or you can scroll the screen to go to the desired location 2 The element is marked by an asterisk when you ve clicked Click at the same place again if you want the virtual interrupt you ve set to be canceled In this case the asterisk goes out 3 Repeat steps 1 and 2 as many times as the number of virtual interrupts to
122. ed from the Script Window Click the Open button on the Script Window toolbar When the file selection dialog box opens select the script file to be executed Run Step Open Clesse Log0n Log0ff View Clear RecOn Recor d Click the Open button to open a script file You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Script gt Open The file list in the File Selection dialog box starts with files with the scr attribute However you can enter a full filename including the attribute directly into the filename input area to open a script file with an attribute other than scr You can nest script files up to 5 levels When a script file is read in the command history display in the Script Window changes into the script file display To execute the contents of the script file as a batch click Run on the toolbar of the Script Window Batch execution starts and the script file is then closed after all the commands have been executed Run Step Open Close Log0n Loz0ff View Clear RecOn Rec if Click the Run button to execute all the commands in the script file in batch mode You can also select the following from the PD38SIM Window menu when the Script Window is active Option gt Script gt Run To stop execution of a script file Click the STOP button displayed in th
123. ed newly again PD38SIM User s Manual 4 2 Output Files PD38SIM outputs the following files 4 2 1 Intel HE X format Files The Intel HE X format files store machine language data These files which are saved using PD38SIM s upload function take the attribute hex Files saved in the Intel HEX format can be downloaded by PD38SIM 4 2 2 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 3 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 4 View File The view file is a text file that contains the contents of the script window In PD38SIM 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 5 Coverage 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 6 ASM Watch Point Data File TheASM 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
124. eeeeeeaaeees 98 1 9 Checking Source Programs in Other Directories 20 00 cecceeeeecseeeeeeeteeeeeteaeees 100 1 10 Mixing Source and Disassemble Displawvs 101 1 11 Displaying the Results of Disassemiltng 102 1 12 Changing Display ei Tei 103 2 STARTING AND STOPPING TARGET PROGRAM EXECUTION104 2 1 Starting and Stopping eee ete eee treet eee rete eee etc aee ee teaee ee teaaeeetteaaeeeete 104 2 2 Step EXECUTION EE 105 2 3 Returning from Current to Calling ROUtING cece eeene ee eeeteeeeeteaeeeetee 106 2 4 Program Execution to Specified Location 107 2 5 Resetting the Progra saae aaa EEN 107 3 CHECKING AND SETTING REGISTER DATA AND MEMORY CONTENTS 108 3 1 Checking the Contents of Rezsters cece eee eenee ee eeeneeeetetaeeeeeeeaaeeeeteaeeeetea 108 3 2 Changing the Contents of Registers ect teen eeeeeeeeeeteeaeeeeeeeaaeeetteaeeeete 109 3 3 Checking Changes in RAM During Target Program Exvectton 111 3 4 Checking the Value at a Specified Address AA 111 3S PO Ee eher LEE 114 3 6 Setting Data at a Specified Address 114 3 7 Updating the Memory Display 116 3 8 To change the acquisition mode of the memory eee ttetaeeeetee 116 4 SOFTWARE BREAKS 117 4 1 Opening the S W Break Point Setting Dialog BOX 0 00 eee eeeteeeeeeeeees 117 4 2 Setting a Break e Le iia dadintindintiaintiagadindadins 118 4 3 Deleting a Break Pont 119 4 4 Temporarily Disabling Break Ponts 119 4 5 Temporarily Enabling Break Ponts 120 4 6 Setting a Break Po
125. eeeesteeeeeeeeeeeeeeaeees 144 9 8 To Open the Editor ucede tendinitis 144 HIGH END DEBUGGING 145 1SETTING VIRTUAL PORT INPUTS IN I O WINDOW 147 L IER bebe selec atic ations 147 1 2 Setting Cvdezvpnchrontzedlnpute cece ee eeeeeeeeeeceeeeeeetaeeeeeteaaeeeeteaeeeene 147 1 3 Setting Read Access synchroniZed Input 150 1 4 SGettnglnterrupt zvnchrontzedlnputs 152 2 SETTING VIRTUAL PORT OUTPUTS IN I O WINDOW 156 2 OVEINVIEW twinned ie aide lac aac eine 156 2 2 Setting Virtual Port Outputs 2 0 0 cece eect ee eeeaeeeeeeeaeeeeeeeaaeeeeteaeeeeeeeaaeees 156 3 SETTING VIRTUAL INTERRUPTS IN I O WINDOW 158 ERR EE 158 3 2 Setting Cvclezwvnchrontzedlnterrupts eee e cece ee eeeneeeeeeecaeeeeteaeeeeeeeaaeees 158 Contents 3 3 Setting Executed Address synchronized lnterrupts 161 4 OTHER FUNCTIONS OF I O WINDOW 164 4 1 Changing Setup Data of Virtual Port Inputs and Virtual Interrupts 164 4 2 Deleting Virtual Port Inputs Virtual Port Outputs Virtual Interrupts or 1 O Script Files EE ddd dds eines 169 4 3 Changing Display Mode of Virtual Port Input Virtual Port Output or Virtual ug lee 174 4 4 Changing Scale of Display Screen 175 4 5 Changing Colors of Display Green NENNEN 176 4 6 Searching for Display Data 177 4 7 Listing Registered 1 O Script File 178 4 8 Regarding Evaluation Timings of Virtual Port Inputs Virtual Interrupts and I O Sieger SE 178 5 SETTING GUI INPUT WINDOW 179 DOVER VOW cei ee ek ena D st edited ee bebe kee
126. ement 1 else if conditional expression Statement 2 else Statement 3 When if conditional expression is true not 0 statement 1 is executed If the conditional expression is false 0 else if conditional expression is evaluated to see whether it is true or false If the conditional expression is true statement 2 is executed Otherwise statement 3 the else statement is executed The else if and else statements can be omitted The if statement can be nested in up to 32 levels Right side expressions can be used for the conditional expression The conditional expressions written in I O script are calculated as unsigned type Therefore if negative values are compared in an if statement the operation to be performed by PD38SIM is indeterminate 7 3 4 Repeat Statement while and break Statement Repeat statements judge the results of expressions thereby executing statements repeatedly The following shows a description format while conditional expression statement or break statement f the conditional expression is true the statement is executed repeatedly If the conditional expression is false program execution exits from the loop The while statement can be nested in up to 32 levels A break statement is used if it is necessary to forcibly exit the while statement If the while statement is nested program execution exits from the innermost loop Right side expressions can be used
127. en the respective formats Format 3 Use to stop program execution regardless of the value of the accessed data Format 4 Use to stop program execution according to the size of the accessed data Use to stop program execution according to the accessed data Enter the following to stop program execution when any data is written to address 3016 format 3 HardwareBreak 30 WRITE You can abbreviate WRITE to W Specify READ or R to stop program execution when data is read or RW when data is read or written Enter the following to stop execution when 1 bytes of data is written to address 3016 format 4 HardwareBreak 30 WRITE BYTE You can abbreviate BYTE toB If not specified the default size is BYTE This also applies to other formats Enter the following to stop program execution when a value of 5016 is written to 3016 format 5 HardwareBreak 30 WRITE 50 As with other formats is assumed if data is specified for comparison but no condition is specified This also applies to other formats Enter the following to stop program execution when a value of 5016 or more is written to 3016 format 5 HardwareBreak 30 WRITE 50 gt 220 Table of Script Commands CoVerage CV Coverage Measurement Use the coverage measuring function to check addresses accessed during execution The coverage measurement function is realized using the CoVerage CV script command F or details of using script com
128. en the result of calculation is a function type the starting address is displayed in hex as follows void main OxF000 all Radices 3 2 6 Reference Types When the result of calculation is a reference type the reference address is displayed in hex as follows signed int amp ref 0xD038 all Radices 3 2 7 Bit Field Types When the result of calculation is a bit field type it is displayed as follows unsigned int 13 s f 8191 when Radix is in initial state unsigned int 13 s f Ox1FFF when Radix is hex unsigned int 13 s f 1111111111111B when Radix is binary 3 2 8 When No C Symbol is Found Ifthe calculated expression contained a C symbol that could not be found it is displayed as follows x lt not active gt all Radices 3 2 9 Syntax Errors When the calculated expression contains a syntax error it is displayed as follows str p lt syntax error gt all Radices where st r p is the syntax error 236 C Expressions 3 2 10 Structure and Union Types When theresult of calculation is a structure or union type the address is displayed in hex as follows Data v 0x1234 all Radices If as in structures and unions the C expression consists of members a is displayed to the left of the type name tag name indicating structure or union Add struct cl str Ox41E struct a str 0x40E unsigned long b 15 signed int c 10 u
129. ent below if sread 0x800 becomes true 1 if memory at address 0x800 had been accessed for read immediately before the if statement was evaluated 4 iswrite expression Format swrite address Function The value of the expression becomes true 1 immediately after a specified memory address is accessed for write to write data to memory Otherwise the expression is false 0 For example the if statement below if Aswirte 0x800 becomes true 1 if memory at address 0x800 had been accessed for write immediately before the if statement was evaluated 7 5 Method for Writing Left side Expressions Left side expressions can be written in memory addresses and macro variables of the set statement in I O script statements The following shows an example of an I O script statement using left side expressions set 0x2 Oxla set val 10 7 5 1 Composition of Left side E xpressions Left side expressions may be composed of the following Macro variable Memory variable Each part of left side expressions are described below 203 PD38SIM User s Manual 7 5 2 Macro Variables Macro variables are used by adding at the beginning of each variable name Variable names following the percent character may consist of alphanumeric characters and underscore _ However numbers cannot be used at the beginning of macro variable names The values that can be handled by an expression that is substituted f
130. er data 12 s 8 s s HAW Break Point P Label Addr Cnt Size Data Type Cp 8 Click the Add button 7 DE 002 BYTE 0012 READ i zc E 002 BYTE vun READ RECH main OBDOB 001 vn san FETCH Del All Close 9 Click the Close button 124 Hardware Breaks To break when the specified data or greater is written to the specified address The following example shows how to break when the specified data 5616 or greater is written to address AE 40 Make the following settings in the H W Break Point setting dialog box 1 Select Enable C Disable Enable 2 Enter address 4E 40 Address de 40 Pass Count i 3 Select Write gt Access Type write Length Bre P Data Compare 4 Deselect Not Specify T Not Specify Data 56 6 Select gt Se SC HAW Break Point Label Addr Cnt Size Data Type Dm O4E4B 005 BYTE 0012 WRITE D O4E4D 002 BYTE 0012 READ SC O4E4F 002 BYTE va READ Del All OBDOB 001 zt ar FETCH Daal Close lt 5 Enter data 56 7 Click the Add button 8 Click the Close button To disable a hardware break The following shows how to disable a hardware break Make the following settings in the H W Break Point dialog box 1 Select Disable gt e i Enable Address Pass Count 1 Access Type Read Length Byte Si Data Compare k Not Specify Date c cbk
131. ers can be input The radix of numerals is discriminated by a symbol added at the beginning or end of a numeric value OxAB24 1234 10010 200 1 0 Script Function 7 4 3 Symbols and Labels The global symbols and global labels defined in the target program can be used Symbol and label names may consist of alphanumeric characters underscore _ period and question mark However numbers cannot be used at the beginning of symbol and label names Symbol and label names can be written in up to 255 characters Symbol and label names are discriminated between uppercase and lowercase letters The structured instructions pseudo instructions macro instructions and reserved op code words of assembler sra74 cannot be used in symbol and label names These for example include SECTION BYTE switch and if Character strings that begin with cannot be used in symbol and label names 7 4 4 Macro Variables Macro variables are used by adding at the beginning of each variable name Variable names following the percent character may consist of alphanumeric characters and underscore _ However numbers cannot be used at the beginning of macro variable names Register names cannot be used in variable names Variable names are discriminated between uppercase and lowercase letters Up to 32 macro variables can be defined Once defined the macro variables remain effective until PD38SIM is terminated 7 4 5 Memory
132. ertain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electro
133. ete Virtual Port Input Todelete virtual port outputs that have been set choose Delete Virtual Port Output Todelete virtual interrupts that have been set choose Delete Virtual Interrupt Todeete l O script files that have been set choose Delete I O Script File When you ve selected one follow the procedure below to delete 169 PD38SIM User s Manual 4 2 1 Deleting Virtual Port Input After selecting Delete Virtual Port Input press the Next button to bring up the dialog box shown below Delete Dialog 0000 First choose the type of virtual port input you want to be deleted in the Data Input Timing column When selected the currently set virtual port inputs are listed in the Select Data column Here choose the virtual port input you want to be deleted Then press the Delete button Or press the Prev button here if you want to return to the previous dialog box Thus the virtual port input is deleted Press the Close button to close the dialog box 170 Other Functions of 1 0 Window 4 2 2 Deleting Virtual Port Output After selecting Delete Virtual Port Output press the Next button to bring up the dialog box shown below Delete Dialog 0090 Here choose the virtual port output you want to be deleted Then press the Delete button Or press the Prev button here if you want to return to the previous dialog box Thus the virtual port output is deleted Press the Close button to close the
134. ettings Custarize Open Custavizedialog box 1 1 3 5 Debugging Basic The Debug menu in PD38SIM contains the items for basic debugging such as starting and stopping and one step execution of the target program Go Start target program Go Run from current program counter Go Option Run from specified address Step execution Execute one step Step Option Execute specified No of steps Over step execution E xecute one over step Over Option Execute e ified No of over steps be penneu raun tomoren suran Break Point Set break point SMW Break Point Open S W Break Point Setting dialog box F 7 HAN Break Point Open H W Break Point Setting dialog box Shift F 7 Break Set cancel software break at cursor Reet bestens SiC s fso target proram OoOo EREECHEN e SCS take Maketarget program 30 Window function of PD38SIM 1 1 3 6 Debugging Option The extended menus in PD38SIM contains the items for operating the various PD38SIM 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 Option This menu contains the extended menus for the various PD38SIM windows 1 1 3 7 Window Operations The BasicWindow menu has assigned to it the menus which among PD38SIM functions are used to control the display mode of each window provided by PD38SIM and to open the basic
135. fied address SBDA SBE specified address SBEA specified line No specified function 215 PD38SIM User s Manual 1 2 8 Hardware Break Setting Commands Command format HardwareBreak HB 1 HardwareBreak 1 Reference hardware break point 2 HardwareBreak address 2 Set hardware break point READ WRITE RW FETCH I passes See Supplementation LU BYTE reference data explanation of Script comparison condition Commands for details HBC specified address HBCA 2 BreakMode ON OFF 2 Set hardware break mode 1 2 9 Coverage Measurement Commands Command format CoVerage CV 1 Coverage 1 Check starting address for displaying the 2 Coverage LOCAL start address end address results of coverage measurements 3 Coverage GLOBAL start address end address 2 Display results of coverage measurements 4 Coverage TOTAL start address end address in 1 byte units 5 Coverage FUNC 3 Display results of coverage measurements 6 7 Coverage CLEAR in 4 byte units Coverage DISP starting address for displaying 4 Display results of coverage measurements as percentages 5 Display results of coverage measurements of sub routines as percentages 6 Initialize memory for coverage measurements 7 Set starting address for displaying the results of coverage measurements See Supplementation explanation of Script Commands for details
136. file name or single clicking on it in the file list press the lt Open gt button or double dck on the file name in the file list Coverage information will be loaded from the specified file into the computer 206 Customize Function 9 Customize F unction 9 1 About Customize F unction The Customize F unction allows you to add your own original functions to PD38SIM By loading custom command and custom window programs to PD38SIM you can extend the standard functions of PD38SIM To create custom command and custom window programs A special software called CB38SIM Custom Builder for PD38SI M is induded with PD38SIM Use it to create custom command and custom window programs The custom command and custom window programs created with CB38SIM can be made available to use by registering them to PD38SIM using a MACRO command For details on how to create custom command and custom window programs refer to the CB38SIM User s Manual To use custom window programs There are two methods to show in the following to use the custom window made with CB38SIM Register the custom window in the menu and open from the menu Register the custom window with the MACRO command and open with the MACRO command Show the way of registering to the menu in the following Refer to the following To use custom command and custom window programs for the registration with the MACRO command and the open PD38SIM User s Manual
137. g Box Version Information Sim38 PD38SIM simulator engine as Ge D Sims8 i Version 1 20 00 COPYRIGHT C 1998 1999 2003 RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION ALL RIGHTS RESERVED Application Information Option Interface CONNECT V Auto exit MCU Status Communications connection status sim38 version information OK button Simulator MCU Status RUN STOP Auto exit switch setting Exit button 23 PD38SIM User s Manual 1 4 3 Setting Up Auto Exit Switch Setting Check the Auto exit checkbox to automatically exit sim38 when you exit pd38sim Communications Connection Status CONNECT is displayed when connected to pd38sim 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 E xit button Exits sim38 Note that you cannot exit sim38 while connected to pd38si m 24 Window function 26 Window function of PD38SIM 1 Window function of PD38SIM 1 1 The PD38SIM Window The PD38SIM Window is the main window for PD38SIM 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 PD38SIM Window Screen Configurati
138. generated for Vector Address using hexadecimal numbers Then press the Next button Or press the Prev button here if you want to return to the previous dialog box 159 PD38SIM User s Manual A matrix dialog box for setting virtual interrupts will appear Setup Dialog Finds the previous data you ve set UP or the next data DOWN Up Down Mamie DEE ECTS A ERR eRe St aetna The setup example in 0 1 a ne er ae a a this element specifies E aie E WW that virtual interrupt e Wd i i eee i d dd be generated at the SE Ne ne 1000 NN 10090 Point to the desired element and dick the mouse button The selected element is marked by an asterisk lt Prev Next gt Cancel Next gt In this dialog box set the virtual interrupts you want to be actually generated Follow the procedure below to set virtual interrupts 1 Movethe mouse cursor to the cycles location called an element where you want a virtual interrupt to be generated then click the left mouse button Or you can scroll the screen to go to the desired location 2 The element is marked by an asterisk when you ve clicked Click at the same place again if you want the virtual interrupt you ve set to be canceled In this case the asterisk goes out 3 Repeat steps 1 and 2 as many times as the number of virtual interrupts to be generated When you finished setting all virtual interrupts press the Next button
139. he Program Window is active in the PD38SIM main display area the Option menu contains the following items 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 LineAssarbe Open LineAsserbledialog Coverage Set Coveragemeasurement On Off Turn on off Measurenent result Clear Initializecoveragemeasurement result Refresh Updatedisplay of coveragemeasurement result 37 PD38SIM User s Manual 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
140. he symbol data from the file 695 is read To reload a file When downloading a previously downloaded file again PD38SIM allows you to download it without having to specify its file name Toreload a file choose the PD38SIM window menus File gt Reload The file is reloaded when these menus are selected When using IAR C compiler 1CC 740 It is necessary to make the EEE 695 absolute format file specifying the option when compile and linking Please refer to the release note of PD38SIM for details SI Loading and Displaying the Target Program 1 2 To Reload the recent downloaded file The recent downloaded files maximum files of 4 are listed in the PD38SIM Window menu File To reload the file select the file name listed PD38SIM C Usr mina PD PD38sim Sam E File Edit View Environ Debug Option Download Reload Upload Auto DownLoad Save Disasm 1 C Sample GOLABS rc Golab hex 2 C Sample SRC M38000 hex Exit 7 Note If the length of the file name with path is more than 25 characters the display of the upper directory is abbreviated 1 3 To download the target program automatically when updated If the target program is updated when a command executing the target program it can De downloaded automatically To select the PD38SIM Window menu File gt AutoDownLoad the AutoDownLoad dialog box open You can specify this function in thi
141. hin the file in which they are declared The effective range of local label symbols is known as the scope which is measured in units of object files files with the r74 attribute The scope is switched in PD38SIM in the following circumstances When a command is entered The object file that includes the address indicated by the program counter becomes the current scope When the SCOPE command is used to set the scope the specified scope is the active scope 226 Writing Script Files During command execution The current scope automatically switches depending on the program address being handled by the command Note 2 Priority levels of labels and symbols The conversion of values to labels or symbols and vice versa is subject to the following levels of priority Conversion of address values 1 Local labels 2 Global labels 3 Local symbols 4 Global symbols 5 Local labels outside current scope 6 Local symbols outside current scope Conversion of data values 1 Local symbols 2 Global symbols 3 Local labels 4 Global labels 5 Local symbols outside current scope 6 Local labels outside current scope e onversion of bit values Global bit symbols C 1 Local bit symbols 2 3 Local bit symbols outside current scope 2 2 4 Macro Variables Macro variables are defined by assign statements in the script file See Section 2 1 Structural Elements of a Script File in the Reference part for details Prece
142. in register information a file No Error Message Notes and Action 11000 Address value is out of range ECH 11001 The save file name filename is wrong ee 245 PD38SIM User s Manual 2000 Kaes 22001 Cant aetetemporerye JL 22002 Cant open cata fle Cleran JL 2003 frestarase O o 22004 The Output fleofthesameaiesdyses OOOO OOOO 2005 Datanctfound SSCS 22006 Thestarqelelargerthantheandode JL 22007 The Output port aireaays JL 22006 Thereis nodtain theinputile JL e a 246 Error Messages No Error Message Notes and action 25000 cantfind line o o O 25001 cantfind line O 25002 cantfind dino O 25003 Symbol isnt defined line symbol 25004 cantfind liney le 25005 Description of expression is illegal line token 25006 Net level of the if statement is overflow line 25007 Nest level of the while statement is overflow WEN line 25008 Too many the break statement line PO 25009 Thereis no if statement corresponding to the else statement line 25011 at open the filename file pO 25012 The filename file is not a file made in the 1 O window 25013 The description of the memory variable is illega line 0000 cant open ile fienamey Jl 30001 cant aeatefie tenme Jl 30002 cant dosefile flename OOOO 30003 iesst error Gn filename O SSS EE 30005 Le le format flenamey le 0006 lout afheapsmace le 30007 Not yetimperented data Jl 247 PD38SIM User
143. int from Program Source Window 120 4 7 Setting Breakpoints from the Toolbar cece eceeeeeeeeeeeeeeeeaeeeetesaeeeeeeeaaeees 121 4 8 Saving BreakPoint 0 0 eee eeeeeceeeeeeeeeeceeeeeeeeeeeeeaeeeeeeaaaeeeeagaaeeeeeaaeeeeeenaaeeeeenaaeees 121 4 9 Loading Breakponte eee caeeeeeecaeeeeeeeaaeeeeeeaaeeeecaaeeeesecaaeeeeneaaeees 121 5 HARDWARE BREAKS 122 5 1 Opening the HW Break Point Setting Dialog Box 122 PD38SIM User s Manual 5 2 Setting Hardware Breakpoint 0 00 cccceceecceee eee eeee eee eeecaeeeeteaeeeeeeeaaeeeeneeaeeeete 123 5 3 Deleting a Hardware Breakpoint ssssssesssserrssssrrsserinnssrinnsstinnnsrtnnnsnnnnsrnnn n 126 6 CHECKING C VARIABLES 127 6 1 Checking C Varlables acnnacnnecinnannnennieiitdedededdadedands 127 6 2 To change the value of a C variable cece eeeeceeeeeeeeaeeeeeeeaaeeeeteaeeeete 130 7 SCRIPT COMMANDS 131 7 1 Executing Script Commande 131 7 2 Logging the Results of Executing Script Commende AA 132 7 3 Executing Script Commands in Batch Mode A 135 8 EXITING PD38SIM 137 S T Exiting KEREN 137 9 MISCELLANEOUS 138 Oil Ea EE 138 92 Starting Up Makers EE 140 9 3 Searching for Character Strings in Target Program 141 9 4 Changing Window Proporttons eee eeee eee eeecaeeeeeeaeeeeeeeaaeeeeneeaeeeete 142 9 5 Switching Over Active Windows 143 9 6 Displaying the Version of PD38SIM ssssesssssssssssssrrsssrrnsssrinrssrirnssrrnnssrnnssrrn 143 9 7 To Configure the operation of the PD38S1M o oo eeceeeeeeee
144. ize Data Type Dm main OBDOB 001 zz KKK FETCH Aiet 5 Click the Add button ba y All Closet 6 Click the Close button 123 PD38SIM User s Manual To break when the specified data is read from the specified address The following example shows how to break when the specified data 12 6 has been read twice from address 4E 4D Make the following settings in the H W Break Point setting dialog box 2 Enter address 4E 4D 3 Select Read 5 Deselect Not Specify 7 Select HAW Break Disable Enable 1 Select Enable Pass Count 2 4 Enter a pass count of 2 Length Byte 5 Data Compare Not Specify Data 12 6 Enter data 12 o e CR HAW Break Point 7 7 Label Addr Cnt Size Data Type De 8 Click the Add button ac O4E4F 002 BYTE xx READ De main OBDOB 001 mx ps FETCH Ee Del All Close 9 Click the Close button To break when data is written to the specified address The following example shows how to break when the specified data 12 6 has been written five times to address AE AB Make the following settings in the H W Break Point setting dialog box 2 Enter address 4E 4B 3 Select Write 5 Deselect Not Specify 7 Select HAW Break Disable e Enable 1 Select Enable Address edb Pass Count 5 4 Enter a pass count of 5 Access Type write Length wie F Data Compare r Not Specify Data 12 6 Ent
145. k Point Setting dialog box by selecting the following from the PD38SIM Window menu Debug gt Break Point gt S W Break Point See Section 1 18 S W Break Point Setting Dialog Box in the Introduction for the structure of the SW Break Point Setting dialog box 117 PD38SIM User s Manual 4 2 Setting a Break Point To specify an address as a break point In the S W Break Point Setting dialog box specify an address or label in the Address field as follows 2 Specify the address Load Save 1 Click the Address button e Address f 3 Click the Add button Filename R for We E ees H A Click the Close button SAW Break Point SE ECH Del All Enae All Enable Digable To specify a line No as a break point In the S W Break Point Setting dialog box specify a filename and a line No as follows 1 Click the Filename button 2 Specify the filename 3 Specify the line No 4 Click the Add button Filename demo c 5 Click the Close button SAW Break Point BDIA L 40 demo c BD20 42 demo c Enae All Enable Disable All Disable 118 Software Breaks 4 3 Deleting a Break Point In the S W Break Point Setting dialog box delete the break point as follows Load Save CAddess Add Filename demos Refer is o 3 Click the Close button SAW Break Point BDIA demo c 2 Click the Del butt
146. lected by clicking in the software breakpoint display area Y ou can also enable and disable software breakpoints by double clicking on them 87 PD38SIM User s Manual 1 18 2 Entries in List of Software Break Points BD1A 40 demo c Filename for break address Line No at break address Break address Indicates if break point is enabled disabled enabled e fthereis no source line etc for the address only the address is displayed 88 Window function of PD38SIM 1 19 H W Break Point Setting Dialog Box The HW Break Point Setting dialog box allows you to set hardware break points Hardware breaks are effected when data is written to or read from memory or an instruction is fetched from memory 1 19 1 Structure of H W Break Point Setting Dialog Box H W Break Point Address setting area Access condition setting area Check if no data comparison is to be performed Hardware breakpoint display area HAW Break amp Disable scis Address dedd Pass Count 1 Wi Access Type Read H Lenath Byte Data Compare T Not Specify Data 20 se l CR CRW C C lt 4 HAY Break Point Label Addr Cnt Size Data Type Cmp gc O4E4F 001 BYTE ag WRITE Del OBDOB 001 kkk ax FETCH HAN break enable disable area Pass count setting area Comparison data setting area Comparison condition setting area Add breakpoint button Clear specified breakpoint bu
147. les Figure 3 1 Method for measuring cycles 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 PD38SIM User s Manual 3 1 2 Peripheral 1 0 No peripheral I Os such as timers and serial I O in the actual chip are supported Only the CPU core is supported Consequently PD38SIM handles the SFR area to which peripheral I Os are connected simply as RAM However the CPU Mode Register s stack page select bit and the Interrupt Control Register each are handled as SFR For details about each register location refer to the user s manual of your chip When the stack page select bit is set to 1 one page of RAM can be used as a stack area When a bit of the Interrupt Control Register is set to 1 the corresponding interrupt of that bit is enabled Moreover a method is provided that allows you to accomplish interrupts e g a timer interrupt and data input to SRF or other memory by simulating these operations without having to actually execute them For details about this method refer to the virtual port input output and virtual interrupt functions described later in this manual 3 1 3 Memory Space Processor mode is not supported The entire 64 KB of memory space from 000016 to FF FF 16 is alloca
148. lick Down to search the program forwards irection Up Down or Up to search backwards 5 Click Find Next to start the search 2 Check here if you want to differentiate between uppercase and lowercase letters 141 PD38SIM User s Manual 9 4 Changing Window Proportions You can change the proportions of the Program Window Source Window Memory Window and ASM Watch Window using the mouse as described below Program Window and Source Window When in disassemble display mode you can change the relative proportions of the object code display area lt Objcode gt and the two parts lt Label gt and lt Mnemonic gt of the Program display area Drag to resize BRK Objicode Labe Mnemonic 4D1301 Ip LDA 0113H 13 CLC Memory Window You can change the relative proportions of the label display area lt _ABEL gt and the memory content display area lt DATA gt Drag to resize Address LABEL ATA US 00 lt 007C 03 ASM Watch Window You can change the relative proportion of the expression display area xpr gt Drag to resize Addr Bit Expr z Rdx Data 0100 DATAI B Hex Oro eDATA2 B Hex Coverage Window You can change the relative proportion of the Function me display area Lt unction gt Drag to resize Funet ion Start H _main DOT OP DOE _demo_two OOBDIA OOE 142 Miscellaneous 9 5 Switching Over Activ
149. llowing items EE SEELEN za st ote aa Set layout ater Turn on off line No area Addres Area Turn on off address area 86 Window function of PD38SIM 1 18 S W Break Point Setting Dialog Box The S W Break Point Setting dialog box allows you to set software break points Software breaks stop the execution of instructions immediately before the specified break point You can also enable and disable each of those break points 1 18 1 Structure of S W Break Point Setting Dialog Box Loads a breakpoint Saves a breakpoint information file information file S W Break Paint Field for specifying a break address if specifying an address Adds a break point Da Filename enz e Searches for filename Fields for specifying filename line No line Closes dialog box if specifying filename line No Deletes specified break point Deletes all break points eE Enables specified break point All Enable Enables all break points Disable Disables specified break point Disables all break points Area for setting software break points You can set up to 64 software break points in PD38SIM Ifyou have set multiple software breakpoints program execution stops when any one software break address is encountered OR conditions You can continue to set software breakpoints until you click the lt Close gt button to close the S W BreakPoint setting dialog box You can clear enable or disable software breakpoints se
150. lumn Next enter an address for virtual port input in the Input Address column the address to which you want data to be input using a hexadecimal number Then enter the address to be accessed for read to read data from memory in the Read Address column Virtual port inputs are executed when the memory address you ve specified here is accessed for read Then press the Next button Or press the Prev button here if you want to return tothe previous dialog box A matrix dialog box for setting the virtual port input data will appear Read access counts Setup Dialog Finds the previous data you ve set UP or the next data DOWN The setup example in this element specifies that data 0x90 be set when memory is accessed for read 9 times Double click on an element you want and set the desired input lt Prev Cancel In this dialog box set the data you want to be actually input to memory F ollow the procedure below to set data 1 Move the mouse cursor tothe read access counts location called an element where you want data to be set then double click the left mouse button Or you can scroll the screen to go to the desired location 2 Input data in the selected place using a hexadecimal number The data size that can be input is one byte from 0x0 up to OxF F 3 Repeat steps 1 and 2 as many times as the number of data you want to set When you finished entering all data press the Next button
151. m the menus or click the right mouse button on the FLG line and select Layout gt gt Hide FLAGs The radix in the flag item will not change NUVI TI BID 1 ZIL 00000100 Flag register item The name of the currently set flag is displayed The radix item does not appear in the pop up menu displayed over the register window e Toadjust column width The width of each of the Name Value and Radix columns in the register window can be adjusted Drag the separator to do so Also double clicking on the separator will automatically adjust the width to the length of the longest character string 110 Checking and Setting Register Data and Memory Contents 3 3 Checking Changes in RAM During Target Program Execution Use the RAM monitor function to check changes in the contents of memory while the target program is running Check the changes in memory during execution using the RAM Monitor Window To open the RAM Monitor Window select the following from the PD38SIM Window menu Basic Window gt RAM Monitor Window See Section 1 7 RAM Monitor Window in the Window Functions for details of the RAM Monitor Window To change the RAM monitor area PD38SIM has a 1KB RAM monitor area which by default is mapped to 0 to 3F F16 If you want to check another area you must change the RAM monitor area To do so click the Area button on the toolbar in the RAM Monitor Window or make sure the RAM Monitor Window is acti
152. m window programs registered to PD38SIM by a MACRO command use a DELMACRO command by specifying the registered file name of the program not including the extension in it or a DELMACROALL command When using a DELMACRO command only the specified custom command or custom window program is deleted When using a DELMACROALL command all of the registered custom command and custom window programs are deleted Example gt DELMACRO custom lt RET gt gt DELMACROALL lt RET gt 209 PD38SIM User s Manual To set the search directory of custom command and custom window programs The custom command and custom window programs registered by a MACRO command are loaded into PD38SIM when they are executed The custom command and custom window programs to be loaded are searched for from the directory that has been set by a MACROPATH MPATH command Only one directory can be specified by a MACROPATH MPATH command Example gt MACROPATH c usr project custom lt RET gt 210 Customize Function The open of custom window The menu to open the custom window when it is registered is added SSS SSS Sei w OptionalWindow Help 10 Window GU Input Window Ei GUI Output Window Coverage Window Custom Window Option 1 Choose the custom window to v 1 Program Window reg win open The custom window can be opened when the custom window is chosen with the custom window launcher dialog and it clicks on the Run button
153. mands see Section 7 1 Executing Script Commands in the Basic Operation part Input format Format 1 CoVerage Format 2 CoVerage LOCAL GLOBAL TOTAL TL starting address ending_address Format 3 CoVerage FUNC Format 4 CoVerage CLEAR Format 5 CoVerage DISP starting address for displaying the results of coverage Function The coverage function records addresses that have been accessed during execution of the target program CO coverage Torun coverage measurement and log access details Run the target program See Section 2 1 Starting and Stopping in the Basic Operation for details To check accessed addresses Use formats 2 and 3 You can check addresses from 000016 to F FF F 16 Enter the following to check the results of coverage measurements between address 800016 and 8F F Fiein 1 byte units format 2 CoVerage LOCAL 8000 8FFF Enter the following to check the results of coverage measurements between address 800016 and 8F FFisin 4 byte units format 2 CoVerage GLOBAL 8000 GEFF Enter the following to check the results of coverage measurements between address 800016 and 8F FF ie displayed as a percentage format 2 CoVerage TOTAL 8000 8FFF Enter the following to check the results of coverage measurements displayed as percentages of subroutines functions format 3 CoVerage FUNC To initialize the previous results of coverage measurements Use format 4 Enter the following to initialize
154. move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area Cycle count display area It displays cycle counts 69 PD38SIM User s Manual 2 Graphic mode displayed in units of bytes The virtual port input that has been set is displayed in graphic mode in units of Input cycle Cycle 0000000048 Data 0x40 R ESOU HERR HERE A ede aii display area t Address display area Input data display area Address display area It displays the memory address to which a virtual port is input Input data display area It displays the virtual port input data that has been set in graphic mode The peaks in this graph represent data values derived by equally dividing the height of the data displaying area by 255 maximum value of 1 byte data The short white lines appearing at the bottom of the input data display area indicate points at which data are input To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cyde count display area Cycle count display area It displays cycle counts 70 Window function of PD38SIM 3 Hexadecimal mode The virtual port input that has been set is displayed in hexadecimal mode Inout cycle E Cycle EA Data 0x20 Cycle count display ar
155. n File The register information file which is named PD38SIM rdf contains information of MCU registers register name and size etc PD38SIM 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 fileis supplied with PD38SIM 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 PD38SIM This file which is supplied with PD38SIM takes the attribute hlp PD38SIM Input and Output Files 4 1 7 Environmental Setup File The environmental setup file which is automatically generated by PD38SIM and cannot be directly created or edited by the user stores information about the environmental setup of PD38SIM The filename is pd38sim ini The environmental setup file is saved to the Windows directory the directory in which you have installed Windows 4 1 8 SFR File This file contains the information inherent tothe target MCU The SFR fileis included with product The file name is M 3xxxx SFR 4 1 9 Coverage 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 TheASM watch point data file
156. n also select the following from the PD38SIM Window Option gt Mode gt Source Mode Note If the macro definitions include a program counter value the yellow line indicating the PC value may not be displayed 101 PD38SIM User s Manual 1 11 Displaying the Results of Disassembling To display the results of disassembling click the DIS button on the Program or Source Window toolbar You can also select the following from the PD38SIM Window menu Option gt Mode gt Disasm Mode The display mode can only be changed in the active window button Switches to source display mode DiS button Switches to disassemble display mode button Switches to MIX display mode If when the target program stops the program counter is in an area with no source line data the Program Window automatically switches to disassemble display mode Torevert from disassemble display to source program display mode Click the SRC button on the Program or Source Window toolbar You can also switch to source program display mode by selecting the following from the PD38SIM Window menu Option gt Mode gt Source Mode Torevert from disassemble display to MIX display mode Click the MIX button on the Program or Source Window toolbar You can also switch to source program display mode by selecting the following from the PD38SIM Window menu Option gt Mode gt MIX Mode
157. n below will appear Before data Next data When you choose Before data here data is searched backward from the position you ve specified by clicking the mouse button If you choose Next data here data is searched forward from the position you ve specified by clicking the mouse button 4 7 Listing Registered I O Script Files The registered I O scrip files can be listed on the screen For details about I O script files refer to Chapter 7 I O Script Functions The following shows how to list Click here and I O script files will be listed VO Script File 40150160170180 Ginn e 4 8 Regarding Evaluation Timings of Virtual Port Inputs Virtual Interrupts and I O Script Files Set The virtual port inputs virtual interrupts and I O script files you ve set are evaluated at the following timings Evaluation timings When program is executed continuously when come is executed When program is single stepped When program is overstepped When control is returned Processing when program is reset The virtual port inputs virtual interrupts and I O script files that you ve set are reevaluated Namely when a program is reset the virtual port inputs virtual interrupts and I O script files you ve set are set newly again Processing when 1 0 Window is closed If the I O Window is closed the virtual port inputs virtual interrupts and 1 0 script files that you ve set are not evaluated This case is the same a
158. ncel Ned gt First choose Interrupt in the Data Input Timing column Next enter an address for virtual port input in the Input Address column the address to which you want data to be input using a hexadecimal number Then enter the vector address of a virtual interrupt that signals timing for virtual port input in the Vector Address column Or press the Prev button here if you want to return to the previous dialog box 153 PD38SIM User s Manual A matrix dialog box for setting the virtual port input data will appear Virtual interrupt counts Setup Dialog Finds the previous data you ve set UP or the next data DOWN The setup example in this element specifies that data OxFF be set when virtual interrupt occurs 7 times Double click on an element you want and set the desired input value in it lt Prev Cancel In this dialog box set the data you want to be actually input to memory F ollow the procedure below to set data 1 Move the mouse cursor to the virtual interrupt counts location called an element where you want data to be set then double click the left mouse button Or you can scroll the screen to go to the desired location 2 Input data in the selected place using a hexadecimal number The data size that can be input is one byte from 0x0 up to OxF F 3 Repeat steps 1 and 2 as many times as the number of data you want to set When you finished entering all
159. ndow Help S S Asia ziel zial LG gram Window demot cl View SRC MIX DIS WW ale p void gpary2func void amp gcaryL0 amp sucary 0 amp gscaryl0 amp gshoaryL gcpary2 0 gucpary2 gscpary2 gshopary2 gipary2L0 oOo O O O O S DlO O O o Oo SS es ae P amp guiary amp glary 0 3sularyl0 The value of amp sfary 0 the rae C variable is Scary S displayed gulpary2L efpary2L0 edpary2L0 gldpary2L WoW htt Scojclololoio Ready MCU STO 5 127 PD38SIM User s Manual 6 1 2 Checking C Variables in Cwatch display PD38SIM has four windows for checking the C variables declared in the target program Local Window File Local Window Global Window C Watch Window The Local Window displays the values of variables that are valid only within a function To open the Local Window select the following from the PD38SIM Window menu Basic Window gt C Watch Window gt Local Window The File Local Window displays the values of variables that are valid only within the file To open the File Local Window select the following from the PD38SIM Window menu Basic Window gt C Watch Window gt File Local Window The Global Window displays the values of global variables To open the Global Window select the following from the PD38SIM Window menu
160. nics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics tENESAS C 7 D me d lt D D M3T PD38SIM V 2 10 User s Manual Simulator Debugger for 740 Family Renesas Electronics com Rev 1 00 2003 05 www renesas co e Microsoft MS DOS Windows and Windows NT are registered trademarks of Microsoft Corporation in the U S and other countries e IBM and AT are registered trademarks of International Business Machines Corporation e Intel and Pentium are registered trademarks of Intel Corporation e Adobe Acrobat and Acrobat Reader are trademarks of Adobe Systems Incorporated e 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
161. nsigned char 10 d 0x414 aaaaaaaaaa signed int signed int x z signed int k 18951 signed int j 10 signed int i 10 H You can double click on lines indicated by a to see the members of that structure or union The changes to a while the members are displayed To return to the original display double click the line now indicated by the This function allows you to check the members of structures and unions 3 2 11 Register Variables When the result of calculation is a register variable register is displayed to the left of the type name as follows register signed int j 100 237 PD38SIM User s Manual 4 Error Messages The following tables list the PD38SIM error messages T Can t open more name window The maximum number of the specified window is already open Can t Create name window Cannot open the specified window There may not be sufficient memory Quit other applications or increase memory 152 Can t open name window when the target Stop the target program then open the program is running window 153 Value is out of range The specified address exceeds the MCU s maximum address isa senges OOO 156 Fiienct found flename JI 157 path not tound path JI o aaneren Il pss canteeate SC SSS Can t change view mode The display starting address does not match the first line of the source file or the specified source fil
162. nus in the Memory Window When the Memory Window is active in the PD38SIM main display area the Option menu contains the following items Shortcut keys Fok Change font a View Change contents of display God Area Specify scroll range Specify display starting address Change display starting address to value of Stack Pointer Specify data length Display in 1 byte units Display in 2 byte units Specify radix Display in binary Display in decimal Display in hexadecimal Display as ASCII characters Display as SJ IS characters Display as J IS characters Refresh display Set memory contents Set data at specified address Fill specified memory block with data Move specified memory block to specified address Usethecachedf memay aq Window function of PD38SIM 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 Dec J Hex ASCII _ SIS Jis Refresh Cache ASCII code correspondi Address display Data display 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
163. o nns n 197 Reset button ecer 107 Returm button 106 RAM monitor area 4 47 111 RAM Monitor Function nesses 4 RAM Monitor Window 47 111 Read access synchronized input64 150 Real time RAM monitor function111 Register information file 12 Register variable ee 228 Register Wimdow 41 108 Reload ee 95 aeren aioe 96 107 Return execution oo eee 106 Right side evpreeslons 200 Step DUttON seeren 105 Stp DUTTON ssa 104 S W Break Point Setting dialog box WEE 87 117 Sampling period 111 Save Disaem 97 leie EE 226 Scope Setting dialog box 114 Script Commend cece 223 Script file 12 21 61 136 Script Wipdow 61 131 Sear C EE 141 Search path neseser 100 Set statement 198 SClUP EE 19 SIIM38 setup 23 Software Break scssi 5 87 117 Software breakpoint file 13 14 Source Level Debugging F unction 5 Source Window21 38 93 97 98 141 Stack Utilization Monitor 11 StackM onitor oommand 11 Starting PD38SI1M ee 19 Step Execution eee 105 LEE 5 226 Symbol EIERE 12 Symbols and Labele 201 Table of Script Commands 213 TAB value ENEE 21 temporary Ple 15 The Virtual Port Input function 147 Time management eee 7 Uploading asninn 97 Version Information dialog box 23 View buffer oo ee 14 61 133 View Die 14 61 133 Virtual Interrupt nesese 10 66 Virtual Interrupt function 158
164. of the registers and flags 1 4 1Structure 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 dicked the right button of the mouse Flag display area You can click these buttons to change flag 1 4 2E xtended Menu in the Register Window When the Register Window is active in the PD38SIM main display area the Option menu contains the following items Menu Menu options Function Shortcut keys Option Layout Set layout Hide Radix Turn on off radix Hide FLAGs Turn on off flags Eont Change font 41 PD38SIM User s Manual 1 4 3 Shortcut Menu in 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 le Display in hexadecimal Dec Display in decimal Bin Display in binary Layout Set layout Hide Radix Turn on off radix Hide FLAGs Turn on off flags display area Eont Change font The value changed is displayed in red 42 Window function of PD38SIM 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
165. on 1 7 Continuing to Display a Selected Program Position The Program Window always displays the target program at the position of the program counter and you cannot therefore choose to always display the same position Y ou can do so however in the Source Window To open the Source Window select the following from the PD38SIM Window menu Window gt Source Window 97 PD38SIM User s Manual 1 8 Changing the Program Display Position You can display the source program in the Program Window and in the Source Window To change the display position of the Program or Source Window click on the View button in the toolbar of the Program or Source Window to open the Disp Area dialog box You can only change the display position in the active window View button View SRC MIX DIS Click the View button to open the Disp Area dialog box Source button ck Source Change the File F unction level Address button Change the PC Address Line No level button Change the program counter If no debugging information has been read in no changes can be made at the file or function level or at the line No level Further if the Program or Source Window is in disassemble display mode no changes can be made at the line No level Changing the display position at the file function level Click the Source button in the Disp Area dialog box to open the Source dialog box The Source
166. on Toolbar with main command buttons Main display area Menu for executing commands Sub windows Bisi EK File Edit View Environ Debug Option BasicWi OptionalWindow Help EA zSlslAl E RT sw mw CS ll x View SRC MIX DIS Line BRK Source z O01 do 000183 114H 114H 1 00019 113H 0 00020 do 00021 113H 113H 1 00022 00023 while 114H 004H 00024 oix GE Dec Hex fascin SUS JIS Areal Clear Refresh 00027 Address 1 0 1 2 3 4 5 SI 7 8 9 Al EETAS z 00028 DD 0 00 00 00 00 00 00 00 00 Q 0 00 OO 00029 SUB DOE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DOE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 gt 0100 0 0 0 0 0 0 0 0 0 0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0130 0 0 0 0 0 0 0 0 0 0 0 0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0150 00 00 00 0 00 00 00 00 00 00 00 00 0 0160 00 00 00 0 0 0 00 00 00 00 00 00 00 00 i Ready MCU STOP Displays status of execution of target program Displays help on how to use windows and menus 27 PD38SIM User s Manual 1 1 2 PD38SIM Window Toolbar Goj button Break button Executes target program Sets the position of the cursor in the window as the software breakpoint
167. on 1 Click the break point to aii SE SE be deleted es E i Enable All Enable Disable All Disable Click Del All to delete all break points You can also click the breakpoint to be deleted then press the Delete key 4 4 Temporarily Disabling Break Points In the S W Break Point Setting dialog box disable the break point as follows S W Bi Load Save C Address Add Filename demo c Refer ie ooo DIS 3 Click the Close button SAW Break Point BDIA C 40 BD20 ol demo c demo c 1 Click the break point to be disabled demo c demo c Enable All Enable Disable All Disable 2 Click the Disable button Click All Disable to disable all break points You can also double click the breakpoint to be disabled An asterisk is displayed 119 PD38SIM User s Manual 4 5 Temporarily Enabling Break Points In the S W Break Point Setting dialog box enable the break point as follows Load Save cadres Add Filename demo c Refer line O Close SAW Break Point BDIA L BD20 3 Click the Close button 40 42 46 demo c 50 dene Enable All Enable Disable All Disable Click All Enable to enable all break points demo c demo c Click the break point to be enabled 2 Click the Enable button You can also double click the breakpoint to be enabled
168. on Types When the result value of calculation has been defined its name is displayed DATE date Sunday all Radices e ifthe result value of calculation has not been defined it is displayed as follows DATE date 16 when Radix is in initial state DATE date 0x10 when Radix is hex DATE date 0000000000010000B when Radix is binary 3 2 2 Basic Types When the result of calculation is a basic type other than a char type or floating point type it is displayed as follows unsigned int i 65280 when Radix is in initial state unsigned int i OxFF0O0 when Radix is hex unsigned int i 1111111100000000B when Radix is binary When the result of calculation is a char type it is displayed as follows unsigned char c J when Radix is in initial state unsigned char c 0x4A when Radix is hex unsigned char c 10100100B when Radix is binary When the result of calculation is a floating point it is displayed as follows double d 8 207880399131839E 304 when Radix is in initial state double d 0x10203045060708 when Radix is hex double d 0000000010 1000B when Radix is binary indicates abbreviation 3 2 3 Pointer Types When the result of calculation is a pointer type to other than a char type it is displayed in hexadecimal as follows unsigned int p 0x1234 all Radices When the result of calculation is a char type you can select the display
169. on button Displays data in ASCII code Set RAM monitor area 48 Window function of PD38SIM 1 7 3 Extended Menus in the RAM Monitor Window When the RAM Monitor Window is active in the PD38SIM main display area the Option menu contains the following items Font View Change contents of display Display from specified address Specify data length Display in 1 byte units Display in 2 byte units Specify radix Display in decimal Display in hexadecimal Display as ASCII characters Display as SJ IS characters Display as J IS characters Refresh display Clear access attribute Layout Set layout al Turn on off ASCII ll ae RAM RAM Monito Are Set RAM monitor area sd RAM monitor area Set color of access attribute display SE Set sampling period for RAM monitor W ss 49 PD38SIM User s Manual 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 Toolbar Data display area Fe Watch Window x Dec Bin Expression display area Radix display area Address Bit No display area Data length display area The cursor position is indicated by a red mark in the addre
170. ons can be used to specify the vector address Specification of right side expressions is described later For example if following statements are written int Oxffec a timer 2 vector address Oxffec interrupt is generated set statement There are following three formats for the set statement Format 1 set memory address input value Function The input value is input to a specified memory address virtual port input to memory Left side expressions can be used to specify the memory address and right side expressions can be used to specify the input value Specifications of left side and right side expressions are described later For example if following statements are written set 0x2 Ox1d data Ox1d is input to memory address 0x2 Format 2 set condition expression memory address input value 1 input value 2 Function The input value 1 input value 2 etc are sequentially input to a specified memory address each time the conditional expression is established Left side expressions can be used to specify the memory address and right side expressions can be used to specify the conditional expressions and input values Specifications of left side and right side expressions are described later For example if following statements are written set sfetch Oxf000 0x3 0x10 0x20 Hsfetch becomes true established when the program executes a specified address data 0x10 and 0x20 are sequentially input to memor
171. or 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 gt Color The display of access attributes is cleared the addresses are displayed as if not accessed when you select Option gt View gt Clear and after downloading a target program 41 PD38SIM User s Manual Note e If you are displaying data in the RAM monitor area in 2 byte units by selecting Word under Option gt View gt 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 attributes are mismatched between different bytes of the data 0000 O0E0 0000 0000 Display when access attribute is identical for all bytes of the data 1 7 2 RAM Monitor Window Toolbar J IS button Hexlbutton Displays data in J IS code b tan Displays data in hexadedmal default Clear access attribute Dec A CII Dec button Displays data in dedmal button Refresh display Displays data in SJ S code ASCII butt
172. or macro variables are integers in the range of Oto FFFFFFFFie If negative numbers are used they are handled as 2 s complements When specifying a repeat count for the while statement use of macro variables should prove convenient set val 0 Macro variable val is assigned 0 while Yoval lt 10 while statement is repeated until Yval 10 waitc 10000 int Oxffee set val val 1 Yval is incremented by 1 7 5 3 Memory Variables This variable is used when writing values in memory The following shows a format of memory variables address data size Expressions can be written in address Memory variables cannot be used Specify data size as shown in the table below For word 2 byte size If specification of data size is omitted the data size is assumed to be byte long Example 1 When writing to memory at address 0x8000 in bytes set 0x8000 B 0x10 or set 0x8000 0x10 Example 2 When writing to memory at address 0x8000 in words set 0x8000 w 0x1234 204 Coverage Information 8 Coverage Information 8 1 Referencing Coverage To reference the coverage CO coverage of each function in the downloaded C language program open the coverage window The coverage window can be opened by selecting the following from the PD38SIM window menu Window gt Coverage Window Coverage window for checking the execution rate of each function Coverage Esse Address DIOU
173. ords 8000h AW 2 2 7 Line Nos These are source file line Nos The format for line Nos is as follows line_no line_no source file name Specify line Nos in decimal You can only specify line Nos in which software breaks can be set You cannot specify lines in which no assembler instructions have been generated including comment lines and blank lines If you omit the name of the source file the line Nos apply to the source file displayed in the Program Window Include the file attribute in the name of the source file Donot include any spaces between the line No and name of the source file 228 Writing Script Files 2 2 8 Character constants The specified character or character string is converted into ASCII code and processed as a constant Enclose characters in single quote marks Enclose character strings in double quote marks The character string must consist of one or two characters 16 bits max If more than two characters are specified the last two characters of the string are processed For example ABCD would be processed as CD or value 434416 2 2 9 Operators The table below lists the operators that you can use in expressions The priority of operators is indicated by the level level 1 being the highest and level 8 the lowest If two or more operators have the same level of priority they are evaluated in order from the left of the expression Priority level L Bh
174. orming step execution PD38SIM allows debugging at the C language level and at the assembly language level You can use the Program Window and Source Window to view source files 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 You can usetheASM Watch Window to view labels and symbols in assembler source files 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 PD38SIM User s Manual 2 8 On Demand Method PD38SIM 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 PD38SIM uses the on memory method in which all debugging information is stored in memory Use the PD38SIM setup to select the on demand or on memory method of storing debugging information See Section 1 3 PD38SIM Setup in the setup section of this manual for details Temporary files are created with the filename pdb _xxxx tmp where xxxx is a 4digit hexadecimal value in the directory containing the downloaded files Temporary files are deleted immediately befo
175. out giel moa Description of expression isi SSS 1203 ou can register the only command name for alias 1204 Can t use the command now You cannot use the specified command while the target program is running 1205 1207 Cant set break point in this function 1208 The start address larger than the end address 1209 Cant register that token for alias E 1211 bis command is not supported now E 1213 Data value is out of range 241 PD38SIM User s Manual 1302 The Number of Macro constant is over the limit limit 1304 Prefix which gives radix of the constant is La illegal 1305 Description indirect referenceisinegal 1 1306 centina endor sings tr JI 1307 Description of expression sinea SCS 1306 Macro constant t maaro isntdefined 1 1309 syma csm Jistan dS 1310 limmediatevaiveisiliega OOOO an woe le 1313 The value is over the maximum value of which can be treated by MCU 1314 Register name is using for macro variable name No Error Message EES and Action foo addressvalueiscutofrange dT por Target program is already ge 1402 The number of break paintis over treti SSS L The break paint isn t defined at that address y DEER 1406 Cant read write because there are no memory at that area 1409 Can t execute that command when the target program is running 1410 Start address is larger than end address ee 1412 Can t find source lines which include that address Le That comman
176. phic mode 174 Other Functions of 1 0 Window 4 3 3 Changing Display Mode of Virtual Interrupt 1 For cydesynchronized interrupts Choose Cycle in the Select Interrupt Display Mode column 2 For executed address synchronized interrupts Choose E xecuted Address in the Select Interrupt Display Mode column 4 4 Changing Scale of Display Screen The scale of the virtual port input virtual port output or virtual interrupt display screen can be changed This means changing the number of cycles that can be displayed in one screen To change the display scale choose the menus Option gt Scale or the Scale button A dialog box like the one shown below will appear Scale Dialog LS Input all H 14 Output H BU a 10000 Interrupt al E 104 Cancel The following explains how to change the scale of each display screen 1 Tochangethe scale of the virtual port input display screen slide the scroll bar in the Input column until the scale you want is reached 2 Tochange the scale of the virtual port output display screen slide the scroll bar in the Output column until the scale you want is reached 3 Tochange the scale of the virtual interrupt display screen slide the scroll bar in the Interrupt column until the scale you want is reached The display scale can be changed in the range of 1 to 10 000 cycles For example if you change the scale to 50 when displaying a virtual port input in chart mode the data
177. phic mode The maximum number of data that can be recorded by this function is 30 000 entries counted from the beginning of program execution For example if data is written to port 0 address 0 by executing a program like the one shown below T_PORTO byte section DATABUFF blkb OUT_PORTO T_PORTO DATABUFF the data written to address 0 is recorded along with the cycle count in which the data was written 1 14 3 Virtual Interrupt This function defines interrupt generation Using this function you can generate timer interrupts in a simulated manner without having to actually generate them There are following three types of virtual interrupts 1 Cycle synchronized interrupt A specified virtual interrupt can be generated when program execution has reached a specified number of cycles The diagram below shows an example of a virtual interrupt that is synchronized to machine cycles Example where virtual interrupt of vector address Oxffec timer 2 is defined Virtual interrupt Virtual interrupt Virtual interrupt is generated in is generated in the is generated in the 3 000th cycle 6 000th cycle the 9 000th cycle Pe be EE 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Number of cycles executed As shown above virtual interrupts in this case timer 2 interrupt can be generated in any desired cycle 66 Window function of PD38SIM 2 Executed address synchronized interrupt Virtual interrupt
178. phical 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 repro
179. pt file Expressions included in script files are evaluated as unsigned types Therefore operation cannot be guaranteed if you use negative values for comparison in if or while statements You can specify up to 4096 characters per line An error occurs if a line exceeds this number of characters When a script file containing illegal commands is automatically executed when you select Option gt Script gt Run from the Script Window menu after opening a script file or click the lt Run gt button in the Script Window execution of the script file continues even after the error is detected except when the script line itself cannot be read If an error is detected and the script file continues to be executed operation after detection of the error cannot be guaranteed Reliability cannot therefore be placed on the results of execution after an error has been detected 2 2 Writing Expressions PD38SIM allows you to use expressions for specifying addresses data and number of passes etc The following shows example commands using expressions gt DB TABLE1 gt DB TABLE1 20 2 2 1 Elements of Expressions You can use the following elements in expressions Constants Symbols and labels Macro variables Register variables Memory variables Line Nos Character constants Operators The following describes the respective elements 225 PD38SIM User s Manual 2 2 2 Constants You can use binary octal decimal or hexade
180. r Writing I O Script This section explains the method for defining virtual port inputs virtual interrupts and other I Os to be written in I O script by using definition examples To define an I O script write a procedure for it Enclose a procedure with braces Has you write it Multiple procedures can be written in one file In each procedure write settings timings etc of virtual port inputs or virtual interrupts Each of the multiple procedures thus defined are processed in parallel with program execution However the order in which each procedure is evaluated is indeterminate Register the I O script file you ve created in PD38SIM using the I O Window menus Option gt Load or the Load button Multiple I O script files can be registered However the total number of procedures that can be registered is limited to 20 Procedure 1 in the example below defines the timer mode of timer 1 In this example a timer 1 interrupt is generated every divide by ratio number of cycles specified for the timer 1 Procedure 2 in the example below defines a cydesynchronized virtual port input In this example data is input from virtual port to memory when the program has been executed 10 000 cycles Although the O Window supports virtual port inputs in only bytes I O scripts allow for virtual port inputs in words 195 PD38SIM User s Manual Definition example of I O script file gt Comment statement Definition of procedure 1
181. r line you want to change or select the line and press the Enter key Value 08000 2 A dialog box for setting the register value and radix will open up therefore input the new value and radix PG Set Value Radix HEX To change the values of flags When flag window is open Click on the button of the flag you want to change IPL INI ImlxlDiI zlc The flag value will change ever time it is clicked on 0 oOooogodi1 00 However for flags like IPL whose size is larger than 1 bit a dialog box for setting the register value will open up When the flag window is not open Flag values can be changed in the same way as register values Either click on the line where FLG is displayed or select the line and press the Enter key To Change Register Window Layout Changing window size When window size is changed the contents of the window are laid out to fit the new window size Fa Register Window 1 A scroll bar is Added where necessary 1 Flags are assigned depending on window and font size 109 PD38SIM User s Manual Tohide the radix item With the Register Window active either select Option gt gt Layout gt gt Hide Radix from the menus or click the right mouse button on the register window list area and select Layout gt gt Hide Radix Tohide the flag item With the Register Window active either select Option gt gt Layout gt gt Hide FLAGs fro
182. re downloading and when you quit PD38SIM 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 PD38SIM Simulation Specifications 3 PD38SIM Simulation Specifications 3 1 Main Differences to Actual MCU This section describes the main differences between PD38SIM and the actual MCU See later sections for details 3 1 1 Realtime Timings Time management by PD38SIM is performed in cycles However the following differs from the actual chip Here the number of cycles are indicated by values stipulated in 740 family Software M anual e The bus width queue and wait states are not considered when measuring the number of cycles e PD38SIM 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 two cycles are required for the LDA instruction cycles are added at this point in time If four cycles are required for the CMP instruction cycles are added at this point in time LDA instruction l CMP instruction 0 1 2 3 4 5 6 7 8 g Execution cyc
183. ress the Delete key 113 PD38SIM User s Manual To change the memory display format You can change the radix in which data is displayed to select the watch point to be changed in the ASM Watch Window then clicking H ex Ded or Bin in the toolbar of the ASM Watch Window Click to display in Hexadecimal Click to display in Binary Set Del DeaAn Hex Dec Bin Click to display in Decimal You can also double click the radix display area in the ASM Watch Window 3 5 To switch scope To set a Scope open the Scope Setting dialog box by selecting Scope under Debug from the menu in the PD38SIM Window Selecting the object listed in this dialog box make change the scope to the object demod r74 demo r 4 demo r74 demol0 r74 CSTARTUP m cancel 3 6 Setting Data at a Specified Address You can use the M emory Window or Dump Window to set data at a specified address To use the Memory Window select the following from the PD38SIM Window menu Basic Window gt Memory Window To use the Dump Window select the following from the PD38SIM Window menu Basic Window gt Dump Window See Section 1 5 Memory Window in the Window Functions for details of the Memory Window and Section 1 6 Dump Window in the Window F unctions for details of the Dump Window 114 Checking and Setting Register Data and Memory Contents To change data at a specified addre
184. rget program runs until it reaches a breakpoint Freerunning the target program Selecting the PD38SIM Window menu Debug gt GoF ree make the target program executed with software break points and hardware break points disabled To stop the target program Click the Stop button on the PD38SIM Window toolbar lelea Ei Je par eaer Click the Stop button You can also stop the target program by selecting the following from the PD38SIM Window menu Debug gt Stop 104 Starting and Stopping Target Program Execution Note If when the target program stops the program counter is in an area with no source line data the Program Window automatically switches to disassemble display mode To start the target program from a specific address Select the following from the PD38SIM Window menu Debug gt Go gt Go Option The Go dialog box opens Enter the starting address To check if the target program is running The current execution status is displayed at the right end of the status bar in the PD38SIM Window MCU RUN Target program is running MCU sTop Target program is stopped 2 2 Step Execution Click the Step button on the PD38SIM Window toolbar Or press F 3 Sif lslal m el eil Click the Step button When the Program Window is in source program mode each line of the source program is executed step by step When the Program Window is in disassem
185. rogram Font Memory Screen Misc Ms Dos Prompt UKS Cmd line IN make exe makefile Working c WINSSUS Batch file Shortcut key N one Run N ormal window X IT Close on exit Input a command line Uncheck Advanced ic a OK Cancel Apply To open the property dialog box choose Property from the menu that is displayed when you click the right mouse button after selecting a pif file using the explorer etc 140 Miscellaneous 2 Register the pif file in PD38SIM Choose menus Debug gt Entry to bring up the dialog box shown below Use this dialog box to register the pif file Make Input the directory to Argument which the pif file has a ei been copied Input a pif file name 3 Start up Make When you choose menus Debug gt Make the contents specified by the pif file are executed 9 3 Searching for Character Strings in Target Program You can search for character strings in the target program when the Program Window or Source Window is active Make sure the target Program or Source Window is active then select the following from the PD38SIM Window menu Edit gt Find The Find dialog box is displayed Enter the search string then click Find Next to start the search 3 Check here to include wildcards in the search string Find What 4 1 Specify the search string E Match Case F Wild Card eg 4 C
186. rogram Window 1 Sie the BitAdd button to open the following dialog box Add Bir Aaa Set Del DerAn Hex Dec Bin x 2 Spedfy the bit symbol If none has rT a been defined Specify the address Ben ang bit No in the next fields Global Local 3 It is possible to select either the i assembler s global symbol or gt local symbol Address Bit ance 4 Click the OK button 112 Checking and Setting Register Data and Memory Contents To change the value at a specified address Select the watch point to changein the ASM Watch Window then click the Set button on the toolbar of the ASM Watch Window 2 Click the Set button Rdx Data 000400 400 W Hex 404 000400 datal LW Hex 4040404 000401 ata2 B Bin 0000 0100 000400 0 bi t0 Bit 0 000500 500 B Hex 4 1 Click the watch point to be changed The Set dialog box opens Enter the new value To delete a watch point Select the watch point to be deleted in the ASM Watch Window then click the Del button on the toolbar of the ASM Watch Window 2 Click the Del button Addr Bit Expr Rdx Data 000400 400 W Hex 404 000400 datal LW Hex 4040404 000401 ata2 B Bin 0000 0100 000400 0 bur Bit 0 1 Click the watch point to be deleted To delete all watch points click the DelAll button You can also click the watch point to be deleted then p
187. rs Pointers are indicated by the asterisk You can use pointer to pointers zz and pointer to pointer to pointers etc Examples variable name variable name etc Note Immediate values cannot be processed as pointers That is you cannot specify 0xE000 for example 3 1 4 Reference References are indicated by the ampersand el You can only specify evariable name 3 1 5 Sign Inversion Sign inversion is indicated by the minus sign You can only specify immediate_value or variable name No sign inversion is performed if you specify 2 or any even number of minus signs Note Thereis nosupport currently for sign inversion of floating point numbers 3 1 6 Member Reference Using Comma You can only use variable name member name for checking the members of structures and unions using the comma Example struct SI int member1 char member2 struct S STRUCT struct S STRUCT_P In this case STRUCT memberl STRUCT_P member correctly checks the members 231 PD38SIM User s Manual 3 1 7 Member Reference Using Arrow You can only use variable name gt member_name for checking the members of structures and unions using the arrow Example struct S int member1 char member2 struct S STRUCT struct S STRUCT_P In this case STRUCT gt member1 STRUCT_P gt member2 correctly checks the members 3 1 8 Parentheses Use the and to specify priority of c
188. s 1 Ifyou want virtual interrupts to be generated with the lapse of time Virtual interrupts can be generated when program execution has reached a specified number of cycles In this case set cycle synchronized interrupts 2 Ifyou want virtual interrupts to be generated when the program executes a specified address Use this method if you want virtual interrupts to be generated when some specific function is executed In this case set executed address synchronized interrupts 3 2 Setting Cycle synchronized Interrupts To set cyclesynchronized virtual interrupts choose the I O Window menus Option gt Setup or the Setup button The dialog box shown below will appear Select Type C Set Virtual Port Input Select this item S Set Virtual Port Output 158 Setting Virtual Interrupts in 1 0 Window Here choose the item Set Virtual Interrupt and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual interrupt timings will appear Setup Dialog s ol a NEE Expression Executed Address eer can be inpu 1000 i here 10000 First choose Cycle in the Interrupt Generation Timing column Next specify the cycles at which you want a virtual interrupt to be started and ended for Start cycle and End cycle respectively using decimal numbers Then specify the vector address of the virtual interrupt to be
189. s can be generated when the program has executed a specified address The diagram below shows an example of a virtual interrupt that is synchronized to executed addresses Virtual interrupt is generated Address Processing when program execution has moved into address E 000 E000 As shown above a specified virtual interrupt can be generated when program execution has moved into address E000 By using this function you can specify that a virtual interrupt be generated when address E000 is executed first by the program and that no virtual interrupt be generated when the address is executed next as shown below Number of times the address Whether virtual interrupt is E000 is executed generated Virtual interrupt is generated Second Virtual interrupt is not generated Virtual interrupt is generated 67 PD38SIM User s Manual 1 14 4 Screen Configuration of 1 0 Window This window is split into three sections each displaying the setup contents of virtual port inputs the output results of virtual port outputs and the setup contents of virtual interrupts EES Hallie Tod bar Setup Modi f Del Load Mode Scale Color I O Script File 7 Input cycle ss Cycle 0000000030 Data 0x30 a Address Bit 10 1 2 3 4 5 6 7 8 9 101 213141516171 819202 122230 495 6 7282930 00 Virtual port input screen 0 0 0 0 0 0 0 Output cycle Cycl Virtual port output ycle Address Bit 82 100 120
190. s dialog box C Enable AutoDownLoad confirm C Enable AutoDownLoad no confirm Disable AutoDownLoad Cancel Enable AutoDownL oad confirm Downloading automatically with confirmation when the target program is updated Enable AutoDownL oad no confirm Downloading automatically without confirmation when the target program is updated Disable AutoDownL oad Not downloading automatically even if the target program is updated 95 PD38SIM User s Manual 1 4 Changing Program Display Position Immediately After Downloading When you download a target program in PD38SIM The Program Window displays the source program at the position of the program counter after the target program has been reset If there is no source line data at this program counter position the startup program for example has no source line data the program is displayed in disassemble mode If after downloading a target program you want to automatically display a source program such as the main function you must first specify the name of that function From the PD38SIM Window menu select Environ gt StartUp to open the StartU p Dialog box Specify the name of the function to be displayed Function a i Cancel 2 Click the OK button Even when you display the function specified in the StartUp dialog box in the Program Window the program counter remains at the same value it held immediately after downloading To
191. s when their settings have been deleted 178 Setting GUI Input Window 5 Setting GUI Input Window 5 1 Overview The GUI Input Window allows you to create a simple key input panel buttons of the user target system in a window and execute virtual port inputs or virtual interrupts by pressing the buttons you ve created Here we ll explain how to create buttons 5 2 Creating Buttons Follow the procedure below to create buttons 1 Choose the GUI Input Window menus Option gt M ake or the Make button 2 Next move the mouse cursor into the GUI Input Window s input panel display area at which time the mouse cursor will have its shape changed to a cross 3 Whilein this state click the left mouse button at a position where you want a button to be created Hold down the left mouse button while you move the mouse cursor to expand its size and release the left mouse button where the size is what you want Choose this button end GUI Input Windoy e ae Grid Load Save 7 Input panel display area Drag the cross cursor to determine the size of the button 179 PD38SIM User s Manual 4 A button will be created as shown below E Gu J Input Window hk Make Grid Load Save 5 Next doubleclick on the button you ve created CAUTION Before double clicking on the button you ve created check to see that the arrow on the tool bar is selected If not selected choose the arrow befor
192. ses size Format 5 HardwareBreak address access condition passes size reference data Comparison condition The following table shows the values that can be specified for access condition size and comparison condition READ R WRITE W RW BYTE B Comparison condition lt gt lt gt 5 Function Hardware breaks allow you to stop target program execution on detection of data being read from or written to memory or on detection of an instruction fetch PD38SIM allows a maximum of 64 hardware breakpoints to be set To use hardware breaks use the BreakMode command as shown below to enable the break BreakMode ON Checking hardware break settings Use format 1 Enter the following to display the contents of the hardware break setting HardwareBreak 219 PD38SIM User s Manual Stopping program execution on execution of the instruction at the specified address Use format 2 Enter the following to stop execution of the target program on execution of the instruction at address 800016 HardwareBreak 8000 FETCH Enter the following to stop execution of the target program on 10th execution of the instruction at address 800016 HardwareBreak 8000 FETCH 10 If not specified the default number of passes is 1 This also applies to other formats Stopping program execution when data at the specified address is accessed Use formats 3 4 or 5 The following table shows the differences betwe
193. sing an interrupt handler routine section DATA org 0080H T_PORT1 byte 0002H section PROGRAM org 8000H INT_2 A T_PORT1 RTI This interrupt handler routine aims to assign the value of port 1 to accumulator when a virtual interrupt is generated In such a case a value can be assigned to accumulator by entering it to port 1 when a virtual interrupt is generated It is assumed that interrupts are generated using a separately available virtual interrupt function For details refer to the virtual interrupt function described later in this manual To support processing of interrupt handlers like this PD38SIM provides a function that allows you to define the data to be input according to a number of times a virtual interrupt is generated a virtual input port synchronized to virtual interrupts By using this function you can perform an operation where data 0xFF is input to memory address 2 when the virtual interrupt occurs first and data OxFE is input to said memory address when the virtual interrupt occurs next time Number of times a virtual Data input to interrupt is generated address 2 65 PD38SIM User s Manual 1 14 2 Virtual Port Output Virtual Port Output is a function that when data is written to some memory address by the program allows the written data value to be recorded along with the cycle in which the data was written The recorded data can be displayed for your reference in chart numeric or gra
194. sion and close the dialog box A dialog box for selecting the virtual port input whose settings you want to be changed will appear Modify Dialog 0000 First choose the type of virtual port input you want to be changed in the Data Input Timing column When selected the currently set virtual port inputs are listed in the Select Data column Here choosethe virtual port input you want to be changed Then press the Next button Or press the Prev button here if you want to return to the previous dialog box 165 PD38SIM User s Manual A matrix dialog box for changing virtual port inputs will appear Setup Dialog Up Down ee ee ee ee 10020 10030 33 pS lt S27 S255 3S FSS se Fo S65 SSS F 10040 rt DD A4 Ir tI O 10070 10030 rr 10090 pos sc V fk giefen PSS FS Sp oS 6 f ss P lt SF Ss FS s lt Prey Cancel Here change the data for the selected virtual port input as necessary Data can be changed in the same way that data is set Refer to Section 1 Setting Virtual Port Inputs in IO Window After changing the data press the Next button A dialog box for saving the virtual port input data you ve set virtual port input file will appear Save Data Save in IC310 Samples sl ei cel ipn File name finput scr Save as type Script Files scr D Cancel Here enter the directory and file names in which you want
195. splay modes choose the menus Option gt M ode or the Mode button A dialog box like the one shown below will appear Mode Dialog Select Input Display Mode grececcesseesossesoe Style Graph C Read Access C Interrupt Select Output Display Mode CG Cycle Style Graph Select Interrupt Display Mode CG Cycle C Executed Address Cancel The following explains how to change each display mode 4 3 1 Changing Display Mode of Virtual Port Input L For cydesynchronized inputs Choose Cycle in the Select Input Display Mode column Then choose the desired display mode in the Style column Choose Chart if you want the selected input to be displayed in chart mode Choose Hex if you want the selected input to be displayed in hexadecimal mode Choose Graph if you want the selected input to be displayed in graphic mode 2 For read access synchronized inputs Choose Read Access in the Select Input Display Mode column 3 For interrupt synchronized inputs Choose Interrupt in the Select Input Display Mode column 4 3 2 Changing Display Mode of Virtual Port Output Choose your desired display mode from Style in the Select Output Display Mode column Choose Chart if you want the selected output to be displayed in chart mode Choose Hex if you want the selected output to be displayed in hexadecimal mode Choose Graph if you want the selected output to be displayed in gra
196. ss With the Memory Window or Dump Window active select the following from the PD38SIM Window menu Option gt Debug gt Set When the Set dialog box opens enter the address to be changed and the new data Address 1 Specify the address 2 Specify the new data 3 Select the data length Byte Word 4 Click the OK button Data Length You can also double click the data display area in the Memory Window or Dump Window to open the Set dialog box Tofill a specified area with data With the Memory Window or Dump Window active select the following from the PD38SIM Window menu Option gt Debug gt Fill When the Fill dialog box opens enter the area to be filled and the fill data When the Fill Dialog Box open after selecting the area by mouse in the Memory Window or in the Dump Window the start and end address of the area are set in this Dialog box Fill x Start Address End Address Data Length 1 Specify the starting address of the area to be filled 2 Specify the ending address of the area to be filled 3 Specify the fill data 4 Select the data length Byte Word 5 Click the OK button 115 PD38SIM User s Manual To move the contents of a specified area to another area With the Memory Window or Dump Window active select the following from the PD38SIM Window menu Option gt Debug
197. ss display area and data display area Click either area or use the UP button and DOWN button cursor keys to move the cursor Double click the radix Rdx display area to switch the current radix for the data displayed in that area as follows gt hex gt decimal gt binary gt hex gt Provided the watchpoint is within the RAM monitor area the contents of the display are regularly updated while the target program is executing Information about set watchpoints is stored in the Init file when you close the ASM Watch Window or exit PD38SIM When you re open the ASM Watch Window the previously set watch points are automatically restored Inthe 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 lt not active gt are recalculated and the result is a valid address the watchpoints automatically become active again 50 Window function of PD38SIM 1 8 2 ASM Watch Window Toolbar Set button Ded button Add button Sets specified watch point Displays watch point in decimal Adds a watch point address Del button Deletes specified watch point Displays watch point in binary Adds a watch point bi
198. stants are converted to ASCII code and used as 1 byte immediate values Notes You cannot register character constants only as C watchpoints Character constants are valid only when used in a C expression that specifies a C watchpoint and when specifying a value to be assigned character constants are processed in the same manner as immediate values 3 1 14 Character String Literals You can use character strings enclosed in double quote marks as character string literals Examples are abcde I am a boy etc Note Character string literals can only be placed on the right side of an assignment operator in an expression They can only be used when the left side of the assignment operator is a char array or a char pointer type In all other cases a syntax error results 3 2 Display Format of C Expressions C expressions in the data display areas of the C Watch File File Local and Global Windows are displayed as their type name C expression variable name and result of calculation value as shown below inc Watch Window Add Add Del DelAll Set Cancel Radix unsigned char gcpp Ox4E4F ABC signed short int gsho 32768 signed char vi gscp 0x4E51 TC igned char gc 3 Result of calculation value C expression variable name The following describes the display formats of the respective types 233 PD38SIM User s Manual 3 2 1 Enumerati
199. t button Displays watch point in hexadecimal Del All button Deletes all watch points 51 PD38SIM User s Manual 1 8 3 Extended Menus in the ASM Watch Window When the ASM Watch Window is active in the PD38SIM main display area the Option menu contains the following items Register delete watch point Register watch point Register bit level watch point Set new data to be written to selected watch point Delete selected watch point Delete all watch points Change display radix Display value at selected watch point in binary Display value at selected watch point in decimal Display value at selected watch point in hexadecimal Layout Set layout Address Area Turn on off address bit area SizeArea Turn on off data size area Display RAM monitor Set sampling period for RAM monitor Set color of access attribute display Watch point save load Watch point save Watch point load 52 Window function of PD38SIM 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 C watch point display area unsigned char Lag struct _GSDATA esd Display of variable type Dispaly of variable value Dispaly of variable name
200. t Virtual Port Output and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting the address you want to be monitored for virtual port output will appear Setup Dialog Input the address Output Address you want to be monitored for output Input the address you want to be monitored for virtual port output in the Output Address column Then press the Next button A dialog box for specifying a file virtual port output file to which you want the virtual port output results to be saved recorded will appear PD38SIM saves the virtual port output results that have occurred during program execution to this file and references it when the program stops running Save Data Save in a 10_Samples x El cl bs File name Joutput ser Save as type Script Files scr x Cancel Here input the directory and file names in which you want the virtual port output file to be saved When you ve input a file name press the Save button Thus you ve finished setting virtual port outputs 157 PD38SIM User s Manual 3 Setting Virtual Interrupts in 1 0 Window 3 1 Overview The Virtual Interrupt function allows you to generate interrupts in a simulated manner without having to actually generate them Using this function you can generate timer interrupts in a simulated manner Virtual interrupts can be generated at one of the following timing
201. tMemoryByte address set value Change contents of memory at specified address in 1 byte units Enter to stop range in 1 byte units destination address address2 destination address in 2 byte units 214 Table of Script Commands 1 2 5 RAM Monitor Commands 1 RRAM 1 Checks the RAM monitor area 2 RRAM SET Address 2 Sets the RAM monitor area to the 3 RRAM CLEAR specified address 3 Initializes the access state of the RAM monitor area 1 2 6 Assemble Disassemble Commands Assemble A Assemble address Assemble lineby line from specified address DisAssemble DA DisAssemble start address end address Display result of disassembling specified area 2 SCOPE module name 2 Set scope to specified module 1 BIT 1 Display all bit symbols 2 BIT GLOBAL G Bitsymbol Data 2 Set value of bit showed by specified global bit symbol 3 BIT LOCAL L Bitsymbol Data 3 Set value of bit showed by specified local bit symbol SY Mbol SYM 1 SY Mbol 1 Display all symbols 2 SYMbol GLOBAL G symbol 2 Display global symbols 2 SYMbol LOCAL L HL symbol 3 Display local symbols expression 1 2 7 Software Break Setting Commands Command format SoftwareBreak SB 1 SoftwareBreak 1 Display currently set software break points 2 SoftwareBreak address 2 Set software break point at specified address specified address SBCA SBD speci
202. te tabbed 179 5 2 Creating BUELONS va sceeececesecucteveenetenvcenes OSNA ne e ENNERT TEE Teth 179 5 3 Saving Buttons You ve Create 181 5 4 Changing Button Position or Settings after Creating Button 182 e Bebe elteren EE 183 SAADI lie Bel Lage EE 184 5 7 Displaying Grid Line 184 6 SETTING GUI OUTPUT WINDOW 185 E RE Se ee 185 6 2 Creating Labels ut EEN adn ai aaa 185 6 3 Creating BR EE 189 6 4 Saving Parts You ve Create 192 6 5 Changing Parts Position or Settings after Creating Parts 192 6 6 Copying Hl EE 193 6 7 D leting PAKS TTT 193 6 8 Displaying Grid Line 194 71 0 SCRIPT FUNCTION 195 RR He ET 195 7 2 Method for Writing I O Script 195 7 3 Composition of LO Script 196 7 4 Method for Writing Right side E vpreeslons 200 7 5 Method for WrtttngLet zdeEvpreeslons 203 PD38SIM User s Manual 8 COVERAGE INFORMATION 205 8 1 Referencing COVEraG en ENEE 205 8 2 Updating Coverage Display 0 cece cette eee eeenee ee eeeaeeeeteaeeeetenaaeeeeteaeeeene 205 8 3 initializing Coverage ne annie anh 205 8 4 Saving Loading Coverage Measurement I nforMatiOn cccssscseeessssesseees 206 9 CUSTOMIZE FUNCTION 207 9 1 About Customize F UNCON eect e tein rete eee ee tnaee ee teaeeeeenaaeeeeneaaeeeete 207 REFERENCE 211 1 TABLE OF SCRIPT COMMANDS 213 DAA PUEF e dE 213 1 2 Tables of Commands nnani A E E eee 214 2 WRITING SCRIPT FILES 223 2 1 Structural Elements of a Script File 223 2 2 Writing EXP ESSIN S EEN
203. ted as RAM 3 1 4 Interrupts In the actual MCU peripheral I O including external interrupt signals are generating factors for interrupts However PD38SIM has nothing corresponding to peripheral I O PD38SIM 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 WAIT Executed as an NOP instruction Other instructions operate the same as those of the actual MCU 3 3 Resetting Resetting is performed in the same way as the actual MCU A reset is also performed when PD38SIM starts The value 000016 is set in the reset vector FFF Cie to FFF Die immediately after starting The program counter is therefore set to 000016 immediately after PD38SIM starts PD38SIM Simulation Specifications 3 4 Memory 3 4 1 Types of Memory The entire memory space 000016 to F FFF 16 functions as RAM At startup memory is allocated for the entire area 3 4 2 Memory Structure and Initial Values Immediately after Starting The memory is set up as follows immediately after starting PD38SIM 000016 to FFF F 16 Filled with 00 6 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 define
204. ted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document but
205. tems on the extended menus are described under the respective windows 28 Window function of PD38SIM 1 1 3 1 File operation The File menu in PD38SIM contains the items required for file operation such as including files saving files and terminating PD38SIM Download Download target program Load Module Download machine language data and Shift F 1 debugging information Memory Image Download only machine language data Symbol Download only debugging information Reload geed target program DREES Host Upload target program yo eel AutcDownLcad Automatically download when the target program is updated List the file name of target program downloaded aa 1 1 3 2 Editing The Edit menu in PD38SIM contains the items required for editing operation such as character strings copy paste and search Edit Copy character strings specified to clipboard Ctrl C Paste character strings of clipboard Ctrl V 1 1 3 3 Display The View menu in PD38SIM contains the items required for switching display of the tool bar and status bar View Switch display or non display of tool bar WEE Status Bar Switch display or non display of status bar i eee 29 PD38SIM User s Manual 1 1 3 4 Setup The Environ menu in PD38SIM contains the items required for setting up the operating environment Menu Men options Function Shortcut keys Environ Watt Environment setup haa Start Up Startup function s
206. the downloaded files Temporary files are deleted immediately prior to downloading and when you quit PD38SIM 4 3 2 Files Created in 1 0 Window Temporary files are created when you set virtual port inputs or virtual interrupts or I O script files in the O Window PD38SIM 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 PD38SIM User s Manual MEMO 16 Setup 18 Setup 1 1 Installation See the Release Notes provided with the product for how to install PD38SIM 1 2 Starting PD38SIM Follow the instructions below to start PD38SIM Click the start button then select program P gt RENESAS TOOLS gt PD38SIM V X XX Release X gt PD38SIM This operation starts pd38sim the simulator debugger front end and simultaneously starts sim38 the simulator engine If sim38 is already running only pd38sim starts 19 PD38SIM User s Manual 1 3 PD38SIM Setup When you start PD38SIM the I nit dialog box is displayed allowing you to set up the operating environment 1 3 1 Init Dialog Box Screen Configuration MCU M38000 l Init File TAB 1 32 P Area for spedfying SFR
207. the data you ve set to be saved The saved file can be loaded into PD38SIM back again by using the I O Window menus Option gt Load or the Load button When you ve input a file name press the Save button Thus you ve finished changing virtual port input data 166 Other Functions of 1 0 Window 4 1 2 Changing Setup Data of Virtual Interrupts To change the setup data choose the menus Option gt Modify or the Modify button A dialog box like the one shown below will appear Modify Dialog Ela Lee C Modify Virtual Port Input Select this tem Prey Cancel Here choose the item Modify Virtual Interrupt and press the Next button Or press the Cancel button if you want cancel the session and close the dialog box A dialog box for selecting the virtual interrupt whose settings you want to be changed will appear Modify Dialog Interrupt Generation Timing Select Data 803E YectorLFFF6 lt Prev Cancel 167 PD38SIM User s Manual First choose the type of virtual interrupt you want to be changed in the Interrupt Generation Timing column When selected the currently set virtual interrupts are listed in the Select Data column Here choose the virtual interrupt you want to be changed Then press the Next button Or press the Prev button here if you want to return tothe previous dialog box A matrix dialog box for changing virtual interrupts will appear Setup Dialog
208. the display starting address or the display starting line Theresult of the Coverage measurement is displayed by selecting On in the Menu Option gt Coverage 34 Window function of PD38SIM 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 Ee Program Window View SRC MIX J DIS Bddre BRKI Obicocde abe e000 START Address display Object code display area area Program display area Software breakpoint display setting area Theaddress display area and object code display area can be displayed or hidden by selecting or canceling Option gt Layout gt Address Area and Option gt Layout gt 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 f 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 Doubleclick the
209. the number of instruction bytes input is greater than that of instruction bytes before the change a warning dialog box is opened Press the OK button in this dialog box and the instruction you have input will be written tothe program If you press the Cancel button PD38SIM abandons writing the instruction If NOP insertion is turned off no NOP instruction is inserted even when the number of instruction bytes input is fewer than that of instruction bytes before the change 138 Miscellaneous f warning output is turned off the instruction you have input is forcibly written to the program without bringing up a warning dialog box By dicking on a line in the program display area of this dialog box you can choose the line to be line assembled 9 1 2 Line Assembling from Assemble Command Execute the assemble command Assemble A from the Script Window for line assembling Specify the address for line assembling after the command gt Assemble assemble address On execution of the Assemble command the command input area of the Script Window changes to a mnemonic input field See Section 7 1 Executing Script Commands in the Basic Operation for details of how to use script commands Enter the mnemonic for line assembling The following shows the Script Window when waiting for a mnemonic to be input pen Close Log0n Loz0th View Clear Log 00 00 00 00 00 00 00 00 8020 00 00 00 00 00 00 00 00 0
210. the registered file name of the program not including the extension in it or a DELMACROALL command When using a DELMACRO command only the specified custom command or custom window program is deleted When using a DELMACROALL command all of the registered custom command and custom window programs are deleted Example gt DELMACRO custom lt RET gt gt DELMACROALL lt RET gt 209 PD38SIM User s Manual To set the search directory of custom command and custom window programs The custom command and custom window programs registered by a MACRO command are loaded into PD38SIM when they are executed The custom command and custom window programs to be loaded are searched for from the directory that has been set by a MACROPATH MPATH command Only one directory can be specified by a MACROPATH MPATH command Example gt MACROPATH c usr project custom lt RET gt 210 Reference 212 Table of Script Commands 1 Table of Script Commands 1 1 Input Format The format for entering PD38SIM script commands is as follows 1 Insert one or more spaces or tabs between the command and its parameter s 2 You can use uppercase and lowercase letters and numerics for the command Description of symbols used in command format Command format XXXX XXXX must be input XXXX XXXX is optional X1 X2 X3 Oneof X1 X2 or X3 must be input X1 X2 X3 Input can be omitted or you can input one of X1 X2 or X3
211. the results of coverage measurements CoVerage CLEAR 221 PD38SIM User s Manual To check and set the starting address for displaying the results of coverage measurements Use format 1 or format 5 If you omit the starting or ending address when checking the results of coverage measurements the system displays 1KB of results from the display starting address Enter the following to check the display starting address for the results of coverage measurements CoVerage Enter the following to specify address C00016 as the starting address for displaying the results of coverage measurements CoVerage DISP C000 If without specifying a starting or ending address you check the results of coverage measurements after setting the display starting address to C00016 the display extends from C00016 to C40016 222 Writing Script Files 2 Writing Script Files PD38SIM allows you to run script files in a Script Window The script file contains the controls necessary for automatically executing the script commands 2 1 Structural Elements of a Script File You can include the following in script files Script commands Assign statements Conditional statements if else endi Program execution branches to the statement s to be executed according to the result of the conditional expression Loop statements while endw A block of one or more statements is repeatedly executed according to the expression break statement
212. to display the label appears double click somewhere in the frame CAUTION Before double clicking on the label you ve created check to see that the arrow on the tool bar is selected If not selected choose the arrow before double clicking on the label you ve created 186 Setting GUI Output Window 5 A dialog box for setting a label like the one shown below will appear Here you can specify one of the following two methods for monitoring outputs Display erase a user specified character string according to logic 1 or 0 in memory bit Display erase a character string when some value is written to memory 1 For displaying erasing a user specified character string according to logic 1 or O in memory bit Select Bit _1_ Bit G Poet 3 c Specify Positive Positive Negative or Negative Address Bit Or Data Bit Num GUI Out Dialog Input the desired memory address Memory bit number C Data Input the character Name string to be displayed when memory bit 1 Name2 or O if you selected Negative Logic Data Display Hamels Display Wamez Input the character string to be displayed when memory bit 0 or 1 if you selected 187 Negative PD38SIM User s Manual 2 For displaying erasing a character string when some value is written to memory GUI Out Dialog Bit Or Data Bit Bat Num Select Data e Dat
213. ton as in 1 above Then point to the button whose setup contents you want to be changed and double click the left mouse button The dialog box shown below will appear Set Button Dialog Input a butt Button Name Key REES Select Button Type Specify the action to be C Input Interrupt i Se wh n youi press the Input Input the address to which Address O0A0 virtual port is input Input data for virtual port Data PS input Interrupt Input the vector address of virtual interrupt Vector Here change the setup contents of the selected button 5 5 Copying buttons Follow the procedure below to copy buttons 1 Choose the GUI Input Window menus Option gt Copy 2 Next move the mouse cursor into the GUI Input Window s input pane display area at which time the mouse cursor will have its shape changed to a cross 3 Whilein this state point to the button you want to copy and click the left mouse button 4 Next choose the GUI Input Window menus Option gt Paste A new button will be copied on to the button you ve selected with the left mouse button Or choose the GUI Input Window menus Option gt Set or the lt button After choosing the menu point to the button you want to copy and click the left mouse button to select it Then press the Ctlr C key combination and Ctrl V key combination 183 PD38SIM User s Manual 5 6 Deleting buttons Follow
214. ts 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 Toolbar Script file name display area Log file name display area E Script Window OF xi Run Step Open Close Log0n Loz0 ft View Clear RecOn Ret0i Script Log gt 4 b H Enter Command Command input area Execution result display area Command history display area Script file display area The Script Window has a view buffer that stores the results of executing the last 1000 lines Theresults of execution can therefore be stored in a file view file without specifying a logfile 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 When a script file is open you can invoke script commands from the command input area provided the script file is not being executed 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
215. tton Del All Button for closing l Closet dialog box You can set up to 64 hardware break points in PD38SIM If you have set multiple hardware breakpoints program execution stops when any one hardware break address is encountered OR conditions You can continue to set hardware breakpoints until you click the lt Close gt button to close the H W BreakPoint setting dialog box You can clear hardware breakpoints selected by clicking in the hardware breakpoint display area Button to clear all breakpoints 1 19 2 Entries in List of Hardware Break Points e e AE AE 001 BYTE 40 READ gt Break address Pass count Comparison data Comparison condition Label for break address Data size Access condition 89 PD38SIM User s Manual MEMO 90 Basic Operation 92 Loading and Displaying the Target Program 1 Loading and Displaying the Target Program 1 1 Downloading To download the target program select the following from the PD38SIM Window File gt Download gt Load module The File Selection dialog box opens Select the target program from the File Selection dialog box The file to be downloaded is in the Intel HEX format file called an HEX file or the EEE 695 absolute file format called an 695 file HEX files have the filename extension HEX 695 files have the filename extension 695 When the HEX file is specified for the down loading file After the HEX file is down loa
216. u Environ gt Path To add a search path click the Ada button in the Path dialog box The File Selection dialog box opens Use the mouse to select the name of the file to be checked 1 Click the Add button Delete All 3 Click the OK button 2 Specify the search path in the File Selection dialog box 100 Loading and Displaying the Target Program To delete a search path Open the Path dialog box then carry out the following 1 Click the search path to be deleted ce a Tn Add D usr pdsohyouka T30NEw testdata test lestl 2 Click the Delete button Delete Delete All Cancel Click Delete All to delete all search paths 3 Click the OK button 1 10 Mixing Source and Disassemble Displays Click the MIX button on the Program or Source Window toolbar to simultaneously display both the source file and the results of disassembly You can also select the following from the PD38SIM Window menu Option gt Mode gt MIX Model The display mode changes only in the active window The Program Window automatically switches to MIX display mode when the position of the program counter when the target program stops in the area output in the source line information and does not match the starting address of the source line To return to source program display from MIX display mode Click the SRC button on the Program or Source Window toolbar You ca
217. ut Window s output panel display area at which time the mouse cursor will have its shape changed to a cross 3 Whilein this state point to the part you want to copy and click the left mouse button 4 Next choose the GUI Input Window menus Option gt Paste A new part will be copied on to the part you ve selected with the left mouse button Or choose the GUI Output Window menus Option gt Set or the lt button After choosing the menu point to the button you want to copy and click the left mouse button to select it Then press the Ctlr C key combination and Ctrl V key combination 6 7 Deleting Parts Follow the procedure below to delete parts 1 Choose the GUI Output Window menus Option gt Del 2 Next move the mouse cursor into the GUI Output Window s output panel display area at which time the mouse cursor will have its shape changed to a cross 3 Whilein this state point to the part you want to delete and click the left mouse button Or choose the GUI Output Window menus Option gt Set or the lt button After choosing the menu point to the part you want to delete and dick the left mouse button to select it Then press the Delete key 193 PD38SIM User s Manual 6 8 Displaying Grid Lines The GUI Output Window has a function to display grid lines at a position where parts can be located Usethis function when you place parts To display grid lines choose the menus Option
218. ut display screen Press the button for the item whose color you want to be changed in the Output column A dialog box for selecting colors will appear Use this dialog box to choose your desired colors To change the colors of the virtual interrupt display screen Press the button for the item whose color you want to be changed in the Interrupt column A dialog box for selecting colors will appear Use this dialog box to choose your desired colors 4 6 Searching for Display Data The virtual port input or virtual interrupt data or the output result of virtual port output can be displayed at the left edge of the window after searching However the last data of each is displayed at the right edge The following shows how to search WO Window Setup Modif Del Input cycle Load Mode Scale Color I O Script File EI Cycle Address Bit 0 1 2 3 4 516 7 3 9102 41 Ne eODIDHOD pale 32344 Interrupt cycle i Point to somewhere in one of these areas and 5 dick the right mouse d Ge 800 700 800 900 1000 eg A popup menu for searching data will appear M E A E A Sa ONA E ON E A Omn E n e Aa pane Cycle Vec 10000 10001 10002 10003 10004 10005 177 PD38SIM User s Manual Move the mouse cursor to a position in one of the display areas where you want search for data to begin then click the right mouse button A popup menu like the one show
219. ve then select the following from the PD38SIM Window menu to open the RAM Monitor Area dialog box Option gt RAM Monitor Area Enter the starting address of the RAM monitor area The RAM monitor area is also changed when you double click the address display area in the RAM monitor window to change the display starting address In this case if the specified display starting address is not within the current RAM monitor area a confirmation dialog box is displayed asking whether or not to adjust the RAM monitor area Click the OK button to adjust the area To change the sampling period The contents of memory displayed in the RAM Monitor Window are automatically updated at regular intervals The default sampling period is 100 ms To change the sampling period make sure the RAM Monitor Window is active then select the following from the PD38SIM Window menu to open the Sampling Period dialog box Option gt Sampling Period However depending on operating conditions updating may be slower than specified 3 4 Checking the Value at a Specified Address Use the watch function to check the value at a specified address Check the value at the specified address in the ASM Watch Window The address is called as the watch point To open the ASM Watch Window select the following from the PD38SIM Window menu Basic Window gt ASM Watch Window If the specified watch point is within the RAM monitor area
220. y address 0x3 each time the program executes address Oxf000 Namely data 0x10 is input to memory address 0x3 when address Oxf000 is executed first and data 0x20 is input when the address is executed next Format 3 set macro variable right side expression Function The right side expression is placed in a specified macro variable Specification of macro variables is described later For example following macro variables can be written set Yval 10 Macro variable val is initialized to 10 set Yval val 1 Value of the macro variable is incremented by 1 198 1 0 Script Function 5 pass statement Format pass conditional expression pass count Function Execution of the next statement is skipped a number of times as specified by the pass count until the conditional expression is met Right side expressions can be used to specify the conditional statement and pass count Specification of right side expressions is described later For example if following statements are written pass isint Oxffec Hsint becomes true established when a specified virtual interrupt is generated set 0x800 0x10 The set statement is executed only after a timer 2 interrupt vector address Oxffec occurs three times 7 3 3 J udge Statements if else J udge statements judge the results of expressions thereby causing the statements to be executed to branch off The following shows a description format if conditional expression Stat
221. y area 0090 gt Address Output data display area display area Address display area It displays the address to be monitored for virtual port output Output data display area It displays the data as virtual port output results in graphic mode in units of bytes The peaks in this graph represent data values derived by equally dividing the height of the data displaying area by 255 maximum value of 1 byte data The short white lines appearing at the bottom of the output data display area indicate points at which data are output To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area Cycle count display area It displays cycle counts 15 PD38SIM User s Manual 3 Hexadecimal mode Virtual port output results are displayed in hexadecimal mode Output cycle Cycle A Address display area Output data display area Address display area It displays the address to be monitored for virtual port output Output data display area 92938495968789999091192939495969798991 000107 Cycle count display area It displays the data as virtual port output results by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cyde count display are
222. y the string Display character 57 PD38SIM User s Manual 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 Toolbar Scope display area Display of variable type Dispaly of variable value Data display area Dispaly of variable name 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 PD38SIM 1 11 3 Extended Menus in the File Local Window When one of the File Local Window is active in the PD38SIM main display area the Option menu contains the following items Operations related to C function Register selected C variable as C watch point Register pointer of selected C variable as C watch point Set new value for selected C variable Cancel selection of C variable Change contents of display Change radix Layout Turn on off type name Sort Display String Display the string Display character RAM Monita Display RAM monitor
223. zed when the cycle count monitor mode is set ON If the cycle count monitor mode is left ON the results are accumulated each time the program is run To restart monitoring from the beginning set the cycle count monitor mode ON again using the CY cle command it is not necessary to turn the mode OFF beforehand 11 PD38SIM User s Manual 4 PD38SIM Input and Output Files 4 1 Input Files PD38SIM processes the following input files 4 1 1 TEEE 695 Absolute Format Files The EEE 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 ICC740 C compiler made of the IAR company take the attribute 695 4 1 2 Symbol Files This file contains debug information such as symbol information and line number information A SYM file can be generated by specifying the S option when executing LINK74 The file attribute is SYM Although a SYM file is not necessarily required for PD38SIM to operate most of its functions are unavailable to use without a SYM file read in Therefore always be sure to read in a SYM file along with a HEX file 4 1 3 Intel HE X format Files This file contains the machine language generated by the LINK 74 Linker for the SRA74 Assembler The file attribute is HEX PD38SIMSIM reads in a HEX file and loads the target program into the emulator 4 1 4 Register Informatio
Download Pdf Manuals
Related Search
Related Contents
Blackboard Learning System Release 8.0 Folheto de modelo Portégé R700-1D1 BlueBoard-LPC1768-H Copyright © All rights reserved.
Failed to retrieve file