Home
H8S, H8/300 Series Simulator/Debugger User`s Manual
Contents
1. Figure 3 15 Set Register Break Condition Dialog Box 46 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Up to 1024 register break conditions can be specified Register Register name for which the break condition is specified Option Match or mismatch with the data Data Data value used in the break condition if no data is input here a break will occur whenever data is written to the register Data mask Mask condition specifying 0 for a bit masks the bit Size Data size e Break Sequence Set Break Sequence Condition 2 x Address1 JH oo000000 g E a Address2 l al Address3 Address4 Address5 Address6 Address Address8 Figure 3 16 Set Break Sequence Condition Dialog Box Only one sequential break condition can be specified Address1 to Address8 Addresses that must be passed as conditions to generate the break not all of the eight breakpoints have to be set 47 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Break Cycle Set Break Cycle Condition E 2 x Cycle Gount Cancel ALL C Times Figure 3 17 Set Number of Cycles Break Condition Dialog Box Up to 1024 number of cycles break conditions can be specified Cycle Number of cycles required to cause a break H 1 to H FFFFFFFF The condition will be satisfied by execution for the number of cycles in the Cycle setting x n However the speci
2. Choose Create Button from the pop up menu or click the Create Button toolbar button 4 The mouse cursor turns into a symbol Create the button by dragging the mouse cursor from a higher left to a lower right position GUI 1 0 new panel Figure 3 51 GUI I O Window Create Button Double click the created button to open the Set Button dialog box 95 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Set Button Dialog Address fi eB Water l Bengti E Git Eig M NotUse Mask Water 7 Bib e a r Te HAAA Biteymnisol A eivaue E H o00000 Meith ReZ Figure 3 52 Set Button Dialog Box 96 RENESAS H8S H8 300 Series Simulator Debugger User s Manual This dialog box allows the user to specify the details of the pseudo interrupt to be generated by pressing each button Button Name Specifies a name for the button the name will be displayed in the GUI I O window Select Button Type Select Input or Input and Interrupt Interrupt Interrupt Type1 Interrupt vector number Priority Interrupt priority H O to H 11 when the prefix is omitted values input are taken as hexadecimal and the display is in hexadecimal notation Whether or not the interrupt is accepted is determined by the CPU s specification of the selected debugging platform However when H 8 or a larger value is specified for the priority interrupts are always accepted 97 RENESAS H8S
3. Set Text Dialog x Text Text Font Font Name FixedSys Font Size 11 Font dialog box Color Text o Back g Cancel Figure 3 65 Set Text Dialog Box Click the Font button to select the font and size for the text Then click the Text and Back buttons to specify the colors of the text and its background 113 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 6 Changing the Size and Position of an Item Press the k button on the toolbar and click on the item The item is selected as shown in the figure below 4 GUI 170 new panel Figure 3 66 GUI I O Window Item Selected Drag the item to change its position or the control points to change its size 3 11 7 Copying an Item Press the button on the toolbar or choose Copy from the pop up menu The mouse cursor turns into a symbol In this state click on the item you wish to copy Press the button on the toolbar or choose Paste from the pop up menu to create a new item with the same size and attributes 3 11 8 Deleting an Item Press the button on the toolbar or choose Delete from the pop up menu The mouse cursor turns into a symbol In this state click on the item you wish to delete 114 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 9 Showing the Grid Press the button on the toolbar or choose Display Grid from the pop up menu
4. 103 TOOL_INFORMATION TO Outputs information on the currently registered tool to a file 104 TRACE TR Displays trace information 105 TRACE_ACQUISITION TA Enables or disables trace information acquisition 106 TRACE_SAVE TV Outputs trace information into a file 107 TRACE_STATISTIC TST Analyzes statistic information 108 TRAP_ADDRESS TP Sets a simulated I O address 109 TRAP_ADDRESS_ TD Displays simulated I O address settings DISPLAY 110 TRAP_ADDRESS_ TE Enables or disables the simulated I O ENABLE 111 UPDATE_ALL_ UD Updates all build dependencies of the current DEPENDENCIES project 112 WATCH_ADD WA Adds an item for watching 113 WATCH_AUTO_ WU Selects or cancels automatic updating of watched UPDATE items 114 WATCH_DELETE WD Deletes a watched item 115 WATCH_DISPLAY WI Displays the contents of the Watch window 116 WATCH_EDIT WE Edits the value of a watched item 117 WATCH_EXPAND WX Expands or collapses a watched item 118 WATCH_RADIX WR Changes the radix for display of watched items 119 WATCH_RECORD WO Outputs the history of updating of the values of a watched item to a file 120 WATCH_SAVE WS Saves the contents of the Watch window to a file Refer to the simulator debugger help about each command 131 RENESAS 132 H8S H8 300 Series Simulator Debugger User s Manual RENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 6 Messages 6 1 Information Messages The simulator debugger outputs information me
5. 311 9 Showing the Grid porre n E R EE O vectien sees 115 3 11 10 Saving I O Panel Information esesseessesesesessessrsresresrsresresresresrerrnesresresresresresese 115 3 11 11 Loading I O Panel Information ee eee eeceesceeseeeeeeseeeseseeeteeteeenaesnaeenaeens 115 Section 4 WIHJOWS ae ae ene ee eine ee ne nee re nee ee evn ee Peer meen a nee 117 Section S Command AES saesson ens iana ae sa 119 5 1 Commands Functional Order ccccccesscceessseceeseneeeeeseneeecseneeeessnseeeseeeeeesseeseseneeeensees 119 Sll FERC CURLOM 25s foxes fades she soe a lubes shad OE E E 119 5312 Downloaden sd eesigs nse EE scents e aA E E 120 Deed REGISTER enne fia sabeea Coeas coatadatine sche Set sistise seer see sgedunass tees 120 S4 Memory esse ceeees Dass ea Seance covacets goatee sesvuessceauee oi cdevossatnyeasar dence sgegaseanieseyesoasseearoessaesze 121 5 15 Assemble Disassemble sirsiran ai AE EE E Sowers 121 SGS Breaka e S A EE ER E R Set 122 5A 7 TRACC eiaei a Eae EEE IO AN E NEEE 122 DB COvVeTa engagini R E canada E N EEREN 123 5 19 Performante veiren Arai ia A a EO EE Ea AE EEI a pE 123 SALVO Wath issuri aseiksi aai ai aaa aE AVR dune eee ae 123 Sel Script LOS PS essea eai en Ea a E a E E 124 5 112 Memory Reso tCE iiney asacise assesses isenicdeabeuubseaseaueeuicoushs vi sunaseavecuasuaenvesueneesd 124 5 1 13 Simulator Debugger Settings 0 ee cee eeceeseeeseeesecesesseeceesseeeaeseaeeneeeseeeneens 124 5 1 14 Standard I O and Fil
6. C Subroutine Trace Buffer Full Handling Continue C Break Trace Capacity 1024 records Figure 3 23 Trace Acquisition Dialog Box 56 RENESAS H8S H8 300 Series Simulator Debugger User s Manual This dialog box specifies the conditions for trace information acquisition Trace Start Stop Disable Disables trace information acquisition Enable Enables trace information acquisition Instruction Type Instruction Acquires trace information for all instructions Subroutine Acquires trace information for the subroutine instructions only Trace Buffer Full Handling Continue Continues acquiring trace information even if the trace information acquisition buffer becomes full Break Stops execution when the trace information acquisition buffer becomes full The trace buffer capacity can be selected from 1 Kbyte 1 024 records 4 Kbytes 4 096 records 16 Kbytes 16 384 records 32 Kbytes 32 768 records 64 Kbytes 65 536 records 128 Kbytes 131 072 records or 256 Kbytes 262 144 records in Trace Capacity Clicking the OK button stores the settings Clicking the Cancel button closes this dialog box without modifying the settings 57 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 5 3 Acquiring Trace Information After trace acquisition is enabled trace information is acquired during instruction execution The acquired information will be disp
7. Data Area Bit Size Simulated 1 0 Address V Enable o 6 H o0000000 z al Program Area Bit Size Execution Mode D 6 Stop Detail SYSCR Address Response H 0000FF33 z Bl D 40000 Figure 7 6 Simulator System Dialog Box System Page e Confirm that Enable in Simulated I O Address is checked e Click the OK button to enable the simulated I O e Select Simulated I O from the View gt CPU menu and open the Simulated I O window The simulated I O will not be enabled if the Simulated I O window is not open 144 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Simulated 1 0 Figure 7 7 Simulated I O Window 145 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 2 7 Setting the Trace Information Acquisition Conditions e Select Trace from the View gt Code menu to open the Trace window Open the pop up menu by right clicking the mouse on the Trace window and select Acquisition from the pop up menu The Trace Acquisition dialog box below will be displayed Trace Start Stop C Disable Cancel Instruction Type Instruction Subroutine Trace Buffer Full Handling Continue C Break Trace Capacity 1024 records Figure 7 8 Trace Acquisition Dialog Box e Set Trace Start Stop to Enable in the Trace Acquisition dialog box and click the OK button to enable the acquisition of the trace i
8. H8 300 Series Simulator Debugger User s Manual 3 10 Standard I O and File I O Processing Use the Simulated I O window to enable the simulation for standard I O and file I O from the user program 3 10 1 Opening the Simulated I O Window Choose View gt CPU gt Simulated I O or click the Simulated I O toolbar button to open the Simulated I O window Simulated 1 0 Simulated I O Figure 3 53 Simulated I O Window The standard output from the user program is displayed in this window The key input from this window is handled as the standard input to the user program 98 RENESAS 3 10 2 H8S H8 300 Series Simulator Debugger User s Manual T O Functions Table 3 1 lists the supported I O functions The function codes have 16 bit address 24 bit address and 32 bit address versions Select the version suitable for the CPU being used Table 3 1 No 1 T O Functions Function Code H 01 16 bit address H 11 24 bit address H 21 32 bit address Function Name GETC Description Inputs one byte from the standard input H 02 16 bit address H 12 24 bit address H 22 32 bit address PUTC Outputs one byte to the standard output H 03 16 bit address GETS Inputs one line from the standard input H 04 16 bit address H 14 24 bit address H 24 32 bit address PUTS Outputs one line to the standard output H 05 16 bit address H 15 24 bit addre
9. Load Data 24 x fle gt Browse Cancel Figure 3 43 Load Data Dialog Box This dialog box specifies the location and name of a coverage information file to be loaded The placeholder or the Browse button can be used Only COV files can be loaded If a file name extension other than COV is specified an error message will be displayed 3 8 12 Updating the Information Choose Refresh from the pop up menu to update the Coverage window to the latest information 87 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 13 Confirmation Request Dialog Box A confirmation request dialog box will appear when Clear All Clear Data Edit Range or Delete Range is clicked or an attempt is made to close the Coverage window Confirmation Request x Coverage data will be cleared IV Save Coverage data Figure 3 44 Confirmation Request Dialog Box Clicking OK clears the coverage data Choosing Save Coverage data opens the Save Data dialog box figure 3 44 to save the coverage data in a file before it is cleared 88 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 14 Save Coverage Data Dialog Box When File gt Save Session menu option is clicked the Save Coverage Data dialog box will appear which allows the user to save the Coverage window data in separate files or a single file Save Coverage Data Address range 00001000 00001081 No No
10. 15 void main void long a 10 min max long j int i srand 1 printf Data Input tt n for i 0 i lt 10 itt Of j rand if j lt 0 i j j ali j printf a 8d 1d n i alil sort a printf Sorting results k n for i 0 i lt 10 i Jf i printf a d 1d n i alil min a 0 max a 9 min 0 max 0 changela min a 9 max a 0 Figure 7 4 Source Window Setting the Breakpoint 142 RENESAS H8S H8 300 Series Simulator Debugger User s Manual A e is displayed at the line that includes the sort function call indicating that the PC breakpoint is set at the address 7 2 5 Setting the Profiler e Open the Profile window by selecting Profile from the View gt Performance menu Profile B lt Era Show Functions Vatiables JE oa Ee ea eee a ee ust Arey Figure 7 5 Profile Window e Open the pop up menu by right clicking the mouse on the Profile window and select Enable Profiler to enable acquisition of the profile information 143 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 2 6 Setting the Simulated I O When the demonstration project is used the simulated I O is automatically set so check the setting e Open the Simulator System dialog box by selecting Simulator gt System from the Setup menu Simulator System System Memory CPU H8S 2600N
11. 2 Download Command Name Abbreviation Function BUILD BU Performs a build on the current project BUILD_ALL BL Performs a build all on the current project BUILD_FILE BF Compiles files BUILD_MULTIPLE BM Builds multiple projects CLEAN CL Deletes intermediate and output files produced in building DEFAULT_OBJECT_FORMAT DO Sets the default object program format FILE_LOAD FL Loads an object program file FILE_LOAD_ALL LA Loads all object program files FILE_SAVE FS Saves memory to a file FILE_UNLOAD FU Unloads an object program file from memory FILE_UNLOAD_ALL UA Unloads all object program files from memory FILE_VERIFY FV Verifies file contents against memory GENERATE_MAKE_FILE GM Generates a build makefile for the current workspace 5 1 3 Register Command Name Abbreviation Function REGISTER_DISPLAY RD Displays CPU register values REGISTER_SET RS Changes CPU register contents 120 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 5 1 4 Memory Command Name Abbreviation Function CACHE Sets caching on or off MEMORY_COMPARE MC Compares memory contents MEMORY_DISPLAY MD Displays memory contents MEMORY_EDIT ME Modifies memory contents MEMORY_FILL MF Modifies the content of a memory area by specifying data MEMORY_FIND MI Finds a string in an area of memory MEMORY_MOVE MV Moves a block of memory M
12. 80 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 Acquiring Code Coverage The Coverage window acquires code coverage information CO coverage and C1 coverage in the range specified by the user and displays the information 3 8 1 Opening the Coverage Window Choose View gt Code gt Coverage or click the Coverage toolbar button 7 to open the Open Coverage dialog box Open Coverage Options New Window Cancel Start address JH 000800 7 zal End address H 000963 X a Ce fo Breneen C Open a recent coverage file E C Browse to another coverage file Figure 3 37 Open Coverage Dialog Box This dialog box specifies the coverage acquiring range To set coverage for a new range the following two ways are available 81 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Specifying the start and end addresses on the new window Start Address Start address of coverage information display When a prefix is omitted values input are taken as hexadecimal End Address End address of coverage information display When a prefix is omitted values input are taken as hexadecimal e Specifying the file on the new window File Source file whose extension is C or CPP in the current project Functions in the specified file can be set as the coverage range If the extension of the file is omitted C is complemented The file that has other extensi
13. Executes user program until temporary breakpoint 55 HALT HA Halts the user program 56 HELP HE Displays the command line help 57 INITIALIZE IN Initializes the debugging platform 58 LOG LO Controls command output logging 59 MAP_DISPLAY MA Displays memory resource settings 60 MAP_SET MS Allocates a memory area 61 MEMORY_COMPARE MC Compares memory contents 62 MEMORY_DISPLAY MD Displays memory contents 63 MEMORY_EDIT ME Modifies memory contents 64 MEMORY FILL MF Modifies the content of a memory area by specifying data 65 MEMORY FIND MI Finds a string in an area of memory 66 MEMORY_MOVE MV Moves a block of memory 67 MEMORY_TEST MT Tests a block of memory 68 OPEN_TEST OT Opens a test suite 69 OPEN_WORKSPACE OW Opens a workspace 70 PROFILE PR Enables or disables profile 71 PROFILE_DISPLAY PD Displays profile information 72 PROFILE_SAVE PS Saves the profile information to file 73 QUIT QU Exits HEW 74 RADIX RA Sets default input radix 75 REFRESH_SESSION RSE Updates information on the session 129 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 5 1 Simulator Debugger Commands cont No Command Name Abbreviation Function 76 REGISTER_DISPLAY RD Displays CPU register values 77 REGISTER_SET RS Changes CPU register contents 78 REMOVE_FILE REM Removes a file from the current project 79 RESET RE Resets CPU 80 RESPONSE RP Sets an interv
14. Function Call History The simulator debugger displays the function call history in the Stack Trace window when simulation stops which enables program execution flow to be checked easily Selecting a function name in the Stack Trace window displays the corresponding source program in the Editor window This allows the function that has called the current function to also be checked The displayed function call history is updated in the following cases e When simulation stops due to the break conditions described in section 2 15 Break Conditions e When register values are modified while simulation stops due to the above break conditions e While single step execution is performed For details refer to section 17 15 Viewing the Function Call History in the High performance Embedded Workshop V 4 03 User s Manual 21 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 18 Performance Measurement The simulator debugger has the profiler function and performance analysis function for performance measurement of the user program 2 18 1 Profiler The profiler function displays the memory address and size allocated to functions and global variables the number of function calls and the profile data for the entire user program The profile data to be displayed depends on the CPU Profile information is displayed in list tree and chart formats Profile information is useful in optimizing user programs by reducing
15. H8 300 Simulator H8 300 H8 300L Simulator H8 300L H8 300HA Simulator H8 300H advanced mode tS H8 300HN Simulator H8 300H normal mode H8S 2600A Simulator H8S 2600 advanced mode t tS H8S 2600N Simulator H8S 2600 normal mode H8S 2000A Simulator H8S 2000 advanced mode H8SX Advanced Simulator H8SX advanced mode s s 4 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The simulator debugger does not support the following H8S H8 300 series MCU functions Programs that use these functions must be debugged with the H8S H8 300 series emulator e Dual port RAM e Timer Not supported in the H8 300 series only e Pulse width modular e Serial communication interface SCI e A D converter e I O ports e Interrupt controller 2 4 Memory Management Memory Map Specification A memory map is used to calculate the number of memory access cycles during simulation The following items can be specified e Memory type e Start and end addresses of the memory area e Number of memory access cycles e Memory data bus width For details refer to section 3 2 2 Modifying the Memory Map and Memory Resource Settings The user program can be executed in all areas except for the internal I O area Memory Resource Specification A memory resource must be specified to load and execute a user program The following items can be specified e Start address e End address e Access type The access type is readable writable
16. This displays the grid on the background GUI 1 0 new panel Figure 3 67 GUI I O Window Show Grid Clicking the button again hides the grid 3 11 10 Saving I O Panel Information It is possible to reuse created I O panels by saving the information in files Press the fel button on the toolbar or choose Save from the pop up menu to open the Save GUI I O Panel File dialog box Specify the directory where the file is to be stored and enter the file name 3 11 11 Loading I O Panel Information Press the 5 button on the toolbar or choose Load from the pop up menu to open the Load GUI T O Panel File dialog box Specify the file you wish to load Panel information prior to the load will be deleted 115 RENESAS 116 H8S H8 300 Series Simulator Debugger User s Manual RENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 4 Windows Table 4 1 lists the windows Refer to the simulator debugger help about the toolbar buttons Table 4 1 Simulator Debugger Windows Window Name Function Command Line Debugging with the Command Line Interface Coverage Acquiring Code Coverage Disassembly Viewing the Assembly Language Code Editor Viewing a Program Event Using the Simulator Debugger Breakpoints GUI I O Creating a Virtual I O Panel Image Displaying Memory Contents as an Image IO Viewing the I O Memory Label Looking at Labels L
17. ToAl Yes To Al Figure 3 45 Save Coverage Data Dialog Box When multiple Coverage windows are open a Save Coverage Data dialog box will appear for each open coverage window Clicking the No To All button closes the dialog box without saving any coverage data Clicking the Yes To All button saves the data of all Coverage windows in a single file Note If a file is specified for the coverage range not all Coverage windows can be saved in a single file 89 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 15 Displaying the Coverage Information in the Editor Window The coverage information is reflected to the Editor window by highlighting the coverage columns corresponding to the source lines of executed instructions When the coverage settings are modified in the Coverage window the coverage column display will be updated s Demo_H8SXA_16M c jal Coverage S Sowce CS 000800 oid main void long a 10 min max long j int i 000808 srand 1 o0080e printf Data Input n 0008 6e for i O i lt 10 i 000824 j rand o0082c if j3 lt Ojf 000830 j j 000832 a i j 000844 printf a sd sld n i a i 000876 sort ja Figure 3 46 Coverage Column Source 90 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 16 Displaying the Coverage Information in the Disassembly Window The coverage i
18. cee ceseceeceeeeseseeeseeeteeenaeenaeeneeees 55 Viewing Trace Information cic eeeeceesceeseceseeeeeceseseeececesaeeeaeseaeseaesseesseeeaeeeaeenaeesaeenaees 56 3 5 1 Opening the Trace Window ccsdesscescchessuwccsghcbaccenss decepesenseesseesseoueseeasiuessestuneasaiens 56 3 5 2 Specifying Trace Acquisition Conditions 0 cece eeeeseeeseeeseteeeeeseeeeeeeeeeeees 56 3 5 3 Acquiring Trace Information eee cee eeeeseceseceeeeeeeseeeseeeseseaeseeeseeeseeeaeeegs 58 3 5 4 Searching for a Trace Record 0 0 eee ee eeseeeseesseeseeeseceseeeseceeeseeeseeeaeseeseaeeeaeee 59 3 5 5 Clearing the Trace Information eee cece eeceeseeeseeeseeeaeseseseeesseeeaesnaeenaeees 60 3 5 6 Saving the Trace Information in a File wo eee eee eseeeeceeetseeeaeeeseenseeneeeseeeas 60 3 5 7 Viewing the Source File cdsiscstoiesscesctecsesiveesssostsess easpeecsepseseg dogs E ERRE 60 3 9 8 Trimming the Source snosi oresoon nii onai Ee r Oaa E EEEE 60 3 5 9 Analyzing Statistical Information sesseesseseesseresesresreerrsreeresrerterrnrrsrrsrrnresresrnsene 6l Viewing the Profile Imtormations sisisccscsssccsscisce ipessescesesetesdaci cea sapaiensess esevscesabeduedeqvecpeasedets 63 3 6 1 Stack Information Files sissies i 63 3 6 2 Profile Information Fiulesiscccs csscsssssascseestepeisedseecsseashnatuad naasa ipie isiti 65 3 6 3 Loading Stack Information Files sssssesesseeeseesesessesrerrsrrsrenresresresrerrsrrerrnresresens 67 3 0 4 Enabling t
19. details refer to section 3 2 1 Modifying the Simulator System RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 9 H8SX Series CPU Specific Functions Enabling Disabling the Multiplier Divider The user can enable or disable the multiplier or the divider This allows the user to check the difference in performance of the program in cases where the multiplier or the divider is used or not To enable or disable the multiplier or the divider check or uncheck Multiplier or Divider in the Simulator System dialog box respectively Fetch Mode A 16 bit or 32 bit fetch can be selected This allows the user to check the difference in performance of the program with different fetch sizes The fetch mode can be selected by setting of bit FETCHMD in the SYSCR register Endian The endian can be specified by using the ENDIANCR register only when the current MCU mode is the advanced or maximum mode and the size of the address area is 16 Mbytes or 256 Mbytes The byte order of little endian is also supported as the format to save data on memory as well as that of big endian This allows user programs created with little endian to be simulated and debugged Interrupt Control Mode Selection Only bit INTM1 of the interrupt control register INTCR is supported This bit allows selection of the interrupt control mode 2 10 Control Registers The H8S 2600 series and H8SX series simulators debuggers support the SYSCR system control r
20. displayed Type Break types BP PC break BA Access break BD Data break BR Register break register name BS Sequential break BCY Number of cycles break State Whether the breakpoint is enabled or disabled Enable Valid Disable Invalid Condition Condition that causes a break The contents to be displayed depend on the type of the break When the type of the break is BR the register name is displayed and when the type of the break is BCY the number of cycles is displayed BP PC Program counter Corresponding file name line and symbol name BA Address Address Symbol name BD Address Address Symbol name BR Register Register name BS PC Program counter Corresponding file name line and symbol name BCY Cycle Number of cycles displayed in hexadecimal Action Operation of the simulator debugger when a break condition is satisfied Stop Execution halts File Input file name File state Memory data is read from file File Output file name File state Memory data is written to file Interrupt Interrupt type priority Interrupt processing Conditions specifying Stop for Action is displayed on the Software Break tab and the conditions specifying another action type is on the Software Event tab 43 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 4 2 Setting a Breakpoint Selecting Add from the pop up menu in the Event window
21. executed The instruction address following the instruction that caused the error Illegal Instruction The start address of the instruction that caused the error Illegal Operation The instruction address following the instruction that caused the error Use the following procedure when debugging programs that include instructions that generate simulation errors 1 First execute the program in the stop mode and confirm that there are no errors except those in the intended locations 2 After confirming the above execute the program in the continuation mode Note If an error occurs in the stop mode and simulation is continued after changing the simulator debugger mode to the continuation mode simulation may not be performed correctly When restarting simulation always restore the register contents and the memory contents to the state prior to the occurrence of the error Break Due to a Trace Buffer Overflow After the Break mode is specified with Trace Buffer Full Handling in the Trace Acquisition dialog box the simulator debugger stops execution when the trace buffer becomes full The following message is displayed in the Output window when execution is stopped Trace Buffer Full 19 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Break Due to Execution of the SLEEP Instruction When the SLEEP instruction is executed during instruction execution the simulator debugger stops execution The following m
22. in this document for the purpose of military applications such as the development of weapons of mass destruction or for the purpose of any other military use When exporting the products or technology described herein you should follow the applicable export control laws and regulations and procedures required by such laws and regulations All information included in this document such as product data diagrams charts programs algorithms and application circuit examples 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 products listed in this document please confirm the latest product information with a Renesas sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas such as that disclosed through our website http Awww renesas com Renesas has used reasonable care in compiling the information included in this document but Renesas assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information included in this document When using or otherwise relying on the information in this document you should evaluate the information in light of the total system before deciding about the applicability of such information to the intended application Renesas makes no representations warranties or guaranties regarding the suitability
23. of its products for any particular application and specifically disclaims any liability arising out of the application and use of the information in this document or Renesas products With the exception of products specified by Renesas as suitable for automobile applications Renesas products are not designed manufactured or tested for applications or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality and reliability such as safety systems or equipment or systems for transportation and traffic healthcare combustion control aerospace and aeronautics nuclear power or undersea communication transmission If you are considering the use of our products for such purposes please contact a Renesas sales office beforehand Renesas shall have no liability for damages arising out of the uses set forth above Notwithstanding the preceding paragraph you should not use Renesas products for the purposes listed below 1 artificial life support devices or systems 2 surgical implantations 3 healthcare intervention e g excision administration of medication etc 4 any other purposes that pose a direct threat to human life Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use Renesas products in any of the foregoing applications shall indemnify and hold harmless Renes
24. outside the supported range 201 The specified priority is outside the supported range I O DLL Memory Access Error errNum Oxx Address 0xXXXXXXXX An error has occurred during a memory access to the peripheral function errNum shows the details on this error and Address shows the address where this error occurred Correct the user program according to the error information errNum 001 The specified address is outside the supported range 002 No memory exists in the specified area 003 The required memory cannot be allocated 004 The specified data size is outside the supported range 005 The specified address cannot be accessed I O DLL Register Access Error errNum 1xx RegisterName xxxx An error has occurred during a register access to the peripheral function errNum shows the details on this error and RegisterName shows the register where this error occurred Correct the user program according to the error information errNum 100 The register description is incorrect 101 The specified data value is incorrect 135 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 6 2 Error Messages cont Message Conients Memory Access Error One of the following events occurred the information in parentheses Address H nnnnnnnn shows the target address for the operation that generated the error A memory area that had not been allocated was accessed Data was written to a me
25. program Menu Description Step In Executes each statement includes statements within the function Step Over Executes a function call in a single step Step Out Steps out of a function and stops at the next statement of the program that called the function Step Executes the specified number of steps at the specified speed Step In Enters the called function and stops at the statement at the start of the called function e To step in the sort function select Step In from the Debug menu or click the Step In button on the toolbar H Figure 7 21 Step In Button 156 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Tutorial c RES sorta printf k Sorting results n for i 0 i lt 10 i Jf printf a d Id n i a i l min a 0 max a 9 min 0 max 0 changela al min max a 0 nng ununun Nn long t int i j k gap gap il 5 e gap gt 0 for k 0 k lt gap kt for itktgap i lt 10 i itgap for j i gap j gt k j j ga ese ea teeaeae wh alidi ali alitgap alitgap t else Figure 7 22 Source Window Step In e The PC location display gt in the Source window moves to the statement at the start of the sort function 157 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Step Out Steps out of the called function and stops at the next state
26. read only or write only Since an error occurs if the user program attempts an illegal access for example trying to write to read only memory such an illegal access in the user program can be easily detected Unlike the other memory EEPROM is writable by the EEPMOV instruction even if its access type is read only Other instructions than EEPMOV are not available RENESAS H8S H8 300 Series Simulator Debugger User s Manual For details on memory resource setting refer to section 3 2 2 Modifying the Memory Map and Memory Resource Settings 2 5 Instruction Execution Reset Processing The simulator debugger resets the instruction execution counts and the number of instruction execution cycles when e The program counter PC is modified after the instruction simulation stops and before it restarts e The Run command to which the execution start address has been specified is executed e Initialization is performed or the program is loaded RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 6 Exception Processing The simulator debugger detects the generation of TRAPA instructions H8 300H H8S and H8SX series only and trace exceptions H8S and H8SX series only and simulates exception processing Accordingly simulation can be performed even when an exception occurs The simulator debugger simulates exception processing with the following procedures Detects an exception during instruction execution 2 S
27. the address range or function to be measured the coverage statistical information is displayed in percentage This gives the user a clear idea how much the program has been executed The instruction coverage information can be saved in or loaded from a file Only a file in the COV format can be loaded For details refer to section 3 8 Acquiring Code Coverage 24 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 3 Debugging This section describes the simulator debugger operations and their related windows and dialog boxes For details on the functions common to the HEW listed below refer to the HEW help information Preparations for Debugging Viewing a Program Operating Memory Displaying Memory Contents as Waveforms Displaying Memory Contents as an Image Modifying the Memory Contents Viewing the I O Memory Looking at Registers Executing Your Program Viewing the Current Status Synchronizing Multiple Debugging Platforms Debugging with the Command Line Interface Elf Dwarf2 Support Looking at Labels 25 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 1 Creating the Workspace for Simulator Debugger To use the simulator debugger a workspace for the simulator debugger must be created This section only describes the procedures specific to the simulator debugger For details refer to the HEW user s manual 3 1 1 Select
28. the display of green or red respectively in the LED area when the value of bit 2 at address 0x3E0 is 0 or 1 Set LED Dialog Wata Display Glan l Dispayleaioz l Figure 3 62 Set LED Dialog Box Bit Selection 110 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Response to writing of specified values to a selected address The settings shown below set up the display of green or red respectively in the LED area when the value 0x10 or 0x20 is written to address 0x3E0 Set LED Dialog Ed Address 3e0 7 Bl Bib orn Color1 C Color2 C Logie Positive Negative Data Display Color1 fio Display Color2 20 Cancel Figure 3 63 Set LED Dialog Box Data Selection Clicking the Color 1 or Color 2 button opens the Color dialog box which allows you to select the color 111 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 5 Creating Fixed Text Click the s button on the toolbar or choose Create Text from the pop up menu The mouse cursor turns into a symbol Create the text box by dragging the mouse cursor from a higher left to a lower right position GUI 1 0 new panel Figure 3 64 GUI I O Window Create Fixed Text 112 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Setting the format for the text Press the h button on the toolbar and double click on the created text to open the Set Text
29. trace record To open this dialog box choose Find from the pop up menu Trace Search ltem PTA C Cycle Cancel C Address Instruction Value BRA Figure 3 25 Trace Search Dialog Box This dialog box specifies the conditions for searching trace information Specify a search item in Item and search for the specified contents in Value PTR Pointer in the trace buffer 0 for the last executed instruction specify in the form of nnn Cycle Total number of instruction execution cycles Address Instruction address Instruction Instruction mnemonic Clicking the OK button stores the settings and starts searching Clicking the Cancel button closes this dialog box without searching When a trace record that matches the search conditions is found the line for the trace record will be displayed in blue When no matching trace record is found a message dialog box will appear If a search operation is successful choosing Find Next from the pop up menu will move to the next found item 59 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 5 5 Clearing the Trace Information Choose Clear form the pop up menu to empty the trace buffer that stores the trace information If more than one Trace window is open all Trace windows will be cleared as they all access the same buffer 3 5 6 Saving the Trace Information in a File Choose Save from the pop up menu to open t
30. 2 17 Display of Function Call History oe eeeceeeeeeeeeeeecseeeaeeeaeeeaeseeeaeeeseeeaeseaeseneseeeaes 21 2 18 Performance Measurement 6 0 c5c2essccsecscsccsecsettcguceveesaccbvenssecneeaboedoacouatssaea teecvecstaenveesdpedeas 22 ZTS Profle ienne ss seed eases esucs soe vetbedegerves sie sous esta cutee E E ESI EEE RENEE 22 218 2 Performance Analysis ccssssessisczsecsesscoecsiantesdodeavvess loeeyicoshecbessdestnesadenstesedesepessedsspe 22 2 19 PSCuUdO lnterrUpts sco svcsiesssedessec n a E eave svseescd ey Senevaeucesete seth save mevared teesedveyeoues 23 2 207 COVETA RC asome R E escaeved gouees cap cues pdatueg E E 24 SOCOM 5 Debusting ennio cases arn ents dace dedi E 25 3 1 Creating the Workspace for Simulator Debugget eee eee eeeeseeeeeeeeeeeeteeeeaeteaeeenetaes 26 3 1 1 Selecting a Debugging Platform 0 eee ceeeeneeereeeeeeaeeeeeteeeteesaeeeaeeeaeees 26 3 1 2 Setting up a Workspace for the Simulator Debugget eee cece tere teres 27 3 2 Modifying the Simulator Debugger Settings eee cee eeseeeeeeseeeeeseeeaeeeseteseeenetaes 29 7RENESAS 3 3 3 4 3 5 3 6 3 2 1 Modifying the Simulator System esssssesesseseesesseesesrsresresresresreeresrsrenrenresresresrs 29 3 2 2 Modifying the Memory Map and Memory Resource Settings 0 00 0 31 3 2 3 Set Memory Map Dialog BOX siesena niniin aa 33 3 2 4 Set Memory Resource Dialog BOX s ssssesesssseesesssrerersrsresresresresrerrerrsresresresresresese 3
31. 265 6688 Fax lt 852 gt 2730 6071 Renesas Technology Taiwan Co Ltd 10th Floor No 99 Fushing North Road Taipei Taiwan Tel lt 886 gt 2 2715 2888 Fax lt 886 gt 2 2713 2999 Renesas Technology Singapore Pte Ltd 1 Harbour Front Avenue 06 10 Keppel Bay Tower Singapore 098632 Tel lt 65 gt 6213 0200 Fax lt 65 gt 6278 8001 Renesas Technology Korea Co Ltd Kukje Center Bldg 18th FI 191 2 ka Hangang ro Yongsan ku Seoul 140 702 Korea Tel lt 82 gt 2 796 3115 Fax lt 82 gt 2 796 2145 Renesas Technology Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 Jalan Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel lt 603 gt 7955 9390 Fax lt 603 gt 7955 9510 Colophon 6 0 H8S H8 300 Series Simulator Debugger User s Manual 2CENESAS Renesas Electronics Corporation 1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan REJ10B0211 0400
32. 3 3 Simulator System Dialog Box System Tab 29 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The following items can be specified in this dialog box CPU Displays the current CPU The CPU must be specified in the Debug Settings dialog box Data Area Bit Size Specifies the number of bits in the data space The following values Program Area Bit Size SYSCR Address Simulated I O Address Response can be set in each CPU H8 300 H8 300L H8 300HN H8S 2600N and H8S 2000N 16 H8 300HA 17 to 24 H8S 2600A and H8S 2000A 17 to 32 Specifies the number of bits in the program area The following values can be set in each CPU H8 300 H8 300L H8 300HN H8S 2600N and H8S 2000N 16 H8 300HA Same as the number of address space bits H8S 2600A and H8S 2000A 17 to 32 Specifies the SYSCR address Specifies the start address of a simulated I O that performs standard input output or file input output processing from the user program Enable Checking this box enables the simulated I O Specifies the window refresh timing that is how many instructions should be executed between refresh operations D 1 to D 2 147 483 647 The default is D 40000 Execution Mode Specifies whether the simulator debugger stops or continues operation when a simulation error including interrupts occurs It is also possible to specify an action to take place when an interrupt occurs by clicking the Detail b
33. 4 8 Viewing the Source Line for a Breakpoint Select a breakpoint and choose Go to Source from the pop up menu to open the Source or Disassembly window at the address of the breakpoint The Go to Source menu is only available when one breakpoint is selected 3 4 9 Closing Input or Output File Select a breakpoint and choose Close File from the pop up menu to close the selected File Input or File Output data file and to reset the address to read the file 3 4 10 Closing All Input and Output Files Choose Close All Files from the pop up menu to close all File Input and File Output data files and to reset the address for reading the file 55 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 5 Viewing Trace Information The simulator debugger acquires the results of each instruction execution as trace information and displays it in the Trace window The conditions for the trace information acquisition can be specified in the Trace Acquisition dialog box 3 5 1 Opening the Trace Window To open the Trace window choose View gt Code gt Trace or click the Trace toolbar button S 3 5 2 Specifying Trace Acquisition Conditions After the Trace window opens specify the trace acquisition conditions in the Trace Acquisition dialog box To open this dialog box choose Acquisition from the pop up menu Trace Start Stop Disable Cancel mhstruction Type Instruction
34. 5 Simulating Peripheral Functions 20 0 0 ee eee eeeeesceeseeeseceseceseesaecsseseecseeeaeseaeseeeseeeaeeeas 36 3 3 1 Registering Peripheral Function Simulation Modules 00 0 0 eee eeeeeeeeeeee 36 3 3 2 Changing the Addresses of Peripheral Functions ei ceceeseeseeeeeeeeeeeeeeeeneeees 38 3 3 3 Changing the Interrupt Source Information of Peripheral Functions 40 3 3 4 Allocating Memory Resources to the Interrupt Priority Register 42 3 3 5 Viewing the Names of Connected Peripheral Functions 0 cee ee eeeeeeeeeeee 42 Using the Simulator Debugger Breakpoint 0 eee eee eeceseeeneeeaeeeseteneteneraeenaeenaeens 42 34 1 Listing the Break pots sccisscciccs cdeiccs sesatesgedsattants sacesacs easeeeed saacsscdsseties a 42 3 4 2 Setting a Breakpoint snieni esea enaa EE EA eines Oss eae 44 3 4 3 Modifying Breakpoints esseseessesesessesseeresresresrsresresresresresresresrerrnesrenresrenresrest 54 34 4 Enabling A Breakpoint sisson ossen seene aa En i 54 3 4 5 Disabling a Breakpoint 0 eee eee cee cececseeeeeeseceaeeeseessesenesseeseeeaeeeseseaeeeaeees 54 346 Del ting a Breakpoint seseina E Aa E E 54 34 17 Deleting All Break pont esensina rn a eai r a 54 3 4 8 Viewing the Source Line for a Breakpoint sseesseeeseeseeseesssresrerrerreresrreresresrese 55 3 4 9 Closing Input or Output File eee eeeeeecereeeseeeseeeseesneseeeeeesaeenaeenaeenaeens 55 3 4 10 Closing All Input and Output Files eee
35. 62 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Tree Sheet Displays the profile information as a tree diagram e Select the Tree sheet Double clicking the function name in the Profile window expands or minimizes the tree structure El WorkSpace H8 Tut PowerON Reset H o000001ce H O00000000 __INITS cT H 00000000 H 00000000 H main H O00000 0 H 00000000 CLOSEALL H 00000048 H 00000000 _fclose H 00000034 H 00000000 H flelose H 000000A2 H O0000000 __INIT_IOLIB H 000000D8 H O0000000 _freopen H 00000054 H o0000000 OR WWHHH HE OopnoOoOrowuH coo0oaoc co od Figure 7 28 Profile Window Tree Sheet In above figure it can be found that the __flclose function was called three times from the _fclose function the execution cycle was 762 and the internal memory was accessed 48 times 163 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Profile Chart Window Displays the relation of calls for a specific function e Select the __flclose function on the Profile window Open the pop up menu by right clicking the mouse on the Profile window and select View Profile Chart to display the Profile Chart window LT ox _fclose __ flclose _freopen Figure 7 29 Profile Chart Window In the above figure it can be found that the __flclose function was called three times from the _fclose and _freopen functions and t
36. Box e Files to be downloaded are listed in Download Modules e Close the Debug Settings dialog box by clicking the OK button e Download the sample program by selecting Download Modules gt All Download Modules from the Debug menu 140 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 2 3 Displaying the Source Program The HEW supports the source level debugging Display the source file Tutorial c in the Source window e Open the Source window by double clicking Tutorial c on the Workspace window 2 0 x void main void long a 10 min max long j int i srand 1 printf ti t Data Input ttit n for i 0 i lt 10 i j rand ifj lt of j j ali j printf a d 3ld n i aLli sort a printf Sorting results k n for i 0 i lt 10 i Jf printf al amp d 8ld n i aLli min a 0 max a9 min 0 max 0 change a min a 9 max a 0 Figure 7 3 Source Window Displaying the Source Program 141 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 2 4 Setting a PC Breakpoint Breakpoints can be set easily via the Source window To set a breakpoint on a line that includes the sort function call e Place the cursor in the line that includes the sort function call and click the right mouse button to launch the pop up menu and select Toggle Breakpoint from the pop up menu
37. CYCLE BCY Specifies a cycle as a break condition 13 BREAK_DATA BD Specifies a memory data value as a break condition 14 BREAK_DATA_ BDD Specifies a difference between two values of data in DIFFERENCE memory as a break condition 15 BREAK_DATA_ BDI Specifies inversion of the sign of a value of data in INVERSE memory as a break condition 16 BREAK_DISPLAY Bl Displays a list of breakpoints 17 BREAK_ENABLE BE Enables or disables a breakpoint 18 BREAK_REGISTER BR Specifies a register data as a break condition 19 BREAK_SEQUENCE BS Sets sequential breakpoints 20 BUILD BU Performs a build on the current project 21 BUILD_ALL BL Performs a build all on the current project 22 BUILD_FILE BF Compiles files 23 BUILD_MULTIPLE BM Builds multiple projects 127 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 5 1 Simulator Debugger Commands cont No Command Name Abbreviation Function 24 CACHE Sets caching on or off 25 CHANGE_ CC Sets the current configuration CONFIGURATION 26 CHANGE_PROJECT CP Sets the current project 27 CHANGE_SESSION CS Changes the current session 28 CHANGE_SUB_ CB Changes the currently active session when SESSION simultaneous debugging is enabled 29 CLEAN CL Deletes intermediate and output files produced in building 30 CLEAR_OUTPUT_ COW Clears the contents of the specified tab in the WINDOW Output window 31 CLOSE_TEST CT Clo
38. EMORY_TEST MT Tests a block of memory 5 1 5 Assemble Disassemble Command Name Abbreviation Function ASSEMBLE AS Assembles instructions into memory DISASSEMBLE DA Disassembles memory contents SYMBOL_ADD SA Defines a symbol SYMBOL_CLEAR SC Deletes a symbol SYMBOL_LOAD SL Loads a symbol information file SYMBOL_SAVE SS Saves a symbol information file SYMBOL_VIEW SV Displays symbols 121 RENESAS 5 1 6 Break Command Name Abbreviation H8S H8 300 Series Simulator Debugger User s Manual Function BREAKPOINT BP Sets a breakpoint at an instruction address BREAK_ACCESS BA Specifies a memory range access as a break condition BREAK_CLEAR BC Deletes breakpoints BREAK_CYCLE BCY Specifies a cycle as a break condition BREAK_DATA BD Specifies a memory data value as a break condition BREAK_DATA_ BDD Specifies a difference between two values of data in DIFFERENCE memory as a break condition BREAK_DATA_ BDI Specifies inversion of the sign of a value of data in INVERSE memory as a break condition BREAK_DISPLAY Bl Displays a list of breakpoints BREAK_ENABLE BE Enables or disables a breakpoint BREAK_REGISTER BR Specifies a register data as a break condition BREAK_SEQUENCE BS Sets sequential breakpoints SET_DISASSEMBLY_ SDB Sets or deletes a software breakpoint at the SOFT_BREAK disassembly level SET_SOURCE_ SSB Sets or deletes a software breakpoint at the s
39. ENESAS H8S H8 300 Series Simulator Debugger User s Manual Output Profile Information Files Displays the Save Profile Information Files dialog box Profiling results are saved in a profile information file pro extension The optimizing linkage editor optimizes user programs according to the profile information in this file For details of the optimization using the profile information refer to the manual of the optimizing linkage editor Note If profile information has been acquired by choosing the Not trace the function call menu the program cannot be optimized by the optimizing linkage editor Output Text File Displays the Save Text of Profile Data dialog box Displayed contents are saved in a text file Setting This menu has the following submenus the menus available only in the List sheet are also included Show Functions Variables Displays both functions and global variables in the Function Variable column Show Functions Displays only functions in the Function Variable column Show Variables Displays only global variables in the Function Variable column Only Executed Functions Only displays the executed functions If a stack information file sni extension output from the optimizing linkage editor does not exist in the directory where the load module is located only the executed functions are displayed even if this check box is not checked Include Data of Child Functions Sets whethe
40. EPENDENCIES UD Updates all build dependencies of the current project 125 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 5 1 17 Test Tool Facility Command Name Abbreviation Function CLOSE_TEST CT Closes a test suite COMPARE_TEST_DATA CTD Compares test data LOAD_TEST_DATA LTD Loads test data to the Load Test Image File dialog box OPEN_TEST OT Opens a test suite RUN_TEST RT Executes a test SAVE_TEST_DATA STD Saves test data 126 RENESAS 5 2 H8S H8 300 Series Simulator Debugger User s Manual Commands Alphabetical Order Table 5 1 lists the commands in alphabetical order Refer to the simulator debugger help about each command Table 5 1 No Command Name Abbreviation Function Simulator Debugger Commands 1 Comment 2 ADD_FILE AF Adds a file to the current project 3 ANALYSIS AN Enables or disables performance analysis 4 ANALYSIS_RANGE AR Sets or displays performance analysis functions 5 ANALYSIS_RANGE_ AD Deletes a performance analysis range DELETE 6 ASSEMBLE AS Assembles instructions into memory 7 ASSERT Checks if an expression is true or false 8 AUTO_COMPLETE AC Enables or disables the auto complete function 9 BREAKPOINT BP Sets a breakpoint at an instruction address 10 BREAK_ACCESS BA Specifies a memory range access as a break condition 11 BREAK_CLEAR BC Deletes breakpoints 12 BREAK_
41. Electronics 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 mh on lt D D H8S H8 300 Series Simulator Debugger User s Manual Renesas Microcomputer Development Environment System Renesas Electronics Rev 4 00 2007 07 www renesas com 10 11 12 13 Notes regarding these materials This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of Renesas or any third party with respect to the information in this document Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document including but not limited to product data diagrams charts programs algorithms and application circuit examples You should not use the products or the technology described
42. 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 1 2010 Renesas Electronics Corporation Issued by Renesas Electronics Corporation http www renesas com Send any inquiries to http Awww renesas com inquiry 2CENESAS 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 gra
43. a check mark is shown to the left of the menu text 74 RENESAS e Clear Data H8S H8 300 Series Simulator Debugger User s Manual Clears the number of times functions are called Data in the List and Tree sheets of the Profile window are also cleared e Multiple View If a further Profile Chart window is opened while an existing Profile Chart window is already open this option selects whether a new window is opened or the new data is displayed in the existing window When a check mark is shown to the left of this menu item a new window will be opened e Output Profile Information Files Displays the Save Profile Information Files dialog box Profiling results are saved in a profile information file pro extension The optimizing linkage editor optimizes user programs according to the profile information in this file For details on optimization with the profile information refer to the user s manual for the optimizing linkage editor e Expands Size Redo the display with larger intervals between functions The key can also be used to do this e Reduces Size Redo the display with smaller intervals between functions The ce 99 key can also be used to this 3 6 10 Types and Purposes of Displayed Data The profile function is able to acquire the following information Address Size Stack Size Times Profile Data You can view the locations in memory to which the functions are allocate
44. al Access Data 0000271368 OO1EFO 1 E1 E1 lt FAFC 0000271373 OO1EF2 ERO RIL R1L lt 36 0000271381 OO1EF4 H 1EEC 8 Pc lt O0001EEC 0000271385 OO1EEc 1 E0 E0 lt 0004 0000271389 OO1EEE fi E1 R0 RO lt FAFC 0000271393 OO1EFO 1 E1 E1 lt FAFD 0000271398 OO1EF2 ERO RIL R1L lt 00 0000271406 OO1EF4 H LEEC 8 PC lt 00001EF6 0000271410 OO1EF6 ED RO RO lt 0004 0000271420 OO1EFS8 Pc lt 00001500 0000271424 001500 ERO ERO lt O0000 0000271428 001502 ERO ER1 ER1 lt 0000 0000271442 001504 ERO OOOOFBSE lt Figure 7 16 Trace Window Searched Result 7 3 4 Checking Simulated I O Random data that is displayed by the printf function can be checked in the Simulated I O window Simulated 1 0 IEG Data Input a 0 16838 a 1 5758 a 2 10113 a 3 17515 a 4 31051 a 5 5627 a 6 23010 a 7 7419 a 8 16212 a 9 4086 Figure 7 17 Simulated I O Window 153 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Do not close the Simulated I O window 7 3 5 Checking the Breakpoints A list of all the breakpoints that are set in the program can be checked in the Event window e Select Eventpoints from the View gt Code menu ioii BP Enable PC 0B36 Tutorial c 42 Stop 4 gt software Break A Software Event F Figure 7 18 Event Window A breakpoint can be set a new breakpoint can be defined and a breakpoint can be deleted using the E
45. al to refresh the window 81 RUN_TEST RT Executes a test 82 SLEEP Delays command execution 83 SAVE_SESSION SE Saves the current session 84 SAVE_WORKSPACE SW Saves the current workspace 85 SET_DISASSEMBLY_ SDB Sets or deletes a software breakpoint at the SOFT_BREAK disassembly level 86 SET _SOURCE_ SSB Sets or deletes a software breakpoint at the source SOFT_BREAK level 87 SIMULATEDIO_CLEAR SIOC Clears the contents of the Simulated 1 0 window 88 STATE_DISASSEMBLY_ TDB Enables or disables a software breakpoint at the SOFT_BREAK disassembly level 89 STATE_SOURCE_ TSB Enables or disables a software breakpoint at the SOFT_BREAK source level 90 STATUS STA Displays the debugging platform status 91 STEP ST Steps program by instructions or source lines 92 STEP_MODE SM Selects the step mode 93 STEP_OUT SP Steps out of the current function 94 STEP_OVER SO Steps program not stepping into functions 95 STEP_RATE SR Sets or displays rate of stepping 96 SUBMIT SU Executes a command file 97 SYMBOL_ADD SA Defines a symbol 98 SYMBOL_CLEAR SC Deletes a symbol 99 SYMBOL_LOAD SL Loads a symbol information file 100 SYMBOL_SAVE SS Saves a symbol information file 101 SYMBOL_VIEW SV Displays symbols 130 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 5 1 Simulator Debugger Commands cont No Command Name Abbreviation Function 102 TCL Enables or disables the TCL
46. and analyze the performance 3 7 1 Opening the Performance Analysis Window Choose View gt Performance gt Performance Analysis or click the PA toolbar button El to open the Performance Analysis window Performance Analysis Figure 3 35 Performance Analysis Window This window displays the number of execution cycles required for each specified function The number of execution cycles is calculated as follows Execution cycles total number of execution cycles when execution returns from the function total number of execution cycles when the target function is called The following items are displayed Index Index number of the set condition Function Name of the function to be measured or the start address of the function Cycle Total number of instruction execution cycles Count Total number of calls for the function Ratio of execution cycle count required for the function to the execution cycle count required for the whole program 78 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Histogram Histogram display of the above ratio 3 7 2 Specifying a Target Function After the Performance Analysis window is open choose Add Range from the pop up menu or press the Insert key to open the Performance Option dialog box which allows the user to specify a function to be analyzed Performance Option 21x Function Name Po Cancel Figure 3 36 Performance Option Dia
47. as Technology Corp its affiliated companies and their officers directors and employees against any and all damages arising out of such applications You should use the products described herein within the range specified by Renesas especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas shall have no liability for malfunctions or damages arising out of the use of Renesas products beyond such specified ranges Although Renesas endeavors to improve the quality and reliability of its products IC products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Please be sure to implement safety measures to guard against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas 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 applicable measures Among others since the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you In case Renesas products listed in this document are detached from the products to which the Renesas products are attached or affixed the risk
48. aves the PC and CCR in the stack area EXR is also saved when the enabled bit of EXR is on If an error occurs when saving the simulator debugger stops exception processing shows that the exception processing error has occurred and returns to the command input wait state 3 Sets the I bit in CCR to 1 Reads the start address from the vector address corresponding to the vector number If an error occurs when reading the simulator debugger stops exception processing shows that the exception processing error has occurred and returns to the command input wait state 5 Starts instruction execution from the start address If the start address is 0 the simulator debugger stops exception processing shows that the exception processing error has occurred and returns to the command input wait state RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 7 H8S 2000 CPU Specific Functions The H8S 2000 series simulator debugger supports interrupt modes Use the bits INTM1 and INTMO in SYSCR to set the interrupt modes Note that SYSCR only supports INTM1 and INTMO The initial value of the SYSCR address is H FF39 and this value can be changed by changing the SYSCR Address field in the Simulator System dialog box The changed address value is saved in the session file The simulator debugger supports interrupt modes 0 1 and 2 though the availability of interrupt modes depends on the CPU in use The control levels for event driv
49. box and click this button The Set Memory Map dialog box figure 3 5 opens and memory map items can be modified Deletes Memory Map items Select an item to be deleted in the list box and click this button Memory Resource can be added modified or deleted using the following buttons Adds Memory Resource items Clicking this button opens the Set Memory Resource dialog box and memory map items can be specified al Modifies Memory Resource items Select an item to be modified in the list box and click this button The Set Memory Resource dialog box opens and memory map items can be modified lt a Deletes Memory Resource items Select an item to be deleted in the list box and click this button Memory Resource is the same setting information as that of Memory Resource of the Debugger sheet in the H8S H8 300 Standard Toolchain dialog box Modifications are reflected on both items Memory Map and Memory Resource can be reset to the default value by the button Clicking the OK or Apply button stores the modified settings Clicking the Cancel button closes this dialog box without modifying the settings When there is a linkage list file map output by the optimizing linkage editor the memory resource can be automatically allocated according to the memory map and linkage map information For details refer to section 13 1 9 Automatically Allocating the Memory Resource in the High performance Embed
50. but 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
51. c 1 E0 E0 lt 0002 0000271339 OO1EEE E1 RO RO lt FAFA 0000271343 OO1EFO 1 E1 E1 lt FAFE 0000271348 OO1EF2 ERO RIL R1L lt 38 0000271356 OO1EF4 H 1EEC 8 Pc lt O0001EEcC 0000271360 OO1EEc 1 E0 E0 lt 0003 0000271364 OO1EEE E1 R0 RO lt FAFB 0000271368 OO1EFO 1 E1 E1 lt FAFC 0000271373 OO1EF2 ERO RIL R1L lt 36 0000271381 OO1EF4 H 1EEC 8 Pc lt OO001EEcC 0000271385 OO1EEc 1 E0 E0 lt 0004 0000271389 OO1EEE E1 R0 RO lt FAFC 0000271393 OO1EFO 1 E1 E1 lt FAFD 0000271398 OO1EF2 ERO RIL R1L lt 00 Figure 7 14 Trace Window Trace Information Display 151 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 3 3 Performing Trace Search Click the right mouse button on the Trace window to launch the pop up menu and select Find to open the Trace Search dialog box Trace Search ltem C Cycle Cancel C Address Instruction Value BRA Figure 7 15 Trace Search Dialog Box Setting the item to be searched to Item and the contents to be searched to Value and clicking the OK button begins the trace search When the searched item is found the first line is highlighted To continue searching the same contents Value click the right mouse button in the Trace window to display the pop up menu and select Find Next from the pop up menu The next searched line is highlighted 152 RENESAS H8S H8 300 Series Simulator Debugger User s Manu
52. cancels automatic updating of watched items WATCH_DELETE WD Deletes a watched item WATCH_DISPLAY WI Displays the contents of the Watch window WATCH_EDIT WE Edits the value of a watched item WATCH_EXPAND WX Expands or collapses a watched item WATCH_RADIX WR Changes the radix for display of watched items WATCH_RECORD WO Outputs the history of updating of the values of a watched item to a file WATCH_SAVE WS Saves the contents of the Watch window to a file 123 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 5 1 11 Script Logging Command Name Abbreviation Function Comment ASSERT Checks if an expression is true or false AUTO_COMPLETE AC Enables or disables the auto complete function ERASE ER Clears the Command Line window EVALUATE EV Evaluates an expression LOG LO Controls command output logging SLEEP Delays command execution SUBMIT SU Executes a command file TCL Displays TCL information 5 1 12 Memory Resource Command Name Abbreviation Function MAP_DISPLAY MA Displays memory resource settings MAP_SET MS Allocates a memory area 5 1 13 Simulator Debugger Settings Command Name Abbreviation Function EXEC_MODE EM Sets and displays execution mode EXEC_STOP_SET ESS Sets or displays the execution mode at the occurrence of an interrupt 5 1 14 Standard I O and File I O Command Name Abbreviation Function SIMULATEDIO_CLEAR SIOC Clears the con
53. clean build Warning when workspace and or project is read only Cancel Figure 3 29 Options Dialog Box 68 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 4 Enabling the Profile Choose View gt Performance gt Profile to open the Profile window Choose Enable Profiler from the pop up menu of the Profile window The item on the menu will be checked 3 6 5 Specifying Measurement Mode You can specify whether to trace functions calls while profile data is acquired When function calls are traced the relations of function calls during user program execution are displayed as a tree diagram When not traced the relations of function calls cannot be displayed but the time for acquiring profile data can be reduced To stop tracing function calls choose Disable Tree Not traces function call from the pop up menu in the Profile window a check mark is shown to the left of the menu item When acquiring profile data of the program in which functions are called in a special way such as task switching in the OS stop tracing function calls 3 6 6 Executing the Program and Checking the Results After the user program has been executed and execution has been halted the results of measurement are displayed in the Profile window The Profile window has two sheets a List sheet and a Tree sheet 69 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 7 List Sheet Th
54. d Sorting the list of functions and global variables in order of their addresses allows the user to view the way the items are allocated in the memory space Sorting in order of size makes it easy to find small functions that are frequently called Setting such functions as inline may reduce the overhead of function calls When there is deep nesting of function calls pursue the route of the function calls and obtain the total stack size for all of the functions on that route to estimate the amount of stack being used Sorting by the number of calls or accesses makes it easy to identify the frequently called functions and frequently accessed global variables Measurement of a variety of CPU specific data is also available as follows 75 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Cycle the number of execution cycles e Ext_mem the number of external memory accesses e I O_area the number of internal I O area accesses e Int_mem the number of internal memory accesses The number of execution cycles is calculated by subtracting the total execution cycles at a specific function call instruction execution from the total execution cycles at a return instruction execution of a specific function 3 6 11 Creating Profile Information Files To create a profile information file choose the Output Profile Information Files menu option from the pop up menu The Save Profile Information Files dialog box
55. ded Workshop V 4 03 User s Manual 32 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 2 3 Set Memory Map Dialog Box The Set Memory Map dialog box specifies the memory map of the target CPU The contents displayed in this dialog box depend on the target CPU The simulator debugger uses the specified data to calculate the number of cycles for memory accesses Set Memory Map H o0000000 f E Figure 3 5 Set Memory Map Dialog Box 33 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The following items are specified Memory type Memory type ROM Internal ROM RAM Internal RAM EXT External memory IO Internal I O EEPROM EEPROM Begin address Start address of the memory corresponding the memory type End address End address of the memory corresponding to the memory type Data bus size Memory data bus width Read state count Number of cycles states for read access to the specified type of memory Write state count Number of cycles states for write access to the specified type of memory Clicking the OK button stores the settings Clicking the Cancel button closes this dialog box without modifying the settings Note The memory map setting for the area allocated to a system memory resource cannot be deleted or modified First delete the system memory resource allocation on the Memory tab of the Simulator System dialog box then delete or mo
56. der certain 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
57. dify the memory map setting 34 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 2 4 Set Memory Resource Dialog Box The Set Memory Resource dialog box sets and modifies memory resources Set Memory Resource Begin Address H o0000000 x End Address H 0000FFFF Attribute Read Write Cancel Figure 3 6 Set Memory Resource Dialog Box The following items are specified Begin Address Start address of the memory area to be allocated End Address End address of the memory area to be allocated Attribute Access type Read Read only Write Write only Read Write Readable writable Click the OK button after specifying the Begin Address End Address and Attribute Clicking the Cancel button closes this dialog box without modifying the settings Note If memory resources are set memory in the host computer will be used If the user allocates too much memory resources operation of the host computer will be extremely slow 35 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 3 Simulating Peripheral Functions The simulator debugger is able to simulate peripheral functions by using DLL modules This section describes how to register the peripheral function simulation modules to enable the simulation of individual peripheral functions and how to set their configurations 3 3 1 Registering Peripheral Function Simulation Modules Peripheral function simulati
58. e 3 8 7 Deleting the Selected Coverage Range Select a coverage range and choose Delete Range from the pop up menu to delete the selected coverage range 85 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 8 Acquiring Coverage Information Specify a coverage range choose Enable Coverage from the pop up menu and execute the user program to acquire coverage information By default Enable Coverage is selected 3 8 9 Clearing Coverage Information Specify a coverage range and choose Clear Data from the pop up menu to clear the acquired coverage information 3 8 10 Saving Coverage Information in a File Choose Save Data from the pop up menu to open the Save Data dialog box which allows the user to save the coverage information in a file File name filet cov gt Browse Cancel Figure 3 42 Save Data Dialog Box This dialog box specifies the location and name of a coverage information file to be saved The placeholder or the Browse button can be used If a file name extension is omitted COV is automatically added If a file name extension other than COV or TXT is specified an error message will be displayed 86 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 11 Loading Coverage Information from a File Choose Load Data from the pop up menu to open the Load Data dialog box which allows the user to load the coverage information from a file
59. e VO ee eeeceeseeseeseeseeeececeeceeceeeseeeaeeaeeaeeseseeeeeeseaeeeees 125 Selo UOV aea scte toate E E A E E E 125 DAG Project Workspace s onies cnie easa AR E iea 126 SALT Test Tool Fachity encre ian r e E E S RER 126 5 2 Commands Alphabetical Order 000 0 eeeceesceceseeceseeceneeceeecesneceneecseeeceaeeceaeseaeesenaeeeaeees 127 Sectiow 6 Me ssageSsereininieonnnoiii ease e A A aE ERAR 133 6l Information Messagess sceic i ciiieeeead ca lesciaceid NRE ER A EE ERE EREE 133 0 2 Error Messages si srssnn ineeie eion e ieo REENER AE E AEE EAE ERE 134 Section 7 Tutorial cisien aiea a E EEES 137 TA Preparations ssreunee nna E N 137 Tell Sampl Program scrret reaper aisee pannari RRES EEPO iE PEE KREK ENESE 137 7 1 2 Creating the Sample Program iiisriiriisessiscsiicneresrisenisiireressotsonsiiiea rici ieks ikusa 137 72 Settings Tor DEDU SINE soseri rar ai oeer er er naene set PEO os a REST SEEEN 138 iv 7 3 7 2 1 Allocating the Memory Resource 00 eee eceeceeseeeseeesecesececeeaeeeseeeaeesaeesseeseeesees 138 7 2 2 Downloading the Sample Program 0 eee ee eee eseeeseceeececeeeeeeseeeseeeaeeeaeesaeesaes 140 7 2 3 Displaying the Source Program 00 cece eeeeseeeseeeseeeseseeeceeeaeenaeeeaecsaeesseeneeeaees 141 724 Setting a PC Breakpointsssce diss cascisscecastos betes sc lenctecagena eens eseises hesvad gesweiees 142 72 9 Setting the Prowler ccjetsvs cecieets otic cives ceevtbesviea ines seats ass deena wepioeee
60. e pop up menu in the Profile window Profile C Hew3 Sample El _PowerON_Reset 000400 H 00000028 H 00O0O00OS 1 main 000800 H 00000164 H 0O000003E 0 _srand 0010D6 H ooo0000 c H 0O000O0004 0 _rand 00109 H o00000038 H OOOO000c 0 __ print OOOF96 H o00000052 H OO00000c 0 0 0 0 4 4 _ change 000494 H O00000A8 H O00OO0O3A _sort 000964 H 00000136 H 00000018 __INITSCT OOOF3A H OO000000 H FFFFFFFF __CLOSEALL OOOE78 H o0000062 H O000000A4 ooo 0 0c 0c O Oo o __INIT_IOLIB 000D36 H 00000142 H 00000010 4 oyu Tree Figure 3 31 Tree Sheet Double clicking a function in the Function column expands or reduces the tree structure display The expansion or reduction is also provided by the or key Double clicking the Address column displays the source program corresponding to the specific address Right clicking on the mouse within the window displays a pop up menu Supported menu options are as follows e View Source Displays the source program or disassembled memory contents for the address in the selected line e View Profile Chart Displays the Profile Chart window focused on the function in the specified line e Enable Profiler Toggles acquisition of profile data When profile data acquisition is enabled a check mark is shown to the left of the menu text 71 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Not t
61. e when Equal or Not equal has been selected Size Data size Sign Sign of the data This option is only available when Difference has been selected Note Since Inverse sign and Difference require comparison of the data with the value previously written to memory the break will never occur on the first test after a reset or break generation when either of these conditions has been selected 49 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Selecting an Action in Response to a Break If you click on OK after setting break conditions in the dialog boxes described on the preceding pages the Select Break Type dialog box is opened again Select an action type in the Action type field of this dialog box Select Break Type 2h xe Break type PC Breakpoint v Detail Action type File Input x Detail Figure 3 19 Select Break Type Dialog Box The following options are available Stop Execution of the user program is stopped when the condition is satisfied File Input The contents of a specified file are read out and written to the specified memory when the condition is satisfied File Output The contents of the specified memory are read out and written to the specified file when the condition is satisfied Interrupt Interrupt processing proceeds when the condition is satisfied 50 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Setting Details of
62. eceseeseeeseeeseeeaeeeaeseeeseeeeaeenaeees 89 3 8 15 Displaying the Coverage Information in the Editor Window eee 90 3 8 16 Displaying the Coverage Information in the Disassembly Window 91 Generating a Pseudo Interrupt Manually 000 0 eee eeceeseeeseeeseeeseceeeceeeaeeeaeeeaeesseeeees 92 39 1 Trigger Window nirso ea oth oss Eaa AEN EE E oa 92 39 2 GULO WindoW seriscesousnecinoneamni a A 94 Standard I O and File I O Processing seeseeseereeeesrereeseerssrsrrsresresresrenrssrerenisresreeiesresrset 98 3 10 1 Opening the Simulated I O WindoW seesseseeeeseeseesssreerrsrsrrsrrssrnresrisrrsrreresresrnee 98 3 10 2 TO FUNnCHONS sociis cssieds cessvaesediede ts ceseeeny eeN EOE eE E AEA R EREE 99 Creating a Virtual VO Panelississisecasrircneiissnsineia r r s 102 3 11 1 Opening the GUI I O Window ssseseessessesssreressrsresesresrrsresresrerrssrsrenresresresrent 103 311 2 Creating a Button sois iesene esien aparana css vensedastvesseceescesecs EERE SSS 104 3 113 Creating a Labe liissi enep re A r Ea E a aa a idea aE 106 3 TLA Creating an LED oreen arae E OE E E E E a AEEA 109 311 3 Creatine Fixed TEXt wsccsccclscevesed sess cave e iene eins vee evens sono ntaee dectbns Suctoe 112 3 11 6 Changing the Size and Position of an Item ee eee eese eee eeeeseeeeseeeseeeaeees 114 311 7 COpyin 2am Menis e sesei E o EEE E E R esses 114 ILLS Deleting an Hem sscisiscss cisvsssyveesiogsasees Setes aa e E i 114
63. ected a configuration for the selected target is also generated an abbreviation including the target name This configuration name can be changed in Configuration name Sets the debugger target options To modify an option select Item and click Modify If the selected item cannot be modified Modify remains gray even when Item is selected Simulator I O Simulation for standard I O or file I O from the user program is enabled Enable or disabled Disable Simulator I O addr Address for the above simulated I O Bus mode Currently not used by the simulator debugger RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 2 Modifying the Simulator Debugger Settings This section describes how to modify the simulator system memory map and memory resource settings after the simulator debugger is started 3 2 1 Modifying the Simulator System The System tab in the Simulator System dialog box is used to modify the location to start the simulated I O and execution mode Choose Setup gt Simulator gt System or click the Simulator System toolbar button tt to open the System tab in this dialog box Simulator System System Memory CPU H8S 26004 ha Data Area Bit Size Simulated 1 0 Address V Enable D 24 H o0000000 x a Program Area Bit Size Execution Mode D24 Stop Detail SYSCR Address Response H 00FFFF39 bi fa D 40000 Cancel sopi Figure
64. egister as the control register mapped to the memory It enables multiplication accumulation operation user program simulation for EXR accessing and debugging The SYSCR address is set in SYSCR Address in the Simulator System dialog box For modifying or displaying the control register use the IO window For details refer to section 3 2 1 Modifying the Simulator System in this document or section 17 6 Looking at I O Memory in the High performance Embedded Workshop V 4 03 User s Manual RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 11 Timer H8S Series and H8SX Series 2 11 1 Supported Range The H8S and H8SX series simulator debugger supports channel 0 of 16 bit timer pulse unit 0 This simulator debugger only supports interrupts by an overflow or a compare match not a function with an input to or output from pins such as the input capture function 2 11 2 Control Registers This simulator debugger supports timer registers Table 2 2 shows the control registers supported by the simulator debugger The addresses of the timer control registers interrupt vector numbers and positions of the interrupt priority registers can be changed in the Peripheral Module Configuration dialog box For details on the Peripheral Module Configuration dialog box refer to section 3 3 Simulating Peripheral Functions Table 2 2 Timer Control Registers Supported by the Simulator Debugger Timer Supported Control Regis
65. elects whether the data should be appended to the file if an existing file is specified as the output file Address Memory address to read data from Data size Size of each data value to be read 1 2 4 8 Count Number of values to be read H 1 to H FFFFFFFF when the prefix is omitted values input are taken as decimal and the display is in decimal notation 52 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Interrupt Interrupt type1 Ho Interrupt type2 Cancel Priority H O Figure 3 22 Set Interrupt Action Dialog Box When the condition is satisfied interrupt processing proceeds For details refer to section 2 19 Pseudo Interrupts Interrupt type 1 Sets the following values for each CPU when the prefix is omitted values input are taken as hexadecimal and the display is in hexadecimal notation Priority Interrupt priority H O to H 11 when the prefix is omitted values input are taken as hexadecimal and the display is in hexadecimal notation Whether or not the interrupt is accepted is determined by the CPU s specification of the selected debugging platform However when H 8 or larger is specified for the priority interrupts are always accepted 53 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Point for Caution When the same file is specified for multiple File Input actions the simulator debugger will read data from the file in the order o
66. en interrupts vary as follows e If Interrupt is selected and Priority is 0 in the Action type field of the Select Break Type dialog box the control level is 0 e If Interrupt is selected and Priority is not 0 in the Action type field of the Select Break Type dialog box the control level is 1 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 8 H8S 2600 CPU Specific Functions MAC Instruction The multiplication accumulation operation MAC instruction can be performed on the H8S 2600 CPU In this instruction a saturation and non saturation operations are selectable The simulator debugger determines the operation with a value of bit 7 hereafter called as the MACS bit in the SYSCR register of internal I O MACS bit 0 Non saturation operation MACS bit 1 Saturation operation EXR Register The EXR register can be used on the H8S 2600 CPU It is also possible to set the enable or disable state of this register The simulator debugger determines the operation with a value of bit 5 hereafter called as the EXR bit in the SYSCR register of internal I O EXR bit 0 EXR disabled EXR bit 1 EXR enabled The SYSCR address is set in SYSCR Address in the Simulator System dialog box Note Set the SYSCR address in the internal I O Note that the simulator debugger determines the MACS bit as 0 non saturation and the EXR bit as 0 EXR disabled when the SYSCR address is set other than the internal I O For
67. enu to open the Coverage Range dialog box Coverage Range Start address H 000800 7 End address H 000963 Cancel C File gt Browser Figure 3 40 Coverage Range Dialog Box Specifying Address 84 RENESAS H8S H8 300 Series Simulator Debugger User s Manual This dialog box specifies the condition to acquire instruction execution information The following items can be specified Start address Start address When a prefix is omitted values input are taken as hexadecimal End address End address When a prefix is omitted values input are taken as hexadecimal Clicking OK changes the coverage range e Specifying the coverage range with a source file Choose Edit Range from the pop up menu to open the Coverage Range dialog box Coverage Range G Stet address i E End address afa Cancel Qo _26004 Demo_H85_26004 c gt Browse Figure 3 41 Coverage Range Dialog Box Specifying Source File This dialog box specifies the condition to acquire instruction execution information The following items can be specified File Source file whose extension is C or CPP in the current project Functions in the specified file can be set as the coverage range If the extension of the file is omitted C is complemented The file that has other extensions than C or CPP cannot be specified A placeholder or the Browse button is available Clicking OK changes the coverage rang
68. essage is displayed in the Output window when execution is stopped Sleep Note When restarting execution change the PC value to the instruction address at the restart location Break Due to the Stop Button Users can forcibly terminate execution by clicking the HALT button during instruction execution The following message is displayed on the status bar when execution is stopped Stop Execution can be resumed with the GO or STEP command 20 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 16 Floating Point Data Floating point numbers can be used for the following real number data which makes floating point data processing easier The following data can be specified for floating point data e Data when the break type is set to Break Data or Break Register in the Select Break Type dialog box e Data in the Memory window e Data in the Fill Memory dialog box e Data in the Search Memory dialog box e Input data in the Register dialog box The floating point data format conforms to the ANSI C standard In the simulator debugger the round to nearest RN mode is applied as the rounding mode for floating point decimal to binary conversion If a denormalized number is specified for binary to decimal or decimal to binary conversion it is left as a denormalized number in RN mode If an overflow occurs during decimal to binary conversion the infinity is returned in RN mode 2 17 Display of
69. etween a pseudo interrupt occurrence and its acceptance only the interrupt that has a higher priority can be accepted 3 Break by pseudo interrupts The user can select whether or not to cause a break when a pseudo interrupt occurs This can be set in the Simulator System dialog box or by the EXEC_STOP_SET command Note In the pseudo interrupts whether an interrupt is accepted is determined by interrupt information Priority not the vector number Note that when H 8 is specified as the priority level of an interrupt that interrupt is always accepted The simulator debugger does not simulate the operation of the interrupt controller 23 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 20 Coverage The simulator debugger acquires instruction coverage information during instruction execution within the measurement range specified by the user In the measurement range addresses are directly specified and all functions in a file whose name has been specified are set The state of each instruction execution can be monitored through the instruction coverage information In addition this information can be used to determine which part of a program has not been executed The Coverage window displays the acquired instruction coverage information The instruction coverage information can be displayed in the Editor window by highlighting the column corresponding to the source line of the executed instruction For
70. f condition satisfaction When the same file is specified for multiple File Output actions the simulator debugger will write data to the file in the order of condition satisfaction However when the same file is specified for File Input and File Output the only valid action is that for the first condition to be satisfied 3 4 3 Modifying Breakpoints Select a breakpoint to be modified and choose Edit from the pop up menu to open the Select Break Type dialog box which allows the user to modify the break conditions The Edit menu is only available when one breakpoint is selected 3 4 4 Enabling a Breakpoint Select a breakpoint and choose Enable from the pop up menu to enable the selected breakpoint 3 4 5 Disabling a Breakpoint Select a breakpoint and choose Disable from the pop up menu to disable the selected breakpoint When a breakpoint is disabled the breakpoint will remain in the list but a break will not occur when the specified conditions have been satisfied 3 4 6 Deleting a Breakpoint Select a breakpoint and choose Delete from the pop up menu to remove the selected breakpoint To retain the breakpoint but not have it cause a break when its conditions are met use the Disable option see section 3 4 5 Disabling a Breakpoint 3 4 7 Deleting All Breakpoints Choose Delete All from the pop up menu to remove all breakpoints 54 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3
71. fied number of cycles may differ from the number of cycles on which the condition is satisfied Count Number of times the break will occur ALL The break will occur whenever the condition is satisfied Times The break will only occur up to the number of times specified as Times 1 to 65535 if the prefix is omitted values input are taken as hexadecimal and the display is in hexadecimal notation 48 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Break Data Set Break Data Condition E 2 x Address H 00000000 a 7 Option Equal Cancel Data H O E Data mask HFFFFFFFF Size Long word k Sign s igned Figure 3 18 Set Data Break Condition Dialog Box Data break conditions should be set as follows Up to 1024 data break conditions can be specified Address Address in memory for which the break condition is specified Option How the data value is used to form the condition that must be satisfied for break generation Equal The value written to memory matches Data Not equal The value written to memory does not match Data Inverse sign The sign of the value written to memory is the inverse of that for the previous value Difference The difference between the current and previous values written to memory exceeds Data Data Data value used in the break condition Data mask Mask condition specifying 0 for a bit masks the bit This option is only availabl
72. for the priority interrupts are always accepted 93 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Clicking the OK button stores the setting Clicking the Cancel button closes this dialog box without setting the details of the interrupt Note If the Cancel button is clicked after multiple trigger button settings are modified the modifications of all those buttons are canceled e Changing the number of trigger buttons Specify the number of trigger buttons displayed in the Trigger window in the Number of Buttons submenu in the pop up menu 4 16 64 or 256 can be selected e Changing the size of trigger buttons Specify the size of trigger buttons displayed in the Trigger window in the Size submenu in the pop up menu Large Normal or Small can be selected 3 9 2 GUI I O Window Choose View gt Graphic gt GUI I O or click the GUI I O toolbar button fj to open the GUI T O window GUI IFO Sample_pnl 7 2 9 HET bs Input Panel oil Figure 3 50 GUI I O Window 94 RENESAS H8S H8 300 Series Simulator Debugger User s Manual This window displays buttons that generate pseudo interrupts manually The details of the interrupt to be generated by pressing each button can be specified in the Set Button dialog box For details on the interrupt processing in the simulator debugger refer to section 2 19 Pseudo Interrupts e Setting a button
73. generated by the sort function and sorts the data in the descending order using the change function 4 Displays the random data and the sorted data using the printf function The HEW demonstration program is used as the sample program 7 1 2 Creating the Sample Program Note the following when creating the HEW demonstration program e Specify Demonstration for Project Type in Creating a New Workspace e Specify 2600 for CPU Series e Specify H8S 2600N Simulator for Target e Specify SimDebug_H8S 2600 SimDebug_H8S 2600N z for the configuration on the toolbar before building the project e Specify SimSessionH8S 2600 SimSessionH8S 2600N T for the session on the toolbar e This demonstration program uses no peripheral function timer In the Set Peripheral Function Simulation dialog box that opens when the session is changed check Don t show this dialog box and then press the OK button 137 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Since this section explains the debugging function Demonstration has not been optimized Do not change this setting 7 2 Settings for Debugging 7 2 1 Allocating the Memory Resource The allocation of the memory resource is necessary to run the application being developed When using the demonstration project the memory resource is allocated automatically so check the setting e Select Simulator gt Memory Resource from the Setu
74. haracter string is specified by Start and End When Default is selected the input value or character string cannot be specified as a range To specify a range select Range 61 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Set Adds a new condition to the current one New Creates a new condition Result Obtains the result of statistical information analysis Clear Clears all condition and results of statistical information analysis Clicking the Close button closes this dialog box 62 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 Viewing the Profile Information The profile function enables function by function measurement of the performance of the application program in execution This makes it possible to identify parts of an application program that degrade its performance and the reasons for such degradation The HEW displays the results of measurement in three windows according to the method and purpose of viewing the profile data 3 6 1 Stack Information Files The profile function allows the HEW to read the stack information files extension SNI which are output by the optimizing linkage editor ver 7 0 or later Each of these files contains information related to the calling of static functions in the corresponding source file Reading the stack information file makes it possible for the HEW to display information related to the calling of functions without execu
75. he Save As dialog box which allows the user to save the contents of the trace buffer as a text file A range can be specified based on PTR Note that this file cannot be reloaded into the trace buffer 3 5 7 Viewing the Source File The Editor window corresponding to the selected trace record can be displayed in the following two ways e Select a trace record and choose View Source from the pop up menu e Double click a trace record The Editor or Disassembly window opens and the selected line is marked with a cursor 3 5 8 Trimming the Source Choose Trim Source from he pop up menu to remove the white space from the left side of the source When the white space is removed a check mark is shown to the left of the Trim Source menu To restore the white space choose Trim Source while the check mark is shown 60 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 5 9 Analyzing Statistical Information Choose Statistic from the pop up menu to open the Trace Statistic dialog box and analyze statistical information under the specified conditions Statistic Statistic Analysis Default C Range ltem lt None gt Start End Result Condition Amount Figure 3 26 Trace Statistic Dialog Box This dialog box allows the user to analyze statistical information concerning the trace information The target of analysis is specified in Item and the input value or c
76. he Profiles ssnin eisa a a g 69 3 6 5 Specifying Measurement Mode ssesseesssseesesrssesressesresresrrsrsresesresresresrnsrseresese 69 3 6 6 Executing the Program and Checking the Results 0 eee eeeeeeceseeeneeeeeeee 69 36 List Sheptosrin erena R e E estos doves E 70 36 8 Tree SHES ie aerea A AE A Ineevenes 71 3 7 3 8 3 9 3 6 9 Profile Chart WindOW cccccsssssssssssssssssssssssssssssssssssesessssssssssssessssesssssessseeeseees 74 3 6 10 Types and Purposes of Displayed Data ee eee eee cee eeeeeseeeeeeeeeseeeneeenee 75 3 6 11 Creating Profile Information Files 00 0 eseeseeseeseeeeeeseseeeseneeeeeeaeenaeens 76 3612 INOUCS ves fabs 5s ftosss an chest du boa oy Suc Lad A E A A A eee 77 Analyzing Performance seese asa 228s nrn E O acters ios tev EE e AA ener aes E 78 3 7 1 Opening the Performance Analysis WindoW sesssssseeseesseseesssreresresresreeresresreee 78 3 7 2 Specifying a Target FUMCtion 2 eee eeeeeeceeeeeeecseeeaeeeaeeeaeseaeseeeseeeaeeeseseeeees 79 3 7 3 Starting Performance Data Acquisition esseseeseeseersererrerrsrreesresresrsrrsresrrsresreet 79 3 7 4 Resetting Datare eenienieviinenairii togvdaeneendende sli eden iene R 79 3 7 5 Deleting a Target FUNCHON iss scssitecsseesesseuciegs Saudeonsesscebcdedaceses vanaseasedazenessapesebactens 80 3 7 6 Deleting All Target FUnctions cece cece cess eeeeeeeeeeeeaeeeaeseaeseeeseesaeeeaeeeaeees 80 3 7 7 Saving the Currently Displayed Content
77. he _close function was called three times This is the end of the tutorial using the simulator debugger 164 RENESAS Renesas Microcomputer Development Environment System User s Manual H8S H8 300 Series Simulator Debugger Publication Date Rev 4 00 July 25 2007 Published by Sales Strategic Planning Div Renesas Technology Corp Edited by Customer Support Department Global Strategic Communication Div Renesas Solutions Corp 2007 Renesas Technology Corp All rights reserved Printed in Japan Renesas Technology Corp Sales Strategic Planning Div Nippon Bldg 2 6 2 Ohte machi Chiyoda ku Tokyo 100 0004 Japan 2CENESAS RENESAS SALES OFFICES http www renesas com Refer to http Awww renesas com en network for the latest and detailed information Renesas Technology America Inc 450 Holger Way San Jose CA 95134 1368 U S A Tel lt 1 gt 408 382 7500 Fax lt 1 gt 408 382 7501 Renesas Technology Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel lt 44 gt 1628 585 100 Fax lt 44 gt 1628 585 900 Renesas Technology Shanghai Co Ltd Unit 204 205 AZIACenter No 1233 Lujiazui Ring Rd Pudong District Shanghai China 200120 Tel lt 86 gt 21 5877 1818 Fax lt 86 gt 21 6887 7898 Renesas Technology Hong Kong Ltd 7th Floor North Tower World Finance Centre Harbour City 1 Canton Road Tsimshatsui Kowloon Hong Kong Tel lt 852 gt 2
78. he settings 41 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 3 4 Allocating Memory Resources to the Interrupt Priority Register The peripheral function simulation module does not allocate the interrupt priority register IPR to a location in memory Allocate the memory resource for the interrupt priority register IPR through user operation For details on the setting of memory resources refer to section 3 2 2 Modifying the Memory Map and Memory Resource Settings 3 3 5 Viewing the Names of Connected Peripheral Functions After the simulator debugger has been initiated Peripheral Modules on the Platform sheet of the Status window shows the names of the peripheral functions that are connected 3 4 Using the Simulator Debugger Breakpoints Sophisticated breakpoint functions are available in the simulator debugger in addition to the HEW standard PC breakpoints The user can specify break conditions and actions after a break condition is satisfied and can display the breakpoints set 3 4 1 Listing the Breakpoints Choose View gt Code gt Eventpoints or click the Eventpoints toolbar button En to open the Event window which lists the breakpoints set Event Bf X e Type Action BP Enable PC 000800 Demo H82600A c 24 main Stop Software Break A Software Event Figure 3 11 Event Window 42 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The following items are
79. imulator Debugger User s Manual 3 6 3 Loading Stack Information Files You can select whether or not to read the stack information file in a message box for confirmation that is displayed when a load module is loaded Clicking the OK button of the message box loads the stack information file The message box for confirmation will be displayed when e There are stack information files extension SNI e The Load Stack Information Files SNI files check box is checked in the Confirmation tab of the Options dialog box figure 3 29 that can be opened by choosing Setup gt Options from the main menu 67 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Options Build Editor Debug Workspace Confirmation Network m Display confirmation dialogs for External editor change warning Set All MIGo when no programs downloaded Initialize Target Clear All Invalid macro initial directory i Keyboard shortcut overwrite jLoad Program oad Stack Information Files SNI files Loading Labels jLose session changes on refresh Macro recording with non supported target Nested symbols expansion Reload out of date download modules V Save Coverage at Session Saving Save Coverage data again after save Save file changes before mode switch Save memory Saving Labels MShow component dialog on workspace open MlSwitch from disassembly to new source JUnload Program Mwan on
80. ing a Debugging Platform When you create a new workspace the dialog box shown below appears Specify the debugging platform in step 7 New Project 7 9 Setting the Target System for Debugging H85 26004 Simulator JH8S 2600N Simulator Target type 2600 x lt Back n Finish Cancel Figure 3 1 Debugger Target Setting Display Step 7 26 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Targets Sets the debugger targets Select by checking the debugger targets No selection or a selection of more than one target is possible Target type Specifies the type of the targets displayed in Targets Note Debugging may not be available if the operating mode of the selected debugger target is different from the mode selected in Operating Mode in step 2 3 1 2 Setting up a Workspace for the Simulator Debugger Set up the workspace for the simulator debugger in step 8 New Project 8 9 Setting the Debugger Options Target name H8S 26004 Simulator Configuration name SimD ebug_H8S 26004 Detail options Simulator 1 0 disable Simulator 1 0 addr 0x0 Bus mode 0 Modify lt Back ne gt Finish Cancel Figure 3 2 Debugger Option Setting Display Step 8 27 RENESAS 28 H8S H8 300 Series Simulator Debugger User s Manual Configuration name Detail options By default the HEW generates two configurations Release and Debug If a debugger target has been sel
81. input 2 H 02 16 bit address H 12 24 bit address H 22 32 bit address PUTC Outputs one byte to the standard output 3 H 03 16 bit address GETS Inputs one line from the standard input 4 H 04 16 bit address H 14 24 bit address H 24 32 bit address PUTS Outputs one line to the standard output 5 H 05 16 bit address H 15 24 bit address H 25 32 bit address H 13 24 bit address FOPEN Opens a file H 23 32 bit address H 06 FCLOSE Closes a file H 07 16 bit address FGETC Inputs one byte from a file H 17 24 bit address H 27 32 bit address 8 H 08 16 bit address FPUTC Outputs one byte to a file H 18 24 bit address H 28 32 bit address 9 H 09 16 bit address FGETS Inputs one line from a file H 19 24 bit address H 29 32 bit address 10 H 0A 16 bit address FPUTS Outputs one line to a file H 1A 24 bit address H 2A 32 bit address 11 H 0B FEOF Checks for end of the file 12 H 0C FSEEK Moves the file pointer 13 H 0D FTELL Returns the current position of the file pointer For details on I O functions refer to section 3 10 Standard I O and File I O Processing RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 14 Calculation of the Number of Instruction Execution Cycles The simulator debugger calculates the number of instruction execution cycles by using the expression the data bu
82. ion Execution Reset Processing eessesseesesreersereresresrretesrerrerrsreeresrestnsrerrssrsreset 6 2 6 Exception Proc ssing sisercucraniierni riin E E EE A RER 7 2 7 H8S 2000 CPU Specific FUN Ctons 5ccc c cee ctessiscasesceaces hevestpestsactenbaswsasseaesedscessgeeecsestenes 8 2 8 H8S 2600 CPU Specific Functions elec eee eeeeseeeseeeseseeeseceseeeaeeeseeeseeeaeseaessneeenenaes 9 29 H8SX Series CPU Specific PUNCHONS lt 5 scccesssesssasesaces cseresepedveacccqvenssesasenssdarseapeteeseieas 10 2 10 Control RESIStets sccii cessasssasclase escevscralendecoajuads 03 dnesecveenveevieenubawacgeul E EE 10 2 11 Timer H8S Series and H8SX Series ccccccccsssceeseseeceecsneeeeseneeeeseneeeeesseeeessneeseneseeeess 11 211 1 Supported Rangersin nosne nanona ae e RaRa E eseina 11 211 2 Control Registers sorser epeei A A E E E A A EET 11 P O ES EE O A T E 12 2114 Si 87a MEE eee e a R E E EEEE A Y 12 2 11 53 Noteson Using a TIMET essesi isise e E EE 12 212 Trate easi s a eE E E E E A E a E E E E E a leh eee 12 2 13 Standard I O and File I O Processing ssesssssseesseserssoresacesecersseseeeserseserssensseeeeenes 13 2 14 Calculation of the Number of Instruction Execution Cycles ceeeeseesseeseeesereetees 15 2 15 Break COMA tons eco arei ead sanszabsesy E AEE A EA Tin E vanes 16 2 16 Floating Point Datalises 2 ccus asesdanscihctiss seidscedlcetsnadsethessevicassdevansedlenue oaceaten isevi sess E 21
83. is displayed Pressing the Save button after selecting a file name will write the profile information to the selected file Pressing the Save All button will write the profile information to all of the profile information files Save Profile Information Files Profile Information files Profile Information files Demo_H8S_26004 C Hew3 Sample Demo_H8S_260C Save All Browse Figure 3 34 Save Profile Information Files Dialog Box 76 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 12 Notes 1 The number of executed cycles for an application program as measured by the profile function includes a margin of error The profile function only allows the measurement of the proportions of execution time that the functions occupy in the overall execution of the application program Use the Performance Analysis function to precisely measure the numbers of executed cycles The names of the corresponding functions may not be displayed when the profile information on a load module with no debugging information is measured The stack information file extension SNI must be in the same directory as the load module file extension ABS It is not possible to store the results of measurement It is not possible to modify the results of measurement 77 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 7 Analyzing Performance Use the Performance Analysis window to select a function name
84. is sheet lists functions and global variables and displays the profile data for each function and variable Profile fa Show Functions Variables z Fie function Yerssbie e v a arese sree zmes eyele Ext men 170 area mt wen _PowerON_Reset 000400 H 00000028 main 000800 H 00000164 _sort 000964 H 00000136 _change 000494 H 00000048 _charput 0005842 H 00000000 _open 000884 H 00000090 _close ooocia H 00000036 ooocB4 H 00000060 00036 H 00000142 OOOE78 H 00000062 OOOF3A H 00000000 60 loop1 000F50 H 00000000 42 loop2 OOOFSA H o0000000 1134 20456 next_loop2 OOOFS H o0000000 1 12 0 TA ise Figure 3 30 List Sheet Oo _write __INIT_IOLIB __CLOSEALL __INITSCT P F F E F F F F F PF F F F oonore FPO CCC COD ooo0o0ccc 0c cc 0c 0 0808 ty Clicking the column header sorts the items in an alphabetical or ascending descending order Clicking the Function Variable or Address column displays the source program corresponding to the address in the line Right clicking on the mouse within the window displays a pop up menu For details on this pop up menu refer to section 3 6 8 Tree Sheet 70 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 8 Tree Sheet This sheet displays the relation of function calls along with the profile data that are values when the function is called This sheet is available when Disable Tree Not traces function call is not selected from th
85. l after selecting the break type in the Select Break Type dialog box This opens a dialog box that allows you to set conditions for the selected break type PC Breakpoint Set PC Breakpoint Condition 2 x Address H 00000000 7 l Count DY Cancel Figure 3 13 Set PC Breakpoint Condition Dialog Box Up to 1024 PC breakpoint conditions can be specified Address Address of the instruction where a break will occur Count Number of times that the specified instruction is fetched 1 to 16 383 the default value is 1 if the prefix is omitted values input are taken as decimal and the display is in decimal notation 45 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Break Access Set Break Access Condition mziki Begin address JH ooo00000 x Bl End address JHoo000000 gl Cancel i Access type Read Write Figure 3 14 Set Access Break Condition Dialog Box Up to 1024 access break conditions can be specified Begin address First address of the range of memory for which access generates a break End address Last address of the range of memory for which access generates a break if no data is input the range corresponds to the first address alone Access type Read write or read write Break Register Set Break Register Condition ied xf Register jo i tst s si YS i Option Equal m Cancel i Data H0000 I Data mask 9 HFFFFFFFF Size Word tstit iY
86. layed in the Trace window Address Mult Instruction Access Data Source 0000029984 OO0E6 ER lt OOF 0000029995 OOO0E6E ER2 lt 000 0000030006 000E72 ER6 lt OOF 0000030017 000E76 pe lt O0000 0000030021 000416 lt s CCR lt 00 set_imas 0000030032 000418 Pe lt O0000 main 0000030043 000800 ODFFFBE4 void main void _main 0000030047 000804 ER6 lt OOF 0000030055 000806 gt R7 lt FBAE 0000030063 00080A RO lt O0001 srand 1 0000030074 OO080E Pe lt O0000 0000030078 0010D6 ERO lt 000 0000030096 0010p8 OOFFFO6A 0000030107 O010 0 pPe lt O0000 Figure 3 24 Trace Window This window displays the following trace information items PTR Pointer in the trace buffer 0 for the last executed instruction Cycle Total number of instruction execution cycles cleared by instruction execution reset Address Instruction address CCR Displays the contents of the condition code register CCR as a mnemonic Mult Displays the flag in the multiplier as a mnemonic H8S 2600 series only Instruction Instruction mnemonic Access Data Data access information display format destination lt accessed data Source C C or assembly language source programs Label Labels 58 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 5 4 Searching for a Trace Record Use the Trace Search dialog box to search for a
87. lled and global variables are accessed The optimizing linkage editor ver 7 0 or later is capable of reading the profile information file and optimizing the allocation of functions and variables in correspondence with the state of the actual operation of the program To input the profiler information file to the linkage editor choose Optimize from the Category list box and check the Include profile box in the Link Library sheet of the Standard Toolchain dialog box and specify the name of the profile information file 65 RENESAS H8S H8 300 Series Simulator Debugger User s Manual H8S H8 300 Standard Toolchain 2 x Configuration C C Assembly Link Library Standard Library CPU 4 gt Category Optimize 7 Show entries for TCs aaron tce fle Optimize items x C source file Optimi EZEN AT timize Vi Elinmetedisie HJ Assembly source file Spoed a i H Linkage symbol file E G Al Loaded am ealloca Use indirect call jump Size 0 00084 Jptimize branches ze DIAaNcnes f j Eliminate same code Cache size gt short disp im Line 0 00204 Options Link Library noprelink rom D F nomessage list CONFIGDIR S PROJECT NAME map optimize speed Figure 3 28 Standard Toolchain Dialog Box 2 To enable the settings in the Include profile box specify the Optimize list box as some setting other than None 66 RENESAS H8S H8 300 Series S
88. log Box This dialog box specifies a function including a label to be evaluated Up to 255 functions can be specified in total Clicking the OK button stores the setting Clicking the Cancel button closes this dialog box without setting the function to be evaluated Select a function that has been set and choose Edit Range from the pop up menu or press the Enter key to open the Performance Option dialog box and to change the function to be evaluated 3 7 3 Starting Performance Data Acquisition Choose Enable Analysis from the pop up menu a check mark is shown to the left of Enable analysis to start acquiring performance analysis data 3 7 4 Resetting Data Choose Reset Counts Times from the pop up menu to clear the current performance analysis data 79 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 7 5 Deleting a Target Function Select a function and choose Delete Range from the pop up menu to delete the selected target function and to recalculate the data within other ranges The selected function can also be deleted by the Delete key 3 7 6 Deleting All Target Functions Choose Delete All Ranges from the pop up menu to delete all the current target functions to be evaluated and to clear the performance analysis data 3 7 7 Saving the Currently Displayed Contents The contents currently displayed in the window can be saved in a text file Select Save to File from the pop up menu
89. mand Instruction When a Break Condition is Satisfied BREAKPOINT Not executed BREAK_ACCESS Executed BREAK_CYCLE Executed BREAK_DATA Executed BREAK_REGISTER Executed BREAK_SEQUENCE Not executed For BREAKPOINT and BREAK_SEQUENCE if a breakpoint is specified at an address that is not the beginning of an instruction the break will not be detected When a break condition is satisfied during user program execution a break condition satisfaction message is displayed on the status bar and the execution stops RENESAS H8S H8 300 Series Simulator Debugger User s Manual Break Due to Error Detection during User Program Execution The simulator debugger detects simulation errors that is program errors that cannot be detected by the CPU exception generation functions The Simulator System dialog box specifies whether to stop or continue the simulation when such an error occurs Table 2 5 lists the error messages error causes and the action of the simulator debugger in the continuation mode Table 2 5 Simulation Errors Error Message Address Error Address H nnnnnnnn Processing in Continuation Error Cause Mode Odd PC value Operates in the same way as the Instruction was fetched from the actual device operation internal I O area Access in words from odd number addresses Access in longwords from odd number addresses Memory Access Error ADDRESS H 00800000 Access to a memory area that has not On me
90. ment in the called program e Select Step Out from the Debug menu to exit the sort function or click the Step Out button on the toolbar P Figure 7 23 Step Out Button 158 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Tutorial c void main void long a 10 min max long j int i srand 1 printf ti t Data Input tt n for i 0 i lt 10 i Of j rand ifj lt of j i3 ali j printf a d 8ld n i aLli sort a for i 0 i lt 10 i Df printf a d 8ld n i aLli Figure 7 24 Source Window Step Out 159 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Step Over Executes a function call in a single step and stops at the next statement in the main program Select Step Over from the Debug menu or click the Step Over button on the toolbar to step over the statements in the printf function P Figure 7 25 Step Over Button 160 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Tutorial c RES void main void long a 10 min max long j int i srand 1 printf i Data Input ttit n for i 0 i lt 10 i Jf j rand ifj lt Of j j3 ali j printf a d 3ld n i ali sort a printf Sorting results k n for i 0 i lt 10 i Jf min a 0 max a 9 min 0 max 0 changela min a 9 max a 0 Fig
91. mory area having the write protected attribute Data was read from a memory area having the read disabled attribute A memory area in which memory does not exist was accessed Writing to the EEPROM was attempted by instructions other than EEPMOV Allocate memory change the memory attribute or correct the user program to prevent the memory from being accessed System Call Error Simulated I O error occurred Modify the incorrect contents of registers RO R1 and parameter block The memory resource The memory resource was set outside the range of memory mapping has not been set up Modify the memory resource settings so that no error will occur 136 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 7 Tutorial 7 1 Preparation The basic functions of the simulator debugger will be described in this section using a sample program Note The contents of usage examples figures in this section will differ depending on the compiler version 7 1 1 Sample Program The HEW demonstration program is used for the sample program and is written in C language It first sorts ten random data in the ascending order and then in the descending order The sample program 1 Generates random data for sorting using the main function 2 Inputs the array which stores the random data that is generated by the main function then sorts the data in the ascending order using the sort function 3 Inputs the array
92. mory write nothing is been allocated written on memory read all bits Write to a memory area having the are read as 1 write protected attribute Read from a memory area having the read disable attribute Access to an area where memory data do not exist Write to the EEPROM by instructions other than EEPMOV Illegal Instruction Execution of a code that is not an Always stops instruction Execution of MOV B Rn SP or Continues simulation but the MOV B SP Rn result is not guaranteed Illegal Operation 18 Incorrect relation between the values in Continues simulation but the the C flag or H flag of the CCR in the result is not guaranteed DAA or DAS instruction and the values before adjustment Zero division executed by the DIVXU or DIVXS instruction or overflow RENESAS H8S H8 300 Series Simulator Debugger User s Manual When a simulation error occurs in the stop mode the simulator debugger returns to the command input wait state after stopping instruction execution and displaying the error message Table 2 6 lists the states of the program counter PC at a simulation error stop The condition code register CCR value does not change at a simulation error stop Table 2 6 Register States at Simulation Error Stop Error Message PC Value Address Error e When an instruction is read Memory Access Error The start address of the instruction that caused the error e When an instruction is
93. n Error An error occurred during exception processing Correct the user program to prevent the error File Open Error An error occurred during opening a file with the file input output action of Break Correct the file setting File Input Error An error occurred during reading a file with the file input output action of Break Correct the file setting File Output Error An error occurred during writing to a file with the file input output action of Break Correct the file setting Illegal Instruction Either of the following states occurred e Acode other than an instruction was executed e MOV B Rn SP or MOV B SP Rn was executed Correct the user program to prevent the error 134 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 6 2 Error Messages cont Message Illegal Operation Contents Either of the following states occurred e The relationship between flags C and H of CCR and the value before correction was illegal in the DAA or DAS instruction e A division by zero or an overflow occurred during DIVXU or DIVXS instruction execution Correct the user program to prevent the error I O area not exist An attempt was made to delete the I O area Be sure to set the I O area I O DLL Illegal Interrupt Information errNum 2xx Information on interrupts is incorrect errNum shows the details on this error Correct the information errNum 200 The specified vector is
94. n simulation modules Disables all peripheral function simulation modules Opens the Peripheral Module Configuration dialog box allowing you to view information on the corresponding peripheral function and change the address where it starts and the interrupt source information The ratio between the peripheral clock and the internal clock the number of cycles of the internal clock corresponding to one cycle of the peripheral clock is specified here The clock rate setting can be selected as 1 2 3 4 6 8 12 16 24 or 32 Clicking the OK button makes the settings effective Clicking the Cancel button closes this dialog box without storing the settings If you do not wish this dialog box to be opened when the simulator debugger is subsequently initiated check Don t show this dialog box 37 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 3 2 Changing the Addresses of Peripheral Functions The addresses of peripheral functions can be changed in the Address tab of the Peripheral Module Configuration dialog box To open this dialog box select a peripheral function in Peripheral Functions of the Set Peripheral Function Simulation dialog box and then press the Detail button Peripheral Module Configuration Address Interrupt Module TPU Begin Address Reeister HOOFFFFBC Register Address Register Address OOFFFFBG OOFFFFCO OOF FFFG4 OOFFFFCS5 Cancel mv Figu
95. naeet ection 143 7 2 6 Setting the Simulated I O ice sscissic seledeess nrnna ck Natasa steeds eetiaeses 144 7 2 7 Setting the Trace Information Acquisition Conditions 0 eee eeeeeeeeeeereeeees 146 7 2 8 Setting the Stack Pointer and Program Counter ec eeeeeeeeeneeeseeeseeseeeeees 147 Start DEDUL SING i255 ece ceases iusevanbecneeesieewenah E REAA R teal oa sxavicad denesessceeubsed seus 147 PSA Exec ting a PLO SCAN sissie enin ar a a ages 147 7 3 2 Using the Trace Butters icssece niiin n EA ER EARNS 151 7 3 3 Performing Trace Search iriisrneiineinpeannan aia Meeedes heeavaees 152 7 3 4 Checking Simulated Ossis riean aee e onpa na E ECEE ii 153 7 3 5 Checking the Breakpoints seesssesesesseesesresrsresesresrestesresrenrnsrsresresresresresrnsrerese 154 73 0 Watching Variables sinionano nesne E S 154 7 3 7 Executing the Program in Single Steps cece eeseceeeeseeseeeseeeeeeseesseesaes 156 7 3 8 Checking Profile Information sssesssesseesesesreerssrsresresrestesresresrerenresresresresrnsrseree 162 RENESAS vi ztENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 1 Overview The simulator debugger is a powerful development environment tool for embedded applications running on Renesas Technology microcomputers The simulator debugger is used with the High performance Embedded Workshop HEW The HEW provides a graphical user interface that eases the development and debugging of applicati
96. nation cause can be displayed in the Status window e Select Status from the View gt CPU menu to open the Status window and select the Platform sheet in the Status window 148 RENESAS H8S H8 300 Series Simulator Debugger User s Manual CIT o Status H8s 2600N Simulator H85 2600N stop Ready PC Breakpoint Reset Exec Instructions 39580 Cycles 278634 ai gt Platform Figure 7 12 Status Window The above status window indicates that 1 The cause of break is a PC breakpoint 2 Execution is performed from the reset 3 The number of executed instructions by the GO command is 39 580 4 The executed number of cycles from the reset is 278 634 149 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Register values can be checked in the Register window e Select Registers from the View gt CPU menu fa Resister Tele Value oooo000a FFFFOOOA 00000004 00000000 oo000000 ooo00000 nononono OOOOFBAE OOOB36 00000100 01111111 nononono Figure 7 13 Register Window Register values when the program is terminated can be checked 150 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 3 2 Using the Trace Buffer The trace buffer can be used to clarify the history of instruction execution e Select Trace from the View gt Code menu and open the Trace window Scroll up to the very top of the window Access Data 0000271335 OO1EE
97. nformation 146 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 2 8 Setting the Stack Pointer and Program Counter To execute the program the program counter must be set from the location of the reset vector In the reset vector of the sample program the PC value H 400 is written e Select Reset CPU from the Debug menu or click the Reset CPU button on the toolbar Set the program counter to H 400 from the reset vector t Figure 7 9 Reset CPU Button 7 3 Start Debugging 7 3 1 Executing a Program e Select Go from the Debug menu or click the Go button on the toolbar E Figure 7 10 Go Button The program halts where a breakpoint is set An arrow is displayed in the Source window indicating the location the execution has stopped As the termination cause PC Breakpoint PC H 0B36 is displayed in the Output window 147 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Tutorialc 5 x void main void long a 10 min max long j int i3 srand 1 printf Data Input tt n for i 0 i lt 10 i Jf j rand iffi lt Oot j j ali j printf a d 3ld n i aLli printf Sorting results k n for i 0 i lt 10 i Jf printf al d 81d n i aCi min a 0 max a 9 min 0 max 0 change a min a 9 max a 0 Figure 7 11 Source Window Break Status The termi
98. nformation is reflected to the Disassembly window by highlighting the Coverage ASM columns corresponding to the disassembly lines of executed instructions When the coverage settings are modified in the Coverage window the Coverage ASM column display will be updated Demo_H8SXA_16M c Disassembly Coverage ASM 5 Disasse Obj code Label Disassembly 000800 01106DF2 ER2 ER3 000804 79370040 H 0040 16 000808 OF10 1 3 RO 00080A SEOOOEA4 srand 24 OOOSO0E a0000002150 H 0000215 000814 010069F0 ERO BER 000818 5E000D9C printt_ 00081C 1922 R2 R2 00081E 79220004 H 0004 16 000822 4C52 H O876 8 000824 5E000E74 rand 24 000828 17FO ERO 000824 OF83 s ERO ERS 00082 OF80 L ERO ERO 00082E 4c02 H 0832 8 000830 1753 s ERS 000832 OFF1 a ER ER1 000834 79110008 H 0004 16 000838 0D20 R2 RO Figure 3 47 Coverage Column Disassembly 91 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 9 Generating a Pseudo Interrupt Manually Windows Trigger and GUI I O allow the user to generate a pseudo interrupt manually by pressing a button on the window 3 9 1 Trigger Window Choose View gt CPU gt Trigger or click the Trigger toolbar button to open the Trigger window Trigger Figure 3 48 Trigger Window This window displays trigger buttons that generate pseudo interrupts manually The details of
99. nted 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
100. ocal Looking at Variables local variables Memory Viewing a Memory Area Profile Profile Chart Viewing the Profile Information Performance Analysis Analyzing Performance Register Looking at Registers Simulated I O Standard I O and File I O Processing Stack Trace Viewing the Function Call History Status Viewing the Current Status Trace Viewing the Trace Information Trigger Generating a Pseudo Interrupt Manually Watch Looking at Variables any variables Wave Displaying Memory Contents as Waveforms 117 RENESAS 118 H8S H8 300 Series Simulator Debugger User s Manual RENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 5 Command Lines 5 1 Commands Functional Order The following tables show the commands in functional order Refer to the simulator debugger help about each command 5 1 1 Execution Command Name Abbreviation Function GO GO Executes user program GO_RESET GR Executes user program from reset vector GO_TILL GT Executes user program until temporary breakpoint HALT HA Halts the user program RESET RE Resets CPU STEP ST Steps program by instructions or source lines STEP_MODE SM Selects the step mode STEP_OUT SP Steps out of the current function STEP_OVER SO Steps program not stepping into functions STEP_RATE SR Sets or displays rate of stepping RENESAS H8S H8 300 Series Simulator Debugger User s Manual 5 1
101. of accident such as swallowing by infants and small children is very high You should implement safety measures so that Renesas products may not be easily detached from your products Renesas shall have no liability for damages arising out of such detachment This document may not be reproduced or duplicated in any form in whole or in part without prior written approval from Renesas Please contact a Renesas sales office if you have any questions regarding the information contained in this document Renesas semiconductor products or if you have any other inquiries Trademarks Microsoft MS DOS Windows Windows NT are registered trademarks of Microsoft Corporation Visual SourceSafe is a trademark of Microsoft Corporation IBM is a registered trademark of International Business Machines Corporation All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organizations Document Information Product Code S32HEWM Version Copyright Renesas Technology Corp 2003 All rights reserved About This Manual This manual describes the HEW system This manual is composed of two parts HEW part describes information on the basic look and feel of the HEW and customizing the HEW environment and detail the build Figure in the HEW part are those of the SH series Simulator Debugger part describes Debugger functions of the High performance Embedded Workshop This manual does n
102. office 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 un
103. ollowing item is displayed Functions List of functions Statistic Percentage of the instruction executed within the function Status Enable or Disable status of the respective function Note The functions can be sorted by their names or percentage either in ascending or descending order by clicking the column tab Functions or Statistic When the Coverage window is closed the acquired coverage information and the conditions to acquire information will be cleared 83 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 8 2 Acquiring All Coverage Information Choose Enable All from the pop up menu and execute the user program to acquire all coverage information By default Enable All is selected 3 8 3 Clearing All Coverage Information Choosing Clear All from the popup menu clears all the coverage information that has been acquired 3 8 4 Viewing the Source Window Choose View Source from the pop up menu to open the Editor window and to display the Editor window corresponding to the cursor location in the Coverage window 3 8 5 Specifying the New Coverage Range Choose Add Range from the pop up menu to open the Open Coverage dialog box figure 3 37 For the Open Coverage dialog box refer to section 3 8 1 Opening the Coverage Window 3 8 6 Changing the Coverage Range e Specifying the coverage range with an address Choose the coverage range and Edit Range from the pop up m
104. on modules can be registered in the Set Peripheral Function Simulation dialog box which is opened on initiation of the simulator debugger Once a peripheral function simulation module has been registered in this dialog box the simulated peripheral function provided by that simulation module becomes available The registered settings cannot be modified after the simulator debugger has fully started up To change the peripheral function simulation modules that are in use restart the simulator debugger to bring up this dialog box Set Peripheral Function Simulation Peripheral Functions Module Name File Name i Enable All OTPU c hew42 hew420r09ev _ene toals renesas debuet Disable All UIsanie Detail Peripheral Glock Rate ft Don t show this dialog box Cancel Figure 3 7 Set Peripheral Function Simulation Dialog Box The following items are specified in this dialog box Peripheral Functions Shows information on the peripheral function simulation modules Module Name Names of peripheral functions to be simulated File Name Names of files holding peripheral function simulation modules 36 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Enable All Disable All Detail Peripheral Clock Rate Check the checkbox under Module Name to register the corresponding peripheral function simulation module and make it available Enables all peripheral functio
105. ondition was satisfied so execution has stopped The information in parentheses shows the satisfied sequential break condition address of the last instruction I O DLL Stop The peripheral function has stopped PC Breakpoint PC H nnnnnn A PC breakpoint condition was satisfied so execution has stopped The information in parentheses shows the satisfied PC breakpoint condition instruction address Sleep Execution has been stopped by the SLEEP instruction Step Normal End The step execution succeeded 133 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 6 1 Information Messages cont Message Conients Stop Execution has been stopped by the Stop button Trace Buffer Full Since the Break mode was selected by Trace buffer full handling in the Trace Acquisition dialog box and the trace buffer became full execution was terminated 6 2 Error Messages The simulator debugger outputs error messages to notify users of the errors of user programs or operation Table 6 2 lists the error messages Table 6 2 Error Messages Message Conients Address Error One of the following states occurred e The PC value was an odd number e Aninstruction was read from the internal I O area e Word data was accessed to an address that was not a multiple of 2 e Longword data was accessed to an address that was not a multiple of 2 Correct the user program to prevent the error Exceptio
106. onditions The simulator debugger provides the following conditions for interrupting the simulation of a user program during execution e Break due to the satisfaction of a break command condition e Break due to the detection of an error during execution of the user program e Break due to a trace buffer overflow e Break due to execution of the SLEEP instruction e Break due to the STOP button Break Due to Satisfaction of a Break Command Condition There are five break commands as follows e BREAKPOINT Break based on the address of the instruction executed e BREAK ACCESS Break based on access to a memory range e BREAK CYCLE Break based on the instruction execution cycles e BREAK DATA Break based on the value of data written to memory e BREAK REGISTER Break based on the value of data written to a register e BREAK SEQUENCE Break based on a specified execution sequence If Stop is specified as the action to take when a break condition is satisfied user program execution stops when the break condition is satisfied For details refer to section 3 4 Using the Simulator Debugger Breakpoints When a break condition is satisfied and user program execution stops the instruction at the breakpoint may or may not be executed before a break depending on the type of break as listed in table 2 4 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 2 4 Processing When a Break Condition is Satisfied Com
107. ons than C or CPP cannot be specified A placeholder or the Browse button is available To use the settings saved in a coverage information file choose the file from Open a recent coverage file or open a file open dialog box by Browse to another coverage file and select the file When Open a recent coverage file is selected up to four recent files that have been saved are displayed Clicking OK opens the Coverage window When the Coverage window has already been displayed for specifying address settings are added in the window e Coverage window specifying address Coverage JE K ots Os Range Statistic Status 000800 OOO8F3 98 Figure 3 38 Coverage Window Specifying Address 82 RENESAS H8S H8 300 Series Simulator Debugger User s Manual This window displays the coverage range and statistical information The following items are displayed Range Address range Statistic Percentage of the instructions executed within the range Status Enable or Disable status of the coverage range When the Coverage window is closed the acquired coverage information and the conditions to acquire information will be cleared e Coverage window specifying source file Coverage JEK sot OOS Functions Statistic Status main 98 sort 100 change 100 Figure 3 39 Coverage Window Specifying Source File This window displays the coverage range and statistical information The f
108. ons written in the C C programming languages or assembly language for Renesas Technology microcomputers Its aim is to provide a powerful yet intuitive way of accessing observing and modifying the debugging platform on which the application is running READ the simulator debugger and HEW help information before using the simulator debugger RENESAS H8S H8 300 Series Simulator Debugger User s Manual RENESAS H8S H8 300 Series Simulator Debugger User s Manual Section 2 Simulator Debugger Functions This section describes the functions of the H8S H8 300 series simulator debugger 2 1 Features e Since the simulator debugger runs on a host computer software debugging can start without using an actual user system thus reducing overall system development time e The simulator debugger performs a simulation to calculate the number of instruction execution cycles for a program thus enabling performance evaluation without using an actual user system e The simulator debugger provides pseudo interrupt and I O simulation functions for simple system level simulation e The simulator debugger offers the following functions that enable efficient program testing and debugging The ability to handle all of the H8S H8 300 series CPUs Functions to stop or continue execution when an error occurs during user program execution Profile data acquisition and function unit performance measurement A comprehensive set of break f
109. oolbar and double click on the created button to open the Set Button dialog box Set Button Dialog x Button Name Set Select Button Type Input Interrupt Input and Interrupt Input Type Address z Address 3e0 z Data 55 Length Byte H Bib Mest Iv Hot Use Mask Data BithG Bit Suma gt Bit Value fo gt re LETT aa Meruprippei lnterupt ippez Brioni 0 Figure 3 57 Set Button Dialog Box Enter the name of the button input port address and input data The button name must not include white space 105 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 3 Creating a Label Click on the button of the toolbar or choose Create Label from the pop up menu The mouse cursor turns into a symbol Drag the mouse cursor from a higher left to a lower right position This shows the frame for the label GUI 1 0 new panel Figure 3 58 GUI I O Window Create Label Press the button on the toolbar or choose Select Item from the pop up menu and double click on the created label to open the Set Label dialog box Specify the responses to events The label name must not include white space 106 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Response to writing of either value to a selected bit The settings shown below set up display of the character string Printing in progress o
110. opens the Select Break Type dialog box which allows the user to set a breakpoint Two further dialog boxes can be opened from the Select Break Type dialog box Set xx Condition for specifying a break condition and Set xx Action for specifying an action to take when the break condition is satisfied To open the Select Break Type dialog box from the Event window when you wish to select Stop as Action type in the Select Break Type dialog box select Add from the pop up menu on the Software Break tab if you wish to select another action type select Add from the pop up menu on the Software Event tab Selecting a Break Type Selecting Add from the popup menu on the Event window opens the Select Break Type dialog box Select a break type in the Break type field of this dialog box a 2x Break type PC Breakpoint X Detail Cancel Action type File Input Detail Figure 3 12 Select Break Type Dialog Box The following options are available Break type PC Breakpoint Breakpoint set at an instruction Break Access Break on access to a memory range Break Data Break on detection of a memory value Break Register Break on detection of a register value Break Sequence Sequential breakpoints Break Cycle Break after the specified number of cycles 44 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Setting Break Conditions Click on Detai
111. or debugger writes the execution results of each instruction into the trace buffer The conditions for trace information acquisition can be specified in the Trace Acquisition dialog box Right clicking on the Trace window displays the pop up menu Choose Acquisition from the pop up menu to display the Trace Acquisition dialog box The acquired trace information is displayed in the Trace window The trace information can be searched The search conditions can be specified in the Trace Search dialog box Right clicking on the Trace window displays the pop up menu Choose Find from the pop up menu to display the Trace Search dialog box For details refer to section 3 5 Viewing Trace Information RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 13 Standard I O and File I O Processing The simulator debugger enables the standard I O and file I O processing listed in table 2 4 to be executed by the user program When the I O processing is executed the Simulated I O window must be open Table 2 3 shows the supported I O functions The function codes have 16 bit address 24 bit address and 32 bit address versions Select the version suitable for the CPU being used RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 2 3 I O Functions No Function Code Function Name Description 1 H 01 16 bit address H 11 24 bit address H 21 32 bit address GETC Inputs one byte from the standard
112. ot intend to explain how to write C C or assembly language programs how to use any particular operating system or how best to tailor code for the individual devices These issues are left to the respective manuals Document Conventions This manual uses the following typographic conventions Table 1 Typographic Conventions Convention Meaning Menu gt Menu Option Bold text with gt is used to indicate menu options for example File gt Save As FILENAME C Uppercase names are used to indicate filenames enter this string Used to indicate text that must be entered excluding the quotes Key Key Used to indicate required key presses For example CTRL N means press the CTRL key and then whilst holding the CTRL key down press the N key gt When this symbol is used it is always located in the left hand margin It indicates that the text to its immediate right is describing how to The how to symbol i do something Contents Section 1 MVELVICW sick acess cSeictie hesactsideetaiastaensanastgence lugs dlpenaauudvaeevasiceuaia eeeaae 1 Section 2 Simulator Debugger Functions esccescceeecesceeeecceeeceeoneeseeteeee 3 Del FeamreSan noone ea 150 Shed sacks E A E S RA 3 22 Target User Protams croirai enina generee rer EEEE E ERIE ER NEEE REEE EE 4 23 Simu latjon Ranges pi na A ER A bac E eyo odes syed N A 4 2A Memory Ma agement icra er trensi e E E E A 5 2 5 Instruct
113. ource level SOFT_BREAK STATE_ TDB Enables or disables a software breakpoint at the DISASSEMBLY _ disassembly level SOFT_BREAK STATE_SOURCE_ TSB Enables or disables a software breakpoint at the source SOFT_BREAK level 5 1 7 Trace Command Name Abbreviation Function TRACE TR Displays trace information TRACE_ACQUISITION TA Enables or disables trace information acquisition TRACE_SAVE TV Outputs trace information into a file TRACE_STATISTIC TST Analyzes statistic information 122 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 5 1 8 Coverage Command Name Abbreviation Function COVERAGE CV Enables or disables coverage measurement COVERAGE_DISPLAY CVD Displays coverage information COVERAGE_LOAD CVL Loads coverage information COVERAGE_RANGE CVR Sets a coverage range COVERAGE_SAVE CVS Saves coverage information 5 1 9 Performance Command Name Abbreviation Function ANALYSIS AN Enables or disables performance analysis ANALYSIS_RANGE AR Sets or displays performance analysis functions ANALYSIS_RANGE_DELETE AD Deletes a performance analysis range PROFILE PR Enables or disables profile PROFILE_DISPLAY PD Displays profile information PROFILE_SAVE PS Saves the profile information to file 5 1 10 Watch Command Name WATCH_ADD Abbreviation WA Function Adds an item for watching WATCH_AUTO_UPDATE WU Selects or
114. p menu and display the allocation of the current memory resource Simulator System System Memory Memory Map Da g Memory Resource a gt a Begin End Attribute ooo00000 OQOOQEBFF ooo00000 OOOOFFFF Read wr OOO0ECOO OO00FBFF OOOOFCOO O000FE3F OOOOFE40 OO00FFO OOOOFFOS O000FF27 OOOOFF28 OOO0FFFF Figure 7 1 Simulator System Dialog Box Memory Page 138 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The program and stack areas are allocated to the range of addresses H 00000000 to H OOOOFFFF which can be read from or written to e Close the dialog box by clicking OK The memory resource can also be referred to or modified by using the Debugger page on the H8S H8 300 Standard Toolchain dialog box Changes made in either of the dialog boxes are reflected 139 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 2 2 Downloading the Sample Program When using the demonstration project the sample program to be downloaded is automatically set so check the settings e Open the Debug Setting dialog box by selecting Debug Settings on the Debug menu Debug Settings SimSessionH8S 2600N Target Options G Tutorial Target H8S 2600N Simulator Default Debug Format Elf Dwarf2 bi Download Modules Offset Address Add CONFIGDIR S PRO 00000000 Elf Dwarf2 Modi Remove Figure 7 2 Debug Settings Dialog
115. put of data lE GUI O Sampiepni eee Input Panel Figure 3 54 Example of a GUI I O Window 102 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 1 Opening the GUI I O Window Choose View gt Graphic gt GUI I O or click the GUI I O toolbar button A to open the GUI T O window GUI 170 new panel kX IDeA oe Figure 3 55 GUI I O Window This window is used to arrange the following items Button Press a button for input of data to a virtual port or generation of a virtual interrupt Label A character string which is shown when the value written to a selected address or bit was the specified value and hidden otherwise LED A defined region in which a specified color is displayed representing illumination of a LED when the value written to a selected address or bit was the specified value Text A region for the display of a text string 103 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 2 Creating a Button Click on the E button of the toolbar or choose Create Button from the pop up menu The mouse cursor turns into a symbol Create the button by dragging the mouse cursor from a higher left to a lower right position 4 GUI 1 0 new panel Figure 3 56 GUI I O Window Create Button 104 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Specifying the event generated by clicking the button Press the h button on the t
116. r Printer ready when the value of bit 3 at address 0x3E0 is 0 or 1 respectively Set Label Dialog Printing in progress 5 Wata Dispanhiamneik l Dspanhiamnez l Figure 3 59 Set Label Dialog Box Bit Selection 107 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Response to writing of specified values to a selected address The settings shown below set up display of the character string Printing in progress or Printer ready when the value 0x10 or 0x20 respectively is written to address 0x3E0 Set Label Dialog Ed fo el g EAEE OTT l fe Printing in progress logie fe ostive te Weave Figure 3 60 Set Label Dialog Box Data Selection 108 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 4 Creating an LED Click on the amp button on the toolbar or choose Create LED from the pop up menu The mouse cursor turns into a symbol Drag the mouse cursor from an upper left to a lower right position This shows the frame for the LED output GUI 1 0 new panel Figure 3 61 GUI I O Window Create LED Press the button on the toolbar or choose Select Item from the pop up menu and double click on the created LED to open the Set LED dialog box Specify the events and responses 109 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Response to writing of either value to a selected bit The settings shown below set up
117. r or not to display information for a child function called in the function as profile data Properties This menu cannot be used in this simulator debugger 73 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 9 Profile Chart Window The Profile Chart window displays the relation of calls for a specific function This window displays the specified function in the middle with the callers of the function on the left and the callees of the function on the right The numbers of times the function calls the functions or is called by the functions are also displayed in this window Profile Chart _PowerON_Reset Figure 3 33 Profile Chart Window Right clicking the mouse within the window displays a pop up menu Supported menu options are as follows e View Source Displays the source program or disassembled memory contents for the address of the function on which the cursor is placed when the right hand mouse button is clicked If the cursor is not placed on a function when the right hand mouse button is clicked this menu option remains gray e View Profile Chart Displays the Profile Chart window for the specific function on which the cursor is placed when the right hand mouse button is clicked If the cursor is not placed on a function when the right hand mouse button is clicked this menu option remains gray e Enable Profiler Toggles acquisition of profile data When profile data acquisition is enabled
118. race the function call Stops tracing function calls while profile data is acquired This menu is used when acquiring profile data of the program in which functions are called in a special way such as task switching in the OS To display the relation of function calls in the Tree sheet of the Profile window acquire profile data without selecting this menu In addition do not select this menu when optimizing the program by the optimizing linkage editor using the acquired profile information file e Find Displays the Find Text dialog box to find a character string in the Function column Search is started by entering a character string to be found in the edit box and clicking Find Next or pressing the Enter key e Find Data Displays the Find Data dialog box Find Data 2 x Column Laking Next i rr 4 i Cancel Find Data Maximum Minimum Figure 3 32 Find Data Dialog Box By selecting the column to be searched in the Column combo box and the search type in the Find Data group then pressing Find Next button or Enter key search is started If the Find Next button or the Enter key is input repeatedly the second larger data the second smaller data when Minimum is specified is searched for e Clear Data Clears the number of times functions are called and the profile data Data in the List sheet of the Profile window and the data in the Profile Chart window are also cleared 72 R
119. re 3 8 Peripheral Module Configuration Dialog Box Address Tab 38 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The following items can be set or displayed in this dialog box Module Name of the peripheral function supported by the selected peripheral function simulation module Start Address Start address of the peripheral function selected in Module Register Address Names and addresses of registers of the peripheral function selected in Module It is not possible to change the register addresses Clicking the OK or Set button makes the settings effective Clicking the Cancel button closes this dialog box without storing the settings 39 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 3 3 Changing the Interrupt Source Information of Peripheral Functions The interrupt source information of peripheral functions can be changed in the Interrupt tab of the Peripheral Module Configuration dialog box To open this dialog box select a peripheral function in Peripheral Functions of the Set Peripheral Function Simulation dialog box and then press the Detail button Peripheral Module Configuration Address Interrupt Interrupt Source Information Interrupt So Vector Num Priority Register Tea OOFFFD44 6 4 TGE OOFFFD44 6 4 TGDC OOFFFD44 6 4 TGD OOFFFD44 6 4 TOY OOFFFD44 6 4 Cancel Apply Figure 3 9 Peripheral Module Configuration Dialog Box Inte
120. rrupt Tab The following items can be displayed in this dialog box Interrupt Source Name of the interrupt source or sources supported by the peripheral function Vector Number Interrupt vector number Priority Register Address Address of the interrupt priority register and positions of bits in Bit Field Position the register 40 RENESAS H8S H8 300 Series Simulator Debugger User s Manual To change the interrupt source information open the Set Interrupt Source Information dialog box by double clicking on the line for the interrupt source to be changed Set Interrupt Source Information Interrupt Source rama Cancel Interrupt Vector Number 88 Priority Register Address OxFFFFFD4A Priority Register Size 16 bit x Priority Register Bit Position 6 4 Figure 3 10 Set Interrupt Source Information Dialog Box The following items can be set or displayed in this dialog box Interrupt Source Interrupt source name Interrupt Vector Number Interrupt vector number when the prefix is omitted values input are taken as decimal and the display is in decimal notation Priority Register Address Address of the interrupt priority register Priority Register Size Size of the interrupt priority register Priority Register Bit Position Positions of bits in the interrupt priority register Clicking the OK button makes the settings effective Clicking the Cancel button closes this dialog box without storing t
121. s 00 0 eee eeseeseeseeeeeeeeeeeeeeeeeaeeeaeees 80 Acquiring Code Coverage i senisoos aea e a Seeesaseetes esos A Ea 81 3 8 1 Opening the Coverage Window eseeseceeceseeseeeseeeseeesecssesseeseeeseeeaeenaeens 81 3 8 2 Acquiring All Coverage Information eee eee eeeeseeeseeeseceseteeeeseeseeeeseeeaeees 84 3 8 3 Clearing All Coverage Information ieee ee ceceeeeeneeeseeeseceseseeeseeeeseeeaeenaeees 84 3 8 4 Viewing the Source Window uu ec eeeeseeseceeeseeeeeeeeseeeaeeesecssesseetseeseeeaeeeaeeeaeees 84 3 8 5 Specifying the New Coverage Range ce ee eeeeesecseeseeeseeeseeeseeeseseeeeeeeeeeeaeens 84 3 8 6 Changing the Coverage Range cece cseeeeceeeeeeceseeeeeeseeeaeseaesseeseesaeseaeseaeees 84 3 8 7 Deleting the Selected Coverage Range ce ceeeeseeseesseeseeeseeeseeeeeseeesseeeeenaeees 85 3 8 8 Acquiring Coverage Information ieee eee ceeeeseeeseeeeeeaeseeeseeeseeesseeeaeeeaeees 86 3 8 9 Clearing Coverage Information 0 0 0 elec eeeeeeeseeeeeeeseeeseeeaeseaeseeeseeeseeeaeeeaeees 86 3 8 10 Saving Coverage Information in a File oo eee ec eeseeseeeseeeeeeeeseeeseeeeaeeeaeeeneees 86 3 8 11 Loading Coverage Information from a File eee eeeeseeee eee eeeeseeeeeeeeeeeaeees 87 3 8 12 Updating the Information eee cess ceeeceseeseeeseeeseeeaeceaeseeeeeeeseeeaeeeatees 87 3 8 13 Confirmation Request Dialog Box eee eee eesecseeeeceeseeeaeeeaeseeeseeeseeeeaeeeseees 88 3 8 14 Save Coverage Data Dialog BOX o0 ee ceceeccecessees
122. s width of the memory map and the number of access cycles which is described in the H8S H8 300 Series Software Manual However note that the number of instruction execution cycles that is calculated on the simulator debugger may differ from the one when the program is executed on the system MOVFPE and MOVTPE Instructions The number of cycles for transferring data of the E clock synchronization instruction is the value between 9 and 16 The simulator debugger calculates as 11 number of operand access cycles The number of operand access cycles can be calculated from the data bus width of the memory and the number of access cycles EEPMOV Instruction The number of cycles for the EEPROM write instruction is the sum of the number of cycles for reading instructions and cycles for transferring data SLEEP Instruction The simulator debugger does not add the number of cycles considering the case when the SLEEP instruction is used for halting program Standard I O and file I O processing The standard I O and file I O processing are specific functions for the simulator debugger and they are not added to the number of cycles Note that the standard I O and file I O processing are the period while the branch to the position specified with the simulated I O address of the BSR and JSR instructions is completed to return to the caller address after the I O processing RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 15 Break C
123. ses a test suite 32 CLOSE_WORKSPACE CW Close the current workspace 33 COMPARE_TEST_ CTD Compares test data DATA 34 COVERAGE CV Enables or disables coverage measurement 35 COVERAGE_DISPLAY CVD Displays coverage information 36 COVERAGE_LOAD CVL Loads coverage information 37 COVERAGE_RANGE CVR Sets a coverage range 38 COVERAGE_SAVE CVS Saves coverage information 39 DEFAULT_OBJECT_ DO Sets the default object program format FORMAT 40 DISASSEMBLE DA Disassembles memory contents 41 ERASE ER Clears the Command Line window 42 EVALUATE EV Evaluates an expression 43 EXEC_MODE EM Sets and displays execution mode 44 EXEC_STOP_SET ESS Sets or displays the execution mode at the occurrence of an interrupt 45 FILE_LOAD FL Loads an object program file 46 FILE_LOAD_ALL LA Loads all object program files 47 FILE_SAVE FS Saves memory to a file 128 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Table 5 1 Simulator Debugger Commands cont No Command Name Abbreviation Function 48 FILE_UNLOAD FU Unloads an object program file from memory 49 FILE_UNLOAD_ALL UA Unloads all object program files from memory 50 FILE_VERIFY FV Verifies file contents against memory 51 GENERATE_MAKE_FILE GM Generates a build makefile for the current workspace 52 GO GO Executes user program 53 GO_RESET GR Executes user program from reset vector 54 GO_TILL GT
124. ss H 13 24 bit address H 25 32 bit address H 23 32 bit address FOPEN Opens a file H 06 FCLOSE Closes a file H 07 16 bit address H 17 24 bit address H 27 32 bit address FGETC Inputs one byte from a file H 08 16 bit address H 28 32 bit address FPUTC Outputs one byte to a file H 09 16 bit address H 19 24 bit address H 18 24 bit address H 29 32 bit address FGETS Inputs one line from a file H 0A 16 bit address H 1A 24 bit address H 2A 32 bit address FPUTS Outputs one line to a file 11 H 0B FEOF Checks for end of the file 12 H 0C FSEEK Moves the file pointer 13 H 0D FTELL Returns the current position of the file pointer 99 RENESAS H8S H8 300 Series Simulator Debugger User s Manual To perform I O processing use the Simulated I O Address in the Simulator System dialog box refer to section 3 2 1 Modifying the Simulator System in the following procedure 1 Set the address specialized for I O processing in the Simulated I O Address select Enable and execute the program 2 When detecting a subroutine call instruction BSR or JSR that is a simulated I O instruction to the specified address during user program execution the simulator debugger performs I O processing by using the RO and R1 val
125. ssages as listed in table 6 1 to notify users of execution status Table 6 1 Information Messages Message Break Access Access Contents An access break condition was satisfied so execution has stopped The Address H nnnnnnnn Type xxxx Access Size yyyy information in parentheses shows the satisfied access break condition accessed address access type and access unit Break Cycle Cycle H nnnnnnnn A number of cycles condition was satisfied so execution has stopped The information in parentheses shows the satisfied number of cycles condition number of cycles Break Data Access Address H nnnnnnnn Data H mmmmmmmm A data break condition Equal or Not equal was satisfied so execution has stopped The information in parentheses shows the satisfied data break condition accessed address and value Break Data Access Address H nnnnnnnn Previous Data H mmmmmmmm Current Data H mmmmmmmm A data break condition Inverse sign or Difference was satisfied so execution has stopped The information in parentheses shows the satisfied data break condition accessed address and previous and current values Break Register Register XX Value H mmmmmmmm A register break condition was satisfied so execution has stopped The information in parentheses shows the satisfied register break condition register name and value Break Sequence PC H nnnnnn A sequential break c
126. tents of the Simulated 1 0 window TRAP_ADDRESS TP Sets a simulated I O address TRAP_ADDRESS_DISPLAY TD Displays simulated I O address settings TRAP_ADDRESS_ENABLE TE Enables or disables the simulated I O 124 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 5 1 15 Utility Command Name Abbreviation Function HELP HE Displays the command line help INITIALIZE IN Initializes the debugging platform QUIT QU Exits HEW RADIX RA Sets default input radix RESPONSE RP Sets an interval to refresh the window STATUS STA Displays the debugging platform status TOOL_INFORMATION TO Outputs information on the currently registered tool to a file 5 1 16 Project Workspace Command Name Abbreviation Function ADD_FILE AF Adds a file to the current project CHANGE_CONFIGURATION CC Sets the current configuration CHANGE_PROJECT CP Sets the current project CHANGE_SESSION CS Changes the current session CHANGE_SUB_SESSION CB Changes the currently active session when simultaneous debugging is enabled CLEAR_OUTPUT_WINDOW COW Clears the contents of the specified tab in the Output window CLOSE_WORKSPACE CW Close the current workspace OPEN_WORKSPACE OW Opens a workspace REFRESH_SESSION RSE Updates information on the session REMOVE_FILE REM Removes a file from the current project SAVE_SESSION SE Saves the current session SAVE_WORKSPACE SW Saves the current workspace UPDATE_ALL_D
127. ter Support TPUO TSTR TCR TIER TSR TCNT TGRA TGRB TGRC O O 0 OJ OF O O B C TGRD Note O Supported A Partly supported bits for the function described in section 2 11 1 Supported Range RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 11 3 Clocks The simulator debugger supports an internal clock that provides timing in access to memory a peripheral function clock and clocks for operating the timers The numbers of cycles of the internal clock required for access to memory correspond to the specifications for the memory map Set the frequency ratio of the internal clock to the peripheral function clock in the Set Peripheral Function Simulation dialog box Use the timer control register to specify the division ratio to create the clock for operating the timers 2 11 4 Using a Timer To use a timer the timer module must be registered in the Set Peripheral Function Simulation dialog box which is opened at initiation of the simulator debugger For details on the timer module registration refer to section 3 3 Simulating Peripheral Functions 2 11 5 Notes on Using a Timer 1 Even if the actual CPU can only clear a bit to 0 the simulator can write 1 to this bit 2 The user can select whether or not to cause a break when a timer interrupt occurs This can be set in the Simulator System dialog box or by the EXEC_STOP_SET command 2 12 Trace The simulat
128. the interrupt to be generated by pressing each trigger button can be specified in the Trigger Setting dialog box Up to 256 trigger buttons can be used For details on the interrupt processing in the simulator debugger refer to section 2 19 Pseudo Interrupts 92 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e Setting a trigger button Choose Setting from the pop up menu to open the Trigger Setting dialog box and to specify the details of the pseudo interrupt to be generated by pressing each trigger button Trigger Setting RAEI Trigger fi x Cancel M Enable Name 1 Interrupt Type H oooo0000 IRtenpp liped Priority 0 i Figure 3 49 Trigger Setting Dialog Box This dialog box allows the user to specify the details of the pseudo interrupt to be generated by pressing each trigger button Trigger Selects the trigger button to be specified in detail Name Specifies a name for the selected trigger button the name will be displayed in the Trigger window Enable Checking this box enables the trigger button Interrupt typel Interrupt vector number Priority Interrupt priority H O to H 11 when the prefix is omitted values input are taken as hexadecimal and the display is in hexadecimal notation Whether or not the interrupt is accepted is determined by the CPU s specification of the selected debugging platform However when H 8 or a larger value is specified
129. the Action Click on Detail after selecting the action type in the Select Break Type dialog box This opens a dialog box that allows you to set details of the selected action e File Input Set File Input Action oe 71 xi Input file F Browse pes m Destination Address JHooo00000 7 Data size Count Figure 3 20 Set File Input Action Dialog Box When the condition is satisfied data are read out from the specified file and written to the specified location in memory Input file File from which data are to be read out When reading out by the simulator debugger reaches the end of the file reading out recommences from the beginning of the same file Address Memory address to which data should be written Data size Size of each data value in bytes 1 2 4 8 Count Number of values to be written H 1 to H FFFFFFFF when the prefix is omitted values input are taken as decimal and the display is in decimal notation 51 RENESAS H8S H8 300 Series Simulator Debugger User s Manual e File Output Set File Output Action 2 x Output file Append Browse Aaa Source Address JHoo000000 x Data size Gount Figure 3 21 Set File Output Action Dialog Box When the condition is satisfied the contents at the specified location in memory are written to the specified file Output file Data file to which data are written Append S
130. the size and putting the most frequently called functions in line When using the profile information saved in a file it is possible to optimize user programs based on dynamic information using the optimizing linkage editor For details refer to section 3 6 Viewing the Profile Information and description of PROfile in section 4 2 4 Optimize Option in the Optimizing Linkage Editor User s Manual 2 18 2 Performance Analysis The performance analysis function displays the number of execution cycles and function calls for the specified function in the user program Since performance data for only the specified function is acquired faster simulation is possible For details refer to section 3 7 Analyzing Performance 22 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 19 Pseudo Interrupts The simulator debugger can generate pseudo interrupts during simulation in the following two ways 1 Pseudo interrupts generated by satisfaction of break conditions A pseudo interrupt can be generated using a break command to specify Interrupt as the action when a break condition is satisfied For details refer to refer to section 3 4 Using the Simulator Debugger Breakpoints 2 Pseudo interrupts generated from windows A pseudo interrupt can be generated by clicking a button in the Trigger or GUI I O window For details refer to section 3 9 Generating a Pseudo Interrupt Manually If another pseudo interrupt occurs b
131. ting the user application i e before measuring the profile data However this feature is not available when Setting gt Only Executed Functions is checked in the pop up menu of the Profile window When the HEW does not read any stack information files only the data on the functions executed during measurement will be displayed by the profile function To make the linkage editor create a stack information file choose Build gt H8S H8 300 Standard Toolchain and select Other from the Category list box and check the Stack information output box in the Link Library sheet of the Standard Toolchain dialog box 63 RENESAS H8S H8 300 Series Simulator Debugger User s Manual H8S_ H8 300 Standard Toolchain C source file C source file Assembly source file H E Linkage symbol file ae oh information OLow memory use during linkage noprelink rom D R nomessage Jjete CONFIGDIR S PROJECTNAME map nooptimize start PResetPRG 0400 P C C DSEC C ESEC D 0800 8 Figure 3 27 Standard Toolchain Dialog Box 1 64 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 6 2 Profile Information Files To create a profile information file measure a profile data of the application program then choose the Output Profile Information Files menu option from the pop up menu of the Profile window and specify the file name This file contains information on the number of times functions are ca
132. ues H8 300 and H8 300L series or the ER1 value H8 300H H8S and H8SX series as the parameters e Set the function code table 3 1 to the RO register MSB 1 byte 1 byte LSB A Function H 01 code _ aa e Set the parameter block address to the R1 or ER1 register for the parameter block refer to each function description MSB LSB Parameter block address e Reserve the parameter block and input output buffer areas Each parameter of the parameter block must be accessed in the parameter size After the I O processing the simulator debugger resumes simulation from the instruction that follows the simulated I O instruction Refer to the simulator debugger help about each I O function 100 RENESAS H8S H8 300 Series Simulator Debugger User s Manual The following shows an example for inputting one character as a standard input from a keyboard Label SYS_CALL is specified as the simulated I O address MOV W H 0101 R0 MOV W PARM R1 JSR SYS_CALL STOP NOP SYS CALL NOP PARM DATA W INBUF INBUF RES B 2 END 101 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 11 Creating a Virtual I O Panel The simulator debugger has a GUI I O function for simulating a simple key input or key output panel of the user target system in a window This virtual I O panel is created in the GUI I O window That is virtual buttons and virtual LEDs are arranged in this window to allow the input and out
133. unctions Functions to set or edit memory maps Functions to display function call history Coverage information is displayed in the C C or assembly source level Visual debugging functions provided through the display of images or waveforms e The breakpoints memory map performance and trace can be set through the dialog boxes under Windows Environments corresponding to each memory map of the H8S H8 300 series microcomputers can be set through the dialog box Intuitive user interface Online help Common display and operability RENESAS H8S H8 300 Series Simulator Debugger User s Manual 2 2 Target User Program Load modules in the Elf Dwarf2 format can be symbolically debugged with the simulator debugger Load modules in other formats can be downloaded and their instructions can be executed however they cannot be symbolically debugged For details refer to section 17 18 2 Elf Dwarf2 Support in the High performance Embedded Workshop V 4 03 User s Manual 2 3 Simulation Range The simulator debugger provides simulation functions for the H8 300 H8 300L H8 300H H8S 2600 H8S 2000 and H8SX series microcomputers The simulator debugger supports the following H8S H8 300 series microcomputer functions e All CPU instructions e Exception processing e Registers e All address space e CPU modes shown in table 2 1 Table 2 1 Platforms and CPU Modes Names of Debugging Platforms CPU Modes
134. ure 7 26 Source Window Step Over When the printf function has been executed Sorting results will be displayed in the Simulated I O window RENESAS 161 H8S H8 300 Series Simulator Debugger User s Manual 7 3 8 Checking Profile Information The profile information can be checked in the Profile window e Clicking the Go button and continuing execution from the current PC executes the SLEEP instruction and then stops List Sheet Displays the profile information as a list e Open the Profile window by selecting Profile from the View gt Performance menu The List sheet will be displayed CM ox Jia show Functions Variables J na H 00000000 730 H 000008C2 78593 H 00000000 48080 H 00000000 40790 H O00000000O 22 968 H 00000000 7192 H OOOOO0AZ 6 1107 H 00000128 3 1656 H O000000D6 255 73159 H 00000000 230 27140 H OOOO00FO 255 123582 H 00000014 40 4840 H o000008 1 192 MULL 3 ___ fmtout 1742 19D6 1446 145 _ flclose __flopen _fpute DIVUL 3 __flshbuf Ry o _strlen __alochuf Uo E i ooo0oo0oc0c0c0c 0c 0 000d Figure 7 27 Profile Window List Sheet In the above figure it can be found that the __flclose function was called six times the execution cycle was 1107 and the internal memory was accessed 69 times It is possible to search for the critical path such as a function that is called or accesses the memory many times for the program performance 1
135. utton Stop Stops simulation Continue Continues simulation Clicking the OK or Apply button stores the modified settings Clicking the Cancel button closes this dialog box without modifying the settings 30 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 3 2 2 Modifying the Memory Map and Memory Resource Settings The Memory tab in the Simulator System dialog box is used to set and modify the memory map and memory resource Simulator System System Memory Memory Map oS Sa g Memory Resource a 4 Begin End Attribute 00000000 OOFFEBFF Q0000000 OO007FFF Read w r OOFFECOO OOFFFBFF OOFFECOO OOFFFFFF Read w r OOFFFCOO OOFFFE3F OOFFFE40 OOFFFF07 OOFFFFO8 OOFFFF27 OOFFFF28 OOFFFFFF Figure 3 4 Simulator System Dialog Box Memory Tab The following items can be specified in this dialog box Memory Map Displays the memory type start and end addresses data bus width and the number of access cycles Memory Resource Displays the access type and start and end addresses of the current memory resource 31 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Memory Map can be added modified or deleted using the following buttons a Adds Memory Map items Clicking this button opens the Set Memory Map dialog box figure 3 5 and memory map items can be added al Modifies Memory Map items Select an item to be modified in the list
136. vent window e Close the Event window 7 3 6 Watching Variables It is possible to watch the values of variables used in your program and to verify that they change in the way that you expected For example set a watch on the long type array a declared at the beginning of the program by using the following procedure e Select Watch from the View gt Symbol menu to open the Watch window And click the right mouse button on the Watch window and choose Add Watch from the pop up menu The following dialog box will be displayed 154 RENESAS H8S H8 300 Series Simulator Debugger User s Manual Add Watch Variable or expression Figure 7 19 Add Watch Dialog Box 699 e Type array a and click the OK button CPE The Watch window will show the long type array a oo You can double click the symbol to the left of array a in the Watch window to expand the variable and show the individual elements in the array FBB6 long 10 H O00041ic6 long H O000167e long H O00002781 long H 0000446b long H O000794b long H 0O00015fb long H O00059e2 long H O0001cfb long H O0003f54 long H OOOO0ff6 long Figure 7 20 Watch Window e Close the Watch window 155 RENESAS H8S H8 300 Series Simulator Debugger User s Manual 7 3 7 Executing the Program in Single Steps The simulator debugger has various stepping menus that are useful in debugging the
Download Pdf Manuals
Related Search
Related Contents
Manual del usuario Liquid Handling Product Guide Sony 16 Digital Camera User Manual 輸入元:OBABY正規販売代理店 株式会社カトウ企画 東京都港区白金 Graco 309398A User's Manual goclever tab r703g user`s manual en instrukcja obsługi pl to the PDF file. Lupus Electronics LE920 BroadSoft Partner Configuration Guide Grandstream GXV-3000 Copyright © All rights reserved.
Failed to retrieve file