HP H8/3003 User Manual

HP 64784
H8/3003 Emulator Terminal Interface
User’s Guide
HP Part No. 64784-97010 August 1995
Edition 6
this materia l, inc ludi ng, but not limi te d to, the implied warranties of merchantabil ity and fitne ss for a parti cul ar purpo se.
Hewlett-Pa c ka rd sha ll not be liabl e fo r errors c ont a ined he rei n or for incident al or conse que nt ia l dama ges in c onn ect ion with the furn ishi ng, perfo rmance, or use of this mat erial.
Hewlett-Pa c kard assum es no responsibility for the use or reliabil ity of its software on equ ipme nt that is not furni she d by Hewle tt-Packard.
© Copyright 1995, Hewlett-Pac ka rd Co mp an y. This docume nt conta i ns prop rie t ar y information, which i s prot ec ted by
copyrigh t. All righ ts are rese rv ed . No part of this doc um e nt may be photocopie d, reprod uc ed or transl ate d to ano ther l anguage without the prior written co nse nt of Hewl ett- Pac ka rd Compa ny. The infor mat ion contained in this document is subject to change without notice.
HP is a tradem ark of Hewlett -P a c ka rd Com pa n y . UNIX is a registere d trade m ark in the Unit ed Sta tes a nd ot he r
countries, lic en sed exclusiv el y throug h X/Ope n Comp an y Lim ited . H8/3003 is a registered trademark of Hitachi Ltd.
Hewlett-P ac kar d Com pany P.O. Box 219 7 1900 Garden of the Gods Road Colorado Springs, CO 80901-2197, U.S.A.
RESTRICTED RIGHTS LEGEND Use, duplication, or discl osure by the U.S. Governm ent is subjec t to restr icti ons se t forth in subparag raph (C) (1) (ii) of the Rights i n Tec hni c al Dat a and Com put er Software Cla use at DFARS 252.22 7-7013. Hewlett-Packard Compa ny, 3000 Hanove r Str eet , Palo Alto, CA 94304 U. S. A. Ri ght for non-DOD U.S. Gov ernmen t De partment and Agencies are as set fort h in F AR
52.227-19 (c)(1, 2) .
Printing History New editions a re complete re vi sions of the man ua l. The date on the
title page changes only when a new edition is published. A software code may be printe d be fore the dat e; this indicates the
version leve l o f the software produ ct at the ti m e t he manual was issued. Many produc t up da te s an d fix es do not requ ire manua l cha nge s, and manual corre c ti ons m ay be done without accompa nyi ng pr oduc t changes. There fo re , do not expe c t a one-t o-on e corr espondence between pro duc t upda te s an d manu al re visi ons.
Edition 1 64784-97000 , July 1993
Edition 2 64784-97002 , March 199 4
Edition 3 64784-97004 , August 19 94
Edition 4 64784-97006 , April 1995
Edition 5 64784-97008 , May 1995
Edition 6 64784-97010 , Aug 1995
Using This Manual
This manua l is desi gne d to giv e you an introdu ct ion to the HP 64784 H8/3003 Emulat or. This man ua l will also help defi ne how these emulators differ from othe r HP 64700 Emulat ors.
This manua l will :
This manua l wi ll not:
give you an introduc tion to using the emul ator
explore various ways of applying the emul a tor to accomplish your tasks
show you emulator comm ands whi ch are spe cifi c to the H8/3003 Emulator
tell you how to use each and every emulator/analyzer command (refer to the User’s Reference m anual)
Organization
Chapter 1 An introduc tion t o the H8/3003 emul at or fea tu re s and how they ca n
Chapter 2 A brief introduct io n to using the H8/30 03 E mula to r. You will load
Chapter 3 How to plug the emulator probe into a ta rget syste m .
Chapter 4 Configuri ng the em ulat or to adapt it to your speci fic me asu re ment
Appendix A H8/3003 Emulator Specific Command Syntax and Error Message
help you in developi ng new ha rdwa re and software.
and execute a short progra m , and make som e measu re ment s usin g the emulation analyzer.
needs.
Contents
1 Introductio n to the H8/300 3 Emulato r
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Purpose of the H8/3003 Emulator . . . . . . . . . . . . . . . . . . 1-1
Features of the H8/3003 Emulator . . . . . . . . . . . . . . . . . . 1-3
Supported Mic roprocessors . . . . . . . . . . . . . . . . . . . . 1-3
Clock Speeds . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Emulation memory . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Reset Support . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Real Time Operation . . . . . . . . . . . . . . . . . . . . . . . 1-8
Limitations, Restricti ons . . . . . . . . . . . . . . . . . . . . . . . 1-9
Foreground Mo nit or . . . . . . . . . . . . . . . . . . . . . . . . 1-9
DMA Support . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Internal RAM of H8/3005 . . . . . . . . . . . . . . . . . . . . . 1-9
Watch Dog Tim e r in Background . . . . . . . . . . . . . . . . . 1-9
Monitor Bre ak at Sleep/Standby Mode . . . . . . . . . . . . . . 1-9
Hardware Standby Mode . . . . . . . . . . . . . . . . . . . . . 1-9
Interrupts in Background Cycles . . . . . . . . . . . . . . . . . 1-9
Reset Output Enable Bit . . . . . . . . . . . . . . . . . . . . . . 1-9
Evaluation chip . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
2 Getting Started
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
A Look at the Sample Program . . . . . . . . . . . . . . . . . . . . 2-3
Using the Help Fa c il it y . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Initialize the Em ula t or to a Known State . . . . . . . . . . . . . . . 2-8
Set Up the Proper Emulation Configuration . . . . . . . . . . . . . 2-9
Set Up Emulation Conditions . . . . . . . . . . . . . . . . . . . 2-9
Mapping Me mory . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Contents- 1
Transfer Code into Emulat ion Memory . . . . . . . . . . . . . . 2-12
Transferri ng Co de from a Term inal
In Standalone Configuration . . . . . . . . . . . . . . . . . . 2-12
Transferri ng Co de From A Host,
HP 64700 In T ra nsparent Confi guration . . . . . . . . . . . . 2-15
Looking a t Your Code . . . . . . . . . . . . . . . . . . . . . . . 2-18
Familiarize Yourself with the System Prompts . . . . . . . . . . 2-19
Running the Sample Program . . . . . . . . . . . . . . . . . . . 2-20
Stepping Through the Program . . . . . . . . . . . . . . . . . . . 2-22
Tracing Pro gram Execution . . . . . . . . . . . . . . . . . . . . 2-22
Predefine d Tr ac e La be ls . . . . . . . . . . . . . . . . . . . . . 2-22
Predefine d Status Equate s . . . . . . . . . . . . . . . . . . . . 2-23
Specifying a Trigge r . . . . . . . . . . . . . . . . . . . . . . . 2-23
Using Softwar e Br ea kpoints . . . . . . . . . . . . . . . . . . . . 2-27
Displaying and Modifying the Bre ak Conditions . . . . . . . . 2-27
Defining a Software Bre akpoint . . . . . . . . . . . . . . . . . 2-28
Searching Memory for Str ings or Numeric Expressions . . . . . . 2-29
Making Progr am Coverage Measurements . . . . . . . . . . . . . 2-29
Trace Ana lysis Considerations . . . . . . . . . . . . . . . . . . . 2-30
How to Specify th e T rigger Condition . . . . . . . . . . . . . 2-30
Store Condi ti on and Disasse m bling . . . . . . . . . . . . . . . 2-32
Triggering the Analy ze r by Data . . . . . . . . . . . . . . . . 2-34
3 In-Circuit Emulation
Installing the Ta rget System Probe . . . . . . . . . . . . . . . . . . 3-2
QFP adaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
PGA adaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
QFP socket/ad aptor . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Installing the QFP Ad aptor . . . . . . . . . . . . . . . . . . . . 3-5
Installing the 64784E PGA adaptor . . . . . . . . . . . . . . . . 3-6
Installing the H8/3003 micro processor . . . . . . . . . . . . . . 3-9
Using Low Voltag e Adaptor . . . . . . . . . . . . . . . . . . . . 3-10
Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Installing the 64797B PGA adaptor . . . . . . . . . . . . . . . 3-11
Run from Target System Re set . . . . . . . . . . . . . . . . . . . 3-12
Electric al Characteri stics . . . . . . . . . . . . . . . . . . . . . . 3-13
Target System Interface . . . . . . . . . . . . . . . . . . . . . . 3-26
2-Contents
4 Configuring the H8/3 003 Emulator
Types of Emulator Conf iguration . . . . . . . . . . . . . . . . . . 4-1
Emulation Processor to Emu la to r/Ta rge t Sy ste m . . . . . . . . . 4-1
Commands W hich Pe rfo rm an Action or Mea sure m ent . . . . . 4-2
Coordinated Measurements . . . . . . . . . . . . . . . . . . . . 4-2
Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Emulation Processor to Emu la to r/Ta rge t Sy ste m . . . . . . . . . . 4-3
cf ba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
cf dbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
cf drst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
Memory Ma pping . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Break Condit ions . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Where to Find More Information . . . . . . . . . . . . . . . . . . 4-19
A H8/3003 Emulator Spec ific Command Synta x
CONFIG_ITEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Related information . . . . . . . . . . . . . . . . . . . . . . . . A-4
ACCESS MODE and DI SPLAY MODE . . . . . . . . . . . . . . A-4
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
Related Infor ma tion . . . . . . . . . . . . . . . . . . . . . . . . A-5
ADDRESS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
REGISTER CL ASS a nd NAME . . . . . . . . . . . . . . . . . . A-7
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7
Emulator Spe ci fic Error Message s . . . . . . . . . . . . . . . . . A-15
Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-15
Contents- 3
Illustrations
Tables
Figure 1-1. HP 64784 Emula tor for the H8/3003 . . . . . . . . . . 1-2
Figure 2-1. Sample Progr am L isting . . . . . . . . . . . . . . . . . 2-5
Figure 3-1. Installing the QFP adaptor . . . . . . . . . . . . . . . . 3-5
Figure 3-2 Installing the PGA adaptor (Gen er al ) . . . . . . . . . . 3-6
Figure 3-3 Installing the PGA adaptor (3001 mode 3/4) . . . . . . . 3-7
Figure 3-4 Installing the PGA adaptor (3004/5 mode 3) . . . . . . . 3-8
Figure 3-5 Installing the H8/3003 microprocessor . . . . . . . . . . 3-9
Figure 3-6 Installing the PGA adaptor (Gen er al ) . . . . . . . . . 3-11
Table 1-1. Supported Mic roprocessors . . . . . . . . . . . . . . . . 1-3
Table 1-2. Clock Speeds . . . . . . . . . . . . . . . . . . . . . . . 1-6
Table 3-1. DC Charac teristics of input high voltage . . . . . . . . 3-10
Table 3-2. Bus timing (Vc c = 5. 0V, f = 16MHz) . . . . . . . . . 3-13
Table 3-3. Refresh controlle r timing
(Vcc = 5.0V, f = 16MHz) . . . . . . . . . . . . . . . . 3-16
Table 3-4. Control sig nal timing
(Vcc = 5.0V, f = 16MHz) . . . . . . . . . . . . . . . . 3-17
Table 3-5. Tim in g co ndition of On- ch ip supportin g
modules (Vcc = 5.0V, f = 16MHz ) . . . . . . . . . . 3-18
Table 3-6. Bus timing (Vc c = 3. 0V, f = 10MHz) . . . . . . . . . 3-20
Table 3-7. Control sig nal timing
(Vcc = 3.0V, f = 10MHz) . . . . . . . . . . . . . . . . 3-23
Table 3-8. Tim in g co ndition of On- ch ip supportin g
modules (Vcc = 3.0V, f = 10MHz ) . . . . . . . . . . 3-24
Table 4-1. Clock Speeds . . . . . . . . . . . . . . . . . . . . . . . 4-6
4-Contents
Introductio n t o t he H8/3 003 Emul ato r
Introduction The topics in this chapter include:
Purpose of the H8/3003 Emulator
Feature s of the H8/3003 Emu la to r
1
Purpose of the H8/3003 Emulator
The H8/3003 Emulator is designed to replace the H8/3003 microproc e ssor in your tar ge t system so you can cont rol operation of the microproc essor i n your appli cat ion hardwa re (usuall y refe r to as the target system). The H8/3003 emulator perf orms just like the H8/3003 micropro cessor , but is a device that allows yo u to control the H8/3003 micropro ce ssor direc tly. These feat ure s a llow you t o easi ly debug softwa re be for e any hardware i s ava ila bl e, and e ase th e task of integrating hardware and software.
Introduction to the H8/3003 Emulator 1-1
Figure 1-1. HP 64784 Emulato r for the H8/3003
1-2 Introduction to the H8/3003 Emulato r
Features of the H8/3003 Emulator
Supported
Microprocessors
Supported Microproce ssor QFP Adaptor
Type Package System
Clock
Divider
H8/3005 80pinQF P
H8/3004 80pinQFP
H8/3003 112 pin QFP
1:2 -
The HP 64784A H8/300 3 emul a tor suppor ts th e mic ro proc e ssors l ist ed in Table 1-1.
Table 1-1. Supported Microprocessors
PGA Adaptor
On-chip ROM Supply Voltage
4.75 t o 5. 2 5 V
--
2.7 to 5.25V
4.75 t o 5. 2 5 V
--
2.7 to 5.25V
4.75 t o 5. 2 5 V
2.7 to 5.25V
4.75 t o 5. 2 5 V
--
2.7 to 5.25V
Board
-
-
HP64784C HP64784E/
Board/
QFP probe
HP64784E/
HP64784K*1
HP64784E/
HP64784K*1
HP64784F
H8/3002 100 pin QFP
H8/3001 80 pin QFP
4.75 to 5.25V HP64784D HP64784E/
--
2.7 to 5.25V
4.75 t o 5. 2 5 V
--
HP64784G
HP64784E/
-
Introduction to the H8/3003 Emulator 1-3
HP64784J *1
Table 1-1. Supported Microprocessors (Cont’d)
Supported Microproce ssor QFP Adaptor
Type Package System
Clock
Divider
H8/3032 80 pin QFP
H8/3031 80 pin QFP
H8/3030 80 pin QFP
H8/3042 100 pin QFP
On-chip ROM Supply Voltage
2.7 to 5.25V
4.75 to 5.25V
PROM
2.7 to 5.25V
-
4.75 to 5.25 V
Masked ROM
2.7 to 5.25V
4.75 to 5.25 V
--
2.7 to 5.25 V
4.75 to 5.25 V
--
2.7 to 5.25 V
4.75 to 5.25V
PROM
2.7 to 5.25V
-
4.75 to 5.25V
Masked ROM
2.7 to 5.25V
PGA Adaptor
Board
Board/
QFP probe
HP64784E/
-
HP64784H
HP64784E/
-
HP64784H
HP64784E/
-
HP64784H
HP64784D HP64784E/
HP64784G
H8/3041 100 pin QFP
- Masked ROM
H8/3040 100 pin QFP
- Masked ROM
*1 When you do in-ci rc ui t emu lati on fo r H8/3 001 wi th mode 3/4 or H8/3004/5 with mode 3, you must use HP 647 84-6 6509 shipp ed with HP 64784J/K. Refe r to the "In-Circ ui t Emula tion" Chapter in this manual for more details.
1-4 Introduction to the H8/3003 Emulato r
4.75 to 5.25V HP64784D HP64784E/ HP64784G
2.7 to 5. 5V
4.752 to 5.25V HP64784D HP64784E/ HP64784G
2.7 to 5.25V
The H8/3003 e mu lato r is provid ed with out any QFP ada pt ors a nd PGA adaptor(HP 647 84E ) wit h QFP probe. To emulate eac h proce ssor wi th your target syste m , you need to purch ase appro pri at e QFP adapt or or PGA adaptor with QFP probe liste d in Tabl e 1-1. To purcha se the m, contact your l oc al HP sal es re pr esentati ve .
You can buy HP 64797B low voltage adap tor to emula te eac h processor runni ng with sup ply voltage from 2.7 up to 5.25V inp ut in your target syste m . To buy HP 64797B, cont act your l ocal HP sales repres e ntative.
The list of supported micr opro cessor s in Tab le 1-1 i s not nece ssar ily complete. To determ ine if your m icro proc e ssor i s suppor te d or no t, contact Hewlett-Packard.
Clock Speeds You can select whethe r t he emul ator wi ll be clo ck ed by the in ternal
clock source or by the external clock sour ce on your targ et syste m. When you sele c t a cl oc k in put con form i ng to the spe cification of Tabl e 1-2.
Refer to the "Conf igu ra ti on the E mula t or" Cha pt e r in this ma nua l fo r more de tails.
Introduction to the H8/3003 Emulator 1-5
Table 1-2. Clock Speeds
Clock source Chip Without 64797B With 64797B
Internal H8/3001
H8/3002
H8/3003T
H8/3004 H8/3005 H8/3030 H8/3031 H8/3032 H8/3040 H8/3041 H8/3042
H8/3003 with system
cloc k divider
External H8/3001
H8/3002
H8/3003T
H8/3004 H8/3005 H8/3030 H8/3031 H8/3032 H8/3040 H8/3041 H8/3042
16MHz
(System clock)
8MHz
(System clock)
From 0.5 up to 16MHz
(System clock)
8MHz
(System clock)
8MHz
(System clock)
From 0.5 up to 10MHz
(System clock)
H8/3003 with system
cloc k divider
1-6 Introduction to the H8/3003 Emulato r
From 1 up to 24MHz
(System cloc k is from
0.5 up to 12MHz)
From 1 up to 20MHz
(System clock i s from
0.5 up to 10MHz)
Emulation memory The H8/3003 emulator is used with one of the following Emulation
Memory Cards.
HP 64726A 128K byte Emula tion Me mo ry Card HP 64727A 512K byte Emula tion Me mo ry Card HP 64728A 1M byte Emula t ion Memory Card HP 64729A 2M byte Emula t ion Memory Card
You can defin e up to 16 me mo ry ranges (at 512 byte bo unda ri e s and least 512 byt e in le ngt h. ) The em ula t or oc c upi es 6K byte, which is used for monitor pro gram and interna l RAM of micr o proc e ssor ma ppe d as emulation RAM, leaving 1 22K, 506K, 1018K, 2042K byte of emulati on m emo ry which you may use. You can chara c teri z e me mo ry range as emul atio n RAM (e ra m), em ulat ion ROM (er om ), target system RAM (tram), tar get system ROM (trom ), or guard ed mem ory (grd). The emulator gene ra tes an error messa ge when acc esse s are made to guarde d m emo ry lo ca t ion s. You can al so configure the emulator so that writes t o memory def ined as ROM cause e mula to r execu tion to break out of targe t pr ogra m ex ecution.
Analysis The H8/3003 emulator is used with one of the following analyzers
which allows you to trace code exec ut ion an d proce ssor a cti vity.
HP 64704A 80-channel Emulation Bus Ana l yz er HP 64703A 64-channel Emulation Bus Ana l yz er and 16-ch an nel State/ T im ing Analyzer. HP 64794A/C/D Deep Emulat ion Bus Ana lyze r
The Emulatio n Bus Analy ze r moni to rs the emu lati on pr ocesso r usin g an internal analy sis bus. The HP 64703A 64- ch an ne l Emula tion Bu s Analyzer and 16 -cha nne l Stat e/T imi ng Ana lyze r allows you to probe up to 16 different lines in your target syst em.
Registers You can displa y or modi fy the H8/30 03 in terna l reg ist er conte nts. This
include s the abili ty t o mo dify the pro gram counter (PC ) va lue so you can control where the emulator starts a program run.
Breakpoints You can set the emulator/ana lyzer interaction so the emulator will
break to the monit or pr ogra m when the ana lyze r finds a spec ific sta te or states, allowin g you t o perfor m po st-m or tem anal ysis of the prog ra m executi on. You can also set softwa re bre a kpo int s in yo ur pro gra m . This featu re is real ize d by inserting a speci al instru ct io n into use r
Introduction to the H8/3003 Emulator 1-7
program. One of un defin ed opc ode s (577 0 hex) is used as soft war e breakpoint instruc t ion . Refe r to the "Usin g Softwar e Brea kp oin ts" section of "Getting Started" chapter for more information.
Reset Support The emul at or ca n be reset from the emu lati on syste m unde r your
control; or yo ur targ et syste m can re se t the emulat io n proc essor.
Real Time Operation Real-time signifies con tinuou s exe cut ion of your progr am at ful l rated
processor speed wi thout interf er en ce fro m the emulat or. (Suc h interfe rence oc curs when the emula to r ne eds to break to the mo nit or t o perform an action you requeste d, such as displ ay ing targe t system memory. ) Emul at or fe a tu re s per form e d in real time inc l ude : running and analyzer tracing. Emulator features not performed in real time include: displa y or modi fic a tion of targe t syste m me mo ry, load/ dum p of target m emory, displa y or modi fic a ti on of reg ist er s.
1-8 Introduction to the H8/3003 Emulato r
Limitations, Restrictions
Foreground Monitor Foreground monit or is not support ed for the H8/300 3 emul a tor .
DMA Support Direct memory acce ss to the emul a tion by e xt er na l DMAC is not
allowed.
Internal RAM of
H8/3005
Watch Dog Timer in
Background
Monitor B reak at
Sleep/Standby Mode
Hardware Standby
Mode
Interrupts in
Background Cycles
Reset Output Enable
Bit
When you emulat e H8/300 5 proc e ssor, you can’t use addre ss 0fe f10h ­0ff00fh (mode 1) and 0ffe f1 0h - 0ff f00f h (mode 3) as int er na l RAM. These area are worked as extern al 8bit 3stat e area .
Watch dog time r is suspe nd ed count up while the emul ator i s runni ng in background monitor.
When the emula to r brea ks int o the bac kgr ound mon itor, sle ep or software standby mode is released. Then, PC indicates next address of "SLEEP" instru ctio n.
Hardware standb y mo de is not suppor te d for the H8/3 003 e mula t or. Hardware sta ndb y reque st fr om targe t syste m will give th e emula tor reset signal.
The H8/30 03 e mu lato r doe s not ac cep t a ny in terrupts while in background m oni to r. Such interrupts are suspende d whil e runni ng the background m oni to r, and will oc cu r when co nte xt is cha nge d to foreground.
The RSTOE (Reset output enable bit) is used to dete rmi ne whet he r the H8/3003 processor out put s reset signal when the pro cessor is reset by the watch dog timer. Howeve r, the H8/ 3003 emulat or ignor es the configur atio n of th e RSTOE , and works as it is con fig ured with the modify c onfi gur at io n co mm a nd.
Introduction to the H8/3003 Emulator 1-9
Evaluation chip Hewlett-Pa cka rd mak es no warran ty of the problenm cause d by the
H8/3003 Evalua ti on chip in the emulat or.
1-10 Introduction to the H8/3003 Emulato r
Getting Started
Introduction This chapt er will lea d you through a basic , step by ste p tutor ia l
designed to familiari z e you with the use of the HP 64700 emula tor for the H8/3003 micropr oc esso r. When you have compl ete d this chap ter, you will be able to perform these tasks:
Set up an emulation configuration for out of circuit emulation use
Map memory
Transfer a small prog ram into emul atio n mem ory
Use run/stop con tro ls to contro l opera t ion of your progr am
Use memory m a nip ula t ion features to a lte r the pro gra m ’s operat ion
2
Use analyzer comma nds to view the rea l time exe c ution of your program
Use software breakpoint feature to stop program execution at speci fic address
Search mem ory fo r strings or num eric expre ssio n s
Make progr am coverage me a surements
Getting Started 2-1
Before You Begin Before be gi nni ng t he tut ori al pre se nte d i n thi s ch ap te r, you must have
completed the following tasks:
1. Complete d ha rdwa re in sta lla ti on of t he HP 64700 e m ula tor in the configu ra ti on you inten d to use for your wor k:
Standalon e configuration Transparent confi guration Remote conf igu ra ti on
2. If you are using t he Remot e Confi gur at io n, you must ha ve completed installation and configuration of a terminal emulator prog ra m whic h wil l allow your host t o act as a terminal connecte d t o the emu la to r. In addit ion , yo u mu st sta rt the termina l em ula tor program bef ore you ca n work the example s in this c ha pt er .
3. If you have prope rl y c om ple t ed ste ps 1 an d 2 ab ove , you should be able to hit <RETURN> (or <ENTER> on some keyboar ds) and ge t on e of the fol lowi ng c om m an d prompt s on your terminal screen:
U> R> M>
If you do not see one of the se c om m an d prom pt s, retrace yo ur steps throu gh the hardware and softwa re inst a llat ion proced u re s outl ined in the ma nuals abov e, ve ri fying all connecti ons a nd pr oc ed ura l step s. If you ar e stil l unabl e to get a command prompt, refer to the HP 64700 Support Service s Guide. The guid e give s basic troubl esh ooting proce dure s. If this fail s, call the lo cal HP sale s a nd se rvice office list e d in the Support Services Guide.
2-2 Getting Started
In any case, you must have a comm and prompt on your terminal screen bef ore proc e e din g wit h the tu tor ia l.
A Look at the Sample Program
The sample progra m "COMMAND_READE R" use d in this chapt e r is shown figure 2-1. The program emulates a primitive command interpreter.
Data Declarations
Msg_A, Msg_B and Msg_I are the messa ges use d by the progra m to respond to various c om man d inp uts.
Initializ atio n
The locati ons of st ac k and i nput area (C md _Inp ut) are move d in to address re gisters for u se by the program. Next, the CLEAR routine clears the c om mand byte (t he first lo ca tion pointed to by Cmd_In put ­0ff800 hex) . Cmd_ Inpu t cont ai ns 00 hex fo r late use.
Scan
This routine conti nuo usly reads t he byte at loca tion of Cmd_Input until it is something ot he r th an a null cha ra cte r (00 hex); whe n this oc c urs, the Exe _Cm d routine is executed.
Exe_Cmd
Compare s th e i nput byt e (now something ot her than a null) t o the possible comman d bytes of "A" (ASCII 41 hex) and "B" (ASCII 42 hex), then jum ps to the approp ria t e set up routine for the command message. If the input byte does not ma tch either of these values, a branch to a set up routine for an error message is executed.
Cmd_A, Cmd_B, Cmd_I
These ro uti ne s set up the prope r pa ra m et ers for writing the outp ut message: the numbe r of byte s in the messa ge is move d to the R3L register and the base address of th e messag e in the data are a is moved to address register ER4.
Getting Started 2-3
Write_Msg
First the base address of the output area is copied to ER5. Then the Clear_ Old ro uti ne writes null s to 32 byte s of t he outp ut a re a (thi s serves bot h to initia liz e the area a nd to clea r old messa ge s wri tt en during previo us prog ra m passe s).
Finally, the prope r me ssag e is writte n to the out put area by the Write_Loop routi ne . When do ne , Wri te _L oop jumps bac k to Cle ar and the comman d mo nitoring process be gi ns a ga in.
Using the various fea tur es of the emula tor , we wil l show you how to load this p rogram into emulation me mory, exe cute it, monitor the program ’s ope ra ti on with the anal yz er, and simu late entry of different command s uti li zing t he mem ory a cce ss c om mand s provi de d by the HP 64700 command set.
2-4 Getting Started
002000 1 .SECTION Table,DATA,LOCATE=H’2000 002000 2 Msgs 002000 5448495320495320 3 Msg_A .SDATA "THIS IS MESSAGE A" 002008 4D45535341474520 002010 41 002011 5448495320495320 4 Msg_B .SDATA "THIS IS MESSAGE B" 002019 4D45535341474520 002021 42 002022 494E56414C494420 5 Msg_I .SDATA "INVALID COMMAND" 00202A 434F4D4D414E44 002031 6 End_Msgs 7 001000 8 .SECTION Prog,CODE,LOCATE=H’1000 9 ;**************************************************** 10 ;* Set up the Pointers. 11 ;**************************************************** 001000 7A07000FF904 12 Init MOV.L #Stack,ER7 001006 7A01000FF800 13 MOV.L #Cmd_Input,ER1 14 ;**************************************************** 15 ;* Clear previous command. 16 ;**************************************************** 00100C F800 17 Clear MOV.B #H’00,R0L 00100E 6AA8000FF800 18 MOV.B R0L,@Cmd_Input 19 ;**************************************************** 20 ;* Read command input byte. If no command has been 21 ;* entered, continue to scan for it. 22 ;**************************************************** 001014 6A2A000FF800 23 Scan MOV.B @Cmd_Input,R2L 00101A AA00 24 CMP.B #H’00,R2L 00101C 47F6 25 BEQ Scan 26 ;**************************************************** 27 ;* A command has been entered. Check if it is 28 ;* command A, command B, or invalid command. 29 ;**************************************************** 00101E AA41 30 Exe_Cmd CMP.B #H’41,R2L 001020 5870000A 31 BEQ Cmd_A 001024 AA42 32 CMP.B #H’42,R2L 001026 58700010 33 BEQ Cmd_B 00102A 58000018 34 BRA Cmd_I 35 ;**************************************************** 36 ;* Command A is entered. R3L = the number of bytes 37 ;* in message A. R4 = location of the message. 38 ;* Jump to the routine which writes the message. 39 ;**************************************************** 00102E FB11 40 Cmd_A MOV.B #Msg_B-Msg_A,R3L 001030 7A0400002000 41 MOV.L #Msg_A,ER4 001036 58000014 42 BRA Write_Msg 43 ;**************************************************** 44 ;* Command B is entered. 45 ;**************************************************** 00103A FB11 46 Cmd_B MOV.B #Msg_I-Msg_B,R3L 00103C 7A0400002011 47 MOV.L #Msg_B,ER4 001042 58000008 48 BRA Write_Msg
Figure 2-1. Sample Pro g ram List ing
Getting Started 2-5
49 ;**************************************************** 50 ;* An invalid command is entered. 51 ;**************************************************** 001046 FB0F 52 Cmd_I MOV.B #End_Msgs-Msg_I,R3L 001048 7A0400002022 53 MOV.L #Msg_I,ER4 54 ;**************************************************** 55 ;* The destination area is cleared. 56 ;**************************************************** 00104E 7A05000FF804 57 Write_Msg MOV.L #Msg_Dest,ER5 001054 FE20 58 Clear_Old MOV.B #H’20,R6L 001056 68D8 59 Clear_Loop MOV.B R0L,@ER5 001058 0B05 60 ADDS.L #1,ER5 00105A 1A0E 61 DEC.B R6L 00105C 46F8 62 BNE Clear_Loop 63 ;**************************************************** 64 ;* Message is written to the destination. 65 ;**************************************************** 00105E 7A05000FF804 66 MOV.L #Msg_Dest,ER5 001064 6C4E 67 Write_Loop MOV.B @ER4+,R6L 001066 68DE 68 MOV.B R6L,@ER5 001068 0B05 69 ADDS.L #1,ER5 00106A 1A0B 70 DEC.B R3L 00106C 46F6 71 BNE Write_Loop 72 ;**************************************************** 73 ;* Go back and scan for next command. 74 ;**************************************************** 00106E 409C 75 BRA Clear 76 0FF800 77 .SECTION Data,DATA,LOCATE=H’FF800 78 ;**************************************************** 79 ;* Command input area. 80 ;**************************************************** 0FF800 00000004 81 Cmd_Input .RES.L 1 82 ;**************************************************** 83 ;* Destination of the command messages. 84 ;**************************************************** 0FF804 00000100 85 Msg_Dest .RES.W H’80 0FF904 86 Stack 00001000 87 .END Init
2-6 Getting Started
Figure 2-1. Sample Pro g ram List ing (Con t’d)
Using the Help Facility
If you need a quick reference to the Terminal Interface syntax, you can use the built-i n he lp fac ilit ie s. For exa mp le , to displa y t he top lev el he lp menu , ty p e:
R> help
help - display help information help <group> - print help for desired group
help -s <group> - print short help for desired group help <command> - print help for desired command help - print this help screen
--- VALID <group> NAMES --­ gram - system grammar proc - processor specific grammar
sys - system commands emul - emulation commands hl - highlevel commands (hp internal use only) trc - analyzer trace commands * - all command groups
You can type the ? symbol inst e ad of typing help. For exa mp le, if you want a list of c om m ands in the em ul comm a nd g ro up, type:
R> ? emul
emul - emulation commands
-----------------------------------------------------------------------------
b......break to monitor cp.....copy memory mo.....modes
bc.....break condition dump...dump memory r......run user code
bp.....breakpoints es.....emulation status reg....registers
cf.....configuration io.....input/output rst....reset
cim....copy target image load...load memory rx.....run at CMB execute
cmb....CMB interaction m......memory s......step
cov....coverage map....memory mapper ser....search memory
To display help info rm atio n for any c om m an d, just type help (or ?) an d the command na me. For exa mple :
R> help load
Getting Started 2-7
load - download absolute file into processor memory space load -i - download intel hex format
load -m - download motorola S-record format load -t - download extended tek hex format load -S - download sysmbol file load -h - download hp format (requires transfer protocol) load -a - reserved for internal hp use load -e - write only to emulation memory load -u - write only to target memory load -o - data received from the non-command source port load -s <str> - send a character string out the other port load -b - data sent in binary (valid with -h option) load -x - data sent in hex ascii (valid with -h option) load -q - quiet mode load -p - record ACK/NAK protocol (valid with -imt options) load -c <file> - data is received from the 64000. file name format is: <filename>:<userid>:absolute
Initialize the Emulator to a Known State
Note
To initialize the emulator to a known state for this tutorial:
It is especially import a nt tha t you per form the fo llowin g ste p if the emulato r is be ing operate d i n a stan da lone mode cont rolled by only a data terminal. The only program entry available in this mode is through memory modific atio n; conse qu entl y, if the emulat or is reinit ia li z ed , em ula t ion memory wi ll be clea red and a gre at de al of tedious wor k could be lost.
1. Verify that no one else is using the emu la to r or will have nee d of configu ra tion it e ms pr ogra m m ed int o the e mu la to r.
2. Initia li ze th e em ulator by typi ng the comm an d:
R> init
2-8 Getting Started
Set Up the Proper Emulation Configuration
Set Up Emulation
Conditions
cf ba=en cf chip=3042 cf clk=int cf dbc=en cf drst=dis cf mode=7 cf nmi=en cf rrt=dis cf rsp=9 cf tdma=en cf trfsh=en cf trst=en
Note
To set the emula tor’s c onfi gur at io n value s to the proper sta te for t his tutorial, do this:
1. Type:
R> cf
You should se e the follo wing configuration items displayed:
The individual conf igu ration ite ms wo n ’t be explained in thi s exa m ple; refer to Chapter 4 of this manual and the User’s Reference manual for details.
2. If the config ura ti on ite m s displ a ye d on you r scree n do n’t match the one s liste d a bov e, he re is how to make th em a gre e :
For each con fig ura ti on ite m that does not match, type :
R> cf <config_item>=<value>
Getting Started 2-9
cf ba=en cf chip=3042
cf clk=ext
cf dbc=en cf drst=dis cf mode=7 cf nmi=en
cf rrt=en
cf rsp=9 cf tdma=en cf trfsh=en cf trst=en
bc -d bp #disable bc -e rom #enable bc -d bnct #disable bc -d cmbt #disable bc -d trig1 #disable bc -d trig2 #disable
For example , if you ha ve the fol lowi ng c onf igu ra ti on ite ms displaye d (those in bold indic ate item s dif fe re nt from the list above):
To make th ese c onfi gur at io n va lue s a gre e with the desire d values, type :
R> cf clk=int R> cf rrt=dis
3. Now, you need to set up stac k poi nte r. Type:
R> cf rsp=0ff904
4. Let’s go ahe a d and set up th e proper break conditions. Type:
R> bc
You will see:
For each break con ditio n that does not ma tc h the one list ed , use one of the followin g comma nds:
2-10 Getting Started
To enable bre a k conditions that ar e curr en tly disa bl e d, type:
R> bc -e <breakpoint type>
To disable break conditions that are currently enabled, type:
R> bc -d <breakpoint type>
For example , if typi ng bc giv es the foll owi ng li st of bre ak conditions:
Loading...
+ 99 hidden pages