Introduction Purpose This training module provides an overview of debugging features in H8S Simulator. Objectives Understand how to use the Simulator.

Similar documents
Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

Introduction Purpose This training course describes the configuration and session features of the High-performance Embedded Workshop (HEW), a key tool

Introduction Purpose The course describes library configuration and usage in the High Performance Embedded Workshop (HEW), which speeds development of

Introduction Purpose This course explains how to use Mapview, a utility program for the Highperformance Embedded Workshop (HEW) development environmen

LC304_manual.ai

Microsoft Word - Win-Outlook.docx


2

H8000操作編

2

2

2

2

Z7000操作編_本文.indb


Introduction Purpose This training course provides an overview of the High-performance Embedded Workshop (HEW), a key tool for developing software for

2

I117 II I117 PROGRAMMING PRACTICE II SOFTWARE DEVELOPMENT ENV. 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara

+ -


32C2100操作編ブック.indb

RX600 & RX200シリーズ アプリケーションノート RX用仮想EEPROM

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

RR-US470 (RQCA1588).indd

Contents Logging in 3-14 Downloading files from e-ijlp 15 Submitting files on e-ijlp Sending messages to instructors Setting up automatic

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

C FGIH C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

H2000操作編ブック.indb

32_42H3000操作編ブック.indb

How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

BS・110度CSデジタルハイビジョンチューナー P-TU1000JS取扱説明書


2

19_22_26R9000操作編ブック.indb


AN 100: ISPを使用するためのガイドライン




取扱説明書_KX-PW100CL

LC-24_22_19K30.indb



NSR-500 Software Update Installation Procedures

取説_KX-PW38CL_PW48CL


2 3

,,,,., C Java,,.,,.,., ,,.,, i

fx-9860G Manager PLUS_J

VE-GP32DL_DW_ZA

学部ゼミ新規申請方法 (Blackboard 9.1) Seminar Application Method for Undergraduate Seminar Courses ゼミ新規申請は Blackboard で受け付けます! 次セメスターにゼミ履修を希望する学生は 下記マニュアルに従ってゼミ

*Ł\”ƒ‚ä(CV03)

. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr


How to read the marks and remarks used in this parts book. Section 1 : Explanation of Code Use In MRK Column OO : Interchangeable between the new part

0 C C C C C C

MOTIF XF 取扱説明書

323742RH500操作編.indb

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

ZV500操作編_本文.indb

GP05取説.indb

Actual ESS Adapterの使用について

;y ;y ;; yy ;y;; yy y;y;y;y ;y; ;; yy ; y Portable CD player Operating Instructions RQT5364-S

Microsoft PowerPoint - Ritsu-Mate出願操作マニュアル(学部英語版) _STEP4.pptx


0 C C C C C C C

C H H H C H H H C C CUTION:These telephones are for use in Japan only. They cannot be used in other countries because of differences in voltages, tele

取説_VE-PV11L(応用編)

% + RP-BC30 BATTERY CHARGER STAND K -! # % $ $ % % # $ $ $ %

*Ł\”ƒ‚ä(DCH800)

Complex Lab – Operating Systems - Graphical Console

Microsoft Word - Meta70_Preferences.doc


12_11B-5-00-omote※トンボ付き.indd

C-720 Ultra Zoom 取扱説明書

VE-GD21DL_DW_ZB

Z3500操作編ブック.indb


Ver.1 1/17/2003 2

FTDI Driver Error and Recovery Procedure Check FTDI driver operation Rev :OK, Rev :NG, Rev :NG May 11, 2017 CHECK FTDI DRIVER

PFQX2227_ZA

ストラドプロシージャの呼び出し方

untitled

TH-42PAS10 TH-37PAS10 TQBA0286

NSR-500 Installation Guide

WARNING To reduce the risk of fire or electric shock,do not expose this apparatus to rain or moisture. To avoid electrical shock, do not open the cabi

Nios II ハードウェア・チュートリアル

Specview Specview Specview STSCI(Space Telescope SCience Institute) VO Specview Web page htt

RQT8189-S.indd

Table 1. Assumed performance of a water electrol ysis plant. Fig. 1. Structure of a proposed power generation system utilizing waste heat from factori

入学検定料支払方法の案内 1. 入学検定料支払い用ページにアクセス ポータルの入学検定料支払いフォームから 入学検定料支払い用 URL の ここをクリック / Click here をクリックしてください クリックを行うと 入学検定料支払い用のページが新たに開かれます ( 検定料支払い用ページは ポ

卒業論文2.dvi

memo 1 2 H L N Y N

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

Microsoft Word - PrivateAccess_UM.docx

Quickstart Guide 3rd Edition

1 2 3

Fig. 1 Schematic construction of a PWS vehicle Fig. 2 Main power circuit of an inverter system for two motors drive

Transcription:

Introduction Purpose This training module provides an overview of debugging features in H8S Simulator. Objectives Understand how to use the Simulator. Explore various debugging features: CPU status, registers, memory, breakpoints, and stepping. Content 21 pages 3 questions Learning Time 35 minutes 1

H8S Simulator What is a simulator? A software development tool that runs on a PC and substitutes for the MCU Represents the MCU architecture and operating instructions Advantages of a simulator Enables debugging when target hardware is not available Helps reduce overall embedded system development time H8S Simulator functions CPU instructions Memory access Register access Complementary HEW features Help make the H8S Simulator more hardware-like Include simulated I/O, Trigger, and TCL toolkit 2

Before Debugging Session Begins 1.Begin Project Generation 2.Select the Target CPU 3.Set the Target System for Debugging Selecting this option automatically generates a simulator session 3

Enter Code Example: Tutorial program with sorting routine is used for simulation /********************************************************/ /* TUTORIAL PROGRAM */ /********************************************************/ #include <machine.h> #include "string.h" #define NAME (short)0 #define AGE (short)1 #define ID (short)2 #define LENGTH 8 const char LED[]={0x12, 0x12, 0x11}; struct namelist { char name[length]; short age; long idcode; }; struct namelist section1[] = { "Naoko", 17, 1234, "Midori", 22, 8888, "Rie", 19, 7777, "Eri", 20, 9999, "Kyoko", 26, 3333, "", 0, 0 }; int count; void sort(); void main(void) { } void sort(list, key) struct namelist list[]; short key; { count = 0; for ( ; ; ){ } short i,j,k; long min; char *name; struct namelist worklist; sort(section1, NAME); count++; sort(section1, AGE); count++; sort(section1, ID); count++; Initialization Main switch(key){ list[j].name; Sort list[j].idcode; } } case NAME : for (i = 0 ; *list[i].name!= 0 ; i++){ name = list[i].name; k = i; for (j = i+1 ; *list[j].name!= 0 ; j++){ if (strcmp(list[j].name, name) < 0){ name = } } worklist = list[i]; list[i] = list[k]; list[k] = worklist; } break; case AGE : for (i = 0 ; list[i].age!= 0 ; i++){ min = list[i].age; k = i; for (j = i+1 ; list[j].age!= 0 ; j++){ if (list[j].age < min){ } k = j; } worklist = list[i]; list[i] = list[k]; list[k] = worklist; } break; case ID : for (i = 0 ; list[i].idcode!= 0 ; i++){ min = list[i].idcode; k = i; for (j = i+1 ; list[j].idcode!= 0 ; j++){ if (list[j].idcode < min){ min = } break; Switch to Simulator session } worklist = list[i]; list[i] = list[k]; list[k] = worklist; } min = list[j].age; k = j; k = j; 4

Basic Debugging View Debug 5

Basic Debugging: View Menu View Debug Display assembly code View CPU registers View memory View peripheral registers View CPU status View simulated I/O View/configure simulated interrupts View/configure labels View/modify variables View/modify local variables 6

Basic Debugging: Debug Menu View Debug Execute code Reset CPU and execute code Execute until PC reaches the cursor position Set PC value and execute Display PC value Step into deeper level Step to the next line Step out to the higher level 7 Download into target

PROPERTIES On passing, 'Finish' button: On failing, 'Finish' button: Allow user to leave quiz: User may view slides after quiz: User may attempt quiz: Goes to Next Slide Goes to Slide After user has completed quiz After passing quiz Unlimited times

Download Module 1. Right click and select Download module to load module into simulator target Download into target 2. After downloading, the Simulator displays starting address for each line of C code 9

View Status 1. Select to view CPU status 2. Status window shows memory and downloaded module information 10

Disassembly 1. Select Disassembly to view corresponding assembly code 2. Right-click on Disassembly and select Set Address to set the starting address 3. Enter 000800 and click OK 11

View Assembly Instructions 4. Disassembly window shows assembly code, starting from address 000800 ( main function) 12

Registers Window 1. Select to open Registers window 2. Register values can be edited directly in the Registers window 13

Watch Window 1. Select to open Watch window 2. Right-click in Watch window and select Add Watch 3. Enter section1 and click OK 4. View values of section1 array in Watch window 14

Examine Memory Content 1. Select to view memory content 2. Enter address of section1 (from Watch window) 3. Memory window appears. (Values of section1 won t be updated until Reset Go is executed) 15

Set and View Breakpoints 1. Right-click on line, then select Toggle Breakpoint 2. Red dot appears 3. Select to open Eventpoint window 4. See all breakpoints in program 16

PROPERTIES On passing, 'Finish' button: On failing, 'Finish' button: Allow user to leave quiz: User may view slides after quiz: User may attempt quiz: Goes to Next Slide Goes to Slide After user has completed quiz After passing quiz Unlimited times

Execute Program Program Counter stopped at Breakpoint 1. Select Reset Go to begin executing program 2. Execution stops at breakpoint. (Yellow arrow indicates current position of program counter.) 3. Register values are updated in Registers window. (Program counter value corresponds to position marked by yellow arrow in Edit menu.) 18

Content of Memory Window 4. See values of section1 array 19

Stepping Through the Code Three basic levels of stepping: Step In - Takes you deeper into function call - Moves PC to start of sub-function Step Over - Executes current line of source code, including all instructions in sub-function - Moves PC to next line Step Out - Lets you go back to next-higher level of code; i.e., return from the function call HEW also supports flexible stepping, which is accessible from the Step... menu option. 20

Step In Example: 1. Select Step In to go deeper into function call 2. Arrow in Edit window shows program counter position at the beginning of the called function after stepping 3. Registers window updates program counter value If source line does not call a function, a Step-In operation is the same as a Step-Over operation. 21

Step Over Example: 1. Select Step Over to step to the next line 2. Arrow in Edit window shows program counter position after stepping 22 3. Registers window updates program counter value If source line does not call a function, a Step-In operation is the same as a Step-Over operation.

Step Out Example: 1. Select Step Out to go back to next higher level of code Before Step Out 2. Arrow in Edit window shows program counter position at the next line of the calling function after stepping After Step Out 3. Registers window updates program counter value 23

Track Variable in Watch Window 1. Add the variable count to Watch window Breakpoint 2. Step Over to next line Program Counter 3. Value of count is updated in Watch window 24

PROPERTIES On passing, 'Finish' button: On failing, 'Finish' button: Allow user to leave quiz: User may view slides after quiz: User may attempt quiz: Goes to Next Slide Goes to Slide After user has completed quiz After passing quiz Unlimited times

Course Summary Definition of a simulator Key features of H8S Simulator Using H8S features for debugging Download a free evaluation copy of HEW at: www.renesas.com/hew 26