Home

M16C R8C Simulator Debugger V.1.06 User`s Manual

image

Contents

1. Menu Function RAM Monitor Area Set RAM monitor base address Sampling Period Set RAM monitor sampling period Clear Clear access attribute Up Moves display position to the immediately preceding RAM monitor area smaller address Down Moves display position to the immediately following RAM monitor area larger address Address Display from specified address Scroll Area Specify scroll range Data Length lbyte Display in 1Byte unit 2bytes Display in 2Byte unit 4bytes Display in 4Byte unit 8bytes Display in 8Byte unit Radix Hex Display in Hexadecimal Dec Display in Decimal Single Dec Display in Signed Decimal Oct Display in Octdecimal Bin Display in Binary Code ASCII Display as ASCII character SJIS Display as SJIS character JIS Display as JIS character UNICODE Display as UNICODE character EUC Display as EUC character Float Display as Floating point Double Display as Double Floating point Layout Label Switch display or non display of Label area Register Switch display or non display of Register area Code Switch display or non display of Code area Column Set the number of columns displayed on one line Split Split window Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 93 of 2
2. task3 M 4 4 4 EE A ee e _task4j hy 4 B 4 tasks EE EE ee ee ee ee oe ee eee aa ae oe i i CESKE Ge eds eten sn He Me Ferden Ke sn Heen ad task p M 4 dllo f froga 4 B co tOO alata o A E a i R AA AA E an de ei 1 41 osean fete este ee ser PasklOy nr 1 M dP See de DA gt gt gt gt gt gt gt m nmmmmmmf mmmmmmmmmmmmmmmmmnnmm mm m m e ua foo ain fen h feo to OD Drag the start marker position and end marker position The time interval between the markers is displayed in the status bar Note e Definition of time value in the Task Trace window The time value in the Task Trace window indicates the execution elapsed time which sets the program execution start point to 0 in all the cases On the contrary a numeric value above the grid line scale in the Task Trace window is a relative value which sets the start marker to 0 the grid interval is specified in the Value dialog which has nothing to do with the time value It is provided so that you can see the window easily 6 17 2 2 5 Move the Marker Each marker can be moved by dragging When moving the mouse on the marker the cursor shape ch
3. R20UT0522EJ0100 Rev 1 00 Page 186 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 11 Specify the write condition Trace data write conditions can be specified You can specify the following write conditions Write conditions unlimited default Cycles from the start event established to the end event established Only cycles where the start event is established Cycles from the start event established to the start event unestablished Other than cycles from the start event established to the end event established Other than cycles where the start event is established Other than cycles from the start event established to the start event unestablished DE Em R To specify condition 1 choose Total from the list box of the window s Write Condition item Write Condition Total v Detail To specify conditions 2 to 4 choose Pick Up and click the Detail button to open the Realtime trace Write Condition dialog box Write Condition Pick up v e For condition 2 choose the Mode shown below and set the Start and End events R20UT0522EJ0100 Rev 1 00 Page 187 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e For condition 3 choose the Mode shown below and set the Start event Realtime trace Write Condition Similarly when specifying conditions 5 to 7 choose Exclude and click the Detail
4. H W Break Disable Enable Address 400 v Pass Count p Access Type f rite Length Byte POE Data Compare Help Not Specify S fro C C lt z Close m H W Break Point Label Addr Cnt Size Data Type Cmp data SE to 000400 001 BYTE 003F WRITE gt R20UT0522EJ0100 Rev 1 00 Page 147 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 Trace Point Setting Window The Trace Point Setting window is used to set trace points The debugger for 740 doesn t support this function Setting modification flag Setting the effective events ME Trace Points Setting Current event list CONDITION main 000000 000000 000000 FETGH Func Static FETCH lobal float WRITE FETGH FETCH FETCH addr OF 0042 addr OFO1A4 addr 000400 0420 lt data lt O4FF addr 000000 addr 000000 addr 000000 PID I Enable Detail ace rea About 16K 16K X Detail Setting of trace area Setting of combination condition Setting of trace write condition Setting of Process ID e The events listed below can be specified as trace events If the contents of events are altered they are marked by an asterisk on the title bar The asterisks are not displayed after setting up the simulator Fetch Memory Access Bit Access Interrupt e Events at up to six points can be us
5. Simulation Mode Simulation Speed C Cycle Accuracy Cancel Help Do not show this dialog box again The tabs available on this dialog box vary with each product used For details click the desired tab name shown in the table below Tab Name Product Name The debugger The debugger The debugger The debugger for R32C for M32C for M16C R8C for 740 MCU exist exist exist exist Debugging exist exist exist exist Information Script exist exist exist exist Trace exist exist exist T O Script exist exist exist You can open the Init dialog using either one of the following methods e After the debugger gets started select Menu Setup gt Simulator gt System e Start Debugger while holding down the Ctrl key R20UT0522EJ0100 Rev 1 00 Page 51 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 1 1 MCU Tab The specified content becomes effective when the next being start MOU M16cx mcu Refer Time Count Resource MCU Clock fio MHz fi Simulation Mode Simulation Speed C Cycle Accuracy 4 1 1 1 Specifying the MCU file MGU M30626 MCU Refer Click the Refer button The File Selection dialog is opened Specify the corresponding MCU file e An MCU file contains the information specific to the target MCU e The specified MCU file is displayed in the MCU area of the MCU tab If the corres
6. R20UT0522EJ0100 Rev 1 00 Page 151 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 2 Specify the Combinatorial Condition To specify a combinatorial condition specify the desired condition from the combinatorial condition specification area e When AND or OR is selected In the event specification area the event used and a pass count for that event can be specified To alter the pass count while the event to alter is being selected click the pass count value of that event Event Status OODEDOE e When AND Same Time is selected In the event specification area the event used can be specified No pass counts can be specified Event Status m O O m R20UT0522EJ0100 Rev 1 00 Page 152 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e When State Transition is selected Click the Details button and the dialog box shown below appears Sequential specification can be used If the content of any event is altered it is marked with an asterisk on the title bar Once conditions are set in the simulator asterisks are not displayed B1 main FETCH B2 000410 WRITE B3 OFEOOO FETCH B4 000000 FETCH m Time Out B5 000000 FETCH fe Not Use tS start Sl Statel stater Time Cot g6 000000 FETCH 10usec Not Use Sequential Statusen Bli gt B21 gt Pa
7. Item Contents ID ID No of mailbox Msg cnt Number of messages in each mailbox MAXmsg Maximum number of messages that can be contained in each mailbox Wait Queue Message The messages stored in the mailbox or ID No and task name of tasks waiting for messages e The WaitQueue Message field shows a string Msg when a message is stored when Msg cont as described above is non zero and then displays the stored message When no message is stored when Msg cont is zero the WaitQueue field displays a string Task if a task waiting for a message exists and then displays the ID number and name of the task waiting for a message e When a task connected to the mail box queue is in the state of waiting with timeout enabled waiting in trev_msg a string tmo which indicates the state of timeout enabled is appended to a string displayed in the WaitQueue Message field When a task connected to the mail box queue is in the state of forced waiting Double waiting a string sl which indicates the state of double waiting is appended to a string displayed in the WaitQueue Message field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 Is Display when in WAIT SUSPEND with time out 26 task26 tmolls e Upto 8 characters can be displayed in the task name in the WaitQueue Message field If a task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Re
8. R20UT0522EJ0100 Rev 1 00 Page 223 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 11 2 Display the Memory Pool Status When the realtime OS is MRxx conformed to ulTRON specifications V 4 0 All the memory pools are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of memory pool Mplatr Attribute of each memory pool Mpladr Base address of memory pool Mplsz Size of memory pool Blkent Total block count of fixed length memory pool Fblkent Number of unused blocks and information on unused memory blocks Memory Pool Queue Displays the ID number and name of tasks waiting in the memory pool e The following are displayed in the Mplatr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order e The display of the ID field varies depending on which one is specified fixed length or optional length If the data is of fixed length the ID field displays a string F and memory pool ID number For an arbitrary length the contents displayed on the first line are the character string V a memory pool ID number and a block ID number Displayed on the second to fourth lines are the memory pool ID and block ID numbers The block ID numbers are enclosed in par
9. In addition to bus information the window can display disassemble source line or data access information in combination In this case the display will be similar to the one shown below Trace lolx e VE QQQ var Zz Evy Range 32511 00000 Area Break File Oycle 32389 Address OF0107 Time 00 00 00 053587 Label Address Data BUS BIU R U RUT CPU ON B T Q T 76543210 Datahccess hrm s ms us GLOBAL C 52 for j O F 5 55 JF 1 0F0107 CHP U SH 4H FB 32389 0007E2 0000 16b DU W 0 Cu 1 1 1 11111111 0007E2 0000 W 00 00 00 053 587 32388 0007E2 0000 16b DU R 0 RB 0 1 1 11111111 0007E2 0000 R 00 00 00 053 588 32387 OFO10A CATD 16b IU R 0 2 1 fk 11111111 00 00 00 053 588 OFO10C 7318 16b Iv R 0 4 1 1i 414112111 00 00 00 053 588 R20UT0522EJ0100 Rev 1 00 Page 192 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 11 2 Configuration of Disassemble Mode When disassemble mode is selected while bus mode is unselected trace information is displayed in disassemble mode Disassemble mode is configured as shown below 15 x vasaa vaz nv sa ae Pe ET E E a Cycle hr m s ms us a 18960 0F0199 730BFO RO 10H FB 00 00 00 054 427 18957 OFO019C C91BFD 1H 3H FB 00 00 00 054 427 18953 OFO19F FEC1 F0161H 00 00 00 054 427 18948 OFO161 778BFDOA0O OOOAH 3H FB 00 00 00 054 428 18943 OFO166 7DCA
10. nknown By moving the mouse to any information displayed in the window the following window is opened showing the detailed information Interrupt handling or task execution history System call issue history Task state transition history R20UT0522EJ0100 Rev 1 00 Page 231 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 615 241 Search the History of System Call Issue Click the Search button in the tool bar The Search dialog is opened Or select Menu Search Parameter Return Parameter RO Function Code RO Error Gode KJE Ok mi Can WUP a E OBJ che pri E QOVR clr_fl E TMOUT nig fy n p FRA Ri Ri F Ri Ri R2 R2 Cr rr R3 R3 F R A0Object ID F AG Direction Forward C Backward Close Specify the search condition With the function code RO Function Code and error code RO Error Code you can specify multiple values OR condition Other items are searched based on the AND condition Then specify the search direction The debugger searches the items in the direction specified in the dialog using the position pointed by the indicator as the radix point When the debugger does not check all the search items the subsequent system call issuance history in the search direction will be a search result Click the Find Next button The debugger searches the system c
11. 6 10 7 1 3 Reading writing data to addresses outside the specified range Set as below Example Writing data to addresses below 7FFh 41 Set Event Status Event Type DATA ACCESS v Address Data Settine Ranee addr lt Address1 v Address1 FF Jal Address o0040F z l I Function Source File v Function v ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF mest Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Not Specify v Data 1 jooo Data 2 Joona Access WRITE v IT Mask 0000 ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF mest R20UT0522EJ0100 Rev 1 00 Page 166 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 7 2 Memory Access The debugger for M32C 6 10 72 1 Writing Reading a Specified Address Set as below Example Writing to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range add Address v Address1 joo v l Address2 I Function Source File v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 mest Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Not Specify v Data 1 pooo Data 2 ooo Access WRIT E v IT Mask Joao ACCESS
12. View gt CPU gt OutputPort ASM Watch Window View gt Symbol gt ASMWatch C Watch Window View gt Symbol gt CWatch Coverage Window View gt Codel gt Coveragel Script Window View gt Script S W Break Point Setting Window View gt Break gt S W Break Points H W Break Point Setting Dialog Box View gt Break gt H W Break Points Trace Point Setting Window View gt Trace gt Trace Points Trace Window View gt Trace gt Trace Data Trace Window View gt Trace gt Data Trace GUI I O Window View gt Graphic gt GUI I O MR Window View gt RTOS gt MR MR Trace Window View gt IRTOS gt MR Trace MR Analyze Window View gt RTOS gt MR Analyze Task Trace Window View gt RTOS gt Task Trace Task Analyze Window View gt RTOS gt Task Analyze The R32C debuggers are not supported The 740 debuggers are not supported For the reference of the following windows refer to the help attached to a High performance Embedded Workshop main part e Differences Window e Map Window e Command Line Window e Workspace Window e Output Window e Disassembly Window e Memory Window e IO Window e Status Window e Register Window e Image Window e Waveform Window e Stack Trace Window R20UT0522EJ0100 Rev 1 00 Page 91 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 1 RAM Monitor Window
13. task3 task4 task5j task6 l l l 1 task tasks task9 task10 nknown CWO ON The content of each item is as follows Items Contents ID Indicates a task ID number name Indicates an interrupt routine name task name idle processing display idle and unknown name displayed unknown When moving the mouse to the information displayed in the window the pop up window as below is opened showing the detailed information The following information is displayed in the status bar e Time value at the start marker position e Time value at the end marker position e Time interval between the start marker and the end marker e Time value at the indicator position e Display scale e Time width at grid line interval e Measurement trace range R20UT0522EJ0100 Rev 1 00 Page 241 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs The grid lines are displayed using the start marker as the radix point The scale is displayed using the time at which the start marker is positioned as 0 with the left forward in time set to minus and the right backward in time set to plus The grid lines allow you to roughly understand the interrupt occurrence cycle and process time The interval time width of the displayed grid lines appears in the Grid area of the status bar The time value in the Task T
14. 6Windows Dialogs Number of times the address 3E0 is read Data input to address 3E0 First 0x10 Second 0x20 Third 0x30 3 Interrupt synchronized input Data can be input to a specified memory location when a virtual interrupt occurs The data size that can be input is one byte The diagram below shows an example of a virtual port input that is synchronized to interrupts Shown in the sample program below is the case where data is read from port 1 address 3E1 using an interrupt handler routine in this case a timer interrupt handler routine oragma ADDRESS portl 3e1H char port oragma INTERRUPT read port Interrupt handler for polling port 1 read _port char key key porti Input from port I This interrupt handler routine aims to assign the value of port 1 to variable key when a virtual interrupt is generated In such a case a value can be assigned to variable key by entering it to port 1 when a virtual interrupt in this case a timer interrupt is generated It is assumed that timer interrupts are generated using a separately available virtual interrupt function For details refer to the virtual interrupt function To support processing of interrupt handlers like this this described later in this manual debugger provides a function that allows you to define the data to be input according to a number of times a virtual interrupt is generated a vir
15. 7 D mn n lt D 5 v xtENESAS M16C R8C Simulator Debugger V 1 06 User s Manual All information contained in these materials including products and product specifications represents information on the product at the time of publication and is subject to change by Renesas Electronics Corporation without notice Please review the latest information published by Renesas Electronics Corporation through various means including the Renesas Electronics Corporation website http www renesas com Renesas Electronics WwW tenesas com Rev 1 00 Mar 2011 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 granted hereby under any patents copyrights or other int
16. Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range ata Datal 7 Data 1 2 Data 2 Joona Access WRIT E z IV Mask 00FF ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 mest R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 162 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing word length data 1234h to even address 400h 41 Set Event Status Event Type DATA ACCESS x Address Data Setting Range dar Addressl v Address1 joo Jal Address2 000000 X Bl I Function Source File v Function F ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data 1234 orei Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range data Datal Data 1 1234 Data 2 ooo ccess WRIT E z IV Mask FFFF ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 data 1234 mest R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 163 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing data 10h 3Fh to even address 400h Event Type DATA ACCESS x Address Data Setting Range dar Addressl v Address1 joo Jal Address2 000000 X Bl I Function Source File
17. Mark 00 00 00 000 672 00 00 01 569 272 00 00 01 568 600 ID name Num Max Run Time Min Run Time Avg Run Time Total Run Time Ratios o 25 50 75100 1 J 1 00 00 00 005 195 00700 00 005 195 00700 00 005 195 00 00 00 005 195 0 33 i 1 mainj 115 00700 00 007 305 00700 00 000 767 00700 00 001 541 00700 00 177 287 11 30 i H 2 task002 12 00 00 00 012 067 00700 00 006 915 00700 00 011 552 00700 00 138 630 8 84 m 3 task003 12 00700 00 012 597 00 00 00 006 892 00700 00 012 111 00 00 00 145 332 3 27 m i i 4 task004j 12 00 00 00 012 170 00700 00 006 505 00700 00 011 604 00 00 00 139 252 8 65 mm i 5 task005 j 12 00 00 00 012 277 00700 00 006 577 00700 00 011 795 00700 00 141 540 9 02 m i H 6 task006 11 00700 00 013 435 00 00 00 006 490 00700 00 012 353 00 00 00 135 885 6 66 mm 7 task007 11 00 00 00 013 020 00700 00 006 790 00700 00 012 431 00700 00 136 745 8 72 mm i 8 task008 11 00700 00 014 080 00700 00 008 055 00700 00 013 232 00700 00 145 552 9 25 m i 9 task009 11 00 00 00 013 642 00 00 00 007 277 00700 00 012 663 00 00 00 139 295 6 66 m i i 10 _task010 11 00700 00 013 710 00700 00 008 070 00700 00 012 795 00700 00 140 752 8 97 m i 11 taskOllj 11 00 00 00 011 892 00700
18. Oxid data Ox1d is input to memory address 0x3e0 Format 2 set condition expression memory address input value 1 input value 2 Function The input value 1 input value 2 etc are sequentially input to a specified memory address each time the conditional expression is established Left side expressions can be used to specify the memory address and right side expressions can be used to specify the conditional expressions and input values Specifications of left side and right side expressions are described later For example if following statements are written set isfetch 0xf0000 Ox3el 0x10 0x20 isfetch becomes true established when the program executes a specified address data 0x10 and 0x20 are sequentially input to memory address 0x3el each time the program executes address Oxf0000 Namely data 0x10 is input to memory address 0x3el when address Oxf0000 is executed first and data 0x20 is input when the address is executed next Format 3 set macro variable right side expression Function The right side expression is placed in a specified macro variable Specification of macro variables is described later For example following macro variables can be written set val 10 Macro variable val is initialized to 10 set val val 1 Value of the macro variable is incremented by 1 R20UT0522EJ0100 Rev 1 00 Page 267 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 91 0 S
19. SALES OFFICES Renesas Electronics Corporation http www renesas com Refer to http www renesas com for the latest and detailed information Renesas E 2880 Scott Boulevard Santa Clara CA 95050 2554 U S A Te Renesas E 11 Te Renesas E Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Te Renesas E Arcadiastrasse 10 40472 Dusseldorf Germany Te Renesas E 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Te Renesas E Unit 204 205 AZIA Center No 1233 Lujiazui Ring Rd Pudong District Shanghai 200120 China Te Renesas E Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Te Renesas E 7F No 363 Fu Shing North Road Taipei Taiwan Te Renesas E 1 harbour Te Renesas E Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 JIn Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Te Renesas E 11 Te lectronics America Inc 1 408 588 6000 Fax 1 408 588 6130 lectronics Canada Limited 01 Nicholson Road Newmarket Ontario L3Y 9C3 Canada 1 905 898 5441 Fax 1 905 898 3220 lectronics Europe Limited 44 1628 585 100 Fax 44 1628 585 900 lectronics Europe GmbH 49 21 1 65030 Fax 49 211 6503 1327 lectronics China Co Ltd 86 10 8235 1155 Fax 86 10 8235 7679 lectronics Shanghai Co Ltd
20. Setup Dialog Finds the previous data you ve set UP or the next data DOWN The setup example in this element specifies that data 0x22 be set at the 10 016th cycle Double click on an element you want and set the desired input value in it In this dialog box set the virtual interrupts you want to be actually generated Follow the procedure below to set virtual interrupts 1 Move the mouse cursor to the cycles location called an element where you want a virtual interrupt to be generated then click the left mouse button Or you can scroll the screen to go to the desired location 2 The element is marked by an asterisk when you ve clicked Click at the same place again if you want the virtual interrupt you ve set to be canceled In this case the asterisk goes out 3 Repeat steps 1 and 2 as many times as the number of virtual interrupts to be generated When you finished setting all virtual interrupts press the Next button A dialog box for saving the virtual interrupts you ve set to a file virtual interrupt file will appear R20UT0522EJ0100 Rev 1 00 Page 122 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Save in My Computer e EJ 314 Floppy A SYSTEM C DAT D Compact Disc E Compact Disc F SJ SUBSYS G File name finput ios Save as type flo Script Files ios v Cancel ZA Here enter the directory an
21. WAI SMBF TMO SUS Sending waiting state for a message buffer with time out suspended WAI RMBF Receiving waiting state for a message buffer R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 207 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs WAI RMBF SUS Receiving waiting state for a message buffer suspended WAI RMBF TMO Receiving waiting state for a message buffer with time out WAI RMBF TMO SUS Receiving waiting state for a message buffer with time out suspended WAI MTX Waiting state for a mutex WAI MTX SUS Waiting state for a mutex suspended WAI MTX TMO Waiting state for a mutex with time out WAI MTX TMO SUS Waiting state for a mutex with time out suspended The debugger for M32C doesn t support these states The debugger for M16C R8C doesn t support these states e 2Display the Wait Cancellation Condition of Event Flag Wfmode Status TWF ANDW Waits for all bits set in the wait bit pattern to be set AND wait TWF ORW Waits for any one bit set in the wait bit pattern to be set OR wait R20UT0522EJ0100 Rev 1 00 Page 208 of 295 2011 03 16 rRNRENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 3 Display the Ready Queue Status In the MR window select Popup Menu Mode gt Ready Queuel MR x LENEA N A ba EAL ES Current Run Task 1 main Number of P
22. button Download Module aa 2 gt we froma x gu Format IEEE695 RENESAS o Cancel Filename D HEW4 samples M160 demox30 Browse ccess size fi I Download debug information only I Perform memory verify during download I Download automatically on target connection Select the format of the download module in the Format edit box Please refer to the upper table about the format name of a download module Enter the full path and filename of the download module in the Filename edit box Specifies the access size for the current download module in the Access size list box After that click the OK button ATTENTION Offset Access size and Perform memory verify during download is ignored The offset is always set to 0 the access size is always set to 1 and the verification does not work R20UT0522EJ0100 Rev 1 00 Page 49 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 3 Starting the Debugger The debugging can be started by connecting with an simulator 3 3 1 Connecting the Simulator Connect the simulator by simply switching the session file to one in which the setting for the simulator use has been registered The session file is created by default The session file has information about the target selected when a project was created In the circled list box in the following tool bars select the session name including the character s
23. ccccccccccscscsceeecececeeeceeeceeeceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeseeeeees 5 1 2 1 Software Breaks Function cccccccccsssssscccceceesesseceeececsessaesecececeesececaeseeseeesesssaeseeeeeeseneea 5 1 2 2 Hardware Breaks Function ersronernrrvnvvrnrrnennrrnnenerrsnennrrnsvererenennrnnnensssssrennnnsensessrensnnnsen 6 1 3 Real Time Trace Function iscsiseiesecieedenvavscisvsnevtacecovserseeses sinewave eiaesnas aia EEE EREE EEEE E 7 1 8 1 Trace rea cumrrrresersrnsereersnersvrennseersnnnnesnensearsnennerennsenntenennpuennseneersnarnvenvensersnnnsenneesearsnernnsen 7 1 3 2 Trace Condition Setting ccccccccssssecssssssecssssececesssecsssensecsessesecseaeecescesnsecsesarsecsenaeeessenseess 8 1 3 3 Trace Data Write Condition rrsrvrrnnnnrrrrrsnnvnrrrsnnvnrrnrvvsrrnnnvrrssnnnnrrssrnenersnnrsrsssnnnsrsssnnnsrnnn 8 WA Coverage Function saa ere 9 1 4 1 Coverage Measurement AV a cccccccccssscecesssececsesseeeceescecsesaececseaaecesseeeecesseeeeeseaeeseseeaeess 9 LAD Related Windows a seieiecscidcicesiecdads senaceel eri a saa AE Ee E eea E EEO AEAEE EE 9 1 5 Real Time OS Debugging Function rrsnorrrrnnvovrrennvnrrrsnnvnrrsarvvsrrnnnnrsssnnnnrsssnsenersnnnsrsssnnnnssssnsesennn 9 1 6 GUI Input Output Function ssn ee 9 1 7 I O Simulation Function eererororrrrrsrrrennrorrrrrrrrrensnnrernrnrsnensnnrvnnsnsseenannnennenssessenannnsensssnsensnnrsnnene 10 1 8 Time Measurement
24. e Expressions can be written in address Memory variables also can be used e Specify data size as shown in the table below For byte size Borb For word 2 byte size W or w For long word 4 byte size Lorl e If specification of data size is omitted the data size is assumed to be byte long Example 1 To reference memory contents at address 800016 in bytes 0x8000 B or 0x8000 Example 2 To reference memory contents at address 800016 in words 0x8000 w Example 3 To reference memory contents at address 800016 in long words 0x8000 L 9 3 5 Character Constants Specified characters or character strings are handled as constants after being converted into ASCII code e Characters must be enclosed with single quotations e Character strings must be enclosed with double quotations e Character strings must be within 2 characters 16 bits in length If a character string consists of more than two characters only the last two characters written in the string are operated on For example if you write ABCD only the last two characters in this string i e CD are operated on the value of which is 434416 R20UT0522EJ0100 Rev 1 00 Page 271 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 3 6 Operators The following lists the operators that can be written in expressions The priorities of operators are such that level 1 is the highest and level 12 the lowest If
25. CE x Address ms ize v gl Size Word Radix f Hex C Dec Bin oee Click the OK button The ASM Watch window showing the specified area of memory is displayed ASMWatch Address Bit 000410 __msize Word Hex 0300 R20UT0522EJ0100 Rev 1 00 Page 79 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 9 Step9 Watching Variables As the user steps through a program it is possible to watch that the values of variables used in the user program are changed If the downloaded program is the program generated by the assembler package for 740 family you can not watch variables in C watch window 5 2 9 1 Watching Variables For example set a watch on the long type array a declared at the beginning of the program by using the following procedure Click the left of displayed array a in the Editor Source window to position the cursor and select Add C Watch with the right hand mouse button The Watch tab of C watch window in which the variable is displayed opens CWatch xl m x R E 2i Gl amp Watch Local File Local Global Name Value Address Scope signed long 10 a 000414 Auto The user can click mark at the left side of array a in the C Watch window to watch all the elements CWatch Fx mx RI E 2e E amp Watch Local File Local Global Name Value Address Scope signed long 10 a 000414 Auto signed l
26. In the Editor Source window a display of S W breakpoints column is set to Enable by default To erase this column deselect the S W breakpoints check box in the dialog box opened by choosing the main menu Edit gt Define Column Format The S W breakpoints column is erased from all Editor Source windows And select popup menu Columns gt S W breakpoints in the Editor Source window A column can be set up for each Editor Source windows R20UT0522EJ0100 Rev 1 00 Page 143 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 9 H W Break Point Setting Dialog Box The H W Break Point Setting dialog box allows you to set hardware break points HAN Break Point HAW Break Disable f Enable Address key_input v Al Pass Count fi ccess Type write v Length Byte v Data Compare Help I Not Specify Data p add i gt HAW Break Point Label Addr Cnt Size Data Type Cmp OFO02C OOT ok KKK key input 0F0346 001 BYTE 0000 Del Del All WRITE gt e The hardware break point of 64 points can be set up You can set one address breakpoints with pass counts e As address break point access types you can specify writing data to the address break point Write reading data from the address break point Read reading or writing data R W and fetching instructions Fetch e You can also speci
27. Instruction fetch Memory access Bit access e External trigger designation eight events e Interruption The number of events that can be specified are six events of all These break events can be combined as below e Trace when all of the valid events are established AND condition e Trace when all of the valid events are established at the same time And same time comdition e Trace when one of the valid events is established OR condition e Trace upon entering a break state during state transition State Transition condition You can select specified task only or other than specified task as the trace condition to meet the real time OS 1 3 3 Trace Data Write Condition Trace data write conditions can be specified You can specify the following write conditions e Write conditions unlimited default e Cycles from the start event established to the end event established e Only cycles where the start event is established e Cycles from the start event established to the start event unestablished e Other than cycles from the start event established to the end event established e Other than cycles where the start event is established e Other than cycles from the start event established to the start event unestablished R20UT0522EJ0100 Rev 1 00 Page 8 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 4 Coverage Function Coverage Measurement is a function to record the addresses executed accessed
28. Layout Address Switch display or non display of Address area Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window The simulator debugger doesn t support because the entire memory area is coverage area R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 137 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 6 2 Refer to the Source Line the Executed Address It is possible to refer in the Editor Source Window or Memory Window 6 6 2 1 Refer in the Editor Source Window In the Editor Source window a display of Coverage Measurement is set to Disable by default To enable the display check the Coverage check box in the dialog box opened by choosing the main menu Edit gt Define Column Format The column for a coverage measurement display is displayed on all Editor Source windows And select popup menu Columns gt Coverage in the Editor Source window A column can be set up for each Editor Source windows s t Samplel6 c Init i l while 1 I for i 0 i lt DATA SIZE i data i data i 1 data i 2 datalit3 sub 6 6 2 2 Refer in the Memory Window In the Memory window a display of Coverage Measurement is set to Disable by default To enable the display select popup menu Coverage gt On Off in the
29. The RAM monitor window is a window in which changes of memory contents are displayed while running the target program The relevant memory contents are displayed in dump form in the RAM monitor area by using the realtime RAM monitor function The displayed contents are updated at given intervals by default while running the target program every 100 ms 78ms Label Register 1 0 F ASCII 0003F0 000400 000410 000420 000430 000440 000450 000480 pool SB This system provides a 1Kbytes of RAM monitor area which can be placed at any continuous addresses The RAM monitor area can be changed to any desired address range Refer to 6 1 2 Setting the RAM monitor area for details on how to change the RAM monitor area The default RAM monitor area is mapped into a 1 Kbyte area beginning with the start address of the internal RAM The display content updating interval can be set for each window individually The actual updating interval at which the display contents are actually updated while running the target program is shown in the title field of the Address display area The background colors of the data display and code display areas are predetermined by access attribute as shown below Access attribute Background color Read accessed address Green Write accessed address Red Non accessed address White The background colors
30. Timeout Queuel MR xj LEIRA N ME er Value ID name TOFFH 21 task2l dly TFOOH 24 task24 dly TFOFH 22 _task22 dly TFFOH 23 task23 dly TFFFH 6 task6 dly TFFFH 7 task dly s TFFFH 20 task20 dly 6 14 4 1 Display the Timeout Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 The function of each item is as described below Tasks waiting at present are displayed in the descending order of timeout value When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents Value Shows the timeout value of each task ID name Shows the ID No and task name of the tasks in the timeout queue e Following character strings are used to indicate the type of wait state Character string Wait state slp Wait due to tslp tsk dly Wait due to dly_tsk flg Wait due to twai flg sem Wait due to twai sem mbx Wait due to trev msg e When a task connected to the timeout queue is in the state of forced waiting double waiting a string sl which indicates double waiting is appended to a string displayed in the ID name field Normal display 26 task26 Display when in WAIT SUSPEND 26 task20 Isl R20UT0522EJ0100 Rev 1 00 Page 210 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 4 2 Display the Timeout Queue Status When the realtime O
31. Use of the CYcle command allows you to know an approximate number of cycles and the execution time of the program you ve executed The number of cycles are represented using the values listed in the microcomputer s software manual The execution time refers to the target program s execution time calculated from the cumulative number of cycles of the CPU instructions executed and the MCU clock and divide by ratio specified on the Init dialog box s MCU tab 2 4 6 Stack Utilization Monitor The StackMonitor SM Command Use the StackMonitor command to check the maximum and minimum addresses of the stack and to determine how much the program has used of what part of the stack The stack monitoring continues from the time that a Go or GoFree command is invoked until it is interrupted the maximum and minimum values being recorded for the two stack pointers USP and ISP registers If while the program is running it causes a change in the value of a stack pointer monitoring of stack utilization of that stack stops at that point R20UT0522EJ0100 Rev 1 00 Page 37 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 Preparation before Use Please run the High performance Embedded Workshop and connect the emulator In addition in order to debug with this product it is necessary to create a workspace 3 1 Workspaces Projects and Files Just as a word processor allows you to create and modify documents
32. Use the MAP command to map the simulator memory Memory mapped using this command is initialized with the value FF16 immediately after being allocated When downloading a target program the memory is mapped automatically Note Memory space that has been mapped cannot be deleted e Accessing an Area Without Memory There is no actual memory in the memory blocks between 00010000h and 0003FFFFh and between 00050000h and FFFEFFFFh unless memory is secured If an attempt is made to access this area an illegal memory access error occurs and execution of the command or program stops R20UT0522EJ0100 Rev 1 00 Page 14 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 1 41 0 e SFR The actual chip s peripheral I Os other than the CPU core such as the timers DMAC and serial I O are not supported The SFR area to which the peripheral I Os are connected is also handled as RAM by the simulator However a method is available that allows you to materialize data input to memory such as the SFR or interrupts such as timer interrupt in an artificial manner For details about this method see I O Script and Interrupts described later gt e I O Script Virtual Port Input Function This function defines changes of the data that is input from external devices to a specified memory address Using this function you can simulate data inputs to the ports defined in SFR The following shows timings at w
33. button to open the Realtime trace Write Condition dialog box Write Condition R20UT0522EJ0100 Rev 1 00 Page 188 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e For condition 5 choose the Mode shown below and set the Start and End events Realtime trace Write Condition e For condition 6 choose the Mode shown below and set the Start event Realtime trace Wr gt Condition R20UT0522EJ0100 Rev 1 00 Page 189 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e For condition 7 choose the Mode shown below and set the Start event Realtime trace Write Condition R20UT0522EJ0100 Rev 1 00 Page 190 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 11 Trace Window The Trace Window is used to display the results of real time trace measurement The debugger for 740 doesn t support this function The measurement result can be displayed in the following display modes e Bus mode This mode allows you to inspect cycle by cycle bus information The display content depends on the MCU and simulator system used In addition to bus information this mode allows disassemble source line or data access information to be displayed in combination e Disassemble mode This mode allows you to inspect the executed instructions In addition to disassemble information this mode allows source line or data access information to be d
34. by the target program CO coverage After stopping execution of the target program you can understand which addresses are not executed yet By using the coverage measurement function in the test process you can check for missing test items 1 4 1 Coverage Measurement Area On simulator debugger all the memory space is the coverage measurement area 1 4 2 Related Windows Refer to the coverage measurement result in the following windows e Editor Source Window e Memory Window e Coverage Window 1 5 Real Time OS Debugging Function This function debugs the realtime OS dependent parts of the target program that uses the realtime OS This function helps to show the status of the realtime OS and inspect a task execution history etc The debugger for 740 doesn t support the real time OS debugging function 1 6 GUI Input Output Function This function simulates the user target system s key input panel buttons and output panel on a window Buttons can be used for the input panel and labels strings and LEDs can be used for the output panel R20UT0522EJ0100 Rev 1 00 Page 9 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 7 I O Simulation Function e Virtual Port Inputs This function lets you define changes of input port data Use the I O Timing Setting Window to define changes of input port data The contents thus defined can be simulated at the time When the program execution reaches spe
35. e Position where the system call issuance history is displayed R20UT0522EJ0100 Rev 1 00 Page 235 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6 16 MR Analyze Window The MR Analyze window displays the result of the measurement data statistically analyzed within the range specified by the start marker and the end marker in the MR Trace window The debugger for R32C doesn t support this function The debugger for 740 doesn t support this function The MR Analyze window supports three display mode as below CPU occupation state by interrupt task Ready time by task List of system call issuance histories You can extract and display the history based on the specific condition 6Windows Dialogs The MR Analyze window functions together with the MR Trace window This window is available only when a target program using our real time OS MRxx is downloaded 6 16 1 Configuration of CPU Occupancy Status Display Mode The CPU occupation state display mode is used to display the CPU occupation time and ratio by interrupt task The MR Trace window shows the statistical results within the range specified by the start marker and end marker Mark 00 00 00 000 335 00 00 00 164 498 00 00 00 164 163 VEC table ID name Num Max Run Time Min Run Time Avg Run Time Total Run Time Ratio 0 25 50 75100 32 OFFD8O SYSCALLO 17 00 00
36. in combination In this case the display will be similar to the one shown below Trace ioj x VBa vaz Evy Cycle Address Obj code Label Hnemonic Datakccess hm 3 ms us LOCAL C 42 for P Os iR We Leth 19026 OFO161 778BFDOAOO CHP UW HOODAH 3H FB 00 00 00 054 423 0007E3 09 R 0007E4 ODO R nl 19021 OFO166 7DCA39 JGE FO1A1H 00 00 00 054 423 LOCAL C 43 char localScope char a 19019 0F0169 C661FF HOV B 61H 1H FB 00 00 00 054 423 LOCAL C 44 long localScope long 0 19017 OFO16C D90BF9 MoV W OH 7H FB 0007E5 61 W 00 00 00 054 423 19014 OFO16F DSOBFB MOV W HOH SH FB 0007DF 00 W 00 00 00 054 423 z R20UT0522EJ0100 Rev 1 00 Page 193 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 11 3 Configuration of Data Access Mode When data access mode is selected while bus mode and disassemble mode are unselected trace information is displayed in data access mode Data access mode is configured as shown below Cycle 05012 05007 05006 05001 05000 04995 04994 04969 04984 04977 04972 04971 04964 04963 04957 04949 04939 04938 04935 04929 04924 1491A Label global struct global array 1 Data access display area Shows data access information If the information displayed here is 000400 1234 W for example it means that data 1234H was written to the address 000400H
37. please specify the location of a source file R20UT0522EJ0100 Rev 1 00 Page 75 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 5 3 Reviewing Cause of the Break The break factor is displayed in the Output window 4 ol ot al at 21 21 2 G E Lobe Connected Cause of break S W break The user can also see the cause of the break that occurred last time in the Status window Select Status from the CPU submenu of the View menu After the Status window is displayed open the Platform sheet and check the Status of Cause of last break The debugger for 740 doesn t support this function Item Status Connected to Mi6c RSC PC7501 Emulator CPU M16C Run Status Ready Cause of last break S W break Run time count 00 h OO m OG sec 001 msec 991 usec 4 Db Memory Platform Events Please refer to 11 Display the Cause of the Program Stoppage about the notation of a break factor R20UT0522EJ0100 Rev 1 00 Page 76 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 6 Step6 Reviewing Breakpoints The user can see all the breakpoints set in the program in the Breakpoints dialog box 5 2 6 1 Reviewing Breakpoints Push the key Ctrl B and the Breakpoints dialog box will be displayed Mitutorialch Line 40 Cancel Edit Code Remove Remove All This window allows the user to delete enable or disable breakpoint
38. times The registered content is saved for each project separately If two or more of the C watch window are opened at the same time the registered scopes The reference scope of the variable is selectable from current scope global scope and each file s e The C watchpoints can be registered to separate destinations by adding Watch tabs e Variables can be registered from another window or editor by a drag and drop operation e The C watchpoints can be sorted by name or by address e Values can be inspected in real time during program execution by using the RAM monitor function e The RAM monitor can be allocated to the address of specified variable R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 133 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs ATTENTION You cannot change the values of the C watch points listed below Register variables C watch point which does not indicate an address invalid C watch point If a C C language expression cannot be calculated correctly for example when a C C symbol has not been defined it is registered as invalid C watch point It is displayed as lt not active gt If that C C language expression can be calculated correctly at the second time it becomes an effective C watch point The display settings of the Local File Local and Global tabs are not saved The contents of the Watch tab and those of newly added tabs are saved The RAM mon
39. v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 0010 lt data amp 00FF lt 003F omei Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Datal lt data lt Data2 S Data 1 fo Data 2 fF Access WRIT E z I Mask 0000 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 0010 lt data lt 003F mes R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 164 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 71 2 Reading writing data to the specified address range Set as below Example Writing data to addresses ranging from 400h to 40Fh Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Adderss1 lt faddr lt Address2 v Addresst 400 7 Address2 40F 3 Bl I Function Source File v Function ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F cms Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Not Specify i Data1 Pon Data 2 OOOO Access WRITE I mesk ooo SSCS ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F mest R20UT0522EJ0100 Rev 1 00 Page 165 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs
40. 00 00 020 160 00 00 00131 909 00 00 00 111 749 Indicator 00 00 00 052 734 Scale 2 401435 Grid 00 0000032832 Area Break VEC table ID name 1 32 OFFD80 SYSCALLO 33 OFFDe4 SYSCALL1 38 OFFDS8 SYSCALLZ Idle _task4 Unknown ca 1 taskiy Z task2 5 task5 3 _task3 To initialize the display order select Menu Init Order 615 2465 Display the specific task only Click the task interrupt routine to be hidden the left portion of the graph Every time you click the setting is switched between Display and Hide 6 15 24 6 Change the display color Select Menu Color The Color dialog is opened Click the button corresponding to the desired item The Color Setting dialog is opened Change the display color in the dialog R20UT0522EJ0100 Rev 1 00 Page 234 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 2 5 Measure the Execution Time of Task You can measure the execution time between the markers by changing the positions of start marker and end marker in the MR Trace window at MR Trace HOD HAS in my Oo Mark 00 00 00 078 808 00 00 00 131 909 00 00 00 053 101 Indicator 00 00 00 184 063 Scale 2 401435 Grid 00 00 00 032 832 Area Break VEC table ID name 32 OFFD80 SYSCALLO 33 OFFD84 SYSCEALL1 38 OFFD98 SYSCALLZ ET MM KA ME Unknow
41. 00 006 290 00700 00 011 193 00700 00 123 132 7 85 m i H 222 Unknown 0 00 00 00 000 000 00700 00 000 000 00700 00 000 000 00 00 00 000 000 0 00 By clicking the maximum execution time minimum execution time display area of each line you can search process history of the task for the clicked line at the maximum minimum execution time The search result is pointed by the indicator which moves to the target position in the Task Trace window 6 18 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Allow Docking Allows the window docking Hide Hides the window R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 248 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 18 2 Analyze the Execution History of Task You can reference the execution history statistical processing in the Task Analyze window This window shows the CPU occupation time and ratio by task The Task Analyze window functions together with the Task Trace window If the Task Trace window is not open or the Task Trace window does not show any data the Task Analyze window will not function Mark 00 00 00 000 672 00 00 01 569 272 00 00 01 568 600 ID name Num Max Run Time Min Run Time Avg Run Time Total Run Time Ratios 0 25 50 75 100 Y f2 i 1 00 00 00 00
42. 000 cycles Although the I O Timing Setting Window supports virtual port inputs in only bytes I O scripts allow for virtual port inputs in words or long words Definition example of I O script file Comment statement Definition of procedure 1 example for virtual interrupt Beginning of procedure 1 while 1 while statement iff 0x380 b amp 0x01 Ox014 Checks timer A0 s count start flag waite 0x386 w 1 Keeps execution of I O script waiting for the number vid eyele equal to the divide by ratio that is set for er AQ int 21 0x55 r OxT Generates a timer AD virtual interrupt Interrupt control register is referenced to determine lelse priority waiti 100 Keeps execution of I O script waiting for 100 instructions Terminates procedure 1 Definition of procedure 2 example for virtual port input Beginning of procedure 2 waite 10000 Keeps execution of I O script waiting for 10 000 cycles set 0x3e0 0x20 Inputs 0x20 in address Ox3e0 waite 10000 set Oxde0 w 0x4143 Inputs 2 byte data Ox4143 from address Ox3el Terminates procedure 2 9 2 Composition of I O Script Following statements can be written in I O script e Procedure e T O script statement e Judgment if else Execution statements are branched off by judging the evaluation result of expression e Repeat statement while and Break statement Statements are executed rep
43. 06 6Windows Dialogs 6 17 2 Refer the Execution History of Task Taskxx Window You can reference the task execution history in the Task Trace window You can reference the execution history statistical processing result in the Task Analyze window These windows are also available for a target program using an OS other than our real time OS MRxx 6 17 2 1 Prepare the Measurement To measure the task execution history of the program using the real time OS you must select the trace range in the Task Trace window and then execute the target program 6 17 2 1 1 Set the Information of Realtime OS To use the Task Trace window you must set the following information concerning the real time OS the target real time OS which are used by the downloaded program e Label name address value of the execution task ID storage area and its size e Task start address expression Open the Task Trace window Select Menu View gt RTOS gt Task Trace When you select this menu at first time after starting PDxx the RTOS Information dialog is opened before the Task Trace window is opened RTOS Information PID Address RUNtsk v Access Size Byte v Task Entry DTCBE NT amp TaskID 1 8 default Cancel e When using our real time OS MRxx 1 Click the default button The MRxx information is set Click the OK button The Task Trace window is opened e When using a real time OS other than MRxx 1 Specif
44. 1 0 Timing Setting Wind Weenen a eee 95 R20UT0522EJ0100 Rev 1 00 Page iv of viii 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6 2 1 Virtual Port Input inei er E EEE AAT E EEES 96 6 2 2 Virtual Port OQutput ersnornrrrovovrrrnnrrrrrsnnrnrrrsnnrersnnrsrssennrsrsssnnvsrsnnrsssssnnrnrsssnnssrsnnrsssssnnnn 98 6 2 3 Virtual Interrupt yasssaaannadriderhur i EE EAEE E EEEE a 98 6 2 4 Structure of Virtual Port Input Screen rrrsnrrrrrnnrrrrrrnnrrrrrsnnrnrrrnrvrrrrnnvnrrsrnnrsrrssrsesrsnnnn 100 6 2 5 Structure of Virtual Port Output Screen srrrrnnvvnrrnnnrrrrssnnrnrrsnrnrsrrnnrrrrsrnnrsrrssrresrennnn 103 6 2 6 Structure of Virtual Interrupt Screen ccccccccesseceessececseeeeecseeeeeseaececsesaeeesseeeeenees 105 6 2 7 Extended Menu eesse an AE R detta eskere danset 107 6 2 8 Setting Virtual Port Inputs rrorrnnrorrrannrnrrssnnvrrrnnrrvrrennrsrrssnnrsrssernesrsnnrsssssnnrsrsssrsssssnnnn 108 6 2 9 Setting Virtual Port Outputs ss cc rennan i aessa 116 6 2 10 Setting Virtual Interrupts rrrnnrororonnrrrrronnvrrrnnrrvrrrnnrrrrrsnnrrrrnnnnnsrsnnnsrsssnnrsrsssnsessennnn 118 6 2 11 Regarding Evaluation Timings of Virtual Port Inputs Virtual Interrupts and I O Script Piles Set vsccccscssesdsccaccscetssiosentegacsoogegaestededsasoasagauss ccedsagoedseied cossgacsocegtedecdedaadeedegivdoededaeses 128 6 3 Output Port Window acces cess sascgeceeseslaavecs E sevoecaceepadededeneese ecssausgdeveecavanseenlestee
45. 5 6 7 8 9 In the above example no cycles are added while the LDA or CMP instruction is being executed The cycles required for each instruction are added after instruction execution e Target program execution time measurement The target program execution time measurement is calculated from the number of cycles described above and the MCU clock and divide by ratio specified on the MCU tab of the Init dialog box Note Because the simulator s execution time measurement is calculated using the number of cycles described above it includes some error when compared with the actual chip s execution time e WIT STP Executed as an NOP instruction Other instructions operate the same as those of the actual MCU R20UT0522EJ0100 Rev 1 00 Page 33 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 4 2 Resetting e S register is set to FF16 only T flag is set to 1 about PS register and Program Counter is set to the value of the reset vector Other registers are set to 0 e SFR area is not initialized e Executed cycle count is set to 0 Resetting is performed in the same way as the actual MCU A reset is also performed when the debugger of 740 starts The value 0000h is set in the reset vector immediately after starting The program counter is therefore set to 0000h immediately after the debugger of 740 starts 2 4 3 Memory e Memory Space The entire memory space 0000h to FFFFh func
46. 9 Pointers to Members Pointers to members using the or gt operator can be refered only in the forms of variable name member name or variable name gt member name Example class T public int member class T t_cls class T pt cls amp t cls int T mp amp T member In this case t cls mp and tp cls gt mp can correctly reference the variable of pointer to member type Note e Note that the expression mp cannot considered as the variable of pointer to member type 10 1 10 Parentheses Use the and to specify priority of calculation within an expression 10 1 11 Arrays You can use the and to specify the elements of an array You can code arrays as follows variable name element No or variable variable name element No or variable element No or variable etc 10 1 12 Casting to Basic Types You can cast to C basic types char short int and long and cast to the pointer types to these basic types When casting to a pointer type you can also use pointers to pointers and pointers to pointers to pointers etc Note that if signed or unsigned is not specified the default values are as follows Basic type Default char unsigned short signed int signed long signed Notes e Of the basic types of C casts to bool type wchar t type and floating point type float or double cannot be used e Casts to register variables
47. Debugger V 1 06 3Preparation before Use 3 2 1 2 Step2 Setting for the Toolchain A wizard for the project creation starts New Project 1 ct Target CPU Toolchain Which GPU do you want to use for this project GPU Series If there is no GPU type to be selected select the GPU Type that a similar to hardware specification or select Other Here the following contents are set e toolchain e the setting for the real time OS when using e the setting for the startup file heap area stack area and so on Please set required information and click the Next button The contents of a setting change with C C compiler packages of use Please refer to the manual attached to your C C compiler package about the details of the contents of a setting R20UT0522EJ0100 Rev 1 00 Page 41 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 1 3 Step 3 Selecting of the Target Platform Select the target system used for your debugging emulator simulator When the setting for the toolchain has been completed the following dialog box is displayed New Project 5 Setting the Target System for Debugging MM16G R8C FoUSB UART MIM160 R8C PC7501 Emulator MMISG REC Simulator External Debugger Target type m 60 60 v Next gt Finish Cancel 1 Selecting of the Target type In the Target type list box select the target CPU type 2 Selecting of the Target P
48. FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000400 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF els Placing the mouse cursor on a point in the display of data in the Memory window and double clicking allows the values at that point to be changed R20UT0522EJ0100 Rev 1 00 Page 71 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 3 Step3 Downloading the Tutorial Program 5 2 3 1 Downloading the Tutorial Program Download the object program to be debugged The download file and the address to be downloaded will depends on the target mcu you uses Please replace the screen image and addresses with corresponding one to your target mcu e The Debugger for M16C R8C M32C or R32C Select Download module from Tutorial x30 under Download modules e The Debugger for 740 If you use the C Compiler Package for 740 Family select Download module from Tutorial 695 under Download modules If you use the Assembler Package for 740 Family select Download module from Tutorial hex under Download modules E Q Tutorial B Tutorial E a Assembly source file a nert0 a30 B ra G source file j E sorte 4 Tutoriale Dependencie a ies defin Pors JP Data Only E sect30 i Unload i E sorth Download New Module Remove Debug Settines Configure View v Allow Docking Hide Properties R20UT0522EJ0100 Rev 1 00 Page 72 of 295
49. IEEE695 RENESAS v Download Modules Offset Address Format D work HEW4 Samples M16C Sample01 x30 00000000 TEEE6S way ij Dai gt Cancel be connected in the Target drop down list box Select the format of the load module to be downloaded in the Default Debug Format drop down list box Format Name Contents IEEE695 RENESAS IEEE 695 format file When Using Renesas toolchain IEEE695 IAR IEEE 695 format file When Using IAR toolchain IEEE695 TASKING IEEE 695 format file When Using Tasking toolchain ELF DWARF2 ELF DWARF format file When Using Renesas toolchain ELF DWARF2 IAR ELF DWARF format file When Using IAR toolchain ELF DWARF2_TASKING ELF DWARF2 format file When Using Tasking toolchain ELF DWARF2_KPIT ELF DWARF2 format file When Using KPIT toolchain Intel Hex Sym Intel Hex format file with Symbol format file When Using Renesas toolchain SRA74 IEEE695 ICC740 IEEE 695 format file When Using Renesas toolchain ICC740 This debugger does not support the object formats which are not shown in the drop down list R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 48 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 Then register the corresponding download module in the Download Modules list box download module can be specified in the dialog opened with a Add
50. INTO instruction only generates an interrupt when the O flag is 1 2 3 2 Resetting e The SFR area is nonexistent in the debugger so the initialization as in the actual chip is not performed e The cycle count is initialized to 0 Resetting is performed in the same way as the actual MCU A reset is also performed when the debugger starts The value 000F000016 is set in the reset vector immediately after starting The program counter is therefore set to F000016 immediately after the debugger starts R20UT0522EJ0100 Rev 1 00 Page 27 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 3 3 Memory Memory Space There is no processor mode If mapped for memory the whole 1MB of memory from 00000h to FFFFFh can be read from and written Note however that in the initial state memory between 10000h and EFFFFh is not secured and an error will result if an attempt is made to access this part of memory If this occurs while a program is running the program will stop with an illegal memory access error Use the map function described later to map this part of memory Memory Structure and Initial Values Immediately after Starting The memory is set up as follows immediately after starting the debugger 00000h to 003FFh Filled with 00h 00400h to OFFFFh Filled with FFh 10000h to EFFFFh No memory immediately after starting F0000h to FFFFFh Filled with FFh Reset Vector S
51. M16C R8C Simulator Debugger V 1 06 1Features 1 1 Real Time RAM Monitor Function This function allows you to inspect changes of memory contents without impairing the realtime capability of target program execution The simulator system contains a 1 Kbyte RAM monitor area which cannot be divided into smaller areas 1 1 1 RAM Monitor Area This debugger provides a 1KB of RAM monitor area which can be placed at any continuous addresses Base Address 000h Base Address 400h Oh Oh R20UT0522EJ0100 Rev 1 00 Page 3 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 1 2 Sampling Period Sampling cycle means the display update interval You can specify this function in any window which supports the RAM monitor The interval of 100 ms is set by default The actual sampling cycle may take longer time than the specified cycle depending on the operating environment Sampling cycle depends on the following environments e Communication interface e Number of the RAM Monitor windows displayed e Size of the RAM Monitor window displayed e Number of ASM watch points within the RAM monitor area of the ASM Watch window e Number of C watch points within the RAM monitor area of the C Watch window 1 1 3 Related Windows The window where the function of the real time RAM monitor function can be used is shown below e RAM Monitor Window e ASM Watch Window e C Watch Window R20UT0522EJ0100 Rev 1 00 Page 4 of 295 2
52. 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 M16C R8C Simulator Debugger V 1 06 Overview The High performance Embedded Workshop is a Graphical User Interface intended to ease the development and debugging of applications written in C C programming language and assembly language for Renesas microcomputers Its aim is to provide a powerful yet intuitive way of accessing observing and modifying the debugging platform in which the application is running This help explains the function as a debugger of High performance Embedded Workshop Target System The Debugger operates on the simulator system Supported CPU This help explains the debugging function corresponding to the following CPUs e R82C 100 Series Note In this help the information which depends on this CPU is described as for R32C e M32C 80 M16C 80 Series Note In this help the information which depends on this CPU is described as for M32C e M16C 60 M16C 50 M16C 30 M16C Tiny M16C 20 M16C 10 Series R8C Family Note In this help the information which depends on this CPU is described as for M16C R8C e 740 Family Note In this help the information which depends on this CPU is described as for 740 R20UT0522EJ0100 Re
53. Setup Dialog Finds the previous data you ve set or the next data DOWN The setup example in this element specifies that data 0x22 be set at the 10 016th cycle Double click on an element you want and set the desired input value in it ro In this dialog box set the data you want to be actually input to memory Follow the procedure below to set data 1 Move the mouse cursor to the cycles location called an element where you want data to be set then double click the left mouse button Or you can scroll the screen to go to the desired location 2 Input data in the selected place using a hexadecimal number The data size that can be input is one byte from 0x0 up to OxFF 3 Repeat steps 1 and 2 as many times as the number of data you want to set When you finished entering all data press the Next button A dialog box for saving the virtual port input data you ve set to a file virtual port input file will appear 2x Save in B My Computer De F r 314 Floppy A SYSTEM C DATA D Compact Disc E Compact Disc F SJ SUBSYS G File name inputios Save as type 120 Script Files ios v Cancel 4 Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into the simulator debugger back again by using the Load menus in the I O Timing Setting window When you ve input a file n
54. T l Input data display area e Address display area displays the memory address to which a virtual port is input e Input data display area displays the virtual port input data that has been set in graphic mode The peaks in this graph represent data values derived by equally dividing the height of the data displaying area by 255 maximum value of 1 byte data The short white lines appearing at the bottom of the input data display area indicate points at which data are input To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area e Cycle count display area displays cycle counts 3 Hexadecimal mode The virtual port input that has been set is displayed in hexadecimal mode Imu cycle Cycle Address 445678 910111218141516171819204 527 count OUOSED display area Address display area Input data display area e Address display area displays the memory address to which a virtual port is input e Input data display area displays the virtual port input data that has been set by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area e Cycle count display area displays cycle counts R20UT0522EJ0100 Rev 1 00 Page 101 of 295 2011 03 16 rRNENE
55. V 1 06 11Display the Cause of the Program Stoppage 11 Display the Cause of the Program Stoppage If the program is stoped by the debug function the cause of the stoppage is displayed in the Output window or Status window Platform sheet The debugger for 740 doesn t support this function The contents of a display and the meaning of the cause of the stoppage are as follows Display The cause of the stoppage Halt The stop by the Halt Program button menu S W break Software break H W break Hardware break Memory access error Memory access error break Undefined instruction Undefined instruction break R20UT0522EJ0100 Rev 1 00 Page 284 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 Attention 12 1 Common Attention 12 1 1 File operation on Windows The following points should be noted 1 File Name and Directory Name Operation is not guaranteed if your directory names and filenames include kanji Use only one period in a filename 2 Specify the File and Directory You cannot use to specify two levels upper directories You cannot use a network pathname You must allocate a drive 12 1 2 Area where software breakpoint can be set Software breakpoints can be set in the entire area R20UT0522EJ0100 Rev 1 00 Page 285 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 1 3 Get or set C variables If a va
56. V 1 06 6Windows Dialogs 6 14 5 Display the Event Flag Status In the MR window select Popup Menu Mode gt Event Flag ERLT EN EE 6225 ID flg ptn flagg 0000H 8 _task8 0000H OOOOH 9 _task9 s 0000H 0000H 0000H 0000H 6 14 5 1 Display the Event Flag Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the event flags defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of event flag flg ptn Bit pattern of each event flag flagQ Task ID Nos and task names in the event flag queue e When a task connected to the event flag queue is in the state of waiting with timeout enabled waiting in twai flg a string Itmol which indicates a state of waiting with timeout enabled is appended to a string displayed in the flag Q field When a task connected to the event flag queue is in the state of forced waiting double waiting a string sl which indicates double waiting is appended to a string displayed in the flag Q field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 s Display when in WAIT SUSPEND with time out 26 task26 tmolls e Up to 8 characters can be displayed in the task name in the flag Q field If a task name exceeds 8 characters the extra
57. Value dialog is opened Specify the display expansion reduction scale F Time Rate Es 20 Reduce all owe R20UT0522EJ0100 Rev 1 00 Page 245 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 1722 2 Change the grid line display interval Select Value from popup menu by right clicking on the window The Value dialog is opened Specify the time interval in the display Grid Time p hP mO s Em mb us Rate Expand f 500000 Reduce fi 500000 ee 6 17 2 2 3 Change the task display order Select Color from popup menu by right clicking on the window The Color dialog is opened Click the button corresponding to the desired item The Color Setting dialog is opened Change the display color in the dialog R20UT0522EJ0100 Rev 1 00 Page 246 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 17 2 24 Measure the Execution Time of Task By changing the start marker position and end marker position in the Task Trace window you can measure the execution time between the markers w Task Trace HAD HS he ay Mark 00 00 00 190 802 00 00 00 784 555 00 00 00 593 752 Indicator 00 00 01 472 055 Scale 5 600414 Grid 00 0001 ID name D AHCBIENDI M 1 f mmmmmmmmmmmmmmmmmmmmmmmmmmm ME 1 1 M j d M
58. Vector number display area displays the vector number of a virtual interrupt e Priority level display area displays the priority level of a virtual interrupt e Virtual interrupt display area displays timing at which the virtual interrupt you ve set is generated This means that a virtual interrupt is generated men This means that a virtual interrupt is not generated e Cycle count display area displays cycle counts 6 2 6 2 Screen structure for executed address synchronized interrupts When you ve set virtual interrupts that are synchronized to executed addresses a display screen configured as shown below will appear nterrupt address Number of times Address Vec Peal e IGG 7 3 9 10 i e Dn ay 004444 14 2 i i is area Executed Vector Priority level Virtual interrupt display area address display display area display area area e Executed address display area displays the fetch address the address where the program is executed at which time a virtual interrupt is generated e Vector number display area displays the vector number of a virtual interrupt e Priority level display area displays the priority level of a virtual interrupt e Virtual interrupt display area displays timings by an asterisk at which the virtual interrupt you ve set is generated When an asterisk is indicated it means that a virtual interrupt is generated When an asterisk is not indicated it means that a virtual interrupt is not gen
59. Wait bit pattern of event flag flg mode 2 Wait cancellation condition of event flag R20UT0522EJ0100 Rev 1 00 Page 204 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 e 1Task Status Display Status RUN RUNNING state RDY READY state SUS SUSPENDED state DMT DORMANT state WAI SLP Sleeping state WAI SLP SUS Sleeping state suspended WAI SLP TMO Sleeping state with time out WAI SLP TMO SUS Sleeping state with time out suspended WAI DLY Delayed state due to dly tsk WAI DLY SUS Delayed state due to dly tsk suspended WAI FLG Waiting state for an eventflag WAI FLG SUS Waiting state for an eventflag suspended WAI FLG TMO Waiting state for an eventflag with time out WAI FLG TMO SUS Waiting state for an eventflag with time out suspended WAI SEM Waiting state for a semaphore resource WAI SEM SUS Waiting state for a semaphore resource suspended WAI SEM TMO Waiting state for a semaphore resource with time out WAI SEM TMO SUS Waiting state for a semaphore resource with time out suspended WAI MBX Receiving waiting state for a mailbox WAI MBX SUS Receiving waiting state for a mailbox suspended WAI MBX TMO Receiving waiting state for a mailbox with time out WAI MBX TMO SUS Receiving waiting state for a mailbox with time out suspended e 2Display the Wai
60. a state of waiting with timeout enabled is appended to a string displayed in the semQ field When a task connected to the SEM queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the semQ field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 s Display when in WAIT SUSPEND with time out 26 task26 tmo s e Up to 8 characters can be displayed in the task name in the semQ field If a task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Rev 1 00 Page 214 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 6 2 Display the Semaphore Status When the realtime OS is MRxx conformed to ulTRON specifications V 4 0 All the SEMs defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of semaphore Sematr Attribute of each semaphore Sement Semaphore count Semaphore Queue Task ID Nos and task names in the semaphore queue e The following are displayed in the Sematr area TA TFIFO Task wait queue is in FIFO order TA TPRI Task wait queue is in task priority order e When a task connected to the SEM queue is in the state of waiting with timeout
61. allows you to materialize data input to memory such as the SFR or interrupts such as timer interrupt in an artificial manner For details about this method see I O Script and Interrupts described later gt e I O Script Virtual Port Input Function This function defines changes of the data that is input from external devices to a specified memory address Using this function you can simulate data inputs to the ports defined in SFR The following shows timings at which data can be input to memory 1 When program execution has reached a specified number of cycles 2 When a specified memory location is accessed for read by a program 3 When a specified virtual interrupt is generated Virtual interrupts at the above timings can be defined from the I O Timing Setting Window Use of the I O script function the function that allows users to define virtual port input or virtual interrupt makes it possible to specify more elaborate data input timing such as when the program performs fetch or writes to memory or when it executed an instruction a specified number of times Virtual Port Output Function When a data write to some memory address by the program occurs this function records the written data value and the cycle at which the data was written The recorded data can be verified in graphic or numeric format from the I O Timing Setting Window The number of data entries that can be recorded by this function equals the number of data entr
62. characters are omitted R20UT0522EJ0100 Rev 1 00 Page 212 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 5 2 Display the Event Flag Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the event flags defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of event flag Flgatr Attribute of each event flag Flgptn Bit pattern of each event flag Flag Queue Task ID Nos and task names in the event flag queue e The following are displayed in the Flgatr area TA TFIFO Task wait queue is in FIFO order TA TPRI Task wait queue is in task priority order TA_WSGL Only one task is allowed to be in the waiting state for the eventflag TA_WMUL Multiple tasks are allowed to be in the waiting state for the eventflag TA_CLR Eventflag s bit pattern is cleared when a task is released from the waiting state for that eventflag When a task connected to the event flag queue is in the state of waiting with timeout enabled waiting in twai_flg a string tmo which indicates a state of waiting with timeout enabled is appended to a string displayed in the Flag Queue field When a task connected to the event flag queue is in the state of forced waiting double waiting a strin
63. data the data s access attribute cannot be displayed correctly In this case the background colors the access attribute color of the first byte of the data R20UT0522EJ0100 Rev 1 00 Page 131 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 4 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Add Add watchpoint Add Bit Add bit lebel watchpoint Remove Remove the selected watchpoint Remove All Remove all watchpoints Set Set new data to selected watchpoint Radix Bin Display in Binary Dec Display in Decimal Hex Display in Hexadecimal Refresh Refresh memory data Layout Address Area Switch display or non display of Address area Size Area Switch display or non display of Size area RAM Monitor Enable RAM Monitor Switch enable or disable RAM moniter function Sampling Period Set RAM monitor sampling period Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 132 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6 5 C Watch Window 6Windows Dialogs The C Watch Window displays C C expressions and their values results of calculations The C C ex
64. data which are output to UARTs by the Printf function The number of data entries that can be recorded by this function equals the number of data entries specified on the Init dialog box s I O script tab reckoning from the time at which the program started running When reexecuted the previous data is cleared R20UT0522EJ0100 Rev 1 00 Page 15 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Interrupts In the actual MCU peripheral I O including external interrupt signals are generating factors for interrupts However the simulator has nothing corresponding to peripheral I O This simulator provides another method in place of this which allows you to generate interrupts in a simulated manner virtual interrupt function Virtual interrupts can be generated at any time e g in a specified cycle or at an executed address Virtual Interrupt Function This function defines interrupt generation Using this function you can generate timer interrupts and key input interrupts in a simulated manner without having to actually generate them The following shows timings at which virtual interrupts can be generated 1 When program execution has reached a specified number of cycles 2 When the program has executed a specified address 3 Every specified time interval Virtual interrupts at the above timings can be defined from the I O Timing Setting Window Use of the I O script function the function t
65. enabled waiting in twai sem a string Itmol which indicates a state of waiting with timeout enabled is appended to a string displayed in the Semaphore Queue field When a task connected to the SEM queue is in the state of forced waiting double waiting a string sl which indicates double waiting is appended to a string displayed in the Semaphore Queue field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 _task26 sl Display when in WAIT SUSPEND with time out 26 task26 tmollsl e Upto 8 characters can be displayed in the task name in the Semaphore Queue field If a task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Rev 1 00 Page 215 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 7 Display the Mailbox Status In the MR window select Popup Menu Model gt Mailbox MR x wmior pgmd0oHi lt o e BA ID Msg cent MAXmsg WaitQueue Message 0000H OO0AH Task 12 taskl12 0002H 0014H Msg 0033H 0055H 0000H 000AH Task 13 _task13 s 0000H 003CH 0000H 0022H 0000H OOOFH 0000H 0028H 6 14 7 1 Display the Mailbox Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the mail boxes defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0
66. execution time minimum execution time of the task corresponding to the clicked line The search result is pointed by the indicator in the MR Trace window after the indicator moves to the destination position R20UT0522EJ0100 Rev 1 00 Page 238 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 16 5 2 Refer the Ready Queue Time Click the Ready gt Run button in the tool bar Or select Menu Rdy gt Run MR Analyze Elles te Mark 00 00 00 000 335 00 00 00 164 498 00 00 00 164 163 ID name Hum Max Min Byg mj taski 11 00 00 00 013 069 00 00 00 000 013 00 00 00 005 961 2 1 taskz 3 00 00 00 000 080 00700 00 000 009 00 00 00 000 032 task3 2 00700 00 000 083 00700 00 000 013 00700 00 000 048 2 00 00 00 000 093 00 00 00 000 009 00700 00 000 051 l 2 GO 00 00 000 099 00 00 00 000 012 00 00 00 000 056 The time required from execution ready state to transition to execution state by task is processed statistically and displayed The data displayed is the statistical results of the range specified with the start marker and end marker in the MR Trace window By clicking the maximum ready time minimum ready time display field of each line you can search the processing history at the maximum ready time minimum ready time of the task corresponding to the
67. for M16C R8C ccccccccccssessssscecececeeseaeceeececeesssaeeecececeeseseeeeeeeeeenes 26 2 3 1 Operation of Instructions cccccecsescecessseeeceeecececseeecseaaececseeeecesaeeeceesaeesceesaeesseeeeeseaes 26 23 AA T T EE A AE E A 27 23 3 Memory reee E EE EE EEEE E A EE EEEE EAEE EE 28 TO 29 2 3 5 Cycle Count The CYcle CY Command sosvrsrrvrrvrvrevsrnevrnvsrvervevernerreververvensenersersenerveneene 32 2 3 6 Stack Utilization Monitor The StackMonitor SM Command sssrrsvorvrerorvervrrsvrvrenne 32 2 4 Simulation Specifications for 740 cccccccsssscecesssececeeeceeecseeeecsesaececseeeececaeeecseaaeesceeeaeenseeeeeseees 33 2 4 1 Operation of Instructions rrsrorrrrnnrrrrrennvnrrrsrrvrrrnnrvrrrrnnvnrrssnnenrrnnvnesssnnrnsrssnaversnnrsssssnnnn 33 DAD Resetting vavsaneirnpiddes ikeviAendeannla ene fdsrdenedledd 34 PAB Memory e 44r4ta TE 34 DAA al O use 35 2 4 5 Cycle Count The CY cle CY Command cccccccccscscsssessesescscssssessseessscsesscsteceessesesseesseeess 37 2 4 6 Stack Utilization Monitor The StackMonitor SM Command smssvrrrorvrerorvervrrsvrvrenne 37 R20UT0522EJ0100 Rev 1 00 Page iii of viii 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 3 Preparation before Use 38 3 1 Workspaces Projects and Files rorrnnrarooonnnnrnrnrnnsrennnnrnnnrnsneennnnnnnnvesseensnnrnnnenssnenennnnnnensssenennnns 38 3 2 Starting the High performance Embedded Workshop cccsessssecec
68. for setting the virtual port input data will appear Virtual interrupt counts Setup Dialog Finds the previous data you ve set UP or the next data DOWN The setup example in this element specifies that data OxFF be set when virtual interrupt occurs 7 times Double click on an element you want and set the desired input value in it In this dialog box set the data you want to be actually input to memory Follow the procedure below to set data 1 Move the mouse cursor to the virtual interrupt counts location called an element where you want data to be set then double click the left mouse button Or you can scroll the screen to go to the desired location 2 Input data in the selected place using a hexadecimal number The data size that can be input is one byte from 0x0 up to OxFF 3 Repeat steps 1 and 2 as many times as the number of data you want to set When you finished entering all data press the Next button A dialog box for saving the virtual port input data you ve set to a file virtual port input file will appear R20UT0522EJ0100 Rev 1 00 Page 114 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs CT 2x Save in SE My Computer v Aa r 314 Floppy A SYSTEM C DATA D Compact Disc E Compact Disc F SUBSYS G File name inputios Save as type flo Script Files ios v Cancel z 4 Here en
69. fort i 0 i lt 10 i 2 j rand if lt OE j j I ali j sort a p_sam gt s0 a 0 p sam gt s1 a 1 p sen gt et a 2 It takes time to execute this function When the calling source is clarified use Go To Cursor R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 83 of 295 M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 10 3 Executing Step Over Command The Step Over command executes a function subroutine call as a single step and stops at the next statement of the main program To step through all statements in the change function at a single step select Step Over from the Debug menu or click the Step Over button P on the toolbar The PC cursor moves to the next position of a change function Tutorialc p_sam st init p_sam fort i 0 i lt 10 i Jf j rand if j lt of j j ali j sort a change a p_sam gt sl al1 pusen 9s2 a 2 R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 84 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 11 Step11 Forced Breaking of Program Executions This debugger can force a break in the execution of a program 5 2 11 1 Forced Breaking of Program Executions Cancel all breaks To execute the remaining sections of the main function select Go from the Debug menu or the Go button on the toolbar The program goes into an endless loop To force a break in exec
70. grid lines are displayed using the start marker as the radix point The grid lines are displayed using the start marker as the radix point The scale is displayed using the time at which the start marker is positioned as 0 with the left forward in time set to minus and the right backward in time set to plus The grid lines allow you to roughly understand the interrupt occurrence cycle and process time The interval time width of the displayed grid lines appears in the Grid area of the status bar The time value in the MR Trace window means the execution elapsed time using the program execution start time as 0 in all the cases On the contrary the numeric value above the grid lines scale in the MR Trace window is a relative value using the start marker as 0 the grid interval is specified in the Value dialog It has nothing to do with the time value This is provided so that you can see the window easily Note The software interrupt number 1 is different according to product For details about which interrupt number is assigned to which system call refer to the MRxx Reference Manual Assemble Language Interface R20UT0522EJ0100 Rev 1 00 Page 228 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function S
71. gt Dyadic comparison level 8 R20UT0522EJ0100 Rev 1 00 Page 263 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 VOScrpt Settings of virtual port inputs or virtual interrupts can be written to a file in script form This script is called the I O script Also the files that contain a description of I O scripts are called the I O script file Using I O scripts you can set virtual port inputs and virtual interrupts in a more flexible manner than can be set from the I O Timing Setting Window For example you can make the following settings that cannot be made from the I O Timing Setting Window e Ifyou want to generate a cyclic virtual interrupt like timer interrupts you can use the while statement to specify a repetition of virtual interrupt generation e You can specify that the priority levels set in the interrupt control register s interrupt priority level select bits be referenced to resolve the interrupt priority of virtual interrupts generated e As conditions for entering virtual port inputs or generating virtual interrupts you can specify a combination of program fetch memory access for read write or memory comparison In addition to the above various other I O settings are possible 9 1 Method for Writing I O Script This section explains the method for defining virtual port inputs virtual interrupts and other I Os to be written in I O script by using definition examples To
72. in a program 5 2 4 1 Setting a Software Breakpoint For example to set a software breakpoint at the sort function call Double click the S W breakpoints column on the line containing the sort function call Et ox init p sam j rand ifj lt Of j j ali j sorta chanze a p sam gt s0 a 0 p_sam gt sl al1 p_sam gt s2 a 2 p_sam gt s3 a 3 fort i 0 i lt 10 i The red symbol will appear on the line containing the sort function call This shows that a softwarebreak breakpoint has been set R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 74 of 295 M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 5 Step5 Executing the Program Execute the program as described in the following 5 2 5 1 Resetting of CPU To reset the CPU select Reset CPU from the Debug menu or click the Reset CPU button Ef on the toolbar 5 2 5 2 Executing the Program To execute the program select Go from the Debug menu or click the Gol button on the toolbar The program will be executed up to the breakpoint that has been set and an arrow will be displayed in the S W Breakpoints column to show the position that the program has halted eta i lt 10 itt Jf change a p sam gt s0 a 0 p_sam gt sl al 1 p_sam gt s2 a 2 p_sam gt s3 a 3 Note When the source file is displayed after a break a path of the source file may be inquired In this case
73. instructions on the screen R20UT0522EJ0100 Rev 1 00 Page 44 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 2 Creating a New Workspace Toolchain Not Used When debugging the existing load module file with this product a workspace is created by this method It can work even if the tool chain is not installed 3 2 2 1 Step1 Creation of a new workspace In the Welcome dialog box that is displayed when the High performance Embedded Workshop is activated select the Create a new project workspace radio button and click the OK button Creation of a new workspace is started The following dialog box is displayed New Project Workspace Projects Ice eae eg Workspace Name gt Debugger only M16C PC7501 DOSample01 gt Debugger only M160 Starterk Project Name gt Debugger only R8C E SYSTEM DOSample0 gt Debugger only R8C E8 SYSTEM Directory D work HEW4 Samples M16C DOSample01 Browse CPU family m160 v Tool chain None Properties 1 Select the target CPU family In the CPU family combo box select the target CPU family 2 Select the target toolchain meet In the Tool chain combo box select None In this case toolchain is not used When the toolchain has not been installed the fixed information is displayed in this combo box 3 Select the project type When th
74. of 295 RENESAS M16C R8C Simulator Debugger V 1 06 7Table of Script Commands MoveWord MOVEW Moves memory blocks in 2 byte units MR Displays status of realtime OS MRxx OverStep O Overstep execution of source lines OverStepInstruaction OI Overstep execution of instructions Path 5 Sets and checks the search path Pause 5 Waits for user input Print z Check value of specified C variable expression Radix 5 Sets and checks the radix for numerical input Register R Checks and sets a register value Reload Re downloads the target program Reset Resets the target MCU Return RET Executes a source line return ReturnInstruction RETI Executes an instruction return Scope Sets and checks the effective local symbol scope Script Opens and executes a script file Section SEC Checks section information Set Set specified data in specified C variable expression SetMemoryByte MB Checks and changes memory contents in 1 byte units SetMemoryLword ML Checks and changes memory contents in 4 byte units SetMemoryWord MW Checks and changes memory contents in 2 byte units Sleep Halts for user input until the specified time has elapsed SoftwareBreak SB Sets and checks software breaks SoftwareBreakClear SBC Clears software breaks SoftwareBreakClearAll SBCA Clears software breaks SoftwareB
75. of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 4 Attention of the M16C R8C Debugger 12 4 1 Options for compiler assembler and linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification Refer to 12 6 Options for compiler assembler and linker The compiler that can be used by M16C R8C debugger e NCxx e the IAR EC Compiler e the IAR C Compiler e the TASKING C Compiler 12 4 2 TASKING C Compiler When you debug programs compiled by the TASKING C Compiler CCM16 the type of bit field is fixed on unsigned short int Because CCM16 outputs the debug information for the type of bit field as unsigned short int 12 4 3 Precautions on Using M16C 62 Group This debugger does not support the M16C 62 group s memory extension mode Only the normal mode is supported R20UT0522EJ0100 Rev 1 00 Page 289 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 5 Attention of the 740 Debugger 12 5 1 Options for compiler assembler and linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification Refer to 12 6 Options for compiler assembler and linker The compiler that can be used by 740 d
76. operators in an expression have the same priority they are calculated sequentially from left to right Operator Meaning Priority QO Parentheses Level 1 RAS Unary plus unary minus unary bit logic Level 2 il Binary multiplication binary division Level 3 Ji Binary addition binary subtraction Level 4 gt gt Shift right shift left Level 5 lt lt gt gt Binary comparison Level 6 Binary comparison Level 7 amp Binary logical AND Level 8 a Binary exclusive OR Level 9 Binary logical OR Level 10 amp amp Logical AND Level 11 Logical OR Level 12 9 3 7 Hisfetch Hisint Hisread iswrite These statements are used in conditional expressions of I O script statements and if and while statements 9 3 7 1 isfetch expression Format isfetch address Function The value of the expression becomes true 1 when the program s PC value goes to a specified address Otherwise the expression is false 0 For example the if statement below if isfetch 0xfc000 becomes true 1 when the program s address PC value becomes Oxfc000 9 3 7 2 isint expression Format isint vector number Function The value of the expression becomes true 1 immediately after a virtual interrupt of a specified vector number is generated Otherwise the expression is false 0 For example the if statement below if isint 13 becomes true 1 if a virtual inte
77. select Menu Trace Range gt Break in the MR Trace window After Stores the cycles of trace data after the trace point Break Stores the cycles to the point at which the trace point is passed Execute the target program Record the information required to know the task execution history in the trace memory ATTENTION A trace point set in the Trace Point Setting dialog is disabled 6 15 2 2 Stop the Task Execution History Measurement Click the Stop button in the Task Trace window Or select Menu Trace Stop The measurement results so far are displayed in the MR Trace window 6 15 2 3 Restart the Task Execution History Measurement Click the Restart button in the Task Trace window Or select Menu Trace Restart When restarting the trace measurement all the measurement results so far are deleted R20UT0522EJ0100 Rev 1 00 Page 230 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 2 4 Refer the Execution History of Task You can reference the task execution transition in the MR Trace window MR Trace BHM e amp frr d Aono Mark 00 00 00 020 160 00 00 00 131 909 00 00 00111 749 ree ee Scale 2401435 00 00 00 032 832 Area Break VEC table ID name _ 32 OFFDSO SYSCEALLO 33 OFFD84 SYSCELL1 38 OFFD98 SYSCALLZ tn taskZ task3 task4 I tasks U
78. settings Notes The memory area where the memory map was set can be read and written regardless of memory type SFR RAM DFLASH ROM R20UT0522EJ0100 Rev 1 00 Page 60 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 4 3 Simulator engine setup When Simulator engine simxx starts up it is registered in the system tray Right clicking on the running simxx and selecting Version from the menu bar will open up the Version Information dialog box Use this Version Information dialog box to set up simxx Shown below is the Version Information dialog box of the simulator engine for the M16C and M32C series debugger Version Information 2 Sim30 M16C R amp C simulator engine Bsim20 Version 5 00 00 Exit Copyright C 1997 2004 Renesas Technology Corp and Eg Renesas Solutions Corp Application Information Interface CUT Option IV Auto exit MCU Status STOP e Auto Exit Switch Setting By checking the Auto exit check box simxx can be terminated at the same time the simulator debugger front end finishes e Communications Connection Status CONNECT is displayed when connected to the simulator debugger CUT is displayed when there is no connection e Simulator MCU Status RUN STOP RUN is displayed when the simulator MCU is running STOP when stopped e OK button Closes the Version Information dialog box e Exit button Exits simxx R20UT0522EJ0100 Rev 1 00 Page
79. the order of ID number The fixed length data comes first and the optional length data comes after the fixed length data The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of memory pool BaseAddr Base address of memory pool Blk Size Block size of memory pool Total Bilk cent Tot al block count of memory pool Free Blk_cnt map Number of unused blocks and information on unused memory blocks bit information e The display of the ID field varies depending on which one is specified fixed length or optional length If the data is of fixed length the ID field displays a string F and memory pool ID number For an arbitrary length the contents displayed on the first line are the character string V a memory pool ID number and a block ID number Displayed on the second to fourth lines are the memory pool ID and block ID numbers The block ID numbers are enclosed in parentheses e When specifying the optional length memory pool is displayed in the Total Mik cut field No bit information is displayed in the Free Blk_cnt map field e When specifying the fixed length memory pool the display format of each bit in the memory block information in Free Blk_cnt map is as shown below item Contents 0 Memory block in use busy my Memory block not in use ready ie No memory block
80. the realtime OS The debugger for 740 doesn t support this function You can only use the MR Window when you have downloaded a program that uses the realtime OS Gf the downloaded program does not use the MR nothing is displayed in the MR Window when it is opened MR mEOP Am oSA ORE Current Run Task 1 main ID Stazddr name Pra Status wup count timeout flg ptn flg mode OF17F8H OF1A68H OF1A76H OF1A84H OF1ASAH OF1ABOH OF1ACAH OF1AE4H OF1B02H 1 2 3 4 5 6 7 8 9 main task2 task3 task4 task5 task6 task taske task9 1 RUN 0000H RDY 0000H sus 0000H WAI SLP 0000H WAI SLP 5US 0000H WAI DLY 0000H WAI DLY SUS 0000H WAI FLG 0000H WAI FLG SUS 0000H 1111H TWE_ORW 1111H TWF ORW e You can open the MR window as many as the number of display modes e By clicking the desired button the MR window display mode changes and the display data also changes e By double clicking the desired task line you can display the context data of the task e You can drag the cursor to change the width of the display area in each mode e If the downloaded program does not use MR you cannot select all the menu which will select the display mode e The usable display mode depends on MRxx ATTENTION Please use the startup file crtOmr axx start axx whose contents matches with the version of MRxx when you make downloaded program The MR Window and
81. this product allows you to create and modify workspaces A workspace can be thought of as a container of projects and similarly a project can be thought of as a container of project files Thus each workspace contains one or more projects and each project contains one or more files iz workspace Workspaces allow you to group related projects together For example you may have an application that needs to be built for different processors or you may be developing an application and library at the same time Projects can also be linked hierarchically within a workspace which means that when one project is built all of its child projects are built first However workspaces on their own are not very useful we need to add a project to a workspace and then add files to that project before we can actually do anything R20UT0522EJ0100 Rev 1 00 Page 38 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 Starting the High performance Embedded Workshop Activate the High performance Embedded Workshop from Programs in the Start menu The Welcome dialog box is displayed Welcome giis Cancel u C Open recent project workspace Administration gt C Browse to another project workspace In this dialog box A workspace is created or displayed e Create a new project workspace radio button Creates a new workspace e Open a recent project wor
82. treat all sizes of enumeration types whose size is unknown in the debugging information as 1 byte For reducing memory consumption NC30 NC308 and NC100 have an option to treat the sizes of enumerator types as 1 byte and not as same size of int Note that NC30 NC308 and NC100 don t output the sizes of enumerator types in debugging information and debuggers consider the size as same size of int Therefore you may not correctly refer the values of enumeration types in the target programs which were compiled with the above option This function is for resolving the above issue See the users manual of each compiler for details of the above option The debugger for 740 doesn t support this function 5 Always treat variables of enumerator type with unknown size as 1 byte Check the above check box if you would like to treat all sizes of enumeration types as 1 byte It is necessary to load the debugging information again in order to reflect this setting R20UT0522EJ0100 Rev 1 00 Page 55 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 1 3 Script Tab The specified content becomes effective when the next being start Refer 4 1 3 1 Automatically Execute the Script Commands To automatically execute the script command at start of Debugger click the Refer button to specify the script file to be executed so EG By clicking the Refer button the File Selection dialog is opened The specified script
83. virtual interrupt vector number to be monitored e Input data display area displays the virtual port input data that has been set by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the virtual interrupt occurrence count of the data at which the cursor is positioned will be displayed in the virtual interrupt occurrence count display area Virtual interrupt occurrence count display area It displays virtual interrupt occurrence counts R20UT0522EJ0100 Rev 1 00 Page 102 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e Virtual interrupt occurrence count display area displays virtual interrupt occurrence counts 6 2 5 Structure of Virtual Port Output Screen Virtual port output results can be displayed in one of the three modes shown below The display modes can be changed from the Mode menu 1 Chart mode displayed in units of bits Virtual port output results are displayed in chart mode in units of bits Output cycle Cycle 0000004778 Data 0x30 a Address Bit 546204730484049535060517052805390550056 Cycle count display area Address Bit number Output data display area display display area area e Address display area displays the address to be monitored for virtual port output e Bit number display area displays bit numbers of memory being monitored for virtual port output e Output data display area displays the data as virtual port ou
84. you want cancel the setup session and close the dialog box A dialog box for setting the address you want to be monitored for virtual port output will appear R20UT0522EJ0100 Rev 1 00 Page 116 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Setup Dialog Input the address you want to be monitored for output Input the address you want to be monitored for virtual port output in the Output Address column Then press the Next button A dialog box for specifying a file virtual port output file to which you want the virtual port output results to be saved recorded will appear This simulator debugger saves the virtual port output results that have occurred during program execution to this file and references it when the program stops running Save Data g My Computer S SYSTEM C DATA D 8 Compact Disc E S Compact Disc F SUBSYS G output ios 1 0 Script Files ios Ka Here choose the item Set Virtual Port Output and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting the address you want to be monitored for virtual port output will appear R20UT0522EJ0100 Rev 1 00 Page 117 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 10 Setting Virtual Interrupts The Virtual Interrupt function allows you t
85. 0 2011 03 16 Page 203 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 2 Display the Task Status In the MR window select Popup Menu Mode gt Taskl w OPaOS o aR Current Run Task 1 main ID Stazddr name Pri Status wup count timeout flg pen flg mode OF17F8H main 1 RUN 0000H OF1A68H _task2 2 RDY 0000H OF1A76H _task3 sus 0000H OF1A84H task4j WAI SLP 00008 SUS 0000H 0000H OF1A9AH task5 WAT SLP OFLABOH task6 WAI DLY OFIACAH task WAI DLY SUS 00008 OF1AE4H _task8 WAI FLG OF1B02H task9 WAI FLG 0000H 1111H TWF_ORW Sus 0000H 1111H TWF ORW By double clicking any line the information on the task context is displayed in the Context dialog For details on the Context dialog see 6 14 12 Display the Task Context The following data is displayed in the status bar Current Run Task 1 main 6 14 2 1 Display the Task Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the tasks defined in the configuration are listed in the order of ID number The function of each item is as described below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Items Contents ID Task ID StaAddr Starting address of task name Task name Pri Priority Status 1 Task status wup count Wake up count timeout Timeout value flg ptn
86. 0 32 OFFDBO SYSCALLD 17 00 00 00 000 033 00 00 00 000 013 00 00 00 000 022 00 00 00 000 378 0 23 rot 33 OFFDB4 syscaLLi 5 00 00 00 000 020 00 00 00 000 019 6007 00 00 000 019 00700 00 000 099 0 06 38 OFFD98 SYSCALL2 3 00 00 00 000 028 00 00 00 000 028 0070000 000 028 00700 00 000 084 0 05 hale gt F 6 00 00 00 000 017 00 00 00 000 002 00 00 00 000 006 00 00 00 000 036 0 02 1 taski 11 00 00 00 014 003 00 00 00 000 001 00 00 00 008 957 00 00 00 098 528 60 02 mmmmmmmmmmmm 2 _ _task2 3 00 00 00 013 003 00700 00 000 001 00700 00 008 669 00700 00 026 008 15 64 wmm 3 tasks 2 00 00 00 013 006 00 00 00 000 003 0070000 006 504 00700 00 013 009 7 92 4 task4 2 G0 00 00 013 003 60 00 00 000 001 60700 00 006 502 00 00 00 013 005 7 92 m 5 tasks 2 00 00 00 013 007 00 00 00 000 003 00700 00 006 505 00700 00 013 011 7 93 m Unknown 0 0 00 I 00 00 00 000 000 00 00 00 000 000 00 00 00 000 000 00 00 00 000 000 1 i The window shows the CPU occupation time and ratio by interrupt processing and by task The data displayed is the statistical results for the range specified with the start marker and end marker in the MR Trace window By clicking the maximum execution time minimum execution time display field of each line you can search the processing history at the maximum
87. 0 is input Data FF is input Data 1D is input in the 2 000th in the 5 000th in the 9 000th cycle cycle cycle l 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Number of cycles executed As shown above data can be input to memory address 3E0 in any desired cycle as specified by the user 2 Read access synchronized input Data can be input when the program accesses a specified memory location for read The data size that can be input is one byte The diagram below shows an example of a virtual port input that is synchronized to memory accesses for read pragma ADDRESS port eH char porth read_portt char key key porto Input from port D This function aims to assign the value of port 0 to variable key In such a case a value can be assigned to variable key by entering it to port 0 when the program accesses port 0 address 3E0 for read To support processing of functions like this this debugger provides a function that allows you to define the data to be input according to a number of times the specified memory address is read a virtual input port synchronized to memory accesses for read By using this function you can perform an operation where data 0x10 is input to memory address 3E0 when address 3E0 is read first and data 0x20 is input to said memory address when the address is read next R20UT0522EJ0100 Rev 1 00 Page 96 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06
88. 00 00 00 055 299 oo W 00 00 00 055 299 global struct m struct m uchar oo Wj 00 00 00 055 300 oo Wj 00 00 00 055 300 0x10 L le R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 194 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 11 4 Configuration of Source Mode When only source mode is selected trace information is displayed in source mode Source mode is configured as shown below global char A global short 2 global long 3 global struct m char B global struct m short 5 global struct m long 6 OFOOEB i global struct m struct m uchar 0x10 OFOOEF global struct m struct m ushort 0x20 global struct m Struct m uint 0x30 OFGOFB for i 0 i lt 5 i OFO104 for j O j lt 5 j OFO10D global _array i 3 0 a 2 3 4 1 Line number display area Shows the line number information of the displayed file Double click here to bring up a dialog box to change the displayed file 2 Address display area Shows addresses corresponding to source lines Double click here to bring up a dialog box to search for addresses 8 Referenced cycle display area Shows the currently referenced cycle that is marked by gt gt Furthermore the addresses corresponding to source lines if any are marked by 4 Source display area Shows the content of the source file 5 File name Sho
89. 00 000 033 00 00 00 000 013 00 00 00 000 022 00 00 00 000 378 0 23 H H 33 OFFD84 SYSCALL1 5 00700 00 000 020 00700 00 000 019 00 00 00 000 019 00700 100 000 099 0 06 38 OFFDS8 SYSCALLZ 3 60 00 00 000 028 000 0 000 028 084 0 05 Idle 6 00 00 00 000 017 00 00 00 000 002 00 00 00 000 006 00 00 00 000 036 0 02 1 _task1 11 00 00 00 014 003 00700 00 000 001 00 00 00 008 957 00700 00 098 528 60 02 EEE 2 task2 3 00 00 00 013 003 00 00 00 000 001 00 00 00 008 669 00 00 00 026 008 15 04 mmm H Sj tesks 2 00 00 00 013 006 00 00 00 000 003 00 00 00 006 504 00 00 00 013 009 7 92 i 4 _task4 2 00 00 00 013 003 00 00 00 000 001 00 00 00 006 502 00 00 00 013 005 7 92 m 5 tasks 2 00 00 00 013 007 00700 00 000 003 00700 00 006 505 00700 00 013 011 7 93 m Unknown 0 60 00 00 000 000 00 00 00 000 000 00700 00 000 000 0 00 l 00 00 00 000 000 ji By clicking the maximum execution time minimum execution time display area of each line you can search interrupt to the clicked line or process history at the maximum minimum execution time of the task The search result is pointed by the indicator which moves to the target position in the MR Trace window R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 236 of 295 M16C R8C Simulator Debugger V 1 06 6Window
90. 011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 2 Break Functions 1 2 1 Software Breaks Function Software Break breaks the target program before execution of the command at the specified address This break point is called software breakpoint The software breakpoint is set reset in the Editor Source window or in the S W Breakpoint Setting window You can also disable enable a software breakpoint temporarily You can specify up to 64 software breakpoints When specifying two or more software breakpoints the breakpoint combination is based on the OR logic Arrival to any one of breakpoints breaks the target program 1 2 1 1 Setting of software breakpoint The software breakpoint can be set by the following windows e Editor Source Window e S W Break Point Setting Window You can double click the mouse to set reset the software breakpoint in the Editor Source window You can also switch to temporarily disable enable the software breakpoint in the S W Breakpoint Setting window 1 2 1 2 Area where software breakpoint can be set The area which can be set for software breakpoint varies depending on the product For the areas available for software breakpoint see the following Refer to 12 1 2 Area where software breakpoint can be set R20UT0522EJ0100 Rev 1 00 Page 5 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 2 2 Hardware Breaks Function This function stops the ta
91. 1 When writing to memory at address 0x8000 in bytes set 0x8000 B 0x10 or set 0x8000 0x10 Example 2 When writing to memory at address 0x8000 in words set 0x8000 w 0x1234 Example 3 When writing to memory at address 0x8000 in long words set 0x8000 L 0x12345678 R20UT0522EJ0100 Rev 1 00 Page 274 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 1 Writing C C Expressions You can use C C expressions consisting of the tokens shown below for registering C watchpoints and for specifying the values to be assigned to C watchpoints Token Example Immediate values 10 Ox0a 012 1 12 1 0E 3 Scope name classname member Mathematical operators FS Pointers KER oo Reference amp Sign inversion Member reference using dot operator Object Member Member reference using arrow Pointer gt Member this gt Member Pointers to Members Object var Pointer gt var Parentheses GI Arrays Arrayl 2 DArrayl2 3 Casting to basic types int char unsigned long Casting to typedef types DWORD ENUM Variable names and function names var i j func Character constants A bl Character string literals abedef I am a boy 10 1 1 Immediate Values You can use hexadecimals decimals octals as immediate values Values starting with Ox are
92. 1 5 Option settings for download MoOdules ccccccccccccecsesessececececsesseceeccecsessaseeeeceesenses 286 12 1 6 Debugging multi modules iensen ea aea ar EE EEE 287 12 1 7 Synchronized debugging c ccccccccessssecccececsesssececececsesssseeececeesesssaeeeeeesesesssaeeeeeeeenenses 287 12 1 8 Virtual port output function Sisse seisis iesenii se iea a aa iin 287 12 2 Attention of the R32C Debugger rrrrnnnrvrnrnrrnerannrnrnrnssrsrennnnrrenssrerennnnnrensnrsnennnnrnensnnsnensnnnsenene 288 12 2 1 Option of C Compiler Assembler Linker rrnnrrrrronnrnrnnnvvvrrrnnrnrrsrnnvnrrnsrvrersnnrnrrssnnrernnn 288 12 3 Attention of the M32C Debugger rrrnvvrvrnrnrsrerannrnrnrnssrenennnnrrenssrerennnnrrensnrsrensnnrnrnsnnsnsnannrsenene 288 12 3 1 Option of C Compiler Assembler Linker rrnnrrrrronnrnrrnavvvrrnnnrnrrrsnnrsrrsrrrvrrsnnrnrrssnnrernnn 288 12 4 Attention of the M16C R8C Debugger rervrerrrrnannrnrnrnrsrnnennnnrnrnssrerennnnrvensnrsnennnnrvrnsnnsnenannrsensee 289 12 4 1 Options for compiler assembler and linker rrsnnrnrrnavvrrrrnnrnrrrrnnrrrrnsrrrrrsnnrnrrssnnrernnn 289 12 4 2 TASKING C Compiler ccccccccccccccecssssscecececeesessceccceceesssaesecececsesesaeseeececseseasaeeeeseeenes 289 12 4 3 Precautions on Using M16C 62 Group rerrnvrvrrranvrnrrrarvvrrrnnrnrrrrnnrsrrssrvrsrsnnrnrrsrnnrernnn 289 12 5 Attention of the 740 Debugger rerrrrrrnvrvrnrnrrrerannrnrrenssrrrennnnrnenssrerennnnrrnnsnrsnennnnnnensn
93. 1 or 0 in bits LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or 0 in bits Text Display a text string 2 1 5 Cycle Count The CYcle CY Command Use of the CYcle command allows you to know an approximate number of cycles and the execution time of the program you ve executed The number of cycles are represented using the values listed in the microcomputer s software manual The execution time refers to the target program s execution time calculated from the cumulative number of cycles of the CPU instructions executed and the MCU clock and divide by ratio specified on the Init dialog box s MCU tab 2 1 6 Stack Utilization Monitor The StackMonitor SM Command Use the StackMonitor command to check the maximum and minimum addresses of the stack and to determine how much the program has used of what part of the stack The stack monitoring continues from the time that a Go or GoFree command is invoked until it is interrupted the maximum and minimum values being recorded for the two stack pointers USP and ISP registers If while the program is running it causes a change in the value of a stack pointer monitoring of stack utilization of that stack stops at that point R20UT0522EJ0100 Rev 1 00 Page 18 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 2 Simulation Specifications for M32C 2 2 1 Operation of Instructions e Reg
94. 10 2 Select AND Same Time Change the Combination group to AND Same Time Next check turn on an event in the event specification area that you want to use No pass counts can be specified fixed to 1 EE H N Break Points Setting IV Enable HAW Break ADDRE CONDITION Al 000400 WRITE addr 000400 data 0032 42 0F0528 FETCH addr 0F0528 43 000000 FETCH addr 000000 44 000000 FETCH addr 000000 45 000000 FETCH addr 000000 46 000000 FETCH addr 000000 OOOOO8 Combination PID AND Same Time z Detail I Enable Detail Reset Save Close 6 10 10 3 Select State Transition Change the Combination group to State Transition The Detail button included in the Combination group becomes useful so click that button This opens the State Setting window In this window State Transition can be specified using sequentially Use the buttons included in the Sequential group Pass counts can be specified from the popup menu that appears when selecting an event The contents set here are reflected in the state transition diagram Example Events B1 and B2 that occur successively in that order are established W State Setting State Transition 0 Time Out Wot Use Start State C Statez Time Count 65535 fi x 10usec V Sequential Start gt Bil_ gt B21 ie i Cancel
95. 2 2 5 Cycle Count The CYcle CY Command Use of the CYcle command allows you to know an approximate number of cycles and the execution time of the program you ve executed The number of cycles are represented using the values listed in the microcomputer s software manual The execution time refers to the target program s execution time calculated from the cumulative number of cycles of the CPU instructions executed and the MCU clock and divide by ratio specified on the Init dialog box s MCU tab 2 2 6 Stack Utilization Monitor The StackMonitor SM Command Use the StackMonitor command to check the maximum and minimum addresses of the stack and to determine how much the program has used of what part of the stack The stack monitoring continues from the time that a Go or GoFree command is invoked until it is interrupted the maximum and minimum values being recorded for the two stack pointers USP and ISP registers If while the program is running it causes a change in the value of a stack pointer monitoring of stack utilization of that stack stops at that point R20UT0522EJ0100 Rev 1 00 Page 25 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 3 Simulation Specifications for M16C R8C 2 3 1 Operation of Instructions Regarding the number of instruction cycles Time management is exercised in units of cycles Simulation Speed Model The number of cycles is represented by the values li
96. 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Tutorial R20UT0522EJ0100 Rev 1 00 Page 67 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Blank Page R20UT0522EJ0100 Rev 1 00 Page 68 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 Tutorial 5 1 Introduction This section describes the main functions of this debugger by using a tutorial program The tutorial programs are installed to the directory YWorkSpaceYTutorial of the drive you installed High performance Embedded Workshop There are workspaces for each targets and each MCUs Please select the corresponding one to your system and open the workspace file hws from the menu Open Workspace The tutorial program is based on the C program that sorts ten random data items in ascending or descending order The tutorial program performs the following actions e The tutorial function generates random data to be sorted e The sort function sorts the generated random data in ascending order e The change function then sorts the data in descending order Note After recompilation the addresses may differ from those given in this section When using the assembler package for 740 family The tutorial program for the assembler package for 740 family is prepared If you use the assembler package for 740 family please use it e Please read this tutorial with replacing function names with subroutine name e g replace function s
97. 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 3 2 Displaying the Source Program This debugger allows the user to debug a user program at the source level Double click tutorial c under C source file A Editor Source window opens and the contents of a Tutorial c file are displayed Tutorial Tutorial Assembly source file A nert0 a30 SJ source file Bl sort c 8 Download modules H Tutorialx30 00000000 Dependencies Source long a 10 struct Sample st void main void while 1 1 tutorial E no define inc Z sect30 inc sorth void tutorial void long j int i struct Sample far p sam p_sam amp st init p_sam fort i 0 i lt 10 i yH lt gt Tutorial c Select the Format Views option from the Setup menu to set a font and size that are legible if necessary Initially the Editor Source window shows the start of the user program but the user can use the scroll bar to scroll through the user program and look at the other statements R20UT0522EJ0100 Rev 1 00 Page 73 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5 2 4 Step4 Setting a Breakpoint A software breakpoint is a basic debugging function 5Tutorial The Editor Source window provides a very simple way of setting a software breakpoint at any point
98. 39 FOLALH 00 00 00 054 428 18938 OFO1AL 7DF2 00 00 00 054 428 18929 0F0087 F50600 _randam_ FOOSEH 00 00 00 054 429 18920 OFOOSE 7CF204 randam access O4H 00 00 00 054 429 18916 0F0091 FDD40BOF rand FOBD4H 00 00 00 054 430 hl 18906 OFOBD4 7SCO6D4E _rand 4E6DH RO 00 00 00 054 430 18904 OFOBDS 75C2C641 41C6H R2 00 00 00 054 430 18902 OFOBDC 754F4004 0440H 00 00 00 054 430 18898 OFOBEO 754F3E04 043EH 00 00 00 054 431 18893 OFOBE4 FEO1 FOBE6H 00 00 00 054 431 18889 OFOBE6 FD1COCOF __i4mulU FOC1CH 00 00 00 054 431 18879 OFOC1C EC50 _ f R1 R3 00 00 00 054 432 18875 OFOC1E 75B107 3 7H SP R1 00 00 00 054 432 18870 oFoc21 7121 3 R2 R1 00 00 00 054 432 18865 oFoc23 7312 R1 R2 00 00 00 054 433 18863 OFOC25 75B109 3 SH SP R1 00 00 00 054 433 18859 oFoczs 7101 H RO R1 00 00 00 054 433 18854 OFOCZ2A A112 S R1 R2 00 00 00 054 433 j 1 Address display area Shows addresses corresponding to instructions Double click here to bring up a dialog box to search for addresses 2 Object code display area Shows the object codes of instructions 3 Label display area Shows labels corresponding to instruction addresses Double click here to bring up a dialog box to search for addresses 4 Mnemonic display area Shows the mnemonics of instructions Other display areas are the same as in bus mode In addition to disassemble information the window can display source line or data access information
99. 5 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 4 3 Method of making MCU file the M16C R8C Debugger In the MCU file write the following contents in the order listed below For the file name specify the MCU name For the extension specify mcu MCU type MCU type 2 UARTO Transmit Receive Control Register 1 address UART1 Transmit Receive Control Register 1 address UARTO Transmit Buffer Register address UART1 Transmit Buffer Register address Reset Vector address Undefined Instruction Interrupt Vector address Overflow Interruput Vector address 10 BRK Instruction Interrupt Vector address OP aONIorrwnr Always be sure to add a semicolon before the MCU type e 58 R8C Family e 316 M16C Series Write each address in hexadecimal Do not add the prefix that represents the radix Always be sure to add a semicolon before the MCU type 2 e 30 Reserved number Write each address in hexadecimal Do not add the prefix that represents the radix 4 4 3 1 Example 8 0 A5 AD A2 AA FFFC FFDC FFEO FFE4 R20UT0522EJ0100 Rev 1 00 Page 64 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 4 4 Method of making MCU file the 740 Debugger In the MCU file write the following contents in the order listed below For the file name specify the MCU name For the extension specify mcu Write each address in hexadecimal Do not add the prefix that represents the ra
100. 5 195 00700 00 005 195 00700 00 005 195 00 00 00 005 195 0 33 H H t 1 mainj 115 00700 00 007 305 00700 00 000 767 00700 00 001 541 00700 00 177 287 pene i H 2 task002 12 00 00 00 012 067 00700 00 006 915 00700 00 011 552 00 00 00 138 630 8 84 m 3 task003 12 00700 00 012 597 00 00 00 006 892 00700 00 012 111 00 00 00 145 332 9 27 m i i 4 task004j 12 00 00 00 012 170 00700 00 006 505 00700 00 011 604 00 00 00 139 252 8 65 mm i 5 _task005 12 00 00 00 012 277 00700 00 006 577 00700 00 795 00700 00 141 540 9 02 m i H 6 task006 11 00 00 00 013 435 00700 00 006 490 00700 00 012 353 00 00 00 135 885 6 66 mm 7 task007 11 00 00 00 013 020 00700 00 006 790 00700 00 012 431 00 00 00 136 745 8 72 m H H 8 task008 11 00 00 00 014 080 00700 00 008 055 00700 00 013 232 00 00 00 145 552 9 28 i 9 task009 11 00 00 00 013 642 00700 00 007 277 00700 00 012 663 00 00 00 139 295 6 66 m i i 10 taskOl0j 11 00 00 00 013 710 00700 00 008 070 00700 00 012 795 00 00 00 140 752 8 97 m 11 taskOll 11 00 00 00 011 892 00 00 00 006 290 00700 00 011 193 00 00 00 123 132 7 65 m i H 222 Unknown 0 00700 00 000 000 00700 00 000 000 007000 000 00700 00 000 000 0 00 H The displayed data is the statistical results of the r
101. 61 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 4 Method of making MCU file 4 4 1 Method of making MCU file the R32C Debugger In the MCU file write the following contents in the order listed below For the file name specify the MCU name For the extension specify mcu 1 UARTO Transmit Receive Control Register 1 address 2 UART1 Transmit Receive Control Register 1 address 3 UARTO Transmit Buffer Register address 4 UART1 Transmit Buffer Register address Write each address in hexadecimal Do not add the prefix that represents the radix 4 4 1 1 Example 365 36D 362 36A R20UT0522EJ0100 Rev 1 00 Page 62 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 4 2 Method of making MCU file the M32C Debugger In the MCU file write the following contents in the order listed below For the file name specify the MCU name For the extension specify mcu MCU type 0 or 1 UARTO Transmit Receive Control Register 1 address UART1 Transmit Receive Control Register 1 address UARTO Transmit Buffer Register address UART1 Transmit Buffer Register address v Ja ors The MCU type only needs to be specified for the M32C Debugger 0 Selects the M16C 8x 1 Selects the M32C 8x Write each address in hexadecimal Do not add the prefix that represents the radix 4 4 2 1 Example 0 3A5 3AD 3A2 3AA R20UT0522EJ0100 Rev 1 00 Page 63 of 29
102. 6C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 72 2 Reading writing data to the specified address range Set as below Example Writing data to addresses ranging from 400h to 40Fh Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Adderss1 lt faddr lt Address2 v Addresst 400 7 Address2 40F 3 Bl I Function Source File v Function ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F cms Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Not Specify i Data1 Pon Data 2 OOOO Access WRITE I mesk ooo SSCS ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F mest R20UT0522EJ0100 Rev 1 00 Page 172 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 72 3 Reading writing data to addresses outside the specified range Set as below Example Writing data to addresses below 7FFh 41 Set Event Status Event Type DATA ACCESS v Address Data Settine Ranee addr lt Address1 v Address1 FF Jal Address o0040F z l I Function Source File v Function v ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF mest Al Set Event Status Event Type DATA ACCESS x Address Data Setting Rang
103. 86 21 5877 1818 Fax 86 21 6887 7858 7898 lectronics Hong Kong Limited 852 2886 9318 Fax 852 2886 9022 9044 lectronics Taiwan Co Ltd 886 2 8 175 9600 Fax 886 2 8175 9670 lectronics Singapore Pte Ltd Front Avenue 06 10 keppel Bay Tower Singapore 098632 65 6213 0200 Fax 65 6278 8001 lectronics Malaysia Sdn Bhd 60 3 7955 9390 Fax 60 3 7955 9510 lectronics Korea Co Ltd F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea 1 82 2 558 3737 Fax 82 2 558 5141 2010 Renesas Electronics Corporation and Renesas Solutions Corp All rights reserved Colophon 1 0 M16C R8C Simulator Debugger V 1 06 User s Manual r8RtENESAS Renesas Electronics Corporation R20UT0522EJ0100
104. 95 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 1 2 Setting the RAM monitor area Choose the popup menu RAM Monitor Area in the RAM monitor window The Set RRAM Area dialog box shown below will appear The start address of the currently set RAM monitor area and the range of the RAM monitor area are displayed in the Start and the Area fields of this dialog box No values can be entered in the Size field Set RRAM Area Start 810 Size fi blocks Area 000810 0000F Cancel Use this dialog box to change the position of the RAM monitor area Specify the RAM monitor area by its start address The size cannot be changed fixed to 1 Kbyte The start address can be specified in 0x10 byte units If you specify a non aligned address value it is rounded off to the nearest address value in 0x10 byte units before being set 6 1 2 1 Changing the RAM Monitor Area The start address of the RAM monitor area can be changed Specify the start address of the RAM monitor area in the Start field of the Set RRAM Area dialog box No values can be entered in the Size field R20UT0522EJ0100 Rev 1 00 Page 94 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 I O Timing Setting Window The I O Timing Setting Window is used to set and display virtual port input outputs or virtual interrupts Virtual port inputs virtual interrupt settings and virtual
105. Breakpoints cccccsssscccececsesssseceeececeesesseceeececsesssssseceeeceesentsaeeeeees 77 5 2 7 Step7 Viewing Register cccccsssccccccecsesssececececsessaeceeececseseseceeeeecsessnseseeeeeceenentsaeeeeess 78 5 2 8 Step8 Viewing Memory ccccesccccececssssssececececsessaaececececsenseceeeceesessaeseeeeeceesentsaeeeeess 79 5 2 9 Step9 Watching Variables cccccccccceccsssssscecececsessssscecececsesesssseeececsesesssseeeeeceenenssaeeeeess 80 5 2 10 Step10 Stepping Through a Program cccccccsessssccececsessssscecececsesesseseeeesceenesnsaeeeeees 82 5 2 11 Step11 Forced Breaking of Program Executions cccccccssssssccececeesesssceceeeceesenssaeees 85 5 2 12 Step12 Displaying Local Variables rrorvrnrrrrrononnrnrnrnrrrrnennnnrnrnnsrerenennrvnnsnrsnensnnrvnnsne 86 5 2 18 Step13 Stack Trace Function rorrennvorvrnrorsrenannrvrnenrrrenennrnrnenesrenennnnnnenssensennvnnvenssnenen 87 5 2 14 What Next oe reisir ii rE EE sents teves Ab E R eaten chee ER REEE EA TEES 88 Reference 89 6 Windows Dialogs 91 6 1 RAM Monitor Window rerernnnrvverrnnrnrrssvnvnrrnnvnrssennnnrsssnnversnnnsrsssnnnnrsssnnesrsnnnsrssennnsssssnsrsrsnnrsssssnnnn 92 6 1 1 Extended Meine vis sseccccdeia cevscdeecedsheh a deabcavesencehasciesdoacemstenastea teas EEA E Nesters AATRE EREA 93 6 1 2 Setting the RAM monitor area cccccccssscecsenceeesseececsesaececseeeeceesneeecsesaeesceneeeeseeeeeeseeas 94 6 2
106. Dialogs 6 2 8 Setting Virtual Port Inputs The Virtual Port Input function allows you to simulate data inputs and similar other operations performed on the ports defined in the SFR Data can be input to memory at one of the following timings 1 If you want data to be input to some memory location with the lapse of time Data can be input when program execution has reached a specified number of cycles In this case set cycle synchronized inputs 2 If you want data to be input when some memory location is read Data can be input when the program accesses a specified memory location for read For example this method can be used in cases where you want a variable e g global variables located at fixed addresses to be assigned a value when it is read In this case set read access synchronized inputs 3 If you want data to be input when some virtual interrupt occurs Data can be input when a specified virtual interrupt is generated For example this method can be used in cases where memory for the SFR is referenced in an interrupt handler In this case set interrupt synchronized inputs ATTENTION Up to a total of 50 virtual port input virtual interrupt and I O script procedures can be set However if you are using the Printf function output function in the Output Port Window the number of virtual port input virtual interrupt and I O script procedures that can be set is limited to a total of 48 6 2 8 1 Setting Cycle synchronized Input
107. ENDED state DMT DORMANT state WAI SLP Sleeping state WAI SLP SUS Sleeping state suspended WAI SLP TMO Sleeping state with time out WAI SLP TMO SUS Sleeping state with time out suspended WAI DLY Delayed state due to dly_tsk WAI DLY SUS Delayed state due to dly_tsk suspended WAI FLG Waiting state for an eventflag WAI FLG SUS Waiting state for an eventflag suspended WAI FLG TMO Waiting state for an eventflag WAI FLG TMO SUS Waiting state for an eventflag suspended WAI SEM Waiting state for a semaphore resource WAI SEM SUS Waiting state for a semaphore resource suspended WAI SEM TMO Waiting state for a semaphore resource with time out WAI SEM TMO SUS Waiting state for a semaphore resource with time out suspended WAI MBX Receiving waiting state for a mailbox WAI MBX SUS Receiving waiting state for a mailbox suspended WAI MBX TMO Receiving waiting state for a mailbox with time out WAI MBX TMO SUS Receiving waiting state for a mailbox with time out suspended WAI SDTQ Sending waiting state for a data queue WAI SDTQ SUS Sending waiting state for a data queue suspended WAI SDTQ TMO Sending waiting state for a data queue with time out WAI SDTQ TMO SUS Sending waiting state for a data queue with time out suspended WAI RDTQ Receiving waiting state for a data qu
108. Free command is invoked until it is interrupted the maximum and minimum values being recorded for the two stack pointers USP and ISP registers If while the program is running it causes a change in the value of a stack pointer monitoring of stack utilization of that stack stops at that point R20UT0522EJ0100 Rev 1 00 Page 32 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 4 Simulation Specifications for 740 2 4 1 Operation of Instructions e Regarding the number of instruction cycles Time management is exercised in units of cycles The number of cycles is represented by the values listed in the microcomputer s software manual However this differs from the actual chip in the following points The 740 debugger starts counting cycles immediately after a reset Cycles immediately after a reset are 0 The number of cycles needed to execute one machine instruction are added on for each instruction executed See Figure shown below Note Because the number of cycles measured by the emulator does not take into account the bus width queue wait cycles etc it includes some error when compared with the number of cycles in the actual chip If two cycles are required for the LDA instruction cycles are added at this intin time pene If four cycles are required for the CMP instruction cycles are added at this point in time LDA instruction CMP instruction 0 1 2 3 4
109. Functlon ranananananananenanenananenanenenanenenenenenenenenenenenenennnennnenenenenenenenennnnnnnnnenes 11 1 9 Stack Utilization Monitor Function reoororvrnrorsoonnnnrrrnrnrnrensnnrvnnnnsseenennrennrnssnssenannrrenssennensnnrsnnsne 11 2 Simulation Specifications 12 2 1 Simulation Specifications for R32C rerrrrnnvvrrnannvnrrssnnversnnrsrsssnnrnrssssnvsrsnnrsrssennnnrsssrsvsrsnnrsssssnnnn 12 2 11 Op ration of Instructions sagde EET 12 2 1 2 Resetting Luv44v4v4jq4a4 vvs estas ats 13 DVB Memory secese ae ives vcs elaeedscQieduven th avdeas cud vied druer EEEa 14 2 TANO ad 15 2 1 5 Cycle Count The CYcle CY Command cccccccccscsesssessesescscssssessseessscsessesssceessesesseatseeess 18 2 1 6 Stack Utilization Monitor The StackMonitor SM Command cccccccceeeseeeseeeeeees 18 2 2 Simulation Specifications for M32C rrrrrrrrrannnvrvrnrnrnrensvnrrrnsnrseensnnrvnnenssnensnnrvrnensseensnnrnnnenssrensnnrns 19 2 2 1 Operation of Instructions ccccccccsescecesssececeeeceeecsececsesaecesseaeececaeeecsesaeesceeseeesesneeeeseeas 19 2 22 Resetting oreren r RA enes cheney E EEEE E EEEE 20 Men a e E rere cr renter rrr reste rcterrtrerterere rere recipe sere ter Terrien terete 21 221 22 2 2 5 Cycle Count The CYcle CY Command cccccccccccsssssessesescscssesesssecssscsessessscesssesessesseeenss 25 2 2 6 Stack Utilization Monitor The StackMonitor SM Command sssrrrnorvrerorvervrrsvrnrenne 25 2 3 Simulation Specifications
110. MR command will not run properly if the startup file you uses don t match with the version of MRxx R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 202 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 1 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Mode Task Displays Task status Ready Queue Displays Ready status Timeout Queue Displays Timeout status Event Flag Displays Event Flag status Semaphore Displays Semaphore status Mailbox Displays Mailbox status Data Queue Displays Data Queue status Cyclic Handler Displays Cyclic Handler status Alarm Handler Displays Alarm Handler status Memory Pool Displays Memory Pool status Message Buffer Displays Message Buffer status Port Displays Port status Mailbox with Priority Displays Mailbox with Priority status Context Displays Context Layout Status Bar Switch display or non display of status bar Refresh Refresh memory data RAM Monitor Enable RAM Monitor Switch enable or disable RAM Monitor function Sampling Period Set RAM Monitor sampling period Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window The R32C debuggers are not supported R20UT0522EJ0100 Rev 1 0
111. Map dialog box and memory map items can be added Select an item to be modified in the list box and click the Modify button The Memory Map dialog box opens and memory map items can be modified Memory Map can be reset to the default value by the Reset button The Reset button cannot click when you opened the MCU Setting dialog box by selecting menu Setup gt Simulator gt Target Clicking the OK button stores the settings Clicking the Cancel button closes this dialog box without modifying the settings R20UT0522EJ0100 Rev 1 00 Page 59 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 42 1 1 1 Memory Map Dialog box The Memory Map dialog box specifies the memory map The simulator debugger uses the specified data to calculate the number of cycles for memory accesses Begin Address fooooon tsi Bl End Address oF ts Bl Bus Width 16 Read Cycle nm Write Cycle fo Memory Type ROM ht Please specify the following items Items Contents Begin Address Begin address of the memory End Address End address of the memory Bus Width Bus width of the memory 8 16 bit Read Cycle Number of memory read cycles 1 to 255 Write Cycle Number of memory write cycles 1 to 255 Memory Type Type of memory space SFR RAM DFLASH Data Flash ROM Clicking the OK button stores the settings Clicking the Cancel button closes this dialog box without modifying the
112. Memory window Memory data Address Label Reg 000410 data 000420 R20UT0522EJ0100 Rev 1 00 Page 138 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 7 Script Window The Script Window displays the execution of text format script commands and the results of that execution Script commands can be executed using a script file or interactively You can also write script commands in the script file so that they are automatically executed The results of script command execution can also be stored in a previously specified log file Toolbar b bS R AR Om Script Script File Name Loe Log File Name gt assemble main ADDRESS gt LABEL PROGRAM main Execution Result Area assemble _main Command History Area gt Enter Command Command Input Area e The Script Window has a view buffer that stores the results of executing the last 1000 lines The results of execution can therefore be stored in a file view file without specifying a log file e When a script file is opened the command history area changes to become the script file display area and displays the contents of the script file When script files are nested the contents of the last opened script file are displayed The script file display area shows the line currently being executed in inverse vide e When a script file is open you can invoke script commands from the command input area provided the sc
113. S is MRxx conformed to uITRON specifications V 4 0 The function of each item is as described below Tasks waiting at present are displayed in the descending order of timeout value When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents Tmout Shows the timeout value ms of each task ID Name Shows the ID No and task name of the tasks in the timeout queue e Following character strings are used to indicate the type of wait state Character string Wait state slp Wait due to tslp_tsk dly Wait due to dly_tsk flg Wait due to twai flg sem Wait due to twai sem mbx Wait due to trev mbx mpf Wait due to tget_mpf sdtq Wait due to tsnd dtq rdtq Wait due to trev_dtq vsdtq Wait due to vtsnd_dtq vrdtq Wait due to vtrev dtq smbf Wait due to tsnd_mbf rmbf Wait due to trev_mbf mtx Wait due to tloc_mtx The debugger for M32C doesn t support these states The debugger for M16C R8C doesn t support these states e When a task connected to the timeout queue is in the state of forced waiting double waiting a string Isl which indicates double waiting is appended to a string displayed in the ID Name field Normal display 26 _task26 Display when in WAIT SUSPEND 26 _task26 s R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 211 of 295 M16C R8C Simulator Debugger
114. SAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 4 2 Screen structure for read access synchronized inputs When you ve set virtual port inputs that are synchronized to memory accesses for read a display screen configured as shown below will appear Input read Nunbe of times eee are ig ies access count Input data display area Address Read address display display area area e Address display area displays the memory address to which a virtual port is input e Read address display area displays the address to be monitored for read access e Input data display area displays the virtual port input data that has been set by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the read access count of the data at which the cursor is positioned will be displayed in the read access count display area e Read access count display area displays read access counts 6 2 4 3 Screen structure for interrupt synchronized inputs When you ve set virtual port inputs that are synchronized to virtual interrupts a display screen configured as shown below will appear Input interrupt Number of times Address Vec 001000 i Address Vector display display area area Virtual interrupt occurrence count display area Input data display area e Address display area displays the memory address to which a virtual port is input e Vector number display area displays the
115. Show char as string Selects whether to display char type as a string Zero suppress in Hex display Suppress zero in Hex display Sort Sort by Name Sort variables by its name Sort by Address Sort variables by its address RAM Monitor Enable RAM Monitor Switch enable or disable RAM monitor function Sampling Period Set RAM monitor sampling period Arrange a RAM monitor Arrange a RAM monitor area around this variable area around this variable Start Recording Start to record the updated values Stop Recording Stop recording the updated values Add New Tab Add new tab Remove Tab Remove the selected tab Copy Copy the selected item to the clipboard Copy All Copy the all items in the sheet to the clipboard Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 135 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 6 Coverage Window The Coverage window allows you to reference the coverage measurement result of the functions of the target program downloaded The coverage which can be measured is CO coverage Two types of windows are provided the Coverage window in which you can check the start address end address of the functions and coverage measurement results and the Editor w
116. WRITE ADDRESS 000400 CONDITION addr 000400 cance R20UT0522EJ0100 Rev 1 00 Page 167 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing byte length data 32h to even address 400h Al Set Event Status DATA ACCESS pooo a Se Al Set Event Status DATA ACCESS p2 po ooo pe z Maske TT R20UT0522EJ0100 Rev 1 00 Page 168 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing byte length data 32h to odd address 401h Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range addr Address v Address1 000401 BI Address2 000000 v Bl I Function Source File v Function 7 ACCESS WRITE ADDRESS 000401 GONDITION addr 000401 data amp 00FF 0032 met Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range ata Datal 7 Data 1 2 Data 2 Joona Access WRIT E z IV Mask 00FF ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 mest R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 169 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing word length data 1234h to even address 400h 41 Set Event Status Event Type DATA ACCESS
117. ach Interrupt Control Register s interrupt request bit is not set to 1 The priority levels set in each Interrupt Control Register s interrupt priority level select bit are not referenced The priority of virtual interrupts can be specified when setting virtual interrupts on the I O Timing Setting Window The Flag Register FLG s interrupt enable flag I flag and processor interrupt priority level IPL are referenced as in the actual chip Virtual interrupts set by using the I O script function Regarding interrupt control for virtual interrupts generated A statement can be written so that when an interrupt occurs each Interrupt Control Register s interrupt request bit is set to 1 The priority levels set in each Interrupt Control Register s interrupt priority level select bit can be referenced However once a virtual interrupt is generated and registered in the simulator the priority of the virtual interrupt cannot be altered even when the priority levels specified with the interrupt priority level select bit is changed by the user program The Flag Register FLG s interrupt enable flag I flag and processor interrupt priority level IPL are referenced as in the actual chip I O Script Function This function allows you to write virtual port input and virtual interrupt settings to a file in script form Therefore it provides a more flexible way to define virtual port inputs and virtual interrupts than can be set from the I O Timing Set
118. ae ee generated at the 10 007th cycle Point to the desired element and click the mouse button The selected element is ans by an asterisk x In this dialog box set the virtual interrupts you want to be actually generated Follow the procedure below to set virtual interrupts 1 Move the mouse cursor to the cycles location called an element where you want a virtual interrupt to be generated then click the left mouse button Or you can scroll the screen to go to the desired location 2 The element is marked by an asterisk when you ve clicked Click at the same place again if you want the virtual interrupt you ve set to be canceled In this case the asterisk goes out 3 Repeat steps 1 and 2 as many times as the number of virtual interrupts to be generated When you finished setting all virtual interrupts press the Next button A dialog box for saving the virtual interrupts you ve set to a file virtual interrupt file will appear Save in B My Computer ae F r 314 Floppy A SI SYSTEM C IDATA D Compact Disc E Compact Disc F SJ SUBSYS G File name input ios Save as type 120 Script Files ios v Cancel 4 Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into the simulator debugger back again by using the Load menus in the I O Timing Setting window When you ve input a file
119. all issuance history corresponding to the specified condition The specified items are searched using the AND condition If the search condition is met the indicator is moved to that point R20UT0522EJ0100 Rev 1 00 Page 232 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 242 Change the display magnification Click the Expand button or Reduce button in the tool bar Or select Menu Expand or Reduce The display is expanded or reduced using the left corner of the graph area as the radix point By default the display is expanded or reduced with display scale of 1 5 The display scale appears in the Scale field in the status bar The default expansion reduction scale is 1 5 To change the scale select Menu Value The Value dialog is opened Specify the display expansion reduction scale f Value PhP of e me e 1 500000 1500000 Ok Cancel 6 15 243 Change the grid line display interval Select Menu Value The Value dialog is opened Specify the display time interval Value X Po a e e e e 1 500000 1 500000 TO eA R20UT0522EJ0100 Rev 1 00 Page 233 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 2 44 Change the task display order Drag the task interrupt routine to be moved the left portion of the graph to the destination s t MR Trace BAD HARE wiu A Bw Ox Mark 00
120. ame press the Save button Thus you ve finished setting the cycle synchronized virtual port inputs R20UT0522EJ0100 Rev 1 00 Page 110 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 8 2 Setting Read Access synchronized Inputs To set read access synchronized virtual port inputs choose the Setup menus in the I O Timing Setting Window The dialog box shown below will appear Set this item Setup Dialog Here choose the item Set Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual port input timings will appear Expressions can be input here First choose Read Access in the Data Input Timing column Next enter an address for virtual port input in the Input Address column the address to which you want data to be input using a hexadecimal number Then enter the address to be accessed for read to read data from memory in the Read Address column Virtual port inputs are executed when the memory address you ve specified here is accessed for read Then press the Next button Or press the Prev button here if you want to return to the previous dialog box A matrix dialog box for setting the virtual port input data will appear R20UT0522EJ0100 Rev 1 00 Page 111 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialo
121. ange specified by the start marker and the end marker in the Task Trace window By clicking the maximum ready time minimum ready time display field of each line you can search the processing history at the maximum ready time minimum ready time of the task corresponding to the clicked line The search result is pointed by the indicator in the Task Trace window after the indicator moves to the destination position R20UT0522EJ0100 Rev 1 00 Page 249 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 7Table of Script Commands 7 Table of S amp ript Commands The following script commandes are prepared The commands with yellow color displaying can be executed at run time The command to which adheres behind is not supported according to the product 7 1 Table of Script Commands classified by function 7 1 1 Execution Commands Command Name Short Name Contents Go G Program execution with breakpoints GoFree GF Free run program execution GoProgramBreak GPB Run target program with software break point GoBreakAt GBA Run target program with software break point Stop Stops program execution Status Checks the operating status of the MCU Step S Halts for user input until the specified time has elapsed StepInstruction SI Step execution of instructions OverStep O Overstep execution of source lines OverStepInstruaction OI Overstep execution of instructions Return RET Execu
122. anges Then start dragging The start marker moves into the window left portion by clicking the Start Marker button in the tool bar Or select Start Marker from popup menu by right clicking on the window The end marker moves into the window right portion by clicking the End Marker button Or select End Marker from popup menu The indicator moves into the window center by clicking the Indicator button Or select Indicator from popup menu Note that each marker can move only to the point where an event is established R20UT0522EJ0100 Rev 1 00 Page 247 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 18 Task Analyze Window The Task Analyze window displays the result of the measurement data statistically analyzed within the range specified by the start marker and the end marker in the Task Trace window The Task Analyze window displays the CPU occupation state The Task Analyze window functions together with the Task Trace window The debugger for R32C doesn t support this function The debugger for 740 doesn t support this function This window is available even when a target program using an OS other than our real time OS MRxx is downloaded The CPU occupation state display mode is used to display the CPU occupation time and ratio by task This mode shows the statistical result within the range specified by the start marker and end marker in the Task Trace window
123. ar R EEA R eE AE O E RTE EONA EASE T015 Refer nt vara 10 1 6 Sign Inversion 10 1 7 Member Reference Using Dot Operator rrrnnrvrrrsnvvnrrravvvrrrnnrnrrsrrnrnrrssrsrsssnnvsrsssnnnernnn 277 10 1 8 Member Reference Using Arrow cccccceccseceessececeeneeeecsneeecncaeeecsesaececseeecssaeeeseenaeens 277 10 1 9 Pomt rs to Members cscices isen ENEA EEE EEN 278 10 1 10 Parentheses sssrinin teeraa enea EEE O storstue 278 10 111 Arrdye e aE E eE EEE E EEEO NEN 278 10 1 12 Casting to Basic Types c ccccccccccssssecessecceceessececessaeeecseeeesesuececeesaecessaeeeceesaeeeseesaeens 278 10 1 13 Casting to typedef Types cccccccssscesssscecesssececsenseeecenececsesuececseauecessueeecsssaeeseeenaeess 279 10 1 14 Variable Name scree erreser erare EEE SARE EE AEEA EE E EREEREER TEARRE SREE 279 10 115 Function NaMe wigesdevssete ceasineteassanacdeasitecteeiedacvesscewceuabavandeabaves teed stsctxascuseewasinanlecivasesess 279 10 1 16 Character Constants cccccccccccssssecssssececsseceesssececseeececseeeecsesaeeecneseeesseeeeeseaeeeeseaaees 279 10 1 17 Character String Literals is cccssceccecessteciedienete ciens ieee EEE E EE EES RESTEREN EERE EATER 279 10 2 Display Format of C C Expressions ccccsccccssscccesssececessececseeeecesueeecseseeeesseeeesesaeeeseeneess 280 10 21 Enumeration Types srcima reedene srie errosa e oE E NESE E ETENEE ESERE 280 10 2 2 Basie PY POS vosiscicessussceccetesates sachets ceslsadkseanessecceve
124. ar t the names with a numeric e You cannot use the names of registers as variable names e Uppercase and lowercase letters are differentiated in variable names e You can define a maximum of 32 macro variables Once defined a macro variable remains valid until you quit the debugger Macro variables are useful for specifying the number of iterations of the while statement R20UT0522EJ0100 Rev 1 00 Page 261 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files 8 2 4 Register variables Register variables are used for using the values of registers in an expression Precede the name of the register with to use it as a register variable Use the following format The debugger for 740 can use _ instead of Product Name Register name The debugger for R32C PC USP ISP INTB FLB SVF SVP VCT DMD0 DMD1 DMD2 DMD3 DCTO DCT1 DCT2 DCTS DCRO DCR1 DCR2 DCR3 DSAO DSA1 DSA2 DSA3 DSRO DSR1 DSR2 DSR3 DDAO DDA1 DDA2 DDA3 DDRO DDR1 DDR2 DDR3 ORO OR1 OR2 OR3 0R4 OR5 OR6 OR7 OAO OA1 0A2 0A3 OFB OSB lt Bank 0 Register 1R0 1R1 1R2 1R3 1R4 1R5 1R6 1R7 1A0 1A1 1A2 1A3 1FB 1SB lt Bank 1 Register The debugger for M32C PC USP ISP INTB FLB SVF SVP VCT DMD0 DMD1 DCTO DCT1 DRCO DRC1 DMAO DMA1 DCAO DCA1 DRAO DRA1 ORO OR1 OR2 OR3 OAO OA1 OFB OSB lt Bank 0 Register 1RO 1R1 1R2 1R8 1A0 1A1 1FB 1SB lt Bank 1 R
125. arding the number of instruction cycles Time management is exercised in units of cycles The number of cycles is represented by the values listed in the microcomputer s software manual However this differs from the actual chip in the following points The bus width queue and wait states are not considered when measuring the number of cycles The executed cycle of an interrupt sequence is not considered when measuring the number of cycles When an interrupt occurs the executed cycle of an interrupt sequence is 0 This debugger starts counting cycles immediately after a reset Cycles immediately after a reset are 0 The number of cycles needed to execute one machine instruction are added on for each instruction executed See Figure shown below Note Because the number of cycles measured by the simulator does not take into account the bus width queue wait cycles etc it includes some error when compared with the number of cycles in the actual chip If four cycles are required for the ENTER instruction cycles are added at this point in time l If two cycles are required for the MOV instruction cycles are added at this point in time ENTER instruction May instruction p Execution 0 1 2 J 4 5 T g cycles In the above example no cycles are added while the ENTER or MOV instruction is being executed The cycles required for each instruction are added after instruction execution e Target program execut
126. ator debugger only for the latter can be executed at the time the button is pressed Text Display the text string e You can also save the created panel in a file and reload it e You can set up to 200 address points to the created part If different addresses are set to the individual parts you can arrange up to 200 parts R20UT0522EJ0100 Rev 1 00 Page 200 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 13 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Select Item Select an I O item Delete Delete the selected I O item Copy Copy the selected I O item Paste Paste the copied I O item Create Button Create a new button item Create Label Create a new label item Create LED Create a new LED item Create Text Create a new text item Display grid Display the grid line Save Save I O panel file Load Load I O panel file Sampling Period Set RAM monitor sampling period Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 201 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 MR Window Use the MR Window to display the status of
127. ays 129 6 3 1 Extended Menus rrrrrrrrerererevereverevereverevereverevereseseveseveveveveveveverevevevevevesevevevevevesevesnvennes 130 6 4 ASM Wate Witt w seision E n NEE N oes ids toevacuaetees dey near 131 6 4 1 Extended Menus rrrrererorerereverevereverevereverevereverevevevevevevevevevesevevevevevesevesevesevevevesevesnvesne 132 GBC Watch Wind wuusnugoal kh leesuearGaTLGEenGN ak GRALEOk en snGs ni 133 6 5 1 Extended Menus rrrorrrerererevereverevereverevereverevevevevevesevevevesevesevevevevevesevessvevevevevesnvssnvevens 135 6 6 Coverage Windowusuassaarauu darkness aS lt eane oes EAE Gaus beh Wanna RENS 136 6 6 1 Extended Menus 00 cecccssssecececeesennececececeesennnaecececeeseaeaececseeeseaaaecececeseeaaeseeeeeeneneaaes 137 6 6 2 Refer to the Source Line the Executed AddYVeSs c cccccccessessecesececsesssssceceeeeeenentsaeees 138 6 T Serpt WINGO W resten ieonta lastest tad onecdessvaav aa a a a Gee a sb nsdueandooteas lt bavdagecd a i ia aes 139 6 71 Extended M6nuis ise ces cscccceicvecs fences ienn E E E E E Ei 140 6 8 S W Break Point Setting Window rervrrrnrrrnnannnnrnrnsnrsrsnnnnrrrnsnrsrensnnrnrneneseenennrnnnenssnesannvnnssnssnene 141 6 83 1 C mmand Button ssasestkavstesak enga GesuGLNGSkeoklkaseGe RUE 142 6 8 2 Setting and Deleting a Break Points from Editor Source Window rsrervrvvarvervrrrervene 143 6 9 H W Break Point Setting Dialog Box rrrnnrvverennrnrrrsnvrrrrnsvrrrrsnnrnrrssnnrsrsssrsrs
128. can be changed ATTENTION The RAM monitor window shows the data that have been accessed through the bus Therefore changes are not reflected in the displayed data unless they have been accessed via the target program as in the case where memory is rewritten directly from an external I O If the data in the RAM monitor area are displayed in lengths other than the byte it is possible that the data will have different memory access attributes in byte units If bytes in one data have a different access attribute as in this case those data are enclosed in parentheses when displayed in the window In that case the background color shows the access attribute of the first byte of the data R20UT0522EJ0100 Rev 1 00 Page 92 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 0018 0008 0002 0000 007C 0000 0000 0000 0000 0000 0000 MODNEN 0000 0000 0000 0000 0000 0050 0000 e The displayed access attributes are initialized by downloading the target program e The interval time at which intervals the display is updated may be longer than the specified interval depending on the operating condition shown below Host machine performance load condition Communication interface Window size memory display range or the number of windows displayed 6 1 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window
129. cancecuavs abate ceaneduannesctsesaecninsrsens 261 8 2 4 Register Vara bles csere Ea E ae ARE r A E E R es EERO att 262 8 2 5 Memory Varialbl es oiean a e renee i ee eiae e RAE E EESE EEEE SE RAEE 262 R20UT0522EJ0100 Rev 1 00 Page vi of viii 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 8 2 6 Line NOs esses an do ede denen da ea chide bdo etd had dae eee E A TS 263 8 2 7 Character constants c cccecssscccesssecessecceceesececsesaeeeceeeecsesaececsesseeeseeeessesaeeecsesaeesseeeeenes 263 8 2 8 Operator Seien A susscoeceeassiesuieek eek Geer Aker 263 9 IO Script 264 9 1 Method for Writing I O Script ccccccecsscessecceceesnececseeceeeceneeecseaececseseeeesseeeceesaeeecsesaeeseneeaeenss 264 9 2 Composition of I O Script cccccccccssccccssssececseececeesneeecsescececsneeecssaeeecseeeececseeeceeaeeeesesaeesenneaeenss 265 92 1 PROCO MUI C sprer i eae A caeeevasaner sues teawen EE E EEEE SEERE 266 9 2 2 I O Script Statements cccccccccssceessceceesseeecseeeeecseeceesesaeeecseeeecesseeeeceesaeeeesesaeesseeeeeenes 266 9 2 3 Judge Statements if else cccccccessessssessesssessescssessencssessessssvsseessseasenssasaseecsueasesssneatens 268 9 2 4 Repeat Statement while and break Statement essvsvrrvrsrrvrrvrrveververneververversrverveverne 269 9 2 5 Comment Statements arcere hese diene hss E EEEE EREN 269 9 3 Method for Writing Right side Expressions 0 cccccccssccessesceeeesnececseeeeecseeeeceeaeee
130. cannot be deleted e Accessing an Area Without Memory There is no actual memory in the 253 memory blocks between 020000h and FEFFFFh unless memory is secured If an attempt is made to access this area an illegal memory access error occurs and execution of the command or program stops R20UT0522EJ0100 Rev 1 00 Page 21 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 2 4 I O e SFR The actual chip s peripheral I Os other than the CPU core such as the timers DMAC and serial I O are not supported The SFR area 000000h to 0003FFh to which the peripheral I Os are connected is also handled as RAM by the simulator However a method is available that allows you to materialize data input to memory such as the SFR or interrupts such as timer interrupt in an artificial manner For details about this method see I O Script and Interrupts described later gt e I O Script Virtual Port Input Function This function defines changes of the data that is input from external devices to a specified memory address Using this function you can simulate data inputs to the ports defined in SFR The following shows timings at which data can be input to memory 1 When program execution has reached a specified number of cycles 2 When a specified memory location is accessed for read by a program 3 When a specified virtual interrupt is generated Virtual interrupts at the above timings can be defined fro
131. cannot be used R20UT0522EJ0100 Rev 1 00 Page 278 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 1 13 Casting to typedef Types You can use casting to typedef types types other than the C basic types and the pointer types to them When casting to a pointer type you can also use pointers to pointers and pointers to pointers to pointers etc Notes e You cannot cast to struct or union types or the pointers to those types 10 1 14 Variable Name Variable names that begin with English alphabets as required under C C conventions can be used The maximum number of characters for variable name is 255 And this pointer is available 10 1 15 Function Name Function names that begin with English alphabets as required under C conventions can be used In the case of C no function names can be used 10 1 16 Character Constants You can use characters enclosed in single quote marks as character constants For example A b etc These character constants are converted to ASCII code and used as 1 byte immediate values Notes e You cannot register character constants only as C watchpoints e Character constants are valid only when used in a C C expression that specifies a C watchpoint and when specifying a value to be assigned character constants are processed in the same manner as immediate values 10 1 17 Character String Literals You can use character strings enclosed i
132. ce RAM HAS hel ey oe Mark 00 00 00 020 160 00 00 00 131 909 00 00 00 111 749 Indicator 00 00 00 052 734 Scale 2 401435 Grid 00 00 00 032832 Area Break VEC table ID name 32 OFFD80 SYSCALLO 33 OFFD84 SYSCALL1 38 OFFD98 eee Idle taski task2j task _task4 task5j ini leone The content of each item is as follows Items Contents VEC 1 Indicates a software interrupt number table Indicates the interrupt vector table number ID Indicates a task ID number name Indicates an interrupt routine name task name idle processing display idle and unknown name displayed unknown R20UT0522EJ0100 Rev 1 00 Page 227 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs When moving the mouse to the information displayed in the window the pop up window as below is opened showing the detailed information Interrupt handling or task execution history System call issue history Task state transition history PEE Following information is displayed in the status bar e Time value at which start marker is positioned e Time value at which end marker is positioned e Time width of a range indicated by start and end markers e Time value at which indicator is positioned e Scale factor of display e Time width of grid line interval e Range of measurement trace result The
133. ceesaeeseeneeeenss 270 98 A COmstants ss Jaaa Gel 270 9 3 2 Symbols and Labels c cccccsscccsssseceesececeesneeecsssaeeecseececsesesecseeececseeeeesesaeesesesaeesseneeeenes 270 9 3 3 Macro Variables i sczscccceicenesinssiterssasseseanes EEEE E E EE EEEE AEE EREE 271 9 3 4 Memory Variables rrnrnrrnnrnrrranonnrnnnvnrrrsnenernnnvnnerssensrnnnnnvsrssrnernnsnnssssssnnnnnsenssssrenennssensne 271 9 3 5 Character Constants eessen shete ers Erre EO EE EAEE EE EE ESEE EEEE EEEE ENESE 271 SERLO OE EELO EE SE E E E 272 9 3 7 isfetch isint isread iswrite rrrrensnrrrrnrrrrrensnnrrrnrnnrrrnsnnrnnvrnrrerrsnnrnrneneseenennrnnsenseee 272 9 4 Method for Writing Left side Expressions cccccccssscessssceeeeseeecseeeececseeeecesaeeeceesaeeseeneeeenes 274 94 1 Macro Variables osi scnecudsieiasscstivceedstedavapsctabensasunantdesedoness deudedeaausdniced sats EEEE E SEAN 274 9A 2 Memory Variables ereere rro erer eE oE EPEE cde RE E AEA NEPE eE SEE OREIRO RSi 274 10 C C Expressions 275 10 1 Writing C C Expressions rorrrrrvovrrrnnvrrrrsnnvnrrssrrversnnrnrrrsnnnnrrsnrnvsrsnnnsrsssnnnsrsnnrsrsssnnrnssssnsnssnn 275 10 1 1 Immediate Valte Sinoie NE EE EEEE EER 275 10 1 2 Scope Resolution cccccsccccssssecesssececseseeecseeceescsaececseaececseeeececsaeeeceeseeeeseeeeesesaeeesseeaees 276 10 1 3 Mathematical Operators errnnrvrrronnrnrrravvvrrrnnrnrrrsnnvnrrsnnnnsrsnnnnrsssnnnsrrsrsesssnnvsssssnnnernnn 276 UO McA Pointer Seen a
134. cified by the start marker and end marker in the MR Trace window The number indicates a numeric value counted from the top system call within the measurable range MR Analyze Er ee Mark 00 00 00 000 335 00 00 00 164 498 00 00 00 164 163 No System Call Parameter Return Parameter TIME 7 wai flg wfmode H 3 waiptn H 1 flgid D 1 FE OK flgptn H 1 00 00 00 000 501 8 wai sem semid D 1 E_OK 00 00 00 000 533 9 rev msg mbxid D 1 E OK pk msgiRlj H 1234 pk 00 00 00 000 565 10 wup tsk tskid D 2 E OK 00 00 00 000 594 ii sip tsk E OK 00 00 00 013 620 12 ram tsk tskid D 2 E OBJ 00 00 00 020 147 AY 25 Ale setptn H l flgid D 1 E OK 00 00 00 033 163 14 wai flg wfmode H 3 mwaiptn H l flgid D 1 erced 22 flgptn 22 00 00 00 046 203 H 15 rsm tsk tskid D 3 E OBJ 00 00 00 052 734 16 sig sem semid D 1 E OK 00 00 00 065 751 17 wai sem semid D 1 erced 22 00 00 00 078 780 18 ram tsk tskid D 4 E OBS 00 00 00 085 310 19 snd msg pk msgiRlj H 5678 pk msg R3j H 12 E OK 00 00 00 098 327 20 rev msg mbxid D 1 ercd 22 pk msg R1j 222 pk 00 00 00 111 362 ly By clicking the desired line you can search the system call issuance history to the clicked line The search result is pointed by the indicator which moves to the target position in the MR Trace window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 237 of 295 RENESAS M16C R8C Sim
135. cified cycles When the program accesses a specified memory location for read When a specified virtual interrupt is generated This function when combined with the I O script function allows you to simulate at any time such as when the program fetches an instruction or memory is accessed for write e Virtual Port Outputs This function lets you record changes of output port data and the cycles in which changes occurred The recorded data can be verified in graphic or numeric forms on the I O Timing Setting Window The number of data entries recorded is the number of entries specified on the Init dialog box s I O Script tab reckoning from when the program started to run When reexecuted the previous data is cleared e Virtual Interrupts This function lets you generate an interrupt e g timer interrupt or key input interrupt An interrupt can be generated at the time When the program execution reaches specified cycle When the program fetches an instruction from a specified address Ata specified time interval Use the I O Timing Setting Window to define virtual interrupts This function when combined with the I O script function allows you to generate an interrupt at any time such as when memory is accessed for write or accessed for read e Simulating output ports This function lets you record changes of output port data The recorded data can be displayed in the Output Port Window or can be output to a file The number of da
136. ck the Other option and select the ieee 695 as Output Format Include Tab In the XCL File Name area specify your XCL file ex nkm16c xcl 2 Edit the XCL file Add the command line option y to your XCL file The designation of y option varies depending on the product Product Name y Option The debugger for R32C ylmba The debugger for M32C ylmb The debugger for M16C R8C ylmb The debugger for 740 ylmba 3 Build your program after the setting above In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 292 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 6 5 When Using the IAR C Compiler ICC 12 6 5 1 Specify the Option Please compile according to the following procedures and link e At compilation Specify the r option e Before linking Open the linker s option definition file extension xcl to be read when linking and add FIEEE695 and y options The designation of y option varies depending on the product Product Name y Option The debugger for R32C ylmba The debugger for M32C ylmb The debugger for M16C R8C ylmb The debugger for 740 ylmba e At link Specify the linker s option definition file name using f option In the options o
137. cle Accuracy Mode Therefore this mode can measure close number of cycles to the actual chip However simulation speed of the Cycle Accuracy Mode slows than the Simulation Speed Mode The contents set here are reflected at only startup time R20UT0522EJ0100 Rev 1 00 Page 53 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 4 1 2 Debugging Information Tab The specified content becomes effective when the next being start Compiler E Object Format On Demand iv Display the instruction format specifier in disassembly Always treat variables of enumerator type with unknown size as 1 byte 4 1 2 1 display the compiler used and its object format Display the compiler used and its object file format Compiler NG30WA NG8G ad Object Format IEEE 695 z Please specify the compiler used and its object file format in the dialog opened by menu Debug gt Debug Settings 4 1 2 2 Specify the Storing of Debugging Information There are two methods for storing debugging information on memory and on demand Select one of these two methods The on memory method is selected by default To select the on demand method click the On Demand check box e On memory method Debugging information is stored in the internal memory of your computer Usually select this method e On demand method Debugging information is stored in a reusable temporary file on the hard disk of your computer Because
138. clicked line The search result is pointed by the indicator in the MR Trace window after the indicator moves to the destination position 6 16 5 3 Refer the System Call Issuance History Click the System Call button in the tool bar Or select Menu System Call s t MR Analyze Er ee Mark 00 00 00 000 335 00 00 00 164 498 00 00 00 164 163 No System Call Parameter Return Parameter TIME 7 wai flg wimode H 3 mwaiptn H l flgid D 1 E OK flgptn H 1 00 00 00 000 501 8 wai sem semid D 1 E OK 00 00 00 000 533 9 rev msg mbxid D 1 E OK pk msgiRlj H 1234 pk 00 00 00 000 565 10 wup tsk tskid D 2 E OK 00 00 00 000 594 ii s1p_tsk E OK 00 00 00 013 620 12 ram tsk tskid D 2 E OBJ 00 00 00 020 147 tej 25 s le setptn H l flgid D 1 E OK 00 00 00 033 163 14 wai flg wfmode H 3 waiptn H l flgid D l erced 22 flgptn 22 00 00 00 046 203 H 15 rsm tsk tskid D 3 E OBJ 00 00 00 052 734 16 sig sem semid D 1 E OK 00 00 00 065 751 17 wai sem semid D 1 erced 22 00 00 00 078 780 18 ram tsk tskid D 4 E OBS 00 00 00 085 310 19 snd msg pk msgiRlj H 5678 pk msg R3j H 12 E OK 00 00 00 098 327 20 rev mag mbxid p 1 ered 22 pk msg Rlj 22 pk 00 00 00 111 362 ly The issued system calls are listed in chronological order of system call The data displayed is the statistical results for the range specified with the start marker and end marke
139. cript 9 2 2 5 pass statement Format pass conditional expression pass count Function Execution of the next statement is skipped a number of times as specified by the pass count until the conditional expression is met Right side expressions can be used to specify the conditional statement and pass count Specification of right side expressions is described later For example if following statements are written pass isint 21 3 isint becomes true established when a specified virtual interrupt is generated set 0x800 0x10 The set statement is executed only after a timer AO interrupt vector number 21 occurs three times 9 2 3 Judge Statements if else Judge statements judge the results of expressions thereby causing the statements to be executed to branch off The following shows a description format if conditional expression Statement 1 else if conditional expression Statement 2 else Statement 3 e When if conditional expression is true not 0 statement 1 is executed If the conditional expression is false 0 else if conditional expression is evaluated to see whether it is true or false If the conditional expression is true statement 2 is executed Otherwise statement 3 the else statement is executed e The else if and else statements can be omitted e The if statement can be nested in up to 32 levels e Right side expressions can be used for the conditiona
140. ct memory contents at those addresses If a registered address resides within the RAM monitor area the memory content at that address is updated at given intervals by default every 100 ms during program execution Toolbar 080000 080655 Buf Tsk 1 084620 Dbe_cnt 0108CB 4 Dbz mode Address Bit No Data Length Expression Radix The addresses to be registered are called the watchpoints One of the following can be registered Address can be specified using a symbol Address Bit number Bit symbol The registered watchpoints are saved in the debugger when the ASM watch window is closed and are automatically registered when the window is reopened If symbols or bit symbols are specified for the watchpoints the watchpoint addresses are recalculated when downloading the target program The invalid watchpoints are marked by lt not active gt when displayed on the screen The order in which the watchpoints are listed can be changed by a drag and drop operation The watchpoint expressions sizes radixes and datas can be changed by in place editing ATTENTION The RAM monitor obtains the data accessed through the bus Any change other than the access from the target program will not be reflected If the display data length of the RAM monitor area is not 1 byte the data s access attribute to the memory may varies in units of 1 byte In such a case that the access attribute is not unified within a set of
141. d expression contains a syntax error it is displayed as follows str p lt syntax error gt all Radices where str p is the syntax error 10 2 10 Structure and Union Types e When the result of calculation is a structure or union type the address is displayed in hex as follows Data v 0x1234 all Radices If as in structures and unions the C C expression consists of members a is displayed to the left of the type name tag name ip indicating structure or union Value f unsigned char str OxFOOOO 89 Y unsigned char str 89 y struct DATA pData 0x408 struct Answer ans Ox82B unsigned char ch 100 a signed int nID 3980 a 11 Lo lrr 1 a You can double click on lines indicated by a to see the members of that structure or union The changes to a while the members are displayed To return to the original display double click the line now indicated by the This function allows you to check the members of structures and unions Attention If a variable is declared with the same name as the type definition name declared by typedef you cannot reference that variable e Register Variables When the result of calculation is a register variable register is displayed to the left of the type name as follows register signed int j 100 R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 283 of 295 2tENESAS M16C R8C Simulator Debugger
142. d file names in which you want the data you ve set to be saved The saved file can be loaded into the simulator debugger back again by using the Load menus in the I O Timing Setting window When you ve input a file name press the Save button Thus you ve finished setting executed address synchronized virtual interrupts 6 2 10 3 Setting interval synchronized interrupts To set virtual interrupts which are synchronized to fixed intervals choose the Timer menus in the T O Timing Setting window This opens a dialog box necessary to set virtual interrupts which are synchronized to fixed intervals In this dialog box you can set the following items e Setting a virtual interrupt e Deleting a virtual interrupt e Temporarily disabling a virtual interrupt e Reenabling a disabled virtual interrupt e Saving a virtual interrupt e Loading a virtual interrupt The following shows how to specify each item R20UT0522EJ0100 Rev 1 00 Page 123 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 10 3 1 Setting a virtual interrupt Shown below is an example specification with the M16C 6X simulator debugger Example Generate an interrupt of vector number 21 with priority level IPL 7 every 200 ms Fill out the dialog box as shown below For the Temp Directory area set a writable directory because it is a temporary area used internally by the debugger to set virtual interrupts Se
143. d in this debugger in the following circumstances e When a command is entered The object file that includes the address indicated by the program counter becomes the current scope When the SCOPE command is used to set the scope the specified scope is the active scope e During command execution The current scope automatically switches depending on the program address being handled by the command R20UT0522EJ0100 Rev 1 00 Page 260 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files 8 2 2 2 Priority levels of labels and symbols The conversion of values to labels or symbols and vice versa is subject to the following levels of priority e Conversion of address values Local labels Global labels Local symbols Global symbols Local labels outside scope Local symbols outside scope SH AR NH e Conversion of data values Local symbols Global symbols Local labels Global labels Local symbols outside scope Local labels outside scope Ao Pp wN e Conversion of bit values 1 Local bit symbols Global bit symbols 3 Local bit symbols outside scope D 8 2 3 Macro Variables Macro variables are defined by assign statements in the script file See Section 8 1 2 Assign Statement in the Reference part for details Precede variables with for use as macro variables e You can specify alphanumerics and or the underbar _ in the variable name following the percent sign However do not st
144. define an I O script write a procedure for it Enclose a procedure with braces as you write it Multiple procedures can be written in one file In each procedure write settings timings etc of virtual port inputs or virtual interrupts Each of the multiple procedures thus defined are processed in parallel with program execution However the order in which each procedure is evaluated is indeterminate Register the I O script file you ve created in debugger using the popup menus Load in the I O Timing Setting Window Multiple I O script files can be registered However the total number of procedures that can be registered is limited to 50 Also if you are using the Printf function output function in the Output Port Window the number of virtual port input virtual interrupt and I O script procedures that can be set is limited to a total of 48 R20UT0522EJ0100 Rev 1 00 Page 264 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script e Procedure 1 in the example below defines the timer mode of timer AO In this example a timer AO interrupt is generated every divide by ratio number of cycles specified for the timer AO The value specified in the interrupt control register is referenced to determine the priority of this timer interrupt e Procedure 2 in the example below defines a cycle synchronized virtual port input In this example data is input from virtual port to memory when the program has been executed 10
145. dicating pointer type Value unsigned char str OxFOOOO 89 struct DATA pData 0x408 struct DATA pData 0x408 signed int nID 0 unsigned char str OxFOOOS 83 s You can double click on lines indicated by a to see the members of that structure or union The changes to a while the members are displayed To return to the original display double click the line now indicated by the R20UT0522EJ0100 Rev 1 00 Page 281 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 2 4 Array Types e When the result of calculation is an array type other than a char type the starting address is displayed in hex as follows signed int 10 z 0x1234 all Radices e When the result of calculation is a char type it is displayed as follows unsigned char 10 str 0x1234 Japan all Radices If the string contains a non printing code prior to the code to show the end of the string 0 it is displayed up to the non printing character and the closing quote mark is not displayed unsigned char 10 str 0x1234 Jap all Radices Also if the string contains more than 80 characters the closing quote mark is not displayed When the C C expression is an array type as same as pointer type a is display to the left of the type name You can see the elements of the array by using this indicating for the details refer 10 2 3 Point
146. dix Please describe information on 3 6 referring to the data book on MCU used 1 SHARON MCU name Reserved number CPU mode register address and stack page select bit number Reset vector address information BRK vector address information Interrupt vector address information MCU name and Reserved number Always be sure to add a semicolon before the CPU name and the reserved number CPU mode register address and stack page select bit number Separate the CPU mode register address and the stack page select bit number with a colon Reset vector address information Add the word RST after the reset vector address BRK vector address information Add the word BRK after the BRK vector address Interrupt vector address information Separate between the interrupt vector address and interrupt control register address and between the interrupt control register address and interrupt control bit number with a colon Interrupt vector information can be writennen for up to 32 points 4 4 4 1 Example 1 3B 2 FFFC FFDC FFEE FFE2 3F FFEO M38000 RST BRK FFFA FFF8 FFF6 FFF4 FFF2 FFFO 3E FFEC FFEA FFES FFE6 FFE4 3E 3E 3E 3E 3E 3E 3E 3F 3F 3F 3F UuURWNKHOSJaAURUWUNKHO 3F R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 65 of 295 M16C R8C Simulator Debugger V 1 06 Blank Page R20UT0522EJ0100 Rev 1 00 Page 66 of 295
147. e Not Specify v Data 1 jooo Data 2 Joona Access WRITE v IT Mask 0000 ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF mest R20UT0522EJ0100 Rev 1 00 Page 173 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 7 3 Memory Access The debugger for M16C R8C 610731 Writing Reading a Specified Address Set as below Example Writing to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range add Address v Address1 joo v l Address2 I Function Source File v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 mest Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Not Specify v Data 1 pooo Data 2 ooo Access WRIT E v IT Mask Joao ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 cance R20UT0522EJ0100 Rev 1 00 Page 174 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing byte length data 32h to even address 400h Al Set Event Status DATA ACCESS pooo a Se Al Set Event Status DATA ACCESS p2 po ooo pe z Maske TT R20UT0522EJ0100 Rev 1 00 Page 175 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example W
148. e When the result of calculation is a char type it is displayed as follows unsigned char c J when Radix is in initial state unsigned char c Ox4A when Radix is hex unsigned char c 10100100B when Radix is binary e When the result of calculation is a floating point it is displayed as follows double d 8 207880399131839E 304 when Radix is in initial state double d 0x10203045060708 when Radix is hex double d 0000000010 1000B when Radix is binary Canis bodice indicates abbreviation R20UT0522EJ0100 Rev 1 00 Page 280 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 2 3 Pointer Types e When the result of calculation is a pointer type to other than a char type it is displayed in hexadecimal as follows unsigned int p 0x1234 all Radices e When the result of calculation is a char type you can select the display format of the string or a character in the C Watch window s menu Display String string types unsigned char str 0x1234 Japan all Radices character types unsigned char str 0x1234 74 J all Radices I When the result of calculation is a char type it is displayed as follows unsigned char str 0x1234 Jap all Radices If the string contains a non printing code prior to the code to show the end of the string 0 it is displayed up to the non printing character and the closing quote mark is not displayed 4 in
149. e a specified virtual interrupt and virtual port input at the same time Text Display a text string GUI output function The GUI output function refers to simulating the user target system s simple key output panel on a window The key output panel is created from the GUI output window The following parts can be arranged on this output panel Character string User specified character strings are displayed or erased when some value is written to a specified memory address or according to logic 1 or 0 in bits LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or Qin bits Text Display a text string 2 3 5 Cycle Count The CYcle CY Command Use of the CYcle command allows you to know an approximate number of cycles and the execution time of the program you ve executed The number of cycles are represented using the values listed in the microcomputer s software manual The execution time refers to the target program s execution time calculated from the cumulative number of cycles of the CPU instructions executed and the MCU clock and divide by ratio specified on the Init dialog box s MCU tab 2 3 6 Stack Utilization Monitor The StackMonitor SM Command Use the StackMonitor command to check the maximum and minimum addresses of the stack and to determine how much the program has used of what part of the stack The stack monitoring continues from the time that a Go or Go
150. e not referenced The priority of virtual interrupts can be specified when setting virtual interrupts on the I O Timing Setting Window The Flag Register FLG s interrupt enable flag I flag and processor interrupt priority level IPL are referenced as in the actual chip Virtual interrupts set by using the I O script function Regarding interrupt control for virtual interrupts generated A statement can be written so that when an interrupt occurs each Interrupt Control Register s interrupt request bit is set to 1 The priority levels set in each Interrupt Control Register s interrupt priority level select bit can be referenced However once a virtual interrupt is generated and registered in the simulator the priority of the virtual interrupt cannot be altered even when the priority levels specified with the interrupt priority level select bit is changed by the user program The Flag Register FLG s interrupt enable flag I flag and processor interrupt priority level IPL are referenced as in the actual chip I O Script Function This function allows you to write virtual port input and virtual interrupt settings to a file in script form Therefore it provides a more flexible way to define virtual port inputs and virtual interrupts than can be set from the I O Timing Setting Window Specifically this includes for example reading the divide by N ratios you ve set in the timer register and generating a timer interrupt periodically No
151. e previous data is cleared R20UT0522EJ0100 Rev 1 00 Page 22 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Interrupts In the actual MCU peripheral I O including external interrupt signals are generating factors for interrupts However the simulator has nothing corresponding to peripheral I O This simulator provides another method in place of this which allows you to generate interrupts in a simulated manner virtual interrupt function Virtual interrupts can be generated at any time e g in a specified cycle or at an executed address Virtual Interrupt Function This function defines interrupt generation Using this function you can generate timer interrupts and key input interrupts in a simulated manner without having to actually generate them The following shows timings at which virtual interrupts can be generated 1 When program execution has reached a specified number of cycles 2 When the program has executed a specified address 3 Every specified time interval Virtual interrupts at the above timings can be defined from the I O Timing Setting Window Use of the I O script function the function that allows uses to define virtual port input or virtual interrupt makes it possible to write timer interrupt Differences between Virtual Interrupts and Interrupts in Actual Chip Virtual interrupts differ from interrupts in the actual chip in the following points 1 Special hard
152. e specified data in 1 byte units FillWord FW Fills a memory block with the specified data in 2 byte units FillLword FL Fills a memory block with the specified data in 4 byte units Move Moves memory blocks MoveWord MOVEW Moves memory blocks in 2 byte units MoveLword MOVEL Moves memory blocks in 4 byte units R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 251 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 7Table of Script Commands 7 1 5 Assemble Disassemble Commands Command Name Short Name Contents Assemble A Line by line assembly DisAssemble DA Disassembles memory contents line by line Module MOD Displays modules names Scope Sets and checks the effective local symbol scope Section SEC Checks section information Bit Checks and sets bit symbols Symbol SYM Checks assembler symbols Label Checks assembler labels Express EXP Displays an assembler expression 7 1 6 Software Break Setting Commands Command Name Short Name Contents SoftwareBreak SB Sets and checks software breaks SoftwareBreakClear SBC Clears software breaks SoftwareBreakClearAll SBCA Clears all software breaks SoftwareBreakDisable SBD Disables software breakpoints SoftwareBreakDisableAll SBDA Disables all software breaks SoftwareBreak Enable SBE Enables software breakpoints SoftwareBreakEnableAll Enables all software breaks BreakAt SBEA Sets a
153. e toolchain is not used it is displayed on a Project Typel list box as Debugger only Target Name Select it When two or more project types are displayed please select one of them 4 Specify the workspace name and project name In the Workspace Name edit box enter the new workspace name In the Project Name edit box enter the project name When the project name is the same as the workspace name it needs not be entered In the Directory edit box enter the directory name in which the workspace will be created Click the Browse button to select a directory After a setting click the OK button R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 45 of 295 M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 2 2 Step 2 Selecting of the Target Platform Select the target system used for your debugging emulator simulator A wizard starts and the following dialog box is displayed Setting the Tare em for Debugging VIM16G PC4701 Emulator M16G R8C Compact Emulator MI6C R8C FoUSB UART M16C R8C PC7501 Emulator K K K K Target type M16060 1 Selecting of the Target type In the Target typel list box select the target CPU type 2 Selecting of the Target Platform In the Targets area the target for the session file used when this debugger is activated must be selected here Check the box against the target platform And choose other target as required And click
154. eatedly by judging the evaluation result of expression e Comment statement Comments can be written in I O script Comment statements are ignored when executing I O script R20UT0522EJ0100 Rev 1 00 Page 265 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 2 1 Procedure Procedures specify a definition block of an I O script Multiple procedures can be written in one file However the total number of procedures that can be registered is limited to 50 Also if you are using the Printf function output function in the Output Port Window the number of virtual port input virtual interrupt and I O script procedures that can be set is limited to a total of 48 The following shows a description format Statements Statements In the same way multiple procedures can be defined below 9 2 2 I O Script Statements Following five statements can be used in I O script 9 2 2 1 waiti statement Format waiti number of machine instructions Function Execution of the next statement is kept waiting for a specified number of machine instructions Right side expressions can be used to specify the number of machine instructions Specification of right side expressions is described later For example if following statements are written waiti 100 set 0x800 0x10 the set statement is executed only after executing 100 machine instructions 9 2 2 2 waitc statement Format waite numb
155. ebugger e the Assembler Package for 740 Family SRA74 e the IAR C Compiler 12 5 2 Not support functions e The simulator debugger for 740 does not support the real time tracing The following windows and script commands are not available Output Port Window Trace Point Setting Window Trace Window Data Trace Window TracePoint Command TraceData Command TraceList Command e The whole of the memory range is available for debugging with the simulator debugger for 740 The MAP command to assign memories is not supported It is not necessary to specify a range for coverage e The simulator engine for 740 can not detect factors of breaks Therefore the factors are not displayed in the Output window and the Status window Platform sheet e The debugger for 740 does not support stack tracing Therefore the following windows and script commands are not available Stack Trace Window Up command Down command Where command R20UT0522EJ0100 Rev 1 00 Page 290 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 6 Options for compiler assembler and linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentio
156. eceeececsesssececcceceesesscecececsesesssaeeceseeenenseaeees 187 6 11 Trace WO We se ses ses hbgs bese edda eee napus gu E E NERO 191 6 11 1 Configuration of Bus Mode ccccccccccecessssssceeececsesseceeececeeseeseeececeesenseseeeeeeeeneneaeees 191 6 11 2 Configuration of Disassemble Mode rarorvrnrrrrnennnnrnrnrnnrnrnennrnrnrnssrenennrnnnrnssrnsennnnnnensene 193 6 11 3 Configuration of Data Access Mode rrnrnrrnsnvvrrrnrvrrrsnnrnrrrsnnrnrrssrnrsrsnnvsrrsrnnrsrsssrsessennnn 194 6 11 4 Configuration of Source Mode c cccccccccessessssecececsesssssceecceceesessssecececsesesssaeeeeseeenenseaeees 195 6 11 5 Extended Menus rrrnernrrnnvrrrrerennrnnnvnrsrsrennrnrnvssersernsrnnnenssrsrsnernrsenssssrenennnsensssssenennnsesene 196 6 11 6 Display of bus information on the Simulator Debugger rrrrrrnvvrrrrnnrrrrrrnnrrrrnrrrrrrennnn 197 6 12 Data Trace WindowWessiass ccssesacsancagdczesaaientediaeasantansecasgingde are cdepdnsbeaedaceseneg lage ceegaad ecnadinsdcadeadis 198 6 12 1 Extended Menus risina cbeoe desc ceek SecGen bee cea ce EE a Eai 199 6 13 GUI TO Window posiesie din etenaren eaaa area aa era ae n ar E a a Ea SE aeaiia aE 200 6 13 1 Extended Menu snis E E E ERA 201 6 14 MR WNdOW eaea capan aara eE EEEa E E EAEN EE EERIE 202 6 142 Display the Task Status innne nE EE EEN EEA OEE NESES ENa 204 6 14 3 Display the Ready Queue Status rannrnrrrsnnrrrrnnrrrrrrnnrrrrrsnnrsrrnernrsrrnrrrrssnnrsrrssrresrennnn 209 6 14 4 Display t
157. eceessssececececsenesseceeeeeceenes 39 3 2 1 Creating a New Workspace Toolchain Used c ccccccccccscsssescsssessesecsesecsssesessecsessecesensens 40 3 2 2 Creating a New Workspace Toolchain Not Used insersvarvrsvarvervrersevvesrervesvervesvsesessrenne 45 3 3 St rting the Debug e er ccc cesisees divs sata EE kaiene kle say ceseneveadgas boo E NEER 50 8 8 1 Connecting the Simulator rrrronnrorvrnrrrrrenannrvrnrrrsrensnnrnrnrnssnenennnnrnrnsnnesenennnvensnnssenannrsenene 50 3 9 2 Endine the Smul torm vmn ukavugnitiferntriru dessutan A 50 4 Setup the Debugger 51 AAD Wrist Ko eda ce bad baa oa ben bs due us woe cba ea bas US edb UGuS bo bea ano ed nO TeuS wo bab ouS eaborenedneE 51 41 1 MCU Tapiri chide dando acdbeundeedeteesscasuteseets da0ievauckdectev loa S EEES REN 52 41 2 Debtigging Information Tabb eei vcssissaciescscccevesvedourbeisecesecscseereess cp evovvechenseeavouvees cdenesevazsnncneds 54 413 Scrpt LAD osc ccadssasodecdecaeeseaanecatedacedoadeingagesaduoes obingecdedoea EErEE ENSE 56 AV iA Trace Tabssussasdemssdrkagsknene engene 57 41 5 1 0Senpt Tab lt 3 lt szscegecdeeteasoss codes aa a e aa a a Coeds vdowhexied aaan Sarain ack eodes 57 4 2 MCU Setting Dialog for M16C R8C ccceseesssssesesesesesesesesecseneseseeeeceseseacacaeaesnsnsucneaencaeeeetereeees 58 ALD A Memory Tab isssstersessesrsrrastersassgesssrdastessdenseesdddesdeseteddevesrdagbetsdsesevesrensderedesdeeesrdagdesstanseede 59 4 3 Simulator engine setu
158. ecify No optimization by Optimization level Debug Tab Please check only Enable generation of any debug information including type checkeing and Genarate symbolic debug information 2 Select menu EDE gt Linker Locator Options The M16C Linker Locator Options Project Namel dialog opens Please set as follows by this dialog Format Tab Please specify IEEE 695 for debuggers abs by Output Format 3 Build your program after the setting above In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 6 7 When Using the TASKING C Compiler CM 12 6 7 1 Specify the Option Please specify g and OO options when compiling In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 6 7 2 Command Execution Examples The following shows examples of entering commands gt CM16 g 00 filel c lt Enter gt R20UT0522EJ0100 Rev 1 00 Page 294 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention MEMO R20UT0522EJ0100 Rev 1 00 Page 295 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 User s Manual Publication Date Mar 16 2011 Rev 1 00 Published by Renesas Electronics Corporation Edited by Renesas Solutions Corp tENESAS
159. ed e These events can be combined in one of the following ways Trace when all of the valid events are established AND condition condition Trace when one of the valid events is established OR condition Trace when all of the valid events are established at the same time simultaneous AND Trace upon entering a break state during state transition State Transition condition R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 148 of 295 M16C R8C Simulator Debugger V 1 06 6 10 1 Specify the Trace Event 6Windows Dialogs To set events double click to select the event you want to set from the event setting area of the Trace Point Setting Window This opens the dialog box shown below Event name Specify the event type Contents change with the setting of Event Type Following events can be set by specifying Event Type in this dialog box e When FETCH is selected Traces for the instruction fetch addr Address1 ha main Ge d R20UT0522EJ0100 Rev 1 00 2011 03 16 rRRENESAS Page 149 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e When DATA ACCESS is selected Traces for the memory access oo rm a FFFF e When BIT SYMBOL is selected Traces for the bit access R20UT0522EJ0100 Rev 1 00 Page 150 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e When INTERRUPT is selected Traces for the interrupt occurrence or termination
160. ed as pointers That is you cannot specify OxE000 for example 10 1 5 Reference References are indicated by the ampersand amp You can only specify amp variable_name R20UT0522EJ0100 Rev 1 00 Page 276 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 1 6 Sign Inversion Sign inversion is indicated by the minus sign You can only specify immediate value or variable name No sign inversion is performed if you specify 2 or any even number of minus signs Notes e There is no support currently for sign inversion of floating point numbers 10 1 7 Member Reference Using Dot Operator You can only use variable_name member_name for checking the members of structures and unions using the dot operator Example class T public int memberl char member2 class T t_cls class T pt_cls amp t_cls In this case t cIs member1 pt cls member2 correctly checks the members 10 1 8 Member Reference Using Arrow You can only use variable name gt member name for checking the members of structures and unions using the arrow Example class T public int memberl char member2 class T t_cls class T pt_cls amp t_cls In this case amp t_cls gt member1 pt_cls gt member2 correctly checks the members R20UT0522EJ0100 Rev 1 00 Page 277 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 1
161. egister The debugger for M16C R8C PC USP ISP SB INTB FLG ORO OR1 OR2 OR3 OAO OA1 OFB lt Bank 0 Register 1RO 1R1 1R2 1R3 1A0 1A1 1FB lt Bank 1 Register The debugger for 740 PC A X Y S PS Uppercase and lowercase letters are not unique in register names You can specify either 8 2 5 Memory variables Use memory variables to use memory values in expressions The format is as follows Address data size e You can specify expressions in addresses you can also specify memory variables e The data size is specified as shown in the following table The debugger for 740 doesn t support four byte length data Length Debugger Specification 1 Byte All Borb 2 Bytes The debugger for M32R Horh Other W or w 4 bytes The debugger for M32R W or w The debugger for R32C M32C Lor M16C R8C Example Referencing the contents of memory at address 8000h in 2 bytes 0x8000 W e The default data size is word if not specified R20UT0522EJ0100 Rev 1 00 Page 262 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files 8 2 6 Line Nos These are source file line Nos The format for line Nos is as follows fline no line_no source file name Specify line Nos in decimal You can only specify line Nos in which software breaks can be set You cannot specify lines in which no assembler instructions have been generated including commen
162. ellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas Electronics does not warrant that such info
163. ement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Further Renesas Electronics p
164. emory be created 5 2 2 1 Checking the Operation of RAM Select Memory from the CPU submenu of the View menu and enter the RAM address Here enter 400 in the Display Address edit boxes The Scroll Start Address and Scroll End Address editing box is left to a default setting By default the scroll range is set to Oh to the maximum address of MCU Display Address 0 z l Scroll Start Address 000000 x gl Scroll End Address JOFFFFF v gl Note The settings of the RAM area differ depending on the product For details refer to the hardware manual Click the OK button The Memory window is displayed and shows the specified memory area Memory 000400 E lol x norr mu 16 10 40 8 2 Address Label Register 1 0 1 2 3 4 5 46 7 48 9 4 B 0 H E 000400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 000410 DF D5 F OF 20 OA 00 00 20 0A 00 00 00 03 00 000420 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000430 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000440 FF FF GS FF FF FF FF FF FF FF FF FF FF FF FF 000450 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000460 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000470 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000480 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000490 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000440 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000450 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000400
165. en in WAIT SUSPEND with time out 26 task26 tmolls e Up to 8 characters can be displayed in the task name in the Mailbox Queue Wait field If a task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Rev 1 00 Page 217 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 8 Display the Data Queue Status In the MR window select Popup Menu Model gt Data Queuel wi Oreg Dtgatr C Eees Dtent Dtgsz Data Queue Wait Data Queue Data TA TFIFO TA TFIFO TA TFIFO TA TPRI 1 0 0 0 0 Send 23 task23 24 taskz24 s 25 Receive 27 task27 28 _task28 s Send 31 task3l 32 task32 s 33 Receive 35 task35 36 task36 s 6 14 8 1 Display the Data Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the data queues defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of data queue Dtqatr Attribute of each date queue Dtent Number of messages in each data queue Dtqsz Maximum number of messages that can be contained in each data queue Data Queue Wait ID No and task name of tasks waiting for message transmission waiting or message reception waiting Data Queue Data The messag
166. entheses R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 224 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 12 Display the Task Context 6 14 12 1 Display the Task Context In the MR window select Popup Menu Context The Context dialog box is opened The Context dialog box is used to reference specify the context information of the specified task You can also open the Context dialog box by double clicking the data display area in the task state display mode Set Task ID fi 4 Context Task ID 14 taskl4 Status WAI SEM Priority 15 FF2853 RO 0000 Ri 0001 RZ 0000 R3 0014 A0 000001 Al 00005 SB O0040E Enter the task ID number in the Task ID field and click the View button or press the Enter key The context of the specified task appears in the Context field e If the task entered in the Task ID field is RUN or DMT when clicking the View button the context is not displayed In the Context field only the task ID and task state are displayed e Ifa task ID number which does not exist is entered in the Task ID field when clicking the View button an error occurs R20UT0522EJ0100 Rev 1 00 Page 225 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 12 2 Change the task context Enter the task ID number in the Task ID field in the Context dialog and click the Set button The Set Context dialog i
167. epted is indeterminate There are following two methods to set virtual interrupts 1 By using the I O Timing Setting Window 2 By using the I O script function R20UT0522EJ0100 Rev 1 00 Page 30 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications With either method the virtual interrupts are subject to the following limitations Virtual interrupts set by using the I O Timing Setting Window Regarding interrupt control for virtual interrupts generated Each Interrupt Control Register s interrupt request bit is not set to 1 The priority levels set in each Interrupt Control Register s interrupt priority level select bit are not referenced The priority of virtual interrupts can be specified when setting virtual interrupts on the I O Timing Setting Window The Flag Register FLG s interrupt enable flag I flag and processor interrupt priority level IPL are referenced as in the actual chip Virtual interrupts set by using the I O script function Regarding interrupt control for virtual interrupts generated A statement can be written so that when an interrupt occurs each Interrupt Control Register s interrupt request bit is set to 1 The priority levels set in each Interrupt Control Register s interrupt priority level select bit can be referenced However once a virtual interrupt is generated and registered in the simulator the priority of the virtual interrupt cannot be altered even w
168. er Types When the number of the array elements is more than 100 the following dialog box open Specify the number of the elements in the dialog box Please set array area Start 0 End fi 023 The elements from the index specified in Start to the index specified in End are displayed If you specify the value more than the max index of the array the value is regarded as max index of the array When you click the Cancel button the elements are not displayed 10 2 5 Function Types e When the result of calculation is a function type the starting address is displayed in hex as follows void main 0xF000 all Radices 10 2 6 Reference Types e When the result of calculation is a reference type the reference address is displayed in hex as follows signed int amp ref 0xD038 all Radices 10 2 7 Bit Field Types e When the result of calculation is a bit field type it is displayed as follows unsigned int 13 s f 8191 when Radix is in initial state unsigned int 13 s f Ox1FFF when Radix is hex unsigned int 13 s f 1111111111111B when Radix is binary R20UT0522EJ0100 Rev 1 00 Page 282 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 2 8 When No C Symbol is Found If the calculated expression contained a C symbol that could not be found it is displayed as follows x lt not active gt all Radices 10 2 9 Syntax Errors e When the calculate
169. er V 1 06 12Attention 12 6 3 When Using the IAR EC Compiler EW Please specify the project setting by following process 1 The Setting in the IAR Embedded Workbench When you select the menu Project gt Options the dialog for Options For Target target will open In this dialog please select the XLINK as category and set the project setting e Output Tab In the Format area check the Other option and select the elf dwarf as Output Format e Include Tab In the XCL File Name area specify your XCL file ex nkm32cf xcl 2 Edit the XCL file Add the command line option y to your XCL file The designation of y option varies depending on the product Product Name y Option The debugger for R32C yspe The debugger for M32C yspe The debugger for M16C R8C yspe 3 Build your program after the setting above In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 6 4 When Using the IAR C Compiler EW Please specify the project setting by following process 1 The Setting in the IAR Embedded Workbench When you select the menu Project gt Options the dialog for Options For Target target will open In this dialog please select the XLINK as category and set the project setting Output Tab In the Format area che
170. er of cycles Function Execution of the next statement is kept waiting for a specified number of cycles Right side expressions can be used to specify the number of cycles Specification of right side expressions is described later For example if following statements are written waitc 10000 set 0x800 0x10 the set statement is executed only after executing the program 10 000 cycles R20UT0522EJ0100 Rev 1 00 Page 266 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 2 2 3 int statement Format int vector number priority Function The virtual interrupt of a specified vector number is generated in a specified order of priority Right side expressions can be used to specify the vector number and priority Specification of right side expressions is described later For example if following statements are written int 21 5 a timer AO vector number 21 interrupt is generated at priority level 5 9 2 2 4 set statement There are following three formats for the set statement Format 1 set memory address input value Function The input value is input to a specified memory address virtual port input to memory Left side expressions can be used to specify the memory address and right side expressions can be used to specify the input value Specifications of left side and right side expressions are described later For example if following statements are written set 0x3e0
171. erated e Execution count display area displays execution counts or a number of times the program has executed a specified address R20UT0522EJ0100 Rev 1 00 Page 105 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 6 3 Screen configuration for interval synchronized interrupts To set a virtual interrupt which is synchronized to a specified interval time click the Timer button and use the Timer dialog box that appears The Timer dialog box has a display screen configuration similar to the one shown below Set Timer Dialog Load Save Intervat 10 ee C usec Vector 23 Close Priority E Temp Directory C WIN DOWS TEMP Refer Timer Vecl 21 RE i iol 7 Ti ne see Del Del All Enable All Enable Disable All Disable e In the virtual interrupt register area specify the virtual interrupt you want to set and the interval time at which intervals you want to generate the interrupt e The interval time is calculated from the number of execution cycles and the MCU clock and divide by ratio specified on the MCU tab of the Init dialog box e The virtual interrupt display area shows the registered virtual interrupts and the specified interrupt generation intervals e The operation buttons for virtual interrupts can be used to delete or disable enable each virtual interrupt e The operation buttons to save load virtual interrupts can be used to save the virtual inter
172. es stored in the data queue e The display of the ID field varies depending on which one is specified the standard data or the extended data MR100 4 If the standard data 32 bits the ID field displays a string 32 and data queue ID number If the extended data 16 bits the ID field displays a string 16 and data queue ID number MR308 4 If the standard data 32 bits the ID field displays a string 32 and data queue ID number If the extended data 16 bits the ID field displays a string 16 and data queue ID number MR30 4 If the standard data 16 bits the ID field displays a string 16 and data queue ID number If the extended data 32 bits the ID field displays a string 32 and data queue ID number R20UT0522EJ0100 Rev 1 00 Page 218 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e The following are displayed in the Dtqatr area TA TFIFO Task wait queue is in FIFO order TA TPRI Task wait queue is in task priority order e The Data Queue Wait field displays a string Send if a task waiting for a message sending and then displays the ID number and name of the task waiting for a message sending Also if a task waiting for a message receiving displays a string Receive and then displays the ID number and name of the task waiting for a message receiving e When a task connected to the date queue is in the state of waiting with timeout enab
173. ess Set as below Example Writing to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range add Address v Address1 joo v l Address2 I Function Source File v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 mest Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Not Specify v Data 1 pooo Data 2 ooo Access WRIT E v IT Mask Joao ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 cance R20UT0522EJ0100 Rev 1 00 Page 160 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing byte length data 32h to even address 400h Al Set Event Status DATA ACCESS pooo a Se Al Set Event Status DATA ACCESS p2 po ooo pe z Maske TT R20UT0522EJ0100 Rev 1 00 Page 161 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing byte length data 32h to odd address 401h Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range addr Address v Address1 000401 BI Address2 000000 v Bl I Function Source File v Function 7 ACCESS WRITE ADDRESS 000401 GONDITION addr 000401 data amp 00FF 0032 met
174. et to 000F0000h The Map Function MAP Command The simulator divides the memory between 00000h and FFFFFh so that the memory space can be mapped in 256 byte blocks Note that the blocks with the lowest address 00000h to OFFFFh and with the highest address FO000h to FFFFFh are already mapped when the simulator starts Use the MCU Setting dialog box s Memory tab or the MAP command to map the simulator memory Memory mapped using these function is initialized with the value FFh immediately after being allocated When downloading a target program the memory is mapped automatically Note Memory space that has been mapped cannot be deleted You can not use MCU Setting dialog box s Memory tab to map the simulator memory when the Simulation Speed Mode is selected on the Init dialog box s MCU tab Accessing an Area Without Memory There is no actual memory between 10000h and EFFFFh unless memory is secured If an attempt is made to access this area an illegal memory access error occurs and execution of the command or program stops R20UT0522EJ0100 Rev 1 00 Page 28 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 3 4 I O e SFR The actual chip s peripheral I Os other than the CPU core such as the timers DMAC and serial I O are not supported The SFR area to which the peripheral I Os are connected is also handled as RAM by the simulator However a method is available that
175. etting dialog box setting information on the user target The MCU Setting dialog box opens after closing the Init dialog box MCU Setting gt Memory Memory Map Begin End Size Read Witte Type Add 000000 0003FF 16 2 2 SFR 000400 OOFFFF 16 1 1 RAM odit y OFO000 OFFFFF 16 1 1 ROM Reset Cancel Help I Do not show this dialog box again You can open the MCU Setting dialog using either one of the following methods e After the debugger gets started select Menu Setup gt Simulator gt Target Note You can open the MCU Setting dialog when the Cycle Accuracy Mode is selected on the Init dialog box s MCU tab R20UT0522EJ0100 Rev 1 00 Page 58 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 2 1 Memory Tab The specified content becomes effective when the next being start Memory Map Begin End Size Read write Type Add O00000 OO03FF 16 2 2 SFR 000400 OOFFFF 16 1 1 RAM poji OFODOO OFFFFF 16 1 1 ROM 2006 Reset 4 2 1 1 Setting the memory map Set the memory area in 256 byte units into which you want the memory to be mapped The blocks with the lowest address 00000h to OFFFFh and with the highest address FO000h to FFFFFh are already mapped when the simulator starts Notes Memory space that has been mapped cannot be deleted The memory map can be specified or modified Clicking Add button opens the Memory
176. eue WAI RDTQ SUS Receiving waiting state for a data queue suspended WAI RDTQ TMO Receiving waiting state for a data queue with time out WAI RDTQ TMO SUS Receiving waiting state for a data queue with time out suspended WAI VSDTQ Sending waiting state for an extended data queue WAI VSDTQ SUS Sending waiting state for an extended data queue suspended WAI VSDTQ TMO Sending waiting state for an extended data queue with time out WAI VSDTQ TMO SUS Sending waiting state for an extended data queue with time out suspended WAI VRDTQ Receiving waiting state for an extended data queue WAI VRDTQ SUS Receiving waiting state for an extended data queue suspended WAI VRDTQ TMO Receiving waiting state for an extended data queue with time out WAI VRDTQ TMO SUS Receiving waiting state for an extended data queue with time out suspended WAI MPF Waiting state for a fixed sized memory block WAI MPF SUS Waiting state for a fixed sized memory block suspended WAI MPF TMO Waiting state for a fixed sized memory block with time out WAI MPF TMO SUS Waiting state for a fixed sized memory block with time out suspended WAI SMBF Sending waiting state for a message buffer WAI SMBF SUS Sending waiting state for a message buffer suspended WAI SMBF TMO Sending waiting state for a message buffer with time out
177. file is displayed in the Init File field To disable auto execution of the script command erase a character string displayed in the Init File field R20UT0522EJ0100 Rev 1 00 Page 56 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 1 4 Trace Tab Specify whether or not to enable trace measurement and when you chose to enable specify the trace buffer size In the 740 debugger this tab is not displayed The contents you specified here are also effective the next time you start the debugger Trace Buffer Size 22 K Cycles 1 256 K Cycles To perform trace measurement check Use Trace Function If trace measurement is disabled you cannot open the Trace Window and Trace Point Setting Window In the Trace Buffer Size area specify the size of the buffer in which to store the traced data in K Cycles 4 1 5 I O Script Tab Specify the number of data to be recorded by the I O Window or Output Port Window s port output function In the 740 debugger this tab is not displayed and the maximum number of data is 30000 The contents you specified here are also effective the next time you start the debugger Output Data Num 30000 4 Data 1 1000000 Data In the Output Data Num area specify the number of output data to be recorded R20UT0522EJ0100 Rev 1 00 Page 57 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 2 MCU Setting Dialog for M16C R8C In the MCU S
178. fined using the Assemble command e You can include alphanumerics the underscore _ period and question mark in symbols and labels However do not start with a numeric e Symbols and labels can consist of up to 255 characters e Uppercase and lowercase letters are unique Product Name Notes The debugger for M32R e You cannot include the assembler structured The debugger for R32C instructions pseudo instructions macro instructions The debugger for M32C operation code or reserved words The debugger for M16C R8C SECTION BYTE switch if etc e You cannot use strings that start with two periods for symbols or labels The debugger for 740 e You cannot use the register name A X Y S PC PS P e You cannot include the assembler structured instructions pseudo instructions macro instructions operation code or reserved words SECTION BYTE switch if etc e You cannot use strings that start with two periods for symbols or labels DO to D65535 FO to F65535 IO to 156635 SO to 565535 0 to 65535 0 to 65535 8 2 2 1 Local label symbol and scope This debugger supports both global label symbols which can be referenced from the whole program area and local label symbols which can only be referenced within the file in which they are declared The effective range of local label symbols is known as the scope which is measured in units of object files The scope is switche
179. for memory the whole 16MB of memory from 000000h to FFFFFFh can be read from and written to as RAM Note however that in the initial state memory between 020000h and FEFFFFh is not secured and an error will result if an attempt is made to access this part of memory If this occurs while a program is running the program will stop with an illegal memory access error Use the map function described later to map this part of memory e Memory Structure and Initial Values Immediately after Starting The memory is set up as follows immediately after starting the debugger 000000h to 0003FFh SFR area Filled with 00h 000400h to 01FFFFh Filled with FFh 020000h to FEFFFFh No memory immediately after starting FFO000h to FFFFFBh Filled with FFh FFFFFCh to FFFFFFh reset vector Set to 0000FFOOh e The Map Function MAP Command The simulator divides the memory between 000000h and FFFFFFh into 256 equal parts so that the memory space can be mapped in 64KB blocks Note that the blocks with the lowest address 000000h to OOFFFFh and the next address 010000h to 01FFFFh with the highest address FFO000h to FFFFFFh are already mapped when the simulator starts Use the MAP command to map the simulator memory Memory mapped using this command is initialized with the value FF16 immediately after being allocated When downloading a target program the memory is mapped automatically Note Memory space that has been mapped
180. fy that execution breaks if the data read from or written to the address break point has a specific value Moreover you can specify valid and invalid bits for the specific value e Ifyou have set multiple hardware breakpoints program execution stops when any one hardware break address is encountered OR conditions R20UT0522EJ0100 Rev 1 00 Page 144 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 9 1 Specify the Events 6 9 1 1 Instruction Fetch Set as below Example Executing a instruction at address F0003h HW Break Point H W Break Disable Enable Address frooos Pass Count fi Access Type Fetch x Length Byte a Data Compare Help VV Not Specify oD ls Close H W Break Point Label Addr Cnt Size Data Type Cmp OFO003 O07 KEEKEK KKK When the Add button is clicked the breakpoint is added to the breakpoint list under the dialog Please click the Close button after completing the hardware breakpoint setting R20UT0522EJ0100 Rev 1 00 Page 145 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 9 1 2 Memory Access Set as below Example Reading to even address 400h HW Break Point R20UT0522EJ0100 Rev 1 00 Page 146 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Write data equal to or greater than 3Fh to address 400h HW Break Point
181. g Isl which indicates double waiting is appended to a string displayed in the Flag Queue field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 s Display when in WAIT SUSPEND with time out 26 task26 tmolls e Upto 8 characters can be displayed in the task name in the Flag Queue field If a task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Rev 1 00 Page 213 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 6 Display the Semaphore Status In the MR window select Popup Menu Mode gt Semaphorel miOoPruAHKVDS MI 6ESE ID Def ent Count semQ 0000H 0000H 10 _task10 11 taskll s 0003H 0003H 0005H 0003H 0005H 0005H 0007H 0007H 0002H 0002H 0003H 0003H 6 14 6 1 Display the Semaphore Status When the realtime OS is MRxx conformed to ulTRON specifications V 3 0 All the SEMs defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of semaphore Def cnt Default value of semaphore counter Count Semaphore count semQ Task ID Nos and task names in the semaphore queue e When a task connected to the SEM queue is in the state of waiting with timeout enabled waiting in twai_sem a string tmo which indicates
182. gram is running values of local variables and bit fields cannot be modified 12 1 4 Function name in C When you input the address using the function name in setting display address setting break points and so on you can not specify the member function operator function and overloaded function of a class You can not use function names for C C expression No script commands e g breakin and func can be used in which function names are specified for arguments In address value specifying columns of dialog boxes no addresses can be specified using function names The pointers for a member function can not be referred correctly in C watch window 12 1 5 Option settings for download modules These options which can be set in Debug Settings dialog box are invalid for this debugger Offset specified value is regarded as 0 Access size specified value is regarded as 1 Perform memory verify during download Not supported R20UT0522EJ0100 Rev 1 00 Page 286 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 1 6 Debugging multi modules If you register two or more absolute module file in one session you can download only one file in same time If you register one absolute module file and one or more machine language file in one session you can download all file in same time 12 1 7 Synchronized debugging Synchronized debugging function is not available 12 1 8 Vi
183. gs Read access counts Finds the previous data you ve set UP or the next data The setup example in this element ee ees ee Se eed se ee Lecctes specifies that data 0x90 be set when ER Mt fob read access occurs 9 times KITTY Double click on an element you want p sebeee perser ae tana and set the desired input value in it In this dialog box set the data you want to be actually input to memory Follow the procedure below to set data 1 Move the mouse cursor to the read access counts location called an element where you want data to be set then double click the left mouse button Or you can scroll the screen to go to the desired location 2 Input data in the selected place using a hexadecimal number The data size that can be input is one byte from 0x0 up to OxFF 3 Repeat steps 1 and 2 as many times as the number of data you want to set When you finished entering all data press the Next button A dialog box for saving the virtual port input data you ve set to a file virtual port input file will appear sveve EE Save in 8 My Computer v a fr 314 Floppy A SYSTEM C DAT D Compact Disc E Compact Disc F SUBSYS G File name inputios Save as type flo Script Files ios v Cancel h Here enter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into the simulator debugger back again by using t
184. hat allows uses to define virtual port input or virtual interrupt makes it possible to write timer interrupt Differences between Virtual Interrupts and Interrupts in Actual Chip Virtual interrupts differ from interrupts in the actual chip in the following points 1 Special hardware interrupts cannot be generated as virtual interrupts 2 High Speed interrupt cannot be generated as virtual interrupts 3 If virtual interrupts of the same priority occur simultaneously If in the actual chip multiple interrupts of the same priority occur simultaneously they are resolved according to the priority levels set in hardware so that an interrupt of the highest priority is accepted For virtual interrupts however all interrupts belonging to one interrupt type e g peripheral I O interrupt are handled as having the same priority Therefore if virtual interrupts of the same priority occur simultaneously the order in which they are accepted is indeterminate There are following two methods to set virtual interrupts 1 By using the I O Timing Setting Window 2 By using the I O script function R20UT0522EJ0100 Rev 1 00 Page 16 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications With either method the virtual interrupts are subject to the following limitations 1 2 Virtual interrupts set by using the I O Timing Setting Window Regarding interrupt control for virtual interrupts generated E
185. he Load menus in the I O Timing Setting window When you ve input a file name press the Save button Thus you ve finished setting the read access synchronized virtual port inputs R20UT0522EJ0100 Rev 1 00 Page 112 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 8 3 Setting Interrupt synchronized Inputs To set interrupt synchronized virtual port inputs choose the Setup menus in the I O Timing Setting Window The dialog box shown below will appear Set this item Setup Dialog Here choose the item Set Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box dialog box for setting up virtual port input timings will appear R20UT0522EJ0100 Rev 1 00 Page 113 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Setup Dialog Expressions can be input ere First choose Interrupt in the Data Input Timing column Next enter an address for virtual port input in the Input Address column the address to which you want data to be input using a hexadecimal number Then enter the vector number of a virtual interrupt that signals timing for virtual port input in the Vector column For PD32RSIM the vector addresses are fixed Then press the Next button Or press the Prev button here if you want to return to the previous dialog box A matrix dialog box
186. he Timeout Queue Status ccccccccccccccscsssscccececsesesssceeececsesssssseeceeeeenenseaeees 210 6 14 5 Display the Event Flag Status rrrrrsrorrrnrorsrensnornrnrnsrernennrnnnenssrenennrnnnenssresennnnnnensnee 212 R20UT0522EJ0100 Rev 1 00 Page v of viii 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6 14 6 Display the Semaphore Status rrrrrnnnorvrnrorsrenannrnrnrrerrrnennrnnnrnrsnenennnnnnenssennennnnnnensnee 214 6 14 7 Display the Mailbox Status ccccccccccccccsssssscecececsesssseceeccecsessseceeececsesesssaeeeeseeesenseaeees 216 6 14 8 Display the Data Queue Status rerrronrrorvrnrrrsrensnnrvrnenrrrrnennrnnnrnssnenennrnnnensnnesennnnnnensnee 218 6 14 9 Display the Cycle Handler Status 0 cccccccccccccseessssscecececsesesseceeececsesesssseeceeeeenenseaeees 220 6 14 10 Display the Alarm Handler Status ccccccccccccccssssscecececsesesssceeeeecsesesssseeeeeeeenerseaeees 222 6 14 11 Display the Memory Pool Status ccccccccsscesssceceessececseeeeecseeeeessseeecseeeeesseeeeenees 223 6 14 12 Display the Task Context serari ie EEE E E AE EE ia 225 6 15 MR Trace WindOW escisiones iaeiae iaie iaa eae Eo EEEE 227 6 15 1 Extended Mens rrecn n eee EE AEE E 229 6 15 2 Refer the Execution History of Task MRxx Window ersvrvrrvrsvevrrvrsvevrsvesverssvesverssnee 230 6 16 MR Analy ze Window Rnnessujerasinddetnsesdniuivedabadrnivhidiereddbetarverr 236 6 16 1 Configuration of CPU Occupancy Sta
187. hen the priority levels specified with the interrupt priority level select bit is changed by the user program The Flag Register FLG s interrupt enable flag I flag and processor interrupt priority level IPL are referenced as in the actual chip I O Script Function This function allows you to write virtual port input and virtual interrupt settings to a file in script form Therefore it provides a more flexible way to define virtual port inputs and virtual interrupts than can be set from the I O Timing Setting Window Specifically this includes for example reading the divide by N ratios you ve set in the timer register and generating a timer interrupt periodically Note The virtual port input output and virtual interrupt functions are processed after instruction execution is completed R20UT0522EJ0100 Rev 1 00 Page 31 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Port input output GUI input function The GUI input function refers to simulating the user target system s simple key input panel on a window The key input panel is created from the GUI input window The input panel can have the following parts placed on it Buttons Virtual port input or virtual interrupt can be performed by pressing the button The following actions can be set for the button Enter data to a specified memory address virtual port input Generate a specified virtual interrupt Generat
188. hich data can be input to memory 1 When program execution has reached a specified number of cycles 2 When a specified memory location is accessed for read by a program 3 When a specified virtual interrupt is generated Virtual interrupts at the above timings can be defined from the I O Timing Setting Window Use of the I O script function the function that allows users to define virtual port input or virtual interrupt makes it possible to specify more elaborate data input timing such as when the program performs fetch or writes to memory or when it executed an instruction a specified number of times Virtual Port Output Function When a data write to some memory address by the program occurs this function records the written data value and the cycle at which the data was written The recorded data can be verified in graphic or numeric format from the I O Timing Setting Window The number of data entries that can be recorded by this function equals the number of data entries specified on the Init dialog box s I O script tab reckoning from the time at which the program started running When reexecuted the previous data is cleared The output port simulate function The output port simulate function provides an efficient means of simulation When data are written to some memory addresses by a program it allows you to record the written data values The recorded data can be displayed on a window or output to a file Also you can verify the
189. ies specified on the Init dialog box s I O script tab reckoning from the time at which the program started running When reexecuted the previous data is cleared The output port simulate function The output port simulate function provides an efficient means of simulation When data are written to some memory addresses by a program it allows you to record the written data values The recorded data can be displayed on a window or output to a file Also you can verify the data which are output to UARTs by the Printf function The number of data entries that can be recorded by this function equals the number of data entries specified on the Init dialog box s I O script tab reckoning from the time at which the program started running When reexecuted the previous data is cleared R20UT0522EJ0100 Rev 1 00 Page 29 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Interrupts In the actual MCU peripheral I O including external interrupt signals are generating factors for interrupts However the simulator has nothing corresponding to peripheral I O This simulator provides another method in place of this which allows you to generate interrupts in a simulated manner virtual interrupt function Virtual interrupts can be generated at any time e g in a specified cycle or at an executed address Virtual Interrupt Function This function defines interrupt generation Using this function you can genera
190. in 2 byte units Echo Displays messages Exec Executes external application Exit Exits the script file Express EXP Displays an assembler expression File Checks a filename and displays the contents of that file FillByte FB Fills a memory block with the specified data in 1 byte units FillLword FL Fills a memory block with the specified data in 4 byte units FillWord FW Fills a memory block with the specified data in 2 byte units Func Checks function names and displays the contents of functions Go G Program execution with breakpoints GoBreakAt GBA Run target program with software break point GoFree GF Free run program execution GoProgramBreak GPB Run target program with software break point HardwareBreak HB Sets and checks a hardware break HardwareBreakClear HBC Clears hardware breaks HardwareBreakClearAll HBCA Clears all hardware breaks Label Checks assembler labels Load L Downloads the target program LoadHex LH Downloads an Intel HEX format file Loadleee LI Downloads IEEE 695 absolute format files LoadMot LM Downloads a Motorola S format file LoadSymbol LS Loads source line ASM symbol information Logoff Stops the output of the screen display to a log file Logon Outputs the screen display to a log file Map Checks and sets mapping data Module MOD Displays modules names Move E Moves memory blocks MoveLword MOVEL Moves memory blocks in 4 byte units R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 255
191. in 2 byte width 000470 00047D 00047E 00047F 000480 000481 000482 000483 000484 000486 0007E4 0007E4 0007E2 0007E2 0007E4 0007E2 000442 0007E2 0007E2 0007E2 0007E4 fNNN7E2 1 Other display areas are the same as in bus mode W W y y y y y y y y y R y R R R y R W R R R oo oo 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 00 00 00 055 Anant nn N55 299 299 299 299 299 300 300 300 300 301 301 301 302 302 302 302 303 303 303 304 304 ans In addition to data access information the window can display source line information in combination In this case the display will be similar to the one shown below Range 2281 00000 Area Break F File ycle 0501 2 f ddress OFOODF Time 00 00 00 055 299 05012 05007 05006 05001 05000 00047D 00047E 00047F 000480 GLOBAL C 47 04995 04994 000481 000482 000470 Cycle Label Datazccess GLOBAL C 44 global struct GLOBAL C 45 rober stekt sider 5 hm ms us 42 W oo 00 00 055 299 global_struct m long 6 05 W 00 00 00 055 299 oo W 00 00 00 055 299 06 WU
192. indow in which you can check execution non execution by source line Toolbar For All Files lof x 7 a Te Coverage Base Address DCO000 OFFFFF Funct jon Start main 0F0042 OFO08C randam access OFOO8E OFOOCI Func Global OFOOC2 OFO124 Func_Loca I OFO120 OFO1A2 Func Stat ic OFO1A4 OFO1DC Func_Exe OFOIDE OFO23E exe_stub 0F0240 OFO25C Function Name Coverage of Each Function Function Scope e Allof the memory space is the target for coverage measurement e By double clicking any function line the corresponding function appears in the Editor Source window e During coverage measurement appears in the coverage display area e You can change the display ratio between the function name display area and the function range display area using the mouse R20UT0522EJ0100 Rev 1 00 Page 136 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 6 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Select source file Select a source file for checking the coverage Auto Refresh Refresh coverage measurement result automatically Refresh Refresh coverage measurement result Clear Clear coverage measurement result Base Change coverage base address File Save Save coverage measurement result to file Load Load coverage measurement result from file
193. indows Dialogs 6 8 S W Break Point Setting Window The S W Break Point Setting window allows you to set software break points Software breaks stop the execution of instructions immediately before the specified break point Save Load Break Point Buttons Set Break Point Area Me S W Break Points SAW Break Point 0F0000 0F00C2 36 GLOBAL C 0F012C 22 LOCAL C Display Break Points All Disable View Operation Buttons to Break Points e If you have set multiple software breakpoints program execution stops when any one software break address is encountered OR conditions e You can continue to set software breakpoints until you click the Close button to close the S W Break Point Setting Window e You can clear enable or disable software breakpoints selected by clicking in the software breakpoint display area You can also enable and disable software breakpoints by double clicking on them e Click on the Save button to save the software break points in the file To reload software break point settings from the saved file click the Load button If you load software break points from a file they are added to any existing break points R20UT0522EJ0100 Rev 1 00 Page 141 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 8 1 Command Button The buttons on this window has the following meanings Button Function Load Load sett
194. ing information from a file in which it was saved Save Save the contents set in the window to a file Help Display the help of this window Add Add the break point Refer Open file selection dialog box Close Close the window Delete Remove the selected break point Delete All Remove all break points Enable Enable the selected break points All Enable Enable all break points Disable Disable the selected break point All Disable Disable all break points View Shows the selected breakpoint positions in the Editor Source window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 142 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 8 2 Setting and Deleting a Break Points from Editor Source Window The area which can be set in the software breakpoint is different according to the product Please refer to 12 1 2 Area where software breakpoint can be set for details You can set break points in the Editor Source Window To do so double click the break point setting area S W breakpoints column for the line in which you want to set the break A red marker is displayed on the line to which the break point was set s t Sample c i l while 1 for 0 i lt DATA SIZE i I data i data i 1 data i 2 data i 3 sub Double click You can delete the break point by double clicking again in the break point setting area S W breakpoints column
195. interrupts in the lower part of the dialog box Then click the Disable button Or you can double click on a virtual interrupt to temporarily disable it Set Timer Dialog Load Save hterval J 2 Jes Add Vector Close Priority J Temp Directory CHWINDOWS TEMP Refer Timer Vec 21 Priol Time 200 Insec VecL22 PrioL5b TimeL500 Imsec Del ee Del All Enable All Enable All Disable 6Windows Dialogs The temporarily disabled virtual interrupt is marked with an asterisk to the left of the virtual interrupt list To temporarily disable all virtual interrupts click the All Disable button When you ve finished setting virtual interrupts click the Close button R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 126 of 295 M16C R8C Simulator Debugger V 1 06 6 2 103 4 Reenabling a disabled virtual interrupt Click to select the virtual interrupt you want to reenable from the list of virtual interrupts in the lower part of the dialog box Then click the Enable button Or you can double click on a virtual interrupt to reenable it Set Timer Dialoe Load Save hterval J 2 heed Add Vector Close Priority J Temp Directory CHWINDOWS TEMP Refer Timer x Vec 21 Priol Time 200 Imsec Vec 22 Priol5 TimeL500 Imsec Del Del All All Enable Disable All Disable 6Windows Dialogs The reenabled vi
196. ion fetch at address 80000h to 80FFFh 41 Set Event Status pooo el R20UT0522EJ0100 Rev 1 00 Page 156 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 6 3 Instruction Fetch of Specified Address Area Out Set as below Example Instruction fetch at any address other than the range 80000h to 80FFFh 41 Set Event Status faddr lt Address1 Address2 lt faddr v pooo el porr El Hd R20UT0522EJ0100 Rev 1 00 Page 157 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 6 4 Entering exiting to specified function Set as below Example Entering a break to function name wait Al Set Event Status R20UT0522EJ0100 Rev 1 00 Page 158 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Exiting from function name wait Jl Set Event Status Ia Je mane a 6 10 7 Specify the Events Memory Access To specify a memory access event change the event select dialog box s Event Type to DATA ACCESS The event is established when memory is accessed at the specified address or under conditions set for the specified address range R20UT0522EJ0100 Rev 1 00 Page 159 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 7 1 Memory Access The debugger for R32C 6 10 7 1 1 Writing Reading a Specified Addr
197. ion of Instructions e Regarding the number of instruction cycles Time management is exercised in units of cycles The number of cycles is represented by the values listed in the microcomputer s software manual However this differs from the actual chip in the following points The bus width queue and wait states are not considered when measuring the number of cycles The executed cycle of an interrupt sequence is not considered when measuring the number of cycles When an interrupt occurs the executed cycle of an interrupt sequence is 0 This debugger starts counting cycles immediately after a reset Cycles immediately after a reset are 0 The number of cycles needed to execute one machine instruction are added on for each instruction executed See Figure shown below Note Because the number of cycles measured by the simulator does not take into account the bus width queue wait cycles etc it includes some error when compared with the number of cycles in the actual chip If four cycles are required for the ENTER instruction cycles are added at this point in time If two cycles are required for the MOWY instruction cycles are added at this point in time ENTER instruction Moy instruction Execution 0 1 2 3 4 B T 8 cycles In the above example no cycles are added while the ENTER or MOV instruction is being executed The cycles required for each instruction are added after ins
198. ion time measurement The target program execution time measurement is calculated from the number of cycles described above and the MCU clock and divide by ratio specified on the MCU tab of the Init dialog box R20UT0522EJ0100 Rev 1 00 Page 19 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications Note Because the simulator s execution time measurement is calculated using the number of cycles described above it includes some error when compared with the actual chip s execution time e WAIT BRK2 Executed as an NOP instruction Other instructions operate the same as those of the actual MCU e INT INTO UND BRK As with the actual MCU these instructions generate interrupts The INTO instruction only generates an interrupt when the O flag is 1 2 2 2 Resetting e The SFR area is nonexistent in the debugger so the initialization as in the actual chip is not performed e The cycle count is initialized to 0 Resetting is performed in the same way as the actual MCU A reset is also performed when the debugger starts The value FFO000h is set in the reset vector FFFFFCh to FFFFFFh immediately after starting The program counter is therefore set to FFO000h immediately after the debugger starts R20UT0522EJ0100 Rev 1 00 Page 20 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 2 3 Memory e Memory Space There is no processor mode If mapped
199. ions for specifying addresses data and number of passes etc The following shows example commands using expressions gt DumpByte TABLE1 gt DumpByte TABLE1 20 You can use the following elements in expressions e Constants e Symbols and labels e Macro variables e Register variables e Memory variables e Line Nos e Character constants e Operators 8 2 1 Constants You can use binary octal decimal or hexadecimals The prefix or suffix symbol attached to the numerical value indicates which radix is used The debugger for M32C and M16C R8C and 740 Hexadecimal Decimal Octal Binary Prefix 0x 0X None Suffix h H None 0 0 b B Examples 0xAB24 1234 12340 10010 AB24h 10010b You can only specify when the predetermined radix is hexadecimal e If you are inputting a radix that matches the predetermined radix you can omit the symbol that indicates the radix excluding binary e Use the RADIX command to set the predetermined value of a radix However in the cases shown below the radix is fixed regardless of what you specify in a RADIX command Type Radix Address Hex Line No Dec No of executions No of passes R20UT0522EJ0100 Rev 1 00 Page 259 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files 8 2 2 Symbols and labels You can include symbols and labels defined in your target program or symbols and labels de
200. isplayed in combination e Data access mode This mode allows you to inspect the data read write cycles In addition to data access information this mode allows source line information to be displayed in combination e Source mode This mode allows you to inspect the program execution path in the source program The measurement result is displayed when a trace measurement has finished When a trace measurement restarts the window display is cleared The range of a trace measurement can be altered in the Trace Point Setting Window For details about this window refer to 6 10 Trace Point Setting Window With default settings the trace information immediately before the program has stopped is recorded 6 11 1 Configuration of Bus Mode When bus mode is selected trace information is displayed in bus mode Bus mode is configured as shown below The display content in bus mode differs depending on the MCU or simulator system used Trace loj x ba oj n mm 8 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 00 OFO1DC OFO1DE 00042cC 0007E8 OOO7EA 0007EA 0OF0083 0F0084 0F0086 ypPmawminwmen nnn b Or WWW bN Old ooorooceoooRg R20UT0522EJ0100 Rev 1 00 Page 191 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 1 C
201. itional statements if else endi Program execution branches to the statement s to be executed according to the result of the conditional expression e Loop statements while endw A block of one or more statements is repeatedly executed according to the expression e break statement Exits from the innermost loop e Comment statements You can include comments in a script file The comment statements are ignored when the script commands are executed Specify only one statement on each line of the script file You cannot specify more than one statement on a line or write statements that span two or more lines Notes e You cannot include comments on the same lines as script commands e You can nest script files up to five levels e You can nest if statements and while statements up to 32 levels e If statements must be paired with endi statements and while statements with endw statements in each seript file e Expressions included in script files are evaluated as unsigned types Therefore operation cannot be guaranteed if you use negative values for comparison in if or while statements e You can specify up to 4096 characters per line An error occurs if a line exceeds this number of characters e When a script file containing illegal commands is automatically executed when you select Option gt Script gt Run from the Script Window menu after opening a script file or click the button in the Script Window execution
202. itor obtains the data accessed through the bus Any change other than the access from the target program will not be reflected The variables which are changed in real time are global variables and file local variables only If the display data length of the RAM monitor area is not 1 byte the data s access attribute to the memory may varies in units of 1 byte In such a case that the access attribute is not unified within a set of data the data s access attribute cannot be displayed correctly In this case the background colors the access attribute color of the first byte of the data About more information for C variables please refer to 12 1 3 Get or set C variables R20UT0522EJ0100 Rev 1 00 Page 134 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 5 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Add Add C watchpoint Remove Remove the selected C watchpoint Remove All Remove all C watchpoints Initialize Reevaluates the selected C watchpoint Set New Value Set new data to selected C watchpoint Radix Hex Display in Hexadecimal Bin Display in Binary Default Display in Default Radix Toggle All Variables Change radix toggle Set initial Set initial radix Refresh Refresh memory data Hide type name Hide type names from variables
203. kspace radio button Uses an existing workspace and displays the history of the opened workspace e Browse to another project workspace radio button Uses an existing workspace this radio button is used when the history of the opened workspace does not remain In the case of Selecting an Existing Workspace select Open a recent project workspacel or Browse to another project workspace radio button and select the workspace file hws Please refer to the following about the method to create a new workspace e Refer to 3 2 1 Creating a New Workspace Toolchain Used e Refer to 3 2 2Creating a New Workspace Toolchain Not Used When debugging the existing load module file with this product a workspace is created by this method The method to create a new workspace depends on whether a toolchain is or is not in use Note that this product does not include a toolchain Use of a toolchain is available in an environment where the C C compiler package for the CPU which you are using has been installed For details on this refer to the manual attached to your C C compiler package R20UT0522EJ0100 Rev 1 00 Page 39 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 1 Creating a New Workspace Toolchain Used 3 2 1 1 Step1 Creation of a new workspace In the Welcome dialog box that is displayed when the High performance Embedded Workshop is activated select the Create a new p
204. l and label names may consist of alphanumeric characters underscore _ period and question mark However numbers cannot be used at the beginning of symbol and label names e Symbol and label names can be written in up to 255 characters e Symbol and label names are discriminated between uppercase and lowercase letters e The structured instructions pseudo instructions macro instructions and reserved op code words of assembler asxx cannot be used in symbol and label names These for example include SECTION BYTE switch and if e Character strings that begin with cannot be used in symbol and label names R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 270 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 3 3 Macro Variables Macro variables are used by adding at the beginning of each variable name e Variable names following the percent character may consist of alphanumeric characters and underscore _ However numbers cannot be used at the beginning of macro variable names e Register names cannot be used in variable names e Variable names are discriminated between uppercase and lowercase letters e Up to 32 macro variables can be defined Once defined the macro variables remain effective until the debugger is terminated 9 3 4 Memory Variables Memory variables are used when using memory values in expressions The following shows a format of memory variables address data size
205. l expression e The conditional expressions written in I O script are calculated as unsigned type Therefore if negative values are compared in an if statement the operation to be performed by this debugger is indeterminate R20UT0522EJ0100 Rev 1 00 Page 268 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 2 4 Repeat Statement while and break Statement Repeat statements judge the results of expressions thereby executing statements repeatedly The following shows a description format while conditional expression statement or break statement e If the conditional expression is true the statement is executed repeatedly If the conditional expression is false program execution exits from the loop e The while statement can be nested in up to 32 levels e A break statement is used if it is necessary to forcibly exit the while statement If the while statement is nested program execution exits from the innermost loop e Right side expressions can be used for the conditional expression e The conditional expressions written in I O script are calculated as unsigned type Therefore if negative values are compared in an while statement the operation to be performed by this debugger is indeterminate 9 2 5 Comment Statements Comment statements are used to write comments in I O script The following shows a description format character string e A comment sta
206. latform In the Targets area the target for the session file used when this debugger is activated must be selected here Check the box against the target platform And choose other target as required And click the Next button R20UT0522EJ0100 Rev 1 00 Page 42 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 1 4 Step4 Setting the Configuration File Name Set the configuration file name for each of the all selected target The configuration file saves the state of High performance Embedded Workshop except for the target emulator simulator New Project 6 7 Setting the Debugger Options Mi6C RSC PC7501 Emulator Debue M160 R8C PC7501 Emulator Modify The default name is already set If it is not necessary to change please click the next button as it is R20UT0522EJ0100 Rev 1 00 Page 43 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 1 5 Step5 The check of a created file name Finally confirm the file name you create The files which will be generated by the High performance Embedded Workshop are displayed If you want to change the file name select and click it then enter the new name The following source files will be generated c Main Program a30 Start up file inc Start up file NED Finish Cancel This is the end of the emulator settings Exit the Project Generator following the
207. led a string tmol which indicates the state of timeout enabled is appended to a string displayed in the Data Queue Wait field When a task connected to the data queue is in the state of forced waiting Double waiting a string sl which indicates the state of double waiting is appended to a string displayed in the Data Queue Wait field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 _task26 sl Display when in WAIT SUSPEND with time out 26 task26 tmollsl Up to 8 characters can be displayed in the task name in the Data Queue Wait field If a task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Rev 1 00 Page 219 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 9 Display the Cycle Handler Status In the MR window select Popup Menu Model gt Cyclic Handler ERRETENA ENEE ID Stazddr name interval count Status OF1C56H cyclel 0064H 0064H TCY_ON OF1C58H _cycle2 O3E8H O3E8H TCY OFF OF1CSAH cycle3 O1F4H O1F4H TCY ON OF1C5CH cyclet 0258H 0258H TCY_ON OF1CSEH _cycle5 O0c8H OOc8H TCY OFF OFIC60H eycle6 012CH 012CH TCY ON OF1C62H cycle 0190H 0190H TCY_ON OF1C64H _cycle8 O15EH O15EH TCY ON 1 2 3 4 5 6 7 8 6 14 9 1 Display the Cycle Handler Status When the realtime OS is MRxx conformed to ulTRON specifications V 3 0 All the cycle handlers defined in
208. m the I O Timing Setting Window Use of the I O script function the function that allows users to define virtual port input or virtual interrupt makes it possible to specify more elaborate data input timing such as when the program performs fetch or writes to memory or when it executed an instruction a specified number of times Virtual Port Output Function When a data write to some memory address by the program occurs this function records the written data value and the cycle at which the data was written The recorded data can be verified in graphic or numeric format from the I O Timing Setting Window The number of data entries that can be recorded by this function equals the number of data entries specified on the Init dialog box s I O script tab reckoning from the time at which the program started running When reexecuted the previous data is cleared The output port simulate function The output port simulate function provides an efficient means of simulation When data are written to some memory addresses by a program it allows you to record the written data values The recorded data can be displayed on a window or output to a file Also you can verify the data which are output to UARTs by the Printf function The number of data entries that can be recorded by this function equals the number of data entries specified on the Init dialog box s I O script tab reckoning from the time at which the program started running When reexecuted th
209. mode in the specified direction of search Come Searches in Come mode in the specified direction of search Stop Stops trace measurement in the middle and displays the measured content at the present point of time Restart Restarts trace measurement Layout Change layout of the corrent view Copy Copy selected lines Save Save trace data to file Load Load trace data from file Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 196 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 11 6 Display of bus information on the Simulator Debugger From left to right the contents are as follows e Address The status of the address bus e Data The status of the data bus e Size Indicates the data access size Product Display format Size the R32C Debugger DB 8bit DW 16bit DL 32bit the M32C Debugger DB 8bit the M16C R8C Debugger DW 16bit e Type Indicates that data has been accessed Display format Status Code 1 Instruction fetch Data Data access 1 The Code data displayed by the R32C Debugger are fixed to 32 bits long with the rest of data omitted The Code data displayed by the M32C Debugger M16C R8C Debugger are fixed to 16 bits long with the
210. mory values at the point of a cycle currently in interest or the values of registered C variables e In the access history reference area you can see the history of accesses to registered addresses in chart form e Inconjunction with the Trace Window you can inspect memory values at the point of a cycle you are watching in the Trace Window Conversely you can show the cycle in the Trace Window which you are watching in the Data Trace Window R20UT0522EJ0100 Rev 1 00 Page 198 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 12 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Analyze Trace Data Analyze the realtime trace data Set Cycle Specify the display cycle Sync with Trace Window Synchronize with Trace Window Data Length lbyte Display in 1Byte unit 2bytes Display in 2Byte unit 4bytes Display in 4Byte unit Radix Hex Display in Hexadecimal Dec Display in Decimal Address Display from specified address Add C Watch Add C watchpoint Remove C Watch Remove the selected C watchpoint Hide Type Name Hide type names from variables Add Adds new watch item into Access History Reference Area Remove Removes the selected watch item from Access History Reference Area Zoom Zoom In Increase the display scale Zoom Out Decrease the display
211. n taski taskZ task5j task3 Oo UN Drag the start marker position and end marker position The time interval between the markers is displayed in the status bar Note Definition of time value in the MR Trace window The time value in the MR Trace window indicates the execution elapsed time which sets the program execution start point to 0 in all the cases On the contrary a numeric value above the grid line scale in the MR Trace window is a relative value which sets the start marker to 0 the grid interval is specified in the Value dialog which has nothing to do with the time value It is provided so that you can see the window easily 6 15 25 1 Move the Marker Each marker can be moved by dragging When moving the mouse on the marker the cursor shape changes Then start dragging The start marker moves into the window left portion by clicking the Start Marker button in the tool bar Or select Menu Start Marker The end marker moves into the window right portion by clicking the End Marker button Or select Menu End Marker The indicator moves into the window center by clicking the Indicator button Or select Menu Indicator The other markers can move only to the specified positions listed below e Position to which the interrupt processing or task execution transits e Position to which the task state transits
212. n see the User s Manual of your Renesas C Compiler NCxx e The data which are output to ports can be saved to a specified file log file before being presented to the Output Port Window e The Output Port Window has a buffer that contains 10 000 bytes of the latest execution result Even when you forgot to specify a log file the data which are output to ports can be saved to a file view file e The output data is displayed on a window or output to a file when the target program has stopped R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 129 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 3 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Set Sets output port Colm Sets column Log On Open log file and start recording start output to file Off Close log file and end recording stop output to file View Save Save view buffer to file Clear Clear view buffer Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 Page 130 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 4 ASM Watch Window The ASM watch window is a window in which you can register specific addresses as watchpoints and inspe
213. n Commands ccccsccccesssececeesceeeesneeeceeaececseeeeceesaeeeceesaeesceeseeesssnreeessaaes 251 7 1 3 Register Operation Command s c cccccsccccesssecesssececeesececseeeecessueeeceesaeesceeseeesesueseesenaes 251 7 1 4 Memory Operation Commands c cccccssscecessceeessseeecseaeeecseceecesueeecessaeesceeeeeesssueeeeseaaes 251 7 1 5 Assemble Disassemble Command ccccsssccessssceceesececseceecesseeeeceesaeescseeeeesesneseeseaaes 252 7 1 6 Software Break Setting Commands c ccccccccesssscecssssececseececessneeeceesaeeeseesaeenssnreeeneaaes 252 7 1 7 Hardware Break Setting Commands ccccccccssssssecsessececeeccecesseeeecsesaeeeceeseeesssueeeeneaaes 252 7 1 8 Real time Trace Commands ccccccccesssscecsssceeessnececsenseeecseeeecesaeeecsesaeescseseeesssueeeenenaes 252 7 1 9 Coverage Measurement Commands ccccssccesssceceesececeeceecesseeeceesaeesceeeeeesesnreeensaaes 253 7 1 10 Stack Utilization Monitor Command rrranovornnnrrvrrsnnvnrrssvnvnrrnnrsrsrennvnrsssrsrersnnrsrsssnnnnne 253 7 1 11 Cycle Count Monitor Command cccccccccessccessssceceesececseceecesseeeeceesaeesceuseeesssueseeseaaes 253 7 1 12 Seript Log File Commands cccccccccssscecseceeeesnececsensececseceecessueeeceesaeeeceeseeesesurseeneaaes 253 7 1 13 Program Display Commands rrrnnrorrronnrrrrssnvvsrnnnrvrrsrnnrnrsssnnvnrrnnrsrssennvnrsssnnvsrsnnrsrsssnnnnee 253 7 1 14 Map Command sersessisrssrenmisrreieaderanireknesnnkss
214. n double quote marks as character string literals Examples are abcde I am a boy etc Notes e Character string literals can only be placed on the right side of an assignment operator in an expression They can only be used when the left side of the assignment operator is a char array or a char pointer type In all other cases a syntax error results R20UT0522EJ0100 Rev 1 00 Page 279 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 2 Display Format of C C Expressions C C expressions in the data display areas of the C Watch Windows are displayed as their type name C C expression variable name and result of calculation value as shown below The following describes the display formats of the respective types 10 2 1 Enumeration Types e When the result value of calculation has been defined its name is displayed DATE date Sunday all Radices e If the result value of calculation has not been defined it is displayed as follows DATE date 16 when Radix is in initial state DATE date 0x10 when Radix is hex DATE date 0000000000010000B when Radix is binary 10 2 2 Basic Types e When the result of calculation is a basic type other than a char type or floating point type it is displayed as follows unsigned int i 65280 when Radix is in initial state unsigned int i OxFF00 when Radix is hex unsigned int i 1111111100000000B when Radix is binary
215. name press the Save button Thus you ve finished setting cycle synchronized virtual interrupts R20UT0522EJ0100 Rev 1 00 Page 120 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 10 2 Setting Executed Address synchronized Interrupts To set executed address synchronized virtual interrupts choose the Setup menus in the I O Timing Setting Window The dialog box shown below will appear Select this item Setup Dialog Here choose the item Set Virtual Interrupt and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual interrupt timings will appear R20UT0522EJ0100 Rev 1 00 Page 121 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Setup Dialog Expressions can be input here Siani over i Gy First choose Executed Address in the Interrupt Generation Timing column Next specify the executed address i e the address at which a virtual interrupt is generated when it is executed for Executed Address Then specify the vector number and the priority of the virtual interrupt to be generated for Vector and Priority respectively using decimal numbers Then press the Next button Or press the Prev button here if you want to return to the previous dialog box A matrix dialog box for setting virtual interrupts will appear
216. nddts EER EE A E L EERTE EDIRNE TRSA 280 10 2 3 Pomter TFyp sueumganesmskamemdafenhmediemneuber EEEE ENN 281 10 24 Array Types R ER SNE GER 282 10 25 Function Ty Pes ivesdedivssenscescsieecsassanecdeasipececeieeacvessctecenadavaaksssater tended sdaraccurdeeasinasteciwaseeess 282 10 2 6 Reference Types ccccccccsssccsssseceessececesaeeecseeceesesaeeecseseecesseeeecessaeeeceesseesssneeecsesaeeseseneees 282 10 2 7 Bit Field Types nicieni A ONE EA EE EEEE 282 10 2 8 When No C Symbol is Found rsrvrennnnrnrrnnvvvrrrnnvrrrrsnnvnrrssrnvsrsnnrnrrssnnnsrrssrsrsrsnnrsssssnnnernnn 283 10 29 Syntax Errors eeter enri n rA E EEEE REEE E EE ENE 283 10 2 10 Structure and Union Types ccccccccscccssssecesssececessaeeecseseeesesaeeecseeeeeessueeeceeseescensaeens 283 11 Display the Cause of the Program Stoppage 284 R20UT0522EJ0100 Rev 1 00 Page vii of viii 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12 Attention 285 12 1 Common Attentlonivcss sss co cssess oases ig eiessk oie sees eed eae load la ued eee 285 12 1 1 File operation on Windows erernrnrnrnrnvnrnrnrnrnrnrnrnrnrnnnrnrnrnrnrnrnrnnnnnnnnnnnnnnnnnnnrnvnvnvnvnnnnnnnne 285 12 1 2 Area where software breakpoint can be set c cccccccessssscccececsessseceeececeesssaeeeeeceesenses 285 12 1 8 Get or set C variables ccccccccccssccecssssececseccecessececssseeeecseeeecsssaeeecsesseessseeessesaeeeseeaaees 286 12 1 4 Function name in CHF oriire areor smeden ebd en 286 12
217. nder specified conditions 6 10 8 1 Writing Reading a Specified Bit Set as below Example Writing 0 to bit 2 at address 400h Al Set Event Status BIT SYMBOL R20UT0522EJ0100 Rev 1 00 Page 181 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 8 2 Writing Reading a Specified Bit Symbol Set as below Example Writing 1 to bit symbol bitsym 41 Set Event Status BIT SYMBOL R20UT0522EJ0100 Rev 1 00 Page 182 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 9 Specify the Events Interrupt To specify an interrupt event change Event Type in the event select dialog box to INTERRUPT When an interrupt is generated or finished the event is established 6 10 9 1 Interrupt Occurrence Set as below Al Set Event Status INTERRUPT v R20UT0522EJ0100 Rev 1 00 Page 183 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 9 2 Interrupt Termination Set as below l Set Event Status INTERRUPT 3 R20UT0522EJ0100 Rev 1 00 Page 184 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 10 Specify the Event Combination Condition Use the Combination group of the event setting windows to specify the combinatorial conditions of events The combination of two or more events can be used One of the following combinatorial condition
218. ned cannot be recommended 12 6 1 When Using NCxx When O OR or OS option is specified at compilation the source line information may not be generated normally due to optimization causing step execution to be operated abnormally To avoid this problem specify ONBSD or Ono_Break_source_debug option together with O OR or OS option 12 6 2 When Using the Assembler Package for 740 Family Please assemble according to the following procedures and link At assemble e c option outputs debugging information concerned with source line to a relocatable file Note When the directive comand FUNC is specified to a function in a source file if c option is used the name of the function will be not available Please do not use the option to make the name available e s option outputs local labels local equ symbols and local bequ symbols to a relocatable file At link e s option generates a symbol file In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 6 2 1 Command Execution Examples The following shows examples of entering commands depending on the product e The Debugger for 740 gt sra74 c s main a74 lt Enter gt gt sra74 c s sub a74 lt Enter gt gt link74 main sub s lt Enter gt R20UT0522EJ0100 Rev 1 00 Page 291 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugg
219. nput that has been set is displayed in chart mode in units of bits Cycle count display area Irput cycle Cycle 0C00000041 Daca 0301 Acdress Bi 10201 s040 S060 700000 0003E0 0003E0 t6 0003E0 5 0003E0 H 0003E0 3 0003E0 2 Bit number display area Address display area Input data display area e Address display area displays the memory address to which a virtual port is input e Bit number display area displays bit numbers of memory to which a virtual port is input e Input data display area displays the virtual port input data that has been set in chart mode in units of bits LI This means that memory bits are in the state of logic 0 The short white lines appearing at the bottom of the input data display area indicate points at which data are input To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area e Cycle count display area displays cycle counts This means that memory bits are in the state of logic 1 R20UT0522EJ0100 Rev 1 00 Page 100 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 2 Graphic mode displayed in units of bytes The virtual port input that has been set is displayed in graphic mode in units of bytes Cycle count display area Input cycle Address display area
220. o generate interrupts in a simulated manner without having to actually generate them Using this function you can generate timer interrupts or key input interrupts in a simulated manner Virtual interrupts can be generated at one of the following timings 1 Ifyou want virtual interrupts to be generated with the lapse of time Virtual interrupts can be generated when program execution has reached a specified number of cycles In this case set cycle synchronized interrupts 2 Ifyou want virtual interrupts to be generated when the program executes a specified address Use this method if you want virtual interrupts to be generated when some specific function is executed n this case set executed address synchronized interrupts 3 When generating a virtual interrupt at fixed intervals Use the virtual interrupt function when you want to generate a virtual interrupt at fixed intervals In this case set the interval synchronized interrupts ATTENTION Up to a total of 50 virtual port input virtual interrupt and I O script procedures can be set However if you are using the Printf function output function in the Output Port Window the number of virtual port input virtual interrupt and I O script procedures that can be set is limited to a total of 48 6 2 10 1 Setting Cycle synchronized Interrupts To set cycle synchronized virtual interrupts choose the Setup menus in the I O Timing Setting Window The dialog box shown below will appea
221. of the script file continues even after the error is detected except when the script line itself cannot be read If an error is detected and the script file continues to be executed operation after detection of the error cannot be guaranteed Reliability cannot therefore be placed on the results of execution after an error has been detected R20UT0522EJ0100 Rev 1 00 Page 257 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files 8 1 1 Script Command You can use the same script commands that you enter in the Script Window You can also call script files from within other script files nesting up to 10 levels 8 1 2 Assign Statement Assign statement s define and initialize macro variables and assign values The following shows the format to be used macro variable expression e You can use alphanumerics and the underscore _ in macro variable names However you cannot use a numeric to start a macro variable name e You can specify any expression of which the value is an integer between Oh and FFFFFFFFh to be assigned in a macro variable If you specify a negative number it is processed as twos complement e You can use macro variables within the expression e Always precede macro variables with the sign 8 1 3 Conditional Statement In a conditional statement different statements are executed according to whether the condition is true or false The following shows the forma
222. ong a 0 16838 000414 signed long a 1 5758 000418 signed long a 2 10113 00041C signed long a 3 17515 000420 signed long a 4 31051 000424 signed long a 5 5627 000428 signed long a 6 23010 00042c signed long a 7 7419 000430 Ltd signed long a 8 16212 000434 ba signed long a 9 4086 000438 R20UT0522EJ0100 Rev 1 00 Page 80 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 9 2 Registering Variable The user can also add a variable to the C Watch window by specifying its name Click the C Watch window with the right hand mouse button and select Add from the popup menu The following dialog box will be displayed Enter variable i Add new watch point xi Click the OK button The C Watch window will now also show the int type variable i CWatch eee EN x f lE Z ner amp Watch Local File Local Global Name Value Address Scope signed long 10 a 000414 Auto signed int i 10 000462 Auto R20UT0522EJ0100 Rev 1 00 Page 81 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 10 Step10 Stepping Through a Program This debugger provides a range of step menu commands that allow efficient program debugging 1 Step In Executes each statement including statements within functions subroutines 2 Step Out Steps out of a function subroutine and st
223. ops at the statement following the statement in the program that called the function subroutine 3 Step Over Executes a function subroutine call in a single step 4 Step Steps the specified times repeatedly at a specified rate 5 2 10 1 Executing Step In Command The Step In command steps into the called function subroutine and stops at the first statement of the called function subroutine To step through the sort function select Step In from the Debug menu or click the Step In button rt NE on the toolbar The PC cursor moves to the first statement of the sort function in the Editor Source window p sam gt 88 p_sam gt s9 sort long ta long t int i j k gaps gap 5 while gap gt 0 fort k O k lt gap ktt fort i ktzap i lt 10 i itzap for j i gap j gt k j j gap iffalil gt aliteapl i t alj R20UT0522EJ0100 Rev 1 00 Page 82 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5 2 10 2 Executing Step Out Command 5Tutorial The Step Out command steps out of the called function subroutine and stops at the next statement of the calling statement in the main function To step out of the sort function select Step Out from the Debug menu or click the Step Out button 0 on the toolbar The PC cursor slips out of a sort function and moves to the position before a change function ette Note p sam st initfp sam
224. ort0 with subroutine sort e About the source file name also please replace it with the corresponding one e The diagrams in this tutorial are for C program The displayed diagram for the assembler program may different from them e Step9 and Step12 are descriptions of C program R20UT0522EJ0100 Rev 1 00 Page 69 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 Usage Please follow these instructions 5 2 1 Step1 Starting the Debugger 5 2 1 1 Preparation before Use To run the High performance Embedded Workshop and connect the emulator refer to 3 Preparation before Use 5 2 1 2 Setup the Debugger If it connects with an emulator the dialog box for setting up a debugger will be displayed Please set up the debugger in this dialog box To setup the debugger in this dialog box refer to 4 Setup the Debugger After the setup of a debugger it will function as a debugger R20UT0522EJ0100 Rev 1 00 Page 70 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 2 Step2 Checking the Operation of RAM Check that RAM is operating correctly Display and edit the contents of the memory in the Memory window to check that the memory is operating correctly Note The memory can be installed on the board in some microcomputers In this case however the above way of checking the operation of memory may be inadequate It is recommended that a program for checking the m
225. ory e Memory Space There is no processor mode If mapped for memory the whole 4GB of memory from 00000000h to FFFFFFFFh can be read from and written to as RAM Note however that in the initial state memory between 00010000h and 0003FFFFh and memory between 00050000h and FFFEFFFFh is not secured and an error will result if an attempt is made to access this part of memory If this occurs while a program is running the program will stop with an illegal memory access error Use the map function described later to map this part of memory e Memory Structure and Initial Values Immediately after Starting The memory is set up as follows immediately after starting the debugger 00000000h to 000003FFh SFR1 area Filled with 00h 00000400h to 0000FFFFh Filled with FFh 00010000h to 0003FFFFh No memory immediately after starting 00040000h to 0004FFFFh SFR2 area Filled with 00h 00050000h to FFFEFFFFh No memory immediately after starting FFFF0000h to FFFFFFFBh Filled with FFh FFFFFFFCh to FFFFFFh reset vector Set to FFFF0000h e The Map Function MAP Command The simulator divides the memory between 00000000h and FFFFFFFFh into 65536 equal parts so that the memory space can be mapped in 64KB blocks Note that the blocks with the lowest address 00000000h to OOOOFFFFh and the next address 00040000h to 0004FFFFh with the highest address FFFF0000h to FFFFFFFFh are already mapped when the simulator starts
226. ove the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area e Cycle count display area displays cycle counts 3 Hexadecimal mode Virtual port output results are displayed in hexadecimal mode Outout cycle Cycle Address 138303838363630313 131313131313 131313839313iq E e count 01 display area Address display area Output data display area e Address display area displays the address to be monitored for virtual port output e Output data display area displays the data as virtual port output results by hexadecimal numbers To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area e Cycle count display area displays cycle counts R20UT0522EJ0100 Rev 1 00 Page 104 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 6 Structure of Virtual Interrupt Screen 6 2 6 1 Screen structure for cycle synchronized interrupts When you ve set virtual interrupts that are synchronized to machine cycles a display screen configured as shown below will appear Interrupt cycle Cycle Vec Pel a eee Cycle count LEN ERE SE ER EE JESS LS ee E display area l 3 3 i Virtual interrupt display area Vector Priority level display display area area e
227. p inliklesesdilsseraunkieensuisertm stones deeveas eveusoucneveodeeeee 61 4 4 Method of making MCU file errerrrnnnrorvrnrrrrrrnannrrrnerrsrensnnrvrneresesnennrnrnsnsssenannrnnnsnssnenennrnnsensssenannnen 62 4 4 1 Method of making MCU file the R32C Debugger resrsvervrrrarvervrerervvrsrervrsvesvesvrssersvenne 62 4 4 2 Method of making MCU file the M32C Debugger nssnsrvrvrvrrvrsrverevererererersrseresenesensnnr 63 4 4 3 Method of making MCU file the M16C R8C Debugger rsrrrvrrvrrrvrvvrrvervrsvarvesvssservrenne 64 4 4 4 Method of making MCU file the 740 Debugger r sresvrsrarvrrvarvervresvevvrsrervrsverveevsesesvvenne 65 Tutorial 5 Tutorial 69 Bool ae 0 GK 00 senienas eiue danceti id deqdacdegasiadedueseadegiadsedegecaicadeiede lt denne 69 JA SASS EEE de cuiees aden E Soeueeccteceevenesevess 70 5 2 1 Step Starting the Debugger rrerrrrronnnvrvrnrnrrnenanvrvrnererernennrnrnenssrenennrnnnenssessennvnnsensssene 70 5 2 2 Step2 Checking the Operation of RAM rserrrnnnorvrnrrrrernannrnrnenssnenennrnnnenssessennvnnvenssnennn 71 5 2 3 Step3 Downloading the Tutorial Program ccccccccccceceesssssceeececsessnsececeeeceenesssaeeeeees 72 5 2 4 Step4 Setting a Breakpoint reeeroorronnnnrnrnrersrennnnnnnnrnsnnenennrnnnensseenennnnnnensneenennnnnsensesenen 74 5 2 5 Step5 Executing the Program cccccccssssssccececsessssececececcesesnesecececsesesseseeeeeceesesssaeeeeees 75 5 2 6 Step6 Reviewing
228. pect the executed instructions In addition to disassemble information this mode allows source line or data access information to be displayed in combination e Data access mode This mode allows you to inspect the data read write cycles In addition to data access information this mode allows source line information to be displayed in combination e Source mode This mode allows you to inspect the program execution path in the source program 1 3 1 Trace Area For the simulator debugger as many cycles as specified on the Init dialog box can be recorded The trace area of the following 5 mode is being supported e Break the specified cycles before target program stops e Before the specified cycles before trace point e About the specified cycles either side of trace point e After the specified cycles after trace point e Full Until the specified cycles are written in the trace memory Start Trace Event Stop Event Break is set by default To refer the execution history before stopping the target program use Break designation of trace event is not required To refer the execution history at any position or to continue execution of the target program specify the trace event and change the trance range R20UT0522EJ0100 Rev 1 00 Page 7 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 3 2 Trace Condition Setting The following designations are available as trace events e Address designation
229. pen the Stack Trace window Kind Name Value ies F sort 0F4140 F tutorial I 0F4276 F main OF421E The upper figure shows that the position of the program counter is currently at the selected line of the sort0 function and that the sort0 function is called from the tutorial0 function R20UT0522EJ0100 Rev 1 00 Page 87 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 14 What Next This tutorial has described the usage of this debugger Sophisticated debugging can be carried out by using the emulation functions that the emulator offers This provides for effective investigation of hardware and software problems by accurately isolating and identifying the conditions under which such problems arise R20UT0522EJ0100 Rev 1 00 Page 88 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Reference R20UT0522EJ0100 Rev 1 00 Page 89 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Blank Page R20UT0522EJ0100 Rev 1 00 Page 90 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 Windows Dialogs The window of this debugger is shown below When the window name is clicked the reference is displayed Window Name View Menu RAM Monitor Window View gt CPU gt RamMonitor T O Timing Setting Window View gt CPU gt I O Timing Setting Output Port Window
230. play the Alarm Handler Status When the realtime OS is MRxx conformed to ulTRON specifications V 4 0 Of all the cycle start handlers defined in the configuration only those which are not started yet at present are listed in the ascending order of start time The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of alarm handler Name Name of alarm handler Almtim The amount of time by the millisecond remaining before the alarm handler s activation time Status Activity status of alarm handler The following are displayed in the Status area TALM STA Alarm handler is in an operational state TALM STP Alarm handler is in a non operational state R20UT0522EJ0100 Rev 1 00 Page 222 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 11 Display the Memory Pool Status In the MR window select Popup Menu Mode gt Memory Pooll ERRETENA FETAC E ID BaseAddr Blk size Total Blk cnt Free Blk cnt map F 1 0007B2H 80 4 F 2 0008F2H 10 10 1111111110 F 3 000956H 30 16 15 1111111111111110 Y 1 1 O018B6H 24 1 1 2 000000H 56 0 1 3 000000H 120 0 1 4 001496H 248 6 6 14 11 1 Display the Memory Pool Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the memory pools defined in the configuration are listed in
231. ponding MCU file is not contained in the debugger emulation pod you must create a new MCU file To do this see the following Refer to 4 4 Method of making MCU file 4 1 1 2 Specifying Clock Frequency Specify the operation clock of the target MCU within the MCU Clock field in the Time Count Resource group in units of MHz Resource wu Glock f100 MHz Al Specify the MCU clock and the clock divide ratio If you are using the MCU at 10 MHz divided by 4 for example enter 10 on the left side and 4 on the right side of the text box If no values are set in the clock divide ratio specifying area it is assumed that the clock is not divided i e the same as you would specify the value 1 This setting becomes effective when the debugger is connected the next time R20UT0522EJ0100 Rev 1 00 Page 52 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 4 1 1 3 Selection of the Simulation Mode for M16C R8C Select the simulation mode Simulation Mode Simulation Speed C Cycle Accuracy Simulation Speed Mode The bus width queue and wait states are not considered when measuring the number of cycles in the Simulation Speed Mode The number of cycles is represented by the values listed in the microcomputer s software manual Cycle Accuracy Mode The bus width the state of instruction queues and the software wait for instructions are considered when measuring the number of cycles in the Cy
232. port output results can be displayed for your reference in numeric or graphic mode This window is split into three sections each displaying the setup contents of virtual port inputs the output results of virtual port outputs and the setup contents of virtual interrupts I O Timing Setting AKK gs Bag G Input cycle Address Bit 000100 7 000100 6 000100 5 000100 4 000100 3 000100 2 000100 1 000100 0 Output Address 414 450 500 550 3e0 3e0 3e0 3e0 3e0 3e0 3e0 3e0 lt Interrupt cycle Cycle Vec Pri 13 1415 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 13 7 R20UT0522EJ0100 Rev 1 00 Page 95 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 1 Virtual Port Input Virtual Port Input refers to a function that defines changes in the data that is input from external sources to a specified memory address Use of this function makes it possible to simulate data inputs to the ports defined in the SFR The defined input data can be referenced by displaying it in chart numeric hexadecimal or graphic mode There are following three types of virtual port inputs 1 Cycle synchronized input The input data can be written to memory when program execution has reached a specified number of cycles The data size that can be input is one byte The diagram below shows an example of a virtual port input that is synchronized to machine cycles Data 2
233. pressions displayed in the C Watch Window are known as C watchpoints The displays of the results of calculating the C watchpoints are updated each time a command is executed When RAM monitor function is effective and the C watch points are within the RAM monitor area the displayed values are updated during execution of the target program Watch Local File Local Global Name Value Address istruct tag_s ps struct tag_s ps signed short global short signed long global long signed int 5 5 global array signed int 5 global array 0 signed int global array 0 0 signed int global array 0 1 signed int global array 0 2 signed int global array 0 3 signed int global array 0 4 signed int 5 global array 1 signed int 5 global array 2 e Variables can be inspected by scope local file local or global 0x1 0 1 15 15 15 2649 0 2649 0 768 3842 000410 000001 000412 000414 000418 000418 000418 000412 000410 000415 000420 000422 000420 e The display is automatically updated at the same time the PC value changes e Variable values can be changed e The display radix can be changed for each variable individually The initial display radix can be changed Leading zero suppression is selectable in hexadecimal display e Any variable can be registered to the Watch tab so that it will be displayed at all
234. processed as hexadecimals those with 0 as octals and those without either prefix as decimals Floating point numbers can also be used to assign values to variables Notes e You cannot register only immediate values as C watchpoints e The immediate value is effective only when it is used in C C language expressions that specify C C watchpoints or when it is used to specify the value to be assigned to those expressions When using floating point numbers operation cannot be performed on an expression like 1 0 2 0 R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 275 of 295 M16C R8C Simulator Debugger V 1 06 10C C Expressions 10 1 2 Scope Resolution The scope resolution operator is available as following Global scope valiable name tmx itival Class scope class name member name class name class name member name e g T member A B member 10 1 3 Mathematical Operators You can use the addition subtraction multiplication and division mathematical operators The following shows the order of priority in which they are evaluated Notes e There is no support currently for mathematical operators for floating point numbers 10 1 4 Pointers Pointers are indicated by the asterisk You can use pointer to pointers and pointer to pointer to pointers etc Examples variable_name variable_name etc Notes e Immediate values cannot be process
235. pts This function defines interrupt generation Using this function you can generate timer interrupts and key input interrupts in a simulated manner without having to actually generate them The following shows timings at which virtual interrupts can be generated Virtual Interrupt Function This function defines interrupt generation Using this function you can generate timer interrupts and key input interrupts in a simulated manner without having to actually generate them The following shows timings at which virtual interrupts can be generated 1 When program execution has reached a specified number of cycles 2 When the program has executed a specified address 3 Every specified time interval Virtual interrupts at the above timings can be defined from the I O Timing Setting Window Furthermore this function can be used in combination with the I O script function a function that allows you to define virtual port inputs and virtual interrupts For details refer to High end Debugging described later in this manual Using this I O script function you can specify more precise interrupt generation timings such as when the program reads or writes to memory or when the program has executed instructions a specified number of times Differences between Virtual Interrupts and Interrupts in Actual Chip Virtual interrupts differ from interrupts in the actual chip in the following points About the Interrupt Control and Interrupt Request Regis
236. r Select this item Setup Dialog Select Type Set Virtual Port Input C Set Virtual Port Output Cancel Here choose the item Set Virtual Interrupt and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual interrupt timings will appear R20UT0522EJ0100 Rev 1 00 Page 118 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Setup Dialog s OF Exe Cited Aae Ser Co Expression 10000 Se can be input F se A here 100000 i First choose Cycle in the Interrupt Generation Timing column Next specify the cycles at which you want a virtual interrupt to be started and ended for Start cycle and End cycle respectively using decimal numbers Then specify the vector number and the priority of the virtual interrupt to be generated for Vector and Priority respectively using decimal numbers Then press the Next button Or press the Prev button here if you want to return to the previous dialog box A matrix dialog box for setting virtual interrupts will appear R20UT0522EJ0100 Rev 1 00 Page 119 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Setup Dialog Finds the previous data you ve set UP or the next data DOWN The setup example in this element specifies that virtual interrupt be ee ee EE
237. r in the MR Trace window By clicking each line you can search the system call issuance history corresponding to the clicked line The search result is pointed by the indicator in the MR Trace window after the indicator moves to the destination position R20UT0522EJ0100 Rev 1 00 Page 239 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 16 5 3 1 Extract the Issuance History Click the Pick Up button in the tool bar Or select Menu Pick Up System Call The dialog shown below is opened Specify the search condition of the system call to be extracted and displayed Extract the issuance history of the system call which meets the specified condition and display it R20UT0522EJ0100 Rev 1 00 Page 240 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 17 Task Trace Window The Task Trace window measures the task execution history of a program using the real time OS and display it graphically This window is available even when a target program using an OS other than our real time OS MRxx is downloaded The debugger for R32C doesn t support this function The debugger for 740 doesn t support this function s t Task Trace Han Haa he ew Mark 00 00 00 000 442 00 00 01 847 055 00 00 01 346 612 Indicator 00 00 00 940 805 Scale 6 939931 Grid 00 00 01 850 572 Area Break ID name l D AHCB ENT task2
238. race window means the execution elapsed time using the program execution start time as 0 in all the cases On the contrary the numeric value above the grid lines scale in the Task Trace window is a relative value using the start marker as 0 the grid interval is specified in the Value dialog It has nothing to do with the time value This is provided so that you can see the window easily 6 17 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Start Marker Move the start marker in the display area End Marker Move the end marker in the display area Indicator Move the indicator in the display area Adjust Adjust range of start and end marker to full width of display area Adjust Expand Increase scale factor of display Reduce Decrease scale factor of display Trace Stop Stop measuring Trace Restart Restarts measuring Trace Range After Set measurement range condition to After Break Set measurement range condition to Break Value Set value Color Change display color RTOS Set target RTOS information Toolbar display Displays the toolbar Customize toolbar Opens the toolbar customize dialog box Allow Docking Allows the window docking Hide Hides the window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 242 of 295 2tENESAS M16C R8C Simulator Debugger V 1
239. rational state TCYC_STP Cycle handler is in a non operational state R20UT0522EJ0100 Rev 1 00 Page 221 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 10 Display the Alarm Handler Status In the MR window select Popup Menu Mode gt Alarm Handler ERRETENA I lt 0088 Remain Handler Now System Clock Count 0000H 0000H018AH ID Stazddr name AlarmTime OF1C68H alarm 0000H OOOOH OF1C70H alarm 6 0000H 1000H OF1C66H alarml OOOOH ABCDH OF1C72H alarm OOODH 0013H OF1C6AH _alarm3 OOCDH OOO3H OF1C6CH _alarm4 OOCDH OOO3H OFIC6EH _alarm5 OOCDH OAA3H When the realtime OS is MRxx conformed to uITRON specifications V 3 0 the following data is displayed in the status bar Remain Handler Now System Clock Count 0000H 0000H 0184H gt 6 14 10 1 Display the Alarm Handler Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Of all the cycle start handlers defined in the configuration only those which are not started yet at present are listed in the ascending order of start time The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of alarm handler StaAddr Starting address of alarm handler name Name of alarm handler AlarmTime Starting time of alarm handler 6 14 10 2 Dis
240. rea accessed with 16 bit bus width 6 172 1 2 Select the Trace Range The real time trace function is used for task execution history measurement Click the After button or select After from popup menu by right clicking on the window or Break button or or select Break from popup menu in the Task Trace window After Records a task execution history until the trace memory is filled with recorded data Break Records a task execution history as much as trace memory available until before the target program stops Only an specific cycle required to know the task execution history is recorded in the trace memory ATTENTION A trace point set in the Trace Point Setting dialog is disabled 6 172 1 3 Start the Target Program Execute the target program Record the information required to know the task execution history in the trace memory When you select After for the trace range the execution history is displayed in the Task Trace window immediately after the trace memory is filled or immediately after the target program stops When you select Break for the trace range the execution history is displayed in the Task Trace window immediately after the target program stops You can stop task execution history measurement To do this click the Stop button in the Task Trace window Or select Trace Stop from popup menu by right clicking on the window To restart task execution history measurement click the Restart but
241. reakDisable SBD Disables software breakpoints SoftwareBreakDisableAll SBDA Disables all software breaks SoftwareBreakEnable SBE Enables software breakpoints SoftwareBreakEnableAll SBEA Enables all software breaks StackMonitor SM Sets and checks stack utilization measurement Status Checks the operating status of the MCU Step S Step execution of source line StepInstruction SI Step execution of instructions Stop 5 Stops program execution Symbol SYM Checks assembler symbols TraceData TD Realtime trace data display TraceList TL Displays disassembled realtime trace data TracePoint TP Sets and checks a trace points UnAlias Cancels the alias defined for a command UnAliasAll z Cancels all aliases defined for commands Up z Displays the calling function UploadHex UH Outputs data to an Intel HEX format file UploadMot UM Outputs data to a Motorola S format file Version VER Displays the version No Wait Z Waits for an event to occur before command input Where 5 Displays a function call status R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 256 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files This debugger allows you to run script files in a Script Window The script file contains the controls necessary for automatically executing the script commands 8 1 Structural Elements of a Script File You can include the following in script files e Script commands e Assign statements e Cond
242. reesbedsriedansanansrennd rann dk sbsvednededn anne knsnnnse 254 7 1 15 C Language Debugging Commands ccccccccssssssecseseceseeceecesseeeceesaeescseeeeesssseeesenaes 254 7 1 16 Real time OS Command ccccceccesccesssececeesceeeceeeecseaececseneecessaeeeceesaeeeceeseeesseuteeesaaaes 254 T 117 Utility Commands versies Er AET EAEE ETES E EEEE E Rt 254 7 2 Table of Script Commands alphabetical order srosnerrrvrrvevonvervevenvervevenververenvervevesvessevesvenenr 255 8 Writing Script Files 257 8 1 Structural Elements of a Script File srorrnnrorrronnrorrronvvnrrnsrrvsrrnnvrrrrsnnrnrrssrsvsrennvnrsrsnnnsrsssrsessnnnn 257 8 1 1 Script Command risna E 258 8 1 2 Assign Statement rrrarrrorsnnrnrrronnvnrrnnvrrrrrnnvnrrrsnnrsrsnrnversnnnnrsssnnnnrrsannrsrsnnnsrsssnnrssssnrnessnnn 258 8 1 8 Conditional Statement rsnnrnrrrannvnrrnnvrrrrennvnrrrsnnvnrrnarnnsrsnnnnrsssnnnnrrsnnnesrsnnnnrsssnnrssssnrsrssnnn 258 8 1 4 Loop Statement while endw and Break Statement sorvronrrnrrnrrrvrnvrrrervrrvarvervrrsnenner 258 8 1 5 Comment st t mente urne sseokGE Ranens 259 8 2 Writing Expression S sesinin erer iE Eae ee EA ERS rer E EEIE EAER R E EREE TRETE R EEEE ERRER 259 82 I Constani Seo ear aE E EEE E EEE EEEN 259 8 2 2 Symbols and labels rrrnrnnnrnrrronnvnrrnnrrrrrrnnvnrrrsnnvnrrnnrnnsrsnnnnrsssnnnnrrsnnnrsrennvnrsssnnrssssnrsrssnnnn 260 8 2 3 Macro Variables sii scccccisenssiecsiteiesasieneseds dneweu shamed ees Ueaaed ssciie
243. rest of data omitted e R W Indicates the data access status Display format Status R Read W Write If Type is Code the status is always R code read e h m s ms us Show the elapsed time from the target program beginning The value enclosed in that follows indicates a total amount of instruction execution cycles reckoning from when the program started to run R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 197 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 12 Data Trace Window The Data Trace Window is used to analyze the results of real time trace measurements and graphically show data access information It operates in conjunction with Trace Window The debugger for 740 doesn t support this function Time at indicator cycle Time at makers Grid interval Scale paoa melase OO O Current 00 00 00 661 845 29309 cycle Mark 00 00 00 661 989 00 00 00 661 730 00 00 00 000258 Grid 1000 us Scale 412 Name union tag U b0 struct tag Bit b0 it unsigned char 1 b0 bit bO unsigned char 1 b0 bit bl unsigned char 1 bO bit b2 unsigned char 1 bO bit b3 signed char 4 b0 bit b4 7 unsigned char b0 all Data Trace b0 Ibitj b2 b0 bit b3 BO fat b4_7 Data Reference Indicator Markers Access history reference area e In the data reference area you can inspect me
244. rget program upon detecting data read writes to memory or instruction execution The H W Break Point Setting dialog box allows you to set hardware break points e You can set up to 64 hardware break points e You can set one hardware breakpoints with pass counts e s hardware break point access types you can specify writing data to the hardware break point Write reading data from the hardware break point Read reading or writing data R W and fetching instructions Fetch e You can also specify that execution breaks if the data read from or written to the hardware break point has a specific value e If multiple hardware breakpoints have been set a break occurs when one of the hardware breakpoints is reached R20UT0522EJ0100 Rev 1 00 Page 6 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 3 Real Time Trace Function The real time trace function records the execution history of the target program The debugger for 740 doesn t support the real time trace function The execution history is referred to in the tracing window The execution history can be referred to in the following mode e BUS mode This mode allows you to inspect cycle by cycle bus information The display content depends on the MCU and simulator system used In addition to bus information this mode allows disassemble source line or data access information to be displayed in combination e Disassemble mode This mode allows you to ins
245. riable is declared with the same name as the type definition name declared by typedef you cannot reference that variable Values cannot be changed for register variables Values cannot be changed for 64 bit width variables long long double and so on Values cannot be changed for C C expressions that do not indicate the memory address and size For the sake of optimization the C compiler may place different variables at the same address In this case values of the C variable may not be displayed correctly Literal character strings can only be substituted for char array and char pointer type variables No arithmetic operations can be performed on floating point types No sign inversion can be performed on floating point types Casting cannot be performed on floating point types Casting cannot be performed on register variables Casting cannot be performed on structure types union types or pointer types to structure or union types Character constants and literal character strings cannot contain escape sequences The following values can be substituted for the bit fields integer constants character constants and enumerators variables of bool types characters types integers types and enumeration types bit field When the substituted value is larger than the size of the bit field it will be truncated The bit field member allocated in the SFR area might not be transformed into a correct value While the target pro
246. riority 100 RdyQ 1 main 2 task2 15 _task15 16 _task16 17 taskl1 18 taskl8 The following data is displayed in the status bar Current Run Task 1 main Number of Priority 100 6 14 3 1 Display the Ready Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 The function of each item is as described below When the realtime OS is MRxx conformed to ulTRON specifications V 3 0 Item Contents Pri Displays priority RdyQ Shows the ID Nos and task names of tasks in the ready queue e Up to 8 characters of the task name is displayed in the RdyQ field When the task name exceeds 8 characters the extra characters are omitted 6 14 3 2 Display the Ready Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 The function of each item is as described below When the realtime OS is MRxx conformed to ulTRON specifications V 4 0 Item Contents Pri Displays priority Ready Queue Shows the ID Nos and task names of tasks in the ready queue e Up to 8 characters of the task name is displayed in the Ready Queue field When the task name exceeds 8 characters the extra characters are omitted R20UT0522EJ0100 Rev 1 00 Page 209 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 4 Display the Timeout Queue Status In the MR window select Popup Menu Model gt
247. ript file is not being executed e The Script Window can record the history of the executed commands to a file This function is not the same as the log function This function records not the result but only the executed commands so the saved files can be used as the script files R20UT0522EJ0100 Rev 1 00 Page 139 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 7 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Script Open Open seript file Run Run seript file Step One step execution of seript file Close Close seript file View Save Save view buffer to file Clear Clear view buffer Log On Open log file and start recording start output to file Off Close log file and end recording stop output to file Record On Record the executed commands to a file Off Stop recording the executed commands Copy Copy the selection and put it on the Clipboard Paste Insert Clipboard contents Cut Cut the selection and put it on the Clipboard Delete Erase the selection Undo Undo the last action Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 Page 140 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6W
248. riting byte length data 32h to odd address 401h Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range addr Address v Address1 000401 BI Address2 000000 v Bl I Function Source File v Function 7 ACCESS WRITE ADDRESS 000401 GONDITION addr 000401 data amp 00FF 0032 met Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range ata Datal 7 Data 1 2 Data 2 Joona Access WRIT E z IV Mask 00FF ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 mest R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 176 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing word length data 1234h to even address 400h 41 Set Event Status Event Type DATA ACCESS x Address Data Setting Range dar Addressl v Address1 joo Jal Address2 000000 X Bl I Function Source File v Function F ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data 1234 orei Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range data Datal Data 1 1234 Data 2 ooo ccess WRIT E z IV Mask FFFF ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 da
249. rmation is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers office equipment communications equipment test and measur
250. rnal devices to a specified memory address Using this function you can simulate data inputs to the ports defined in SFR The following shows timings at which data can be input to memory 1 When program execution has reached a specified number of cycles 2 When a specified memory location is accessed for read by a program 3 When a specified virtual interrupt is generated The input data at the above timings can be defined from the I O Window Furthermore this function can be used in combination with the I O script function a function that allows you to define virtual port inputs and virtual interrupts For details refer to High end Debugging described later in this manual Using this I O script function you can specify more precise data input timings such as when the program fetches an instruction when the program writes to memory or when the program has executed instructions a specified number of times Virtual Port Output Function When a data write to some memory address by the program occurs this function records the written data value and the cycle at which the data was written The recorded data can be verified in graphic or numeric format from the I O Window The maximum number of data that can be recorded by this function is 30 000 entries counted from the beginning of program execution R20UT0522EJ0100 Rev 1 00 Page 35 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Interru
251. roducts 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 Electronics products or if you have any other inquiries
252. roject workspace radio button and click the OK button Creation of a new workspace is started The following dialog box is displayed New Project Wor k space Projects Workspace Name Empty Application Sample01 t5 Import Makefile Project Name Library Sa mple01 Directory D work HEW4 Sa mples M16C Sample01 Browse CPU family m160 v Tool chain Renesas M16G Standard F Properties oree 1 Select the target CPU family In the CPU family combo box select the target CPU family 2 Select the target toolchain In the Tool chain combo box select the target toolchain name when using the toolchain 3 Select the project type In the Project typel list box select the project type to be used In this case select Application Please refer to the manual attached to your C C compiler package about the details of the project type which can be chosen 4 Specify the workspace name and project name In the Workspace Name edit box enter the new workspace name In the Project Name edit box enter the project name When the project name is the same as the workspace name it needs not be entered In the Directory edit box enter the directory name in which the workspace will be created Click the Browse button to select a directory After a setting click the OK button R20UT0522EJ0100 Rev 1 00 Page 40 of 295 2011 03 16 RENESAS M16C R8C Simulator
253. rrupt of vector number 13 had occurred immediately before the if statement was evaluated R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 272 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 9 0 Script 9 3 7 3 isread expression Format isread address Function The value of the expression becomes true 1 immediately after a specified memory address is accessed for read to read data from memory Otherwise the expression is false 0 For example the if statement below if isread 0x800 becomes true 1 if memory at address 0x800 had been accessed for read immediately before the if statement was evaluated 9 3 7 4 iswrite expression Format iswrite address Function The value of the expression becomes true 1 immediately after a specified memory address is accessed for write to write data to memory Otherwise the expression is false 0 For example the if statement below if fiswirte 0x800 becomes true 1 if memory at address 0x800 had been accessed for write immediately before the if statement was evaluated R20UT0522EJ0100 Rev 1 00 Page 273 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 4 Method for Writing Left side Expressions Left side expressions can be written in memory addresses and macro variables of the set statement in T O script statements The following shows an example of an I O script statement using left side expressions se
254. rsnnrsrsssnnrsrsssrsessennn 144 6 9 1 Specify the Events 0 cccccecsccccecsessssscecececeesessesecececeeseaseceeeesesenssaeeeeeceesesssaeeeeeeeeseneaaees 6 10 Trace Point Setting Window ccccssssscccececsessssececececsenseaececececsessaeeeeececseseauececeeeesenenssaeeeeecs 6 10 1 Specify the Trace Event 6 10 2 Specify the Combinatorial Condition c cccccccccsessssecececeesessececececsesenssseeeeeceenenseaeees 152 6 10 3 Specify the Trace Range ccccessssccccecsesssseceeececseseseceeececeeseeceeececseseseaeeeeeeeenenseaeees 153 6 10 4 Specify the Trace Write Condition cccccccccccccceesesssceeececeesesseceeececeesesssaeeeeeeeenenssaeees 154 6 10 5 Command Button cccssccecssssecesssssecsssescesssnsecsensnsecsecsecessssnecsesssucssseeeesssneeeserensessss 154 6 10 6 Specify the Events Instruction Fetch cccccccccesscscssessescsseseescsseseescsseseescsseseesesseatees 155 6 10 7 Specify the Events Memory Access c cccccccccssesesesscsscesesscescssecesesecssesscevesesseessesecaueass 159 6 10 8 Specify the Events Bit Access c cccessessesesescsseseescesessescaseasscassacescaucaceecaucaveseaseasess 181 6 10 9 Specify the Events Interrupt c cccccccccsccccsecssesecsscescsscescssecesesecsucsscsesesesasessesecaueass 183 6 10 10 Specify the Event Combination Condition 0 cccccccccccsessessscecececeesenssceeceeceenenseaeees 185 6 10 11 Specify the write condition cccccccccesssss
255. rssenannrsenene 290 12 5 1 Options for compiler assembler and linker rrrsnnrrrrnavvvrrrnnrnrrssnnrnrrnsrvrrrsnnrsrrssnnrernnn 290 12 5 2 Not support functions cccccccccceceesessscecececseseauececececseseaseeeececseneaeeeeececseneasaeeeeeceenes 290 12 6 Options for compiler assembler and linker cccceeccecessseceeseeeeceeseececseeeeeesneeeessseeeeseeaees 291 12 6 1 When Using NUEZ r reeersornnnnrnrnrrsssensnnrnrnensseensnnrnnnensssensnnrnnnenssnenannrnnnenssnensnnrnnnensseenennnen 291 12 6 2 When Using the Assembler Package for 740 Family rrrrronnrorvrnrornrenannrrrnsrrsrensnnnnen 291 12 6 3 When Using the IAR EC Compiler EW esosrvreverervrrervevererervrsesrsveverrrseresrssesnne 292 12 6 4 When Using the IAR C Compiler EW c cccccccscccssessescscesssecseescseceescseceescseceesscseeeens 292 12 6 5 When Using the IAR C Compiler ICC c ccccccccsssssescscesesecsesscsecsesscsecsescsecseseseeaees 293 12 6 6 When Using the TASKING C Compiler EDE ccccccccsscsssesseececsenseseseeececseeeseses 294 12 6 7 When Using the TASKING C Compiler CM resrerrrververerverrerervenserervenseresvenserevsenenne 294 R20UT0522EJ0100 Rev 1 00 Page viii of viii 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Setup of Debugger R20UT0522EJ0100 Rev 1 00 Page 1 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Blank Page R20UT0522EJ0100 Rev 1 00 Page 2 of 295 2011 03 16 RENESAS
256. rtual interrupt has its asterisk shown to the left of the virtual interrupt list disappeared To reenable all virtual interrupts click the All Enable button When you ve finished setting virtual interrupts click the Close button 6 2 10 3 5 Saving a virtual interrupt Click the Save button on the dialog box A file selection dialog box appears In this dialog box specify the file name to which to save virtual interrupts If the extension is omitted the extension stm is automatically added 6 2 10 3 6 Loading a virtual interrupt Click the Load button on the dialog box A file selection dialog box appears In this dialog box specify the file name from which to load virtual interrupts The virtual interrupts loaded from the file are added to the currently set virtual interrupts R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 127 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 11 Regarding Evaluation Timings of Virtual Port Inputs Virtual Interrupts and I O Script Files Set The virtual port inputs virtual interrupts and I O script files you ve set are evaluated at the following timings 6 2 11 1 Evaluation timings 1 When program is executed continuously when come is executed 2 When program is single stepped 3 When program is overstepped 4 When control is returned 6 2 11 2 Processing when program is reset The virtual port inputs virtual interrupts and I O script files that you
257. rtual port output functions The maximum number of data that can be acquired on I O timing setting window s virtual port output or output port windows can be specified in the Init dialog box We recommend specifying a value less than 500 000 for this data count In the 740 debugger the maximum number of data is 30000 Specifying any value greater than that may cause the performance of the simulator debugger or Windows to drop R20UT0522EJ0100 Rev 1 00 Page 287 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 2 Attention of the R32C Debugger 12 2 1 Option of C Compiler Assembler Linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification Refer to 12 6 Options for compiler assembler and linker The compiler that can be used by R32C debugger e NCxx e the IAR EC Compiler e the IAR C Compiler 12 3 Attention of the M32C Debugger 12 3 1 Option of C Compiler Assembler Linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification Refer to 12 6 Options for compiler assembler and linker The compiler that can be used by M32C debugger e NCxx e the IAR EC Compiler e the IAR C Compiler R20UT0522EJ0100 Rev 1 00 Page 288
258. rupt information to a file as well as load the saved virtual interrupt information from the file R20UT0522EJ0100 Rev 1 00 Page 106 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 7 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Setup Sets up data virtual port input virtual port output or virtual interrupt Modify Changes the setup data Delete Deletes the setup data Load Loads the saved setup data or I O script file Mode Changes display mode Scale Changes display scale Color Changes display color Timer Sets the interval synchronized interrupts T O Script Files Lists registered I O script files Previous Input data Find the previous input data Next Input data Find the next input data Previous Output data Find the previous output data Next Output data Find the next output data Previous Interrupt data Find the previous interrupt data Next Interrupt data Find the next interrupt data Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 107 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows
259. s R20UT0522EJ0100 Rev 1 00 Page 77 of 295 2011 03 16 rRNRENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 7 Step7 Viewing Register The user can see all registers flags value in the Register window 5 2 7 1 Viewing Register Select Registers from the CPU submenu of the View menu The Register window is displayed The figure below shows a Register window of the debugger for M16C R8C 0 BANK Register FI 0024 OFOO 0000 0000 O6E6 0000 0718 O6c2 0220 OFOZ26F 0400 INTB OFFDOO 10000101 5 2 7 2 Setting the Register Value You can change a register flag value from this window Double click the register line to be changed The dialog is opened Enter the value to be changed Value Radix Hex v Set As Whole Register x R20UT0522EJ0100 Rev 1 00 Page 78 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 8 Step8 Viewing Memory When the label name is specified the user can view the memory contents that the label has been registered in the ASM Watch window 5 2 8 1 Viewing Memory For example to view the memory contents corresponding to __msize in word size Select ASM Watch from the Symbol submenu of the View menu open the ASM Watch window And click the ASM Watch window with the right hand mouse button and select Add from the popup menu enter __msize in the Address edit box and set Word in the Size combo box
260. s To set cycle synchronized virtual port inputs choose the Setup menus in the I O Timing Setting Window The dialog box shown below will appear Setup Dialog Select Type Set this item t Sot Virtual Port Input C Set Virtual Port Output C Set Virtual Interrupt Cancel Here choose the item Set Virtual Port Input and press the Next button Or press the Cancel button if you want cancel the setup session and close the dialog box A dialog box for setting up virtual port input timings will appear R20UT0522EJ0100 Rev 1 00 Page 108 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Setup Dialog f cresstons can be input Read Address es y here jon VECIGn rev Cane First choose Cycle in the Data Input Timing column Next enter an address for virtual port input in the Input Address column the address to which you want data to be input using a hexadecimal number Then enter the cycles at which you want the virtual port input to be started and ended for Start cycle and End cycle respectively using decimal numbers Then press the Next button Or press the Prev button here if you want to return to the previous dialog box A matrix dialog box for setting the virtual port input data will appear R20UT0522EJ0100 Rev 1 00 Page 109 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs
261. s Radix gt Sets and checks the radix for numerical input Alias Specifies and checks command alias definitions UnAlias Cancels the alias defined for a command UnAliasAll Cancels all aliases defined for commands Version VER Displays the version No Date Displays the date Echo Displays messages CD Window open R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 254 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 7Table of Script Commands 7 2 Table of Script Commands alphabetical order Command Name Short Name Contents AddPath Adds the search path Alias Specifies and checks command alias definitions Assemble A Line by line assembly Bit Checks and sets bit symbols BreakAt Sets a software breakpoint by specifying a line No BreakIn Sets a software breakpoint by specifying a function BreakMode BM Sets and checks hardware break mode CD Specifies and checks the current directory Coverage CV Specifies and displays coverage measurement Cycle CY Sets and checks cycle counting Date Displays the date DisAssemble DA Disassembles memory contents line by line Down Displays a called function DumpByte DB Displays the contents of memory in 1 byte units DumpLword DL Displays the contents of memory in 4 byte units DumpWord DW Displays the contents of memory
262. s Dialogs 6 16 2 Configuration of Ready State Duration Display Mode The ready state time display mode by task is used to display the results generated from statistical process of the time required from execution ready to transition to execution by task The statistical result is displayed within the range specified by the start marker and end marker in the MR Trace window Eley te w Mark 00 00 00 000 335 00 00 00 164 498 00 00 00 164 163 ID name Hum Max Min Ag 1 task1 11 00 00 00 013 069 00 00 00 000 013 00700 00 005 961 Z task2 3 00700 00 000 080 00700 00 000 009 00 00 00 000 032 3 task3 2 00 00 00 000 083 00700 00 000 013 00 00 00 000 048 4 task4 2 00 00 00 000 093 00 00 00 000 009 00 00 00 000 051 5 2 00 00 00 000 099 00 00 00 000 012 00 00 00 000 056 l By clicking the maximum ready time minimum ready time display area of the desired line you can search the process history of the maximum ready time minimum ready time of the task corresponding to the clicked line The search result is pointed by the indicator which moves to the target position in the MR Trace window 6 16 3 Configuration of System Call History Display Mode The system call issuance history list mode is used to list the system calls issued The system call issuance history is listed within the range spe
263. s can be selected AND All of the specified events are established AND Same Time The specified events are established at the same time OR One of the specified events is established STATE TRANSITION Established upon entering a break state in the state transition diagram Pass counts number of times passed can be specified for each event 1 255 If the specified combinatorial condition is AND Same Time no pass counts can be set fixed to 1 6 10 10 1 Select AND OR Change the Combination group to AND to specify AND for the combinatorial condition or OR to specify OR for the combinatorial condition Next check turn on an event in the event specification area that you want to use and specify a pass count for that event To alter the pass count while the event to alter is being selected click the pass count value of that event E HAW Break Points IV Enable HAW Break ADDRE CONDITION A1 000400 WRITE addr 000400 data 0032 42 0F0528 FETCH addr 0F0528 43 000000 FETCH addr 000000 44 000000 FETCH taddr 000000 A5 000000 FETCH addr 000000 46 000000 FETCH addr 000000 ODDODGEE Combination PID AND v Detail Enable Detail AND AND Same Time Save Load Set Close R20UT0522EJ0100 Rev 1 00 Page 185 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10
264. s opened The Set Context dialog is used to set the specified context register value of the specified task Set Context Data Task ID 14 Register Ry X Value 2 oo Cancel Specify the register to be changed in the Register field list box and enter the value to be set in the Value field If an expression description set in the Value field is wrong or if the specified value is outside the allowable range set for the specified register an error occurs R20UT0522EJ0100 Rev 1 00 Page 226 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 MR Trace Window The MR Trace window measures the task execution history of a program using the real time OS and displays the result graphically The debugger for R32C doesn t support this function The debugger for 740 doesn t support this function In addition to the task execution history a history of various other operations each are traced and displayed including interrupt processing task state transition and system call issuance This window is available only when a target program which uses our real time OS MRxx is downloaded For MR30 e For MR30 this window is available for V 2 00 or later version If a target program created on MR30 V 1 00 is downloaded the MR Trace window will not function and not display any data For MR308 e The history of the high speed interrupt can not record and display MR Tra
265. scale Zoom Specify the display scale Marker Start Marker Move the start marker in the display area End Marker Move the end marker in the display area Indicator Move the indicator in the display area Adjust Set cycle range between markers Change Grid Interval Change the grid interval Change Row Setting Change setting of the selected row Color Change the display color Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 199 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 13 GUI I O Window The GUI I O window allows you for port input by creating a user target system key input panel button in the window and clicking the created button And this window also allows you to implement the user target system output panel in the window GUI VO Sample pni Ede HER HE E TE Input Panel gd e You can arrange the following parts on the window Label character string Displays erases a character string specified by the user when any value is written to the specified address bit LED Changes the display color of any area when any value is written to the specified address bit Substitution for LED ON Button A virtual port input or virtual interrupt the simul
266. software breakpoint by specifying a line No BreakIn Sets a software breakpoint by specifying a function 7 1 7 Hardware Break Setting Commands Command Name Short Name Contents HardwareBreak HB Sets and checks a hardware break HardwareBreakClear HBC Clears hardware breaks HardwareBreakClearAll HBCA Clears all hardware breaks BreakMode BM Sets and checks hardware break mode 7 1 8 Real time Trace Commands Command Name Short Name Contents TracePoint TP Sets and checks a trace points TraceData TD Realtime trace data display TraceList TL Displays disassembled realtime trace data R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 252 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 7Table of Script Commands 7 1 9 Coverage Measurement Commands Command Name Short Name Contents Coverage CV Specifies and displays coverage measurement 7 1 10 Stack Utilization Monitor Command Command Name Short Name Contents StackMonitor SM Sets and checks stack utilization measurement 7 1 11 Cycle Count Monitor Command Command Name Short Name Contents Cycle CY Sets and checks cycle counting 7 1 12 Script Log File Commands Command Name Short Name Contents Script Opens and executes a script file Exit E
267. ss Count ment 6 10 3 Specify the Trace Range For the simulator debugger as many cycles as specified on the Init dialog box s Trace tab can be recorded Descriptions below are written assuming 32K cycles Trace Area Break v About 16K 16K After 0 32K Full Break Stores the 32K cycles 32K to 0 cycles to the point at which the target program stops Before Stores the 32K cycles 32K to 1 cycles to the point at which the trace point is passed About Stores the 32K cycles 16K to 16K cycles either side of the trace point After Stores the 32K cycles 0 to 32K cycles of trace data after the trace point Full Stores the 32K cycles 32K to 0 cycles of trace data after the trace starts R20UT0522EJ0100 Rev 1 00 Page 153 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 4 Specify the Trace Write Condition Conditions for cycles to be written to trace memory can be specified Realtime trace Write Condition Setting Mode Te gt Start End oe oe 2 23 7 24 oes oes Cancel Total Writes all cycles Pick up Writes only the cycles where specified condition holds true Exclude Writes only the cycles where specified condition does not hold true Also following three write modes are supported I IT Only cycles where specified event is e
268. ss F0000 By using this function you can specify that a virtual interrupt be generated when address F0000 is executed first by the program and that no virtual interrupt be generated when the address is executed next as shown below Number of times the address F0000 is executed Whether virtual interrupt is generated First Virtual interrupt is generated Second Virtual interrupt is not generated Third Virtual interrupt is generated 3 Interval synchronized interrupts A virtual interrupt can be generated at specified intervals The following shows an example of a virtual interrupt which is synchronized to a specified interval time Example where virtual interrupt of software interrupt No 21 timer AD is defined Virtual interrupt is generated every 2OOmz ee y a 0 100 200 304 400 500 600 TAQ 800 900 Execution time ma As shown above virtual interrupts Gn this case timer AO interrupt can be generated in interval synchronized R20UT0522EJ0100 Rev 1 00 Page 99 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 4 Structure of Virtual Port Input Screen 6 2 4 1 Screen structure for cycle synchronized inputs If you ve set virtual port inputs that are synchronized to machine cycles they can be displayed in one of the three modes shown below The display modes can be changed from the Mode menu 1 Chart mode displayed in units of bits The virtual port i
269. stablished _ RL Cycles from where specified event is established to where specified event is not established hen Cycles from where start event is established to where end event is established 6 10 5 Command Button The buttons on this window has the following meanings Button Function Reset Discards the contents being displayed in the window and loads contents from the simulator in which they were set Save Saves the contents set in the window to a file Load Loads event information from a file in which it was saved Set Sends the contents set in the window to the simulator Close Closes the window R20UT0522EJ0100 Rev 1 00 Page 154 of 295 2011 03 16 rRNENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 6 Specify the Events Instruction Fetch To specify an instruction fetch event change the event select dialog box s Event Type to FETCH The event is established when instruction is fetched from the specified address or any address in the specified address range 6 10 6 1 1 Instruction Fetch of Specified Address Set as below Example Instruction fetch at address 80000h addr Address ha om s Jal E R20UT0522EJ0100 Rev 1 00 Page 155 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 6 2 Instruction Fetch of Specified Address Area In Set as below Example Instruct
270. sted in the microcomputer s software manual However this differs from the actual chip in the following points The bus width queue and wait states are not considered when measuring the number of cycles The executed cycle of an interrupt sequence is not considered when measuring the number of cycles When an interrupt occurs the executed cycle of an interrupt sequence is 0 This debugger starts counting cycles immediately after a reset Cycles immediately after a reset are 0 The number of cycles needed to execute one machine instruction are added on for each instruction executed See Figure shown below Note Because the number of cycles measured by the emulator does not take into account the bus width queue wait cycles etc it includes some error when compared with the number of cycles in the actual chip The cycles count indicated for the R8C Family is the number of cycles it takes to read or write 8 bits of data to or from the memory with no wait when the instruction codes are lined up in the instruction cue buffer Therefore depending on the conditions of the instruction cue buffer etc when the program is run on the simulator debugger the results may show half the number of cycles in comparison to the results when using the emulator debugger Please keep this in mind when using these measurements If four cycles are required for the ENTER instruction cycles are added at this point in time If tue cycles are req
271. t 0x3e0 Oxla set val 10 Left side expressions may be composed of the following e Macro variable e Memory variable Each part of left side expressions are described below 9 4 1 Macro Variables Macro variables are used by adding at the beginning of each variable name e Variable names following the percent character may consist of alphanumeric characters and underscore _ However numbers cannot be used at the beginning of macro variable names e The values that can be handled by an expression that is substituted for macro variables are integers in the range of 0 to FFFFFFFF16 If negative numbers are used they are handled as 2 s complements When specifying a repeat count for the while statement use of macro variables should prove convenient set val 0 Macro variable val is assigned 0 while val while statement is repeated until val 10 waitc 10000 int 13 5 set val val 1 val is incremented by 1 9 4 2 Memory Variables This variable is used when writing values in memory The following shows a format of memory variables address data size e Expressions can be written in address Memory variables cannot be used e Specify data size as shown in the table below For byte size Borb For word 2 byte size W or w For long word 4 byte size Lorl e If specification of data size is omitted the data size is assumed to be byte long Example
272. t Cancellation Condition of Event Flag flg_mode Status TWF_ANDW Waits for all bits set in the wait bit pattern to be set AND wait TWF ANDW TWF CLR Clears the event flag to 0 when an AND wait has occurred and the task wait status has been cancelled TWF ORW Waits for any one bit set in the wait bit pattern to be set OR wait TWF ORW TWF CLR Clears the event flag to 0 when an OR wait has occurred and the task wait status has been cancelled R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS 6Windows Dialogs Page 205 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 2 2 Display the Task Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the tasks defined in the configuration are listed in the order of ID number The function of each item is as described below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Items Contents ID Task ID Name Task name Pri Priority Status 1 Task status Wupent Wake up count Actent Activated count Tmout Timeout value Flgptn Wait bit pattern of event flag Wfmode 2 Wait cancellation condition of event flag R20UT0522EJ0100 Rev 1 00 Page 206 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs e 1Task Status Display Status RUN RUNNING state RDY READY state SUS SUSP
273. t Event Status Event Type DATA ACCESS x Address Data Setting Range Not Specify i Data1 Pon Data 2 OOOO Access WRITE I mesk ooo SSCS ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F mest R20UT0522EJ0100 Rev 1 00 Page 179 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 7 3 3 Reading writing data to addresses outside the specified range Set as below Example Writing data to addresses below 7FFh 41 Set Event Status Event Type DATA ACCESS v Address Data Settine Ranee addr lt Address1 v Address1 FF Jal Address o0040F z l I Function Source File v Function v ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF mest Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Not Specify v Data 1 jooo Data 2 Joona Access WRITE v IT Mask 0000 ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF mest R20UT0522EJ0100 Rev 1 00 Page 180 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 8 Specify the Events Bit Access To specify a bit access event change the event select dialog box s Event Type to BIT SYMBOL The event is established when the specified bit at the specified address or specified bit symbol is accessed u
274. t Timer Dialog Load hterval 200 Duce i usec Vector a Close i Priority F Temp Directory C WINDOWS TEMP Refer men o a a o mer Del All __Frable a Enable a a Disable Click the Add button and the virtual interrupt you ve set is added to the list of virtual interrupts in the lower part of the dialog box When you ve finished setting virtual interrupts click the Close button R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 124 of 295 M16C R8C Simulator Debugger V 1 06 6 2 10 8 2 Deleting a virtual interrupt Click to select the virtual interrupt you want to delete from the list of virtual interrupts in the lower part of the dialog box Then click the Del button Set Timer Dialog Load Save hterval J msec add usec Vector J Close Priority J Temp Directory C WINDOWS TEMP Refer Timer Vec 21 Priol TimeL200 Imsec Vec 22 Priol Timel500 Insec Del All Enable All Enable Disable All Disable To delete all virtual interrupts click the DelAll button When you ve finished deleting virtual interrupts click the Close button R20UT0522EJ0100 Rev 1 00 2011 03 16 r8RRENESAS 6Windows Dialogs Page 125 of 295 M16C R8C Simulator Debugger V 1 06 6 2 10 3 3 Temporarily disabling a virtual interrupt Click to select the virtual interrupt you want to temporarily disable from the list of virtual
275. t lines and blank lines If you omit the name of the source file the line Nos apply to the source file displayed in active Editor Source Window Include the file attribute in the name of the source file Do not include any spaces between the line No and name of the source file 8 2 7 Character constants The specified character or character string is converted into ASCII code and processed as a constant Enclose characters in single quote marks Enclose character strings in double quote marks The character string must consist of one or two characters 16 bits max If more than two characters are specified the last two characters of the string are processed For example ABCD would be processed as CD or value 4344h 8 2 8 Operators The table below lists the operators that you can use in expressions The priority of operators is indicated by the level level 1 being the highest and level 8 the lowest If two or more operators have the same level of priority they are evaluated in order from the left of the expression Operator Function Priority level Q Brackets level 1 Hr Monadic positive monadic level 2 negative monadic logical NOT of Dyadic multiply dyadic divide level 3 Dyadic add dyadic subtract level 4 gt gt Right shift left shift level 5 amp Dyadic logical AND level 6 ll Dyadic logical OR dyadic level 7 exclusive OR lt lt gt
276. t to be used if expression statement 1 else statement 2 endi e Ifthe expression is t rue other than 0 statement 1 is executed If false 0 statement 2 is executed e You can omit the else statement If omitted and the expression is false execution jumps to the line after the endi statement e if statements can be nested up to 32 levels 8 1 4 Loop Statement while endw and Break Statement In loop statements execution of a group of statements is repeated while the expression is true The following shows the format to be used while expression statement endw e If the expression is t rue the group of statements is repeated If false the loop is exited and the statement following the endw statement is executed e You can nest while statements up to 32 levels e Use the break statement to forcibly exit a while loop If while statements are nested break exits from the inner most loop R20UT0522EJ0100 Rev 1 00 Page 258 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 8Writing Script Files 8 1 5 Comment statements You can include comments in a script file Use the following format character string e Write the statement after a semicolon You can include only spaces and tabs in front of the semicolon e Lines with comment statements are ignored when the script file is executed 8 2 Writing Expressions This debugger allows you to use express
277. ta 1234 mest R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 177 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing data 10h 3Fh to even address 400h Event Type DATA ACCESS x Address Data Setting Range dar Addressl v Address1 joo Jal Address2 000000 X Bl I Function Source File v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 0010 lt data amp 00FF lt 003F omei Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Datal lt data lt Data2 S Data 1 fo Data 2 fF Access WRIT E z I Mask 0000 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 0010 lt data lt 003F mes R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 178 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 10 7 3 2 Reading writing data to the specified address range Set as below Example Writing data to addresses ranging from 400h to 40Fh Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Adderss1 lt faddr lt Address2 v Addresst 400 7 Address2 40F 3 Bl I Function Source File v Function ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F cms Al Se
278. ta entries recorded is the number of entries specified on the Init dialog box s I O Script tab reckoning from when the program started to run e I O Script This function lets you execute virtual port input or virtual interrupt settings as a script It provides a more flexible way to define virtual port inputs and virtual interrupts than can be set from the I O Timing Setting Window Example Read a set divide by value from the timer register and generate a timer interrupt periodically R20UT0522EJ0100 Rev 1 00 Page 10 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 1Features 1 8 Time Measurement Function This function lets you measure an approximate number of cycles and the execution time spent by the program you ve run The number of cycles are represented using the values listed in the microcomputer s software manual The execution time is calculated from the cumulative number of cycles of the instructions executed and the MCU clock frequency specified on the Init dialog box s MCU tab 1 9 Stack Utilization Monitor Function This function lets you detect the maximum and minimum addresses of the stack which the target program used R20UT0522EJ0100 Rev 1 00 Page 11 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 Simulation Specifications The simulation specifications vary with the type of simulator use 2 1 Simulation Specifications for R32C 2 1 1 Operat
279. tart Marker Move the start marker in the display area End Marker Move the end marker in the display area Indicator Move the indicator in the display area Adjust Adjust range of start and end marker to full width of display area Adjust Expand Expand scale factor of display Reduce Reduce scale factor of display Trace Stop Stop measuring Trace Restart Restarts measuring Search Search for history of system calls Trace Range After Set measurement range condition to After Break Set measurement range condition to Break Value Set value Color Change display color Init Order Reset the task order on the display Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 229 of 295 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 15 2 Refer the Execution History of Task MRxx Window You can reference the task execution history in the MR Trace window You can reference the execution history statistical processing result in the MR Analyze window These windows are available for a target program using our real time OS MRxx 6 15 2 1 Select the Trace Range To measure the task execution history the real time trace function is used Click the After button or select Menu Trace Range gt After or Break button or
280. tch Local File Local Global Name Address Signed int i 000462 signed long j 00024524 struct Sample p sam 000A5E Double click the mark at the left side of pointer p sam in the Locals window to display the structure p_sam When the user refers to the members of the structure at the end of the Tutorial function it is clarified that random data is sorted in descending order R20UT0522EJ0100 Rev 1 00 Page 86 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 13 Step13 Stack Trace Function The debugger uses the information on the stack to display the names of functions in the sequence of calls that led to the function to which the program counter is currently pointing The debugger for 740 doesn t support the stack trace function 5 2 13 1 Reference the function call status Double click the S W Breakpoints column in the sort function and set a software breakpoint rabies ta long t int i j k gap gap 5 while gap gt 0 1 for k 0 k lt gaps k fort i ktgap i lt 10 i itgap I for j i gap j gt k j j gap iffalil gt alitzap t t alj ali a j tgap alitgap t else To executes the user program from the reset vector address select Reset Go from the Debug menu or click the Reset Go button on the toolbar After the break in program execution select Stack Trace from the Code submenu of the View menu to o
281. te The virtual port input output and virtual interrupt functions are processed after instruction execution is completed R20UT0522EJ0100 Rev 1 00 Page 24 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Port input output GUI input function The GUI input function refers to simulating the user target system s simple key input panel on a window The key input panel is created from the GUI input window The input panel can have the following parts placed on it Buttons Virtual port input or virtual interrupt can be performed by pressing the button The following actions can be set for the button Enter data to a specified memory address virtual port input Generate a specified virtual interrupt Generate a specified virtual interrupt and virtual port input at the same time Text Display a text string GUI output function The GUI output function refers to simulating the user target system s simple key output panel on a window The key output panel is created from the GUI output window The following parts can be arranged on this output panel Character string User specified character strings are displayed or erased when some value is written to a specified memory address or according to logic 1 or 0 in bits LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or 0 in bits Text Display a text string
282. te timer interrupts and key input interrupts in a simulated manner without having to actually generate them The following shows timings at which virtual interrupts can be generated 1 When program execution has reached a specified number of cycles 2 When the program has executed a specified address 3 Every specified time interval Virtual interrupts at the above timings can be defined from the I O Timing Setting Window Use of the I O script function the function that allows uses to define virtual port input or virtual interrupt makes it possible to write timer interrupt Differences between Virtual Interrupts and Interrupts in Actual Chip Virtual interrupts differ from interrupts in the actual chip in the following points 1 Special hardware interrupts cannot be generated as virtual interrupts Reset NMI DBC watchdog timer single step address match interrupts cannot be generated as virtual interrupts 2 If virtual interrupts of the same priority occur simultaneously If in the actual chip multiple interrupts of the same priority occur simultaneously they are resolved according to the priority levels set in hardware so that an interrupt of the highest priority is accepted For virtual interrupts however all interrupts belonging to one interrupt type e g peripheral I O interrupt are handled as having the same priority Therefore if virtual interrupts of the same priority occur simultaneously the order in which they are acc
283. tement starts from a semicolon e A range of statement from the semicolon till the end of the line is handled as a comment e Lines of comment statements are ignored when executing I O scripts R20UT0522EJ0100 Rev 1 00 Page 269 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 91 0 Script 9 3 Method for Writing Right side Expressions Right side expressions can be used to write the number of machine instructions or cycles vector numbers priority levels input values conditional expressions or pass counts in I O script statements as well as write expressions in if and while statements The following shows an example of an I O script statement written using right side expressions waitc LABEL waiti 0x800 20 if Ox1ff 0x30 while isfetch 0xf0000 Right side expressions may be composed of the following e Constant e Symbol and label e Macro variable e Memory variable e Character constant e Operator e 6 isfetch Hisint Hisread iswrite Each part of right side expressions are described below 9 3 1 Constants Binary decimal and hexadecimal numbers can be input The radix of numerals is discriminated by a symbol added at the beginning or end of a numeric value Hexadecimal Decimal Binary Beginning 0x 0X None Example 0xAB24 1234 10010 9 3 2 Symbols and Labels The global symbols and global labels defined in the target program can be used e Symbo
284. ter the directory and file names in which you want the data you ve set to be saved The saved file can be loaded into the simulator debugger back again by using the Load menus in the I O Timing Setting window When you ve input a file name press the Save button Thus you ve finished setting the virtual interrupt synchronized virtual port inputs R20UT0522EJ0100 Rev 1 00 Page 115 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 9 Setting Virtual Port Outputs The Virtual Port Output function allows data values written to some memory address by a program to be recorded along with cycles at which data was written The recorded data can be displayed for verification in graphic or numeric form ATTENTION e The number of data entries recorded is the number of entries specified on the Init dialog box s I O Scrip tab reckoning from when the program started to run When reexecuted the previous data is cleared e Up to 200 instances of virtual port output can be set However if you are using the Output Port Window the number of virtual port outputs that can be set is limited to 199 6 2 9 1 Setting Virtual Port Outputs To set virtual port outputs choose the Setup menus in the I O Timing Setting Window The dialog box shown below will appear Select this item Setup Dialog Here choose the item Set Virtual Port Output and press the Next button Or press the Cancel button if
285. ters When a virtual interrupt is generated PD38SIM looks up the Interrupt Control Register s interrupt control bit as it simulates virtual interrupt generation If a virtual interrupt occurs when interrupt generation is disabled the interrupt request is saved inside the simulator so that a virtual interrupt is generated after interrupt generation is enabled However since the interrupt request bit is not simulated the interrupt request bit is not set even when an interrupt request is saved Nor can the virtual interrupts that have been saved be deleted by clearing the interrupt request bit The virtual interrupts saved in the simulator are deleted when the device is reset Note that you can use the I O script function to write a statement to the effect that the interrupt request bit is set when an interrupt occurs Reset interrupts cannot be generated There are following two methods to set virtual interrupts 1 By using the I O Timing Setting Window 2 By using the I O script function I O Script Function This function allows you to write virtual port input and virtual interrupt settings to a file in script form Therefore it provides a more flexible way to define virtual port inputs and virtual interrupts than can be set from the I O Timing Setting Window Specifically this includes for example reading the divide by N ratios you ve set in the timer register and generating a timer interrupt periodically Note The virtual port inp
286. tes a source line return ReturnInstruction RETI Executes an instruction return Reset s Resets the target MCU R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 250 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 7Table of Script Commands 7 1 2 File Operation Commands Command Name Short Name Contents Load L Downloads the target program LoadHex LH Downloads an Intel HEX format file LoadMot LM Downloads a Motorola S format file LoadSymbol LS Loads source line ASM symbol information Loadleee LI Downloads IEEE 695 absolute format files Reload Re downloads the target program UploadHex UH Outputs data to an Intel HEX format file UploadMot UM Outputs data to a Motorola S format file 7 1 3 Register Operation Commands Command Name Short Name Contents Register R Checks and sets a register value 7 1 4 Memory Operation Commands Command Name Short Name Contents DumpByte DB Displays the contents of memory in 1 byte units DumpWord DW Displays the contents of memory in 2 byte units DumpLword DL Displays the contents of memory in 4 byte units SetMemoryByte MB Checks and changes memory contents in 1 byte units SetMemoryWord MW Checks and changes memory contents in 2 byte units SetMemoryLword ML Checks and changes memory contents in 4 byte units FillByte FB Fills a memory block with th
287. the Next button R20UT0522EJ0100 Rev 1 00 Page 46 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 2 3 Step3 Setting the Configuration File Name Set the configuration file name for each of the all selected target The configuration file saves the state of High performance Embedded Workshop except for the target emulator simulator Target name Configuration name Debue Mi 6G R8G PC7501 Emulator Detail options Hem Setting Modity The default name is already set If it is not necessary to change please click the next button as it is This is the end of the emulator settings Exit the Project Generator following the instructions on the screen And the dialog for the setup of a debugger is also displayed at this time If preparation of an emulator is completed set up the debugger in this dialog box and connect with an emulator R20UT0522EJ0100 Rev 1 00 Page 47 of 295 2011 03 16 r8RNENESAS M16C R8C Simulator Debugger V 1 06 3Preparation before Use 3 2 2 4 Step4 Registering the Load modules to be downloaded Finally register the load module file to be used Select Debug Settings from the Debug menu to open the Debug Settings dialog box Debug Settings DoSample0i 1 Select the product name to SessionM16C_R8C_PC7501_ Emulator z Target Options Target m 66 R8C PC7501 Emulator v Default Debue Format
288. the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of cycle handler StaAddr Starting address of cycle handler name Name of cycle handler interval Interrupt interval count Interrupt count Status Activity status of cycle start handler e The following are displayed in the Status area TCY_ON Cycle handler enabled TCY_OFF Cycle handler disabled R20UT0522EJ0100 Rev 1 00 Page 220 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 9 2 Display the Cycle Handler Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the cycle handlers defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of cycle handler Name Name of cycle handler Cycphs The activation phase by the millisecond Cyctim The activation cycle time by the millisecond Tmout The amount of time by the millisecond remaining before the cyclic handler s next activation time Status Activity status of cycle start handler The following are displayed in the Status area TCYC_STA Cycle handler is in an ope
289. the stored debugging information is reused the next time you download the same load module it can be downloaded faster This method is suitable when it takes so long time to download the debugging information because the PC has less memory against the load module file size Notes e If the load module size is large the on memory method may be inefficient because it requires a very large amount of time for downloading In such a case select the on demand method e In the on demand method a folder in which to store a reusable temporary file is created in the folder that contains the downloaded load module This folder is named after the load module name by the word INDEX_ to it If the load module name is sample abs for example the folder name is INDEX_sample This folder is not R20UT0522EJ0100 Rev 1 00 Page 54 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 deleted even after quitting the debugger 4 1 2 3 Specify whether to display the instruction format specifier Specify whether to display the instruction format specifier in the disassembled display The debugger for 740 doesn t support this function v Display the instruction format specifier in disassembly Select the above check box when you display the instruction format specifier This specification can only be set or changed when you start the debugger 4 1 2 4 To treat size of enumeration type as 1 byte You can specify whether your debugger
290. ther than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 6 5 2 Command Execution Examples The following shows examples of entering commands depending on the product e The debugger for R82C gt ICCR32C r filel c lt Enter gt gt ICCR32C r file2 c lt Enter gt gt XLINK o filename 695 f Inkr32c xcl filel file2 lt Enter gt e The debugger for M32C gt ICCMC80 r filel c lt Enter gt gt ICCMC80 r file2 c lt Enter gt gt XLINK o filename 695 f lnkm80 xcl filel file2 lt Enter gt e The debugger for M16C R8C gt ICCM16C r filel c lt Enter gt gt ICCM16C r file2 c lt Enter gt gt XLINK o filename 695 f Inkml6c xcl filel file2 lt Enter gt e The debugger for 740 gt ICC740 r filel c lt Enter gt gt ICC740 r file2 c lt Enter gt gt XLINK o filename 695 f 1nk7400t xcl filel file2 lt Enter gt The XCL file name varies depending on the product and memory model For details see the ICCxxxx manual R20UT0522EJ0100 Rev 1 00 Page 293 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 12Attention 12 6 6 When Using the TASKING C Compiler EDE Please specify the project setting by following process 1 Select menu EDE gt C Compiler Option gt Project Options The M16C C Compiler Options Project Namel dialog opens Please set as follows by this dialog Optimeze Tab Please sp
291. timer interrupts or key input interrupts in a simulated manner without having to actually generate them There are following three types of virtual interrupts 1 Cycle synchronized interrupt A specified virtual interrupt can be generated when program execution has reached a specified number of cycles The diagram below shows an example of a virtual interrupt that is synchronized to machine cycles Example where virtual interrupt of software interrupt No 21 timer AD is defined Virtual interrupt Virtual interrupt Virtual mterrupt is generated in is generated im the is generated in the 3 000th cycle 6 000th cycle the 9 000th cycle l 11 1000 2000 3000 4000 5000 6000 7000 8000 3000 10000 Number of cycles executed As shown above virtual interrupts in this case timer AO interrupt can be generated in any desired cycle R20UT0522EJ0100 Rev 1 00 Page 98 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 2 Executed address synchronized interrupt Virtual interrupts can be generated when the program has executed a specified address The diagram below shows an example of a virtual interrupt that is synchronized to executed addresses funci J J Virtual interrupt is generated Processing when program execution has moved inte address Foood As shown above a specified virtual interrupt can be generated when program execution has moved into addre
292. ting Window Specifically this includes for example reading the divide by N ratios you ve set in the timer register and generating a timer interrupt periodically Note The virtual port input output and virtual interrupt functions are processed after instruction execution is completed R20UT0522EJ0100 Rev 1 00 Page 17 of 295 2011 03 16 2tENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Port input output GUI input function The GUI input function refers to simulating the user target system s simple key input panel on a window The key input panel is created from the GUI input window The input panel can have the following parts placed on it Buttons Virtual port input or virtual interrupt can be performed by pressing the button The following actions can be set for the button Enter data to a specified memory address virtual port input Generate a specified virtual interrupt Generate a specified virtual interrupt and virtual port input at the same time Text Display a text string GUI output function The GUI output function refers to simulating the user target system s simple key output panel on a window The key output panel is created from the GUI output window The following parts can be arranged on this output panel Character string User specified character strings are displayed or erased when some value is written to a specified memory address or according to logic
293. tions as RAM At startup memory is allocated for the entire area e Memory Structure and Initial Values Immediately after Starting The memory is set up as follows immediately after starting the debugger 0000h to FFFFh Filled with 00h R20UT0522EJ0100 Rev 1 00 Page 34 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 4 4 I O e SFR No peripheral I Os such as timers and serial I O in the actual chip are supported Only the CPU core is supported Consequently the 740 debugger handles the SFR area to which peripheral I Os are connected simply as RAM However the CPU Mode Register s stack page select bit and the Interrupt Control Register each are handled as SFR For details about each register location refer to the user s manual of your chip When the stack page select bit is set to 1 one page of RAM can be used as a stack area When a bit of the Interrupt Control Register is set to 1 the corresponding interrupt of that bit is enabled Moreover a method is provided that allows you to accomplish interrupts e g a timer interrupt and data input to SRF or other memory by simulating these operations without having to actually execute them For details about this method refer to the virtual port input output and virtual interrupt functions described later in this manual e I O Script Virtual Port Input Function This function defines changes of the data that is input from exte
294. ton in the Task Trace window Or select Trace Restart from popup menu by right clicking on the window R20UT0522EJ0100 Rev 1 00 Page 244 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 17 2 2 Refer the Execution History of Task You can reference task trace transition in the Task Trace window Han Haap vy Mark 00 00 00 000 442 00 00 01 847 055 00 00 01 846 612 Indicator 00 00 00 940 805 Scale 6 939931 Grid 00 00 01 850 572 Area Break ID name l D AHCB ENT task2 task3 task4 task5 task6 l l l U task task8 task task10 nknown jualan 00 0 0 wo BR o nJ ae ae By moving the mouse to the information displayed in the window a window of the following example is opened showing the detailed information 6 17 2 2 1 Change the display magnification Click the Expand button or Reduce button in the tool bar Or select Expand or Reduce from popup menu by right clicking on the window The display is expanded or reduced using the left corner of the graph area as the radix point By default the display is expanded or reduced with display scale of 1 5 The display scale appears in the Scale field in the status bar The default expansion reduction scale is 1 5 To change the scale select Value from popup menu by right clicking on the window The
295. tput results in chart mode in units of bits This means that memory bits are in the state of logic 1 me This means that memory bits are in the state of logic 0 The short white lines appearing at the bottom of the output data display area indicate points at which data are output To reference data values move the mouse cursor into this area and the value and the cycle count of the data at which the cursor is positioned will be displayed in the cycle count display area e Cycle count display area displays cycle counts R20UT0522EJ0100 Rev 1 00 Page 103 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 2 Graphic mode displayed in units of bytes Virtual port output results are displayed in graphic mode in units of bytes Output cycle cycle Address 10484290 4620 495052895310 594062 i i i i ycle count OCOC f S display area nininini nimiin B E ETE EEE n Address display area Output data display area e Address display area displays the address to be monitored for virtual port output e Output data display area displays the data as virtual port output results in graphic mode in units of bytes The peaks in this graph represent data values derived by equally dividing the height of the data displaying area by 255 maximum value of 1 byte data The short white lines appearing at the bottom of the output data display area indicate points at which data are output To reference data values m
296. tring of the target to connect After the session name is selected the dialog box for setting the debugger is displayed and the simulator will be connected When the dialog box is not displayed select Connect from the Debug menu TERKO 3 3 2 Ending the Simulator The simulator can be exited by using the following methods 1 Selecting the Disconnect Select Disconnect from the Debug menu BOB 2 BCR 2 Selecting the DefaultSession Select the DefaultSession in the list box that was used at the time of simulator connection 3 Exiting the High performance Embedded Workshop Select Exit from the File menu High performance Embedded Workshop will be ended The message box that asks whether to save a session will be displayed when an simulator is exited If necessary to save it click the Yes button If not necessary click the No button R20UT0522EJ0100 Rev 1 00 Page 50 of 295 2011 03 16 ztENESAS M16C R8C Simulator Debugger V 1 06 4 Setup the Debugger 4 1 Init Dialog The Init dialog box is provided for setting the items that need to be set when the debugger starts up The contents set from this dialog box are also effective the next time the debugger starts The data set in this dialog remains effective for the next start hit M16G RBC Simulator MCU Debugging Information Script Trace 1 0 Script MOU Ml c x mcu Refer Time Count Resource MCU Clock fio MHz fi
297. truction execution R20UT0522EJ0100 Rev 1 00 Page 12 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Target program execution time measurement The target program execution time measurement is calculated from the number of cycles described above and the MCU clock and divide by ratio specified on the MCU tab of the Init dialog box Note Because the simulator s execution time measurement is calculated using the number of cycles described above it includes some error when compared with the actual chip s execution time e STOP WAIT BRK2 Executed as an NOP instruction Other instructions operate the same as those of the actual MCU e INT INTO UND BRK As with the actual MCU these instructions generate interrupts The INTO instruction only generates an interrupt when the O flag is 1 2 1 2 Resetting e The SFR area is nonexistent in the debugger so the initialization as in the actual chip is not performed e The cycle count is initialized to 0 Resetting is performed in the same way as the actual MCU A reset is also performed when the debugger starts The value FFFFO000h is set in the reset vector FFFFFFFCh to FFFFFFFFh immediately after starting The program counter is therefore set to FFFF0000h immediately after the debugger starts R20UT0522EJ0100 Rev 1 00 Page 13 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications 2 1 3 Mem
298. tual input port synchronized to virtual interrupts By using this function you can perform an operation where data OxFF is input to memory address 3E1 when the virtual interrupt occurs first and data OxFE is input to said memory address when the virtual interrupt occurs next time Number of times a virtual interrupt is generated Data input to address 3E1 First OxFF Second OxFE Third OxFD R20UT0522EJ0100 Rev 1 00 2011 03 16 RENESAS Page 97 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 2 2 Virtual Port Output Virtual Port Output is a function that when data is written to some memory address by the program allows the written data value to be recorded along with the cycle in which the data was written The recorded data can be displayed for your reference in chart numeric or graphic mode The number of data entries recorded is the number of entries specified on the Init dialog box s I O Scrip tab reckoning from when the program started to run For example if data is written to port 0 address 3E0 by executing a program like the one shown below oragma ADDRESS port 30H char porto out_portichar data port data Data is output to port O the data written to address 3E0 is recorded along with the cycle count in which the data was written 6 2 3 Virtual Interrupt This function defines interrupt generation Using this function you can generate
299. tus Display Mode rrrrnnrvrrrrnnrrrrsrnnvrrrnrrrrrrennnn 236 6 16 2 Configuration of Ready State Duration Display Mode rnrnrnnnrvrrrsnnrnrrssnnrnrrnrrrrsrennnn 237 6 16 3 Configuration of System Call History Display Mode rrrnvrrrnnnrvrrrrnnrrrrssnnrnrrnrrvnsrennnn 237 6 16 4 Extended Menus creon inisa estou ide N EE A E eae des teeene 238 6 16 5 Analyze the Execution History of Task rsnorrrrnnrrrnronnrrrrrsnnrnrrnsrrrrrrnnrrrrsrnnrsrrssrsrsrennnn 238 6 17 Task Trac Window uarnsninssasnisis oeecs tau ddeuenes ceneseas sds cuoia ceacsaesddaeneesacoessuuadscnaesevanveouageieaass 241 6 17 1 Extended Menus 0 cccccccscececsssensececececeeseneececeeeceeseaeaececeeeceesaeaeceeecesneseeaeceeeeneneteaaes 242 6 17 2 Refer the Execution History of Task Taskxx Window 243 6 18 Task Analyze Window cccccccccccceessssscececececsesssaececececeenssseceeececsesnsaesecececeeneaeseeeeecsenensaaeeeeecs 248 6 18 1 Extended Mentiss siccsiccectnds cccciiss edie acc Gh bes E nan edenb anuddbareencdacsegeiuetons 248 6 18 2 Analyze the Execution History of Task rererrrornrororrrrrrrrnsnnrnrrrnrrrensnnrnnnrnssrrsennrnnnensnne 249 7 Table of Script Commands 250 7 1 Table of Script Commands classified by function errrvrrverorvervenervervevesrverveverversevervesveverveseer 250 7 11 Execution Commands 2 22 2c52scesedecssendsehi i osceeeaaicdensdecceavechex tea bedersendeheddvstenrcerstctacdesbcaesses 250 7 1 2 File Operatio
300. uired for the MOY instruction cycles are added at this point in time ENTER instruction Moy instruction 4 Execution 0 1 2 d 4 5 6 T g 9 crcl In the above example no cycles are added while the ENTER or MOV instruction is being executed The cycles required for each instruction are added after instruction execution Cycle Accuracy Mode The bus width the state of instruction queues and the software wait for instructions are considered when measuring the number of cycles The number of cycles however still might not match the result on the actual chip To calculate the exact number of execution cycles we recommend that you use the full spec emulator or the compact emulator R20UT0522EJ0100 Rev 1 00 Page 26 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Target program execution time measurement The target program execution time measurement is calculated from the number of cycles described above and the MCU clock and divide by ratio specified on the MCU tab of the Init dialog box Note Because the simulator s execution time measurement is calculated using the number of cycles described above it includes some error when compared with the actual chip s execution time e WAIT Executed as an NOP instruction Other instructions operate the same as those of the actual MCU e INT INTO UND BRK As with the actual MCU these instructions generate interrupts The
301. ulator Debugger V 1 06 6Windows Dialogs 6 16 4 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Run Time CPU occupancy status display mode Rdy gt Run Ready state duration display mode System Call System call history display mode Pick Up System Call Extract specified system calls display mode Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 6 16 5 Analyze the Execution History of Task 6 16 5 1 Analyze the Execution History of Task You can reference the execution history statistical processing in the MR Analyze window The MR Analyze window functions together with the MR Trace window If the MR Trace window is not open or the MR Trace window does not show any data the MR Analyze window will not function The execution history statistical processing function allows you to reference the following topics 6 16 5 1 1 Refer the CPU Occupation State Click the Run Time button in the tool bar Or select Menu Run Timel The MR Analyze window changes to the CPU occupation state display mode MR Analyze EEE Mark 00 00 00 000 335 00 00 00 164 498 00 00 00 164 163 VEC table ID name Num Max Run Time Min Run Time Avg Run Time Total Run Time Ratio 0 25 50 7510
302. ut output and virtual interrupt functions are processed after instruction execution is completed R20UT0522EJ0100 Rev 1 00 Page 36 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications e Port input output GUI input function The GUI input function refers to simulating the user target system s simple key input panel on a window The key input panel is created from the GUI input window The input panel can have the following parts placed on it Buttons Virtual port input or virtual interrupt can be performed by pressing the button The following actions can be set for the button Enter data to a specified memory address virtual port input Generate a specified virtual interrupt Generate a specified virtual interrupt and virtual port input at the same time Text Display a text string GUI output function The GUI output function refers to simulating the user target system s simple key output panel on a window The key output panel is created from the GUI output window The following parts can be arranged on this output panel Character string User specified character strings are displayed or erased when some value is written to a specified memory address or according to logic 1 or 0 in bits LED LEDs are lit when some value is written to a specified memory address or according to logic 1 or 0 in bits Text Display a text string 2 4 5 Cycle Count The CYcle CY Command
303. ution select Halt Program from the Debug menu or the Halt button on the toolbar R20UT0522EJ0100 Rev 1 00 Page 85 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 5Tutorial 5 2 12 Step12 Displaying Local Variables The user can display local variables in a function using the C Watch window If the downloaded program is the program generated by the assembler package for 740 family you can not watch variables in C watch window 5 2 12 1 Displaying Local Variables For example we will examine the local variables in the tutorial function which declares three local variables i j and p_sam Select C Watch from the Symbol submenu of the View menu The C Watch window is displayed By default C watch window has four tabs as following e Watch tab Only the variable which the user registered is displayed e Local tab All the local variables that can be referred to by the scope in which the the PC exists are displayed If a scope is changed by program execution the contents of the Local tab will also change e File Local tab All the file local variables of the file scope in which the PC exists are displayed If a file scope is changed by program execution the contents of the File Locall tab will also change e Global tab All the global variables currently used by the downloaded program are displayed Please choose the Local tab when you display a local variable CM x Wa
304. v 1 00 Page 216 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 14 7 2 Display the Mailbox Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the mail boxes defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of mailbox Mbxatr Attribute of each mailbox Mailbox Queue Wait ID No and task name of tasks waiting for messages Mailbox Queue Message The messages stored in the mailbox e The following are displayed in the Mbxatr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order TA_MFIFO Message queue is in FIFO order TA_MPRI Message queue is in message priority order e When a task connected to the mail box queue is in the state of waiting with timeout enabled waiting in trev_mbx a string tmo which indicates the state of timeout enabled is appended to a string displayed in the Mailbox Queue Wait field When a task connected to the mail box queue is in the state of forced waiting Double waiting a string s which indicates the state of double waiting is appended to a string displayed in the Mailbox Queue Wait field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 s Display wh
305. v 1 00 Page i of viii 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Active X Microsoft MS DOS Visual Basic Visual C Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries IBM and AT are registered trademarks of International Business Machines Corporation Intel and Pentium are registered trademarks of Intel Corporation Adobe and Acrobat are registered trademarks of Adobe Systems Incorporated All other brand and product names are trademarks registered trademarks or service marks of their respective holders For inquiries about the contents of this document or product email to your local distributor Renesas Tools Homepage http www renesas com en tools R20UT0522EJ0100 Rev 1 00 Page ii of viii 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 Setup of Debugger 1 Features 3 1 1 Real Time RAM Monitor Function rrrororvrorsoosonnrnrrrnerrerennrnrrrnssresennnnnrnnssrsnennennrnnnenssnesennrnnsenssee 3 1 1 1 RAM Monitor Area r rrrerrrennnnrrrnrrrsnensnnrrrnsnnsrensnnrnnnsnssnensnnrnnssnsssnnsnannnsnnssennenannrvenssnssensnnnsen 3 1 1 2 Sampling Period vce e cseccceedsecdsvesseecoeesecesivacteasoceceedebensesesscuesaevectesaddanseeedeadid eesteasovesneesiassbieest 4 1 13 Related Windows ei2scdaccesceeacesiskcevecuePausigenee cease raesedaewen vouueradeeucetocouvasaderaenedivwen Garanti 4 1 2 Break Functions
306. ve set are reevaluated Namely when a program is reset the virtual port inputs virtual interrupts and I O script files you ve set are set newly again 6 2 11 3 Processing when I O Window is closed If the I O Window is closed the virtual port inputs virtual interrupts and I O script files that you ve set are not evaluated This case is the same as when their settings have been deleted R20UT0522EJ0100 Rev 1 00 Page 128 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 3 Output Port Window The Output Port Window is used to display the data to be output to ports on a window or output the data to a file The debugger for 740 doesn t support this function It also allows you to verify the data that is output to UARTs by the Printf function Output Destination Format Window ASCII display Hexadecimal display File ASCII output Hexadecimal output Binary output Not including data output for the Printf function however s OutputPort Gal Ca ER Os BR Port UART1 Log File paige aap ap ABDCDEFGHIT This is test ABDCDEFGHIT This is test ABDCDEFGHIJ This is test ABDCDEFGHIT This is test ABDCDEFGHIT 1 MD 100 oy On 4 Co 0 e For the output port you can select any port or UARTO or UART1 which is the output destination for the Printf function For details about the Printf function output destinatio
307. ware interrupts cannot be generated as virtual interrupts Reset NMI DBC watchdog timer single step address match interrupts cannot be generated as virtual interrupts 2 High Speed interrupt cannot be generated as virtual interrupts 3 If virtual interrupts of the same priority occur simultaneously If in the actual chip multiple interrupts of the same priority occur simultaneously they are resolved according to the priority levels set in hardware so that an interrupt of the highest priority is accepted For virtual interrupts however all interrupts belonging to one interrupt type e g peripheral I O interrupt are handled as having the same priority Therefore if virtual interrupts of the same priority occur simultaneously the order in which they are accepted is indeterminate There are following two methods to set virtual interrupts 1 By using the I O Timing Setting Window 2 By using the I O script function R20UT0522EJ0100 Rev 1 00 Page 23 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 2Simulation Specifications With either method the virtual interrupts are subject to the following limitations 1 2 Virtual interrupts set by using the I O Timing Setting Window Regarding interrupt control for virtual interrupts generated Each Interrupt Control Register s interrupt request bit is not set to 1 The priority levels set in each Interrupt Control Register s interrupt priority level select bit ar
308. ws the file name of the currently displayed source file 6 Referenced cycle Shows the currently referenced cycle 7 Referenced address Shows the address corresponding to the currently referenced cycle 8 Referenced time Shows the time information corresponding to the currently referenced cycle Other display areas are the same as in bus mode R20UT0522EJ0100 Rev 1 00 Page 195 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs 6 11 5 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function BUS Display the information of BUS mode DIS Display the information of Disassemble mode SRC Display the information of Source mode DATA Display the information of Data access mode View Cycle Changes the displayed position by specifying a cycle Address Changes the displayed position by searching an address Source Display a selected source file Time Absolute Time Shows elapsed time from the time the program started running up to now in terms of absolute time Differences Shows a differential time from the immediately preceding displayed cycle Relative Time Shows a relative time from the currently selected cycle Trace Forward Changes the direction of search to forward direction Backward Changes the direction of search to reverse direction Step Searches in Step
309. x Address Data Setting Range dar Addressl v Address1 joo Jal Address2 000000 X Bl I Function Source File v Function F ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data 1234 orei Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range data Datal Data 1 1234 Data 2 ooo ccess WRIT E z IV Mask FFFF ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 data 1234 mest R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 170 of 295 M16C R8C Simulator Debugger V 1 06 6Windows Dialogs Example Writing data 10h 3Fh to even address 400h Event Type DATA ACCESS x Address Data Setting Range dar Addressl v Address1 joo Jal Address2 000000 X Bl I Function Source File v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 0010 lt data amp 00FF lt 003F omei Al Set Event Status Event Type DATA ACCESS x Address Data Setting Range Datal lt data lt Data2 S Data 1 fo Data 2 fF Access WRIT E z I Mask 0000 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 0010 lt data lt 003F mes R20UT0522EJ0100 Rev 1 00 2011 03 16 2tENESAS Page 171 of 295 M1
310. xits the script file Wait Waits for an event to occur before command input Pause Waits for user input Sleep Halts for user input until the specified time has elapsed Logon Outputs the screen display to a log file Logoff Stops the output of the screen display to a log file Exec Executes external application 7 1 13 Program Display Commands Command Name Short Name Contents Func Checks function names and displays the contents of functions Up Displays the calling function Down Displays a called function Where Displays a function call status Path Sets and checks the search path AddPath Adds the search path File Checks a filename and displays the contents of that file R20UT0522EJ0100 Rev 1 00 2011 03 16 Page 253 of 295 2tENESAS M16C R8C Simulator Debugger V 1 06 7 1 14 Map Commands 7Table of Script Commands Command Name Short Name Contents Map Checks and sets mapping data 7 1 15 C Language Debugging Commands Command Name Contents Short Name Print Check value of specified C variable expression Set Set specified data in specified C variable expression 7 1 16 Real time OS Command Command Name Short Name Contents MR Displays status of realtime OS MRxx 7 1 17 Utility Commands Command Name Short Name Content
311. y the label address is also available of the execution task ID storage area in the PID Address field specify the size of the execution task ID storage area in the Size list box If this information is not set correctly you cannot use the Task Trace window 2 Specify the task start address expression in the Task Entry field Describe the expression in the format in accordance with the description rules Use a macro variable TaskID in the address where the task ID number is supposed to assign If this information is not set correctly the task name is not displayed in the Task Trace window 3 Click the OK button The Task Trace window is opened On debuger for 740 simply by clicking the default button the OSEK OS information is set Once the real time OS information is set in this dialog the information becomes effective from the next time To change the setting data select RTOS from popup menu by right clicking on the window The RTOS Information dialog is re opened R20UT0522EJ0100 Rev 1 00 Page 243 of 295 2011 03 16 RENESAS M16C R8C Simulator Debugger V 1 06 6Windows Dialogs ATTENTION When specifying WORD in the access size when performing PID setting in the RTOS Information dialog you must observe the following limits If these conditions are not met the system does not operate normally e The PID information storage area is allocated to an even address e The PID information storage area is allocated to an a
312. ycle display area Shows trace cycles Double click here to bring up a dialog box to change the displayed cycle 2 Label display area Shows labels corresponding to address bus information Double click here to bring up a dialog box to search for addresses 3 Bus information display area The content displayed here differs depending on the MCU or simulator system used 6 11 6 Display of bus information on the Simulator Debugger 4 Time information display area Shows time information of trace measurement result One of the following three modes can be selected from the menu Absolute Time Shows an elapsed time from the time the program started running up to now in terms of absolute time default Differences Shows a differential time from the immediately preceding cycle Relative Time Shows a relative time from the selected cycle Note however that this mode changes to the absolute time display mode when the trace measurement result is updated 5 Acquired range of trace measurement result Shows the currently acquired range of trace measurement result 6 Trace measurement range Shows the currently set range of trace measurement 7 First line cycle Shows the cycle of the first line displayed 8 First line address Shows the address of the first line displayed 9 First line time First line time Shows the time information of the first line displayed 10 Window splitting box Double clicking this box splits the window into parts

Download Pdf Manuals

image

Related Search

Related Contents

CRU RAX212-QR  Instruções de operação compactas Servocontrolador multi  取扱説明書(保  VAM - K & S Antriebssysteme GmbH & Co. KG  User Manual - ADFWeb.com      Descargar Póliza de Garantía  Sun Enterprise 3500–6500 Servers Just the Facts  NVD mini  

Copyright © All rights reserved.
Failed to retrieve file