H8/536 Emulator PC Interface: User's Guide
H8/536 Emulator PC Interface: User's Guide
H8/536 Emulator
PC Interface
User’s Guide
This manual introduces you to the following emulators as used with the
PC Interface.
For the most part, the H8/536 and H8/536S emulators all operate the
same way. Differences of between the emulators are described where
they exist. Both the H8/536 and H8/536S emulators will be referred to
as the "H8/536 emulator". In the specific instances where H8/536S
emulator differs from H8/536 emulator, it will be described as
"H8/536S emulator".
This manual will:
Show you how to use emulation commands by executing them
on a sample program and describing their results.
Show you how to configure the emulator for your
development needs. Topics include: restricting the emulator
to real-time execution, and selecting a target system clock
source.
Show you how to use the emulator in-circuit (connected to a
target system).
Describe the command syntax which is specific to the H8/536
emulator.
This manual does not:
Chapter 1 Introduction to the H8/536 Emulator. This chapter lists the H8/536
emulator features and describes how they can help you in developing
new hardware and software.
Chapter 2 Getting Started. This chapter shows you how to use emulation
commands by executing them on a sample program. This chapter
describes the sample program and how to use basic emulation
commands.
Chapter 3 In-Circuit Emulation. This chapter shows you how to plug the
emulator into a target system, and how to use the "in-circuit" emulation
features.
Chapter 4 Configuring the Emulator. You can configure the emulator to adapt
it to your specific development needs. This chapter describes the
options available when configuring the emulator and how to save and
restore particular configurations.
Chapter 5 Using the Emulator. This chapter describes emulation topics which
are not covered in the "Getting Started" chapter (for example,
coordinated measurements and storing memory).
Appendix A File Format Readers. This appendix describes how to use the
HP 64869 Format Reader from MS-DOS, load absolute files into the
emulator, use global and local symbols with the PC Interface.
Notes
Contents
2 Getting Started
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
A Look at the Sample Program . . . . . . . . . . . . . . . . . . 2-2
Sample Program Assembly . . . . . . . . . . . . . . . . . . . . 2-6
Linking the Sample Program . . . . . . . . . . . . . . . . . . . 2-6
Starting Up the PC Interface . . . . . . . . . . . . . . . . . . . . . 2-7
Selecting PC Interface Commands . . . . . . . . . . . . . . . . 2-8
Emulator Status . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Modifying Configuration . . . . . . . . . . . . . . . . . . . . . . . 2-8
Defining the Reset Value for the Stack Pointer . . . . . . . . . . 2-8
Selecting your Processor . . . . . . . . . . . . . . . . . . . . . 2-8
Contents-11
Saving the Configuration . . . . . . . . . . . . . . . . . . . . . 2-9
Mapping Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Which Memory Locations Should Be Mapped? . . . . . . . . . 2-9
Loading Programs into Memory . . . . . . . . . . . . . . . . . . 2-12
File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Memory Type . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Force Absolute File Read . . . . . . . . . . . . . . . . . . . . 2-13
Absolute File Name . . . . . . . . . . . . . . . . . . . . . . . 2-13
Using Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Displaying Global Symbols . . . . . . . . . . . . . . . . . . . 2-14
Displaying Local Symbols . . . . . . . . . . . . . . . . . . . 2-15
Transfer Symbols to the Emulator . . . . . . . . . . . . . . . 2-17
Displaying Memory in Mnemonic Format . . . . . . . . . . . . . 2-18
Stepping Through the Program . . . . . . . . . . . . . . . . . . . 2-19
Specifying a Step Count . . . . . . . . . . . . . . . . . . . . . 2-20
Modifying Memory . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Running the Program . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Searching Memory for Data . . . . . . . . . . . . . . . . . . . . 2-23
Breaking into the Monitor . . . . . . . . . . . . . . . . . . . . . 2-23
Using Software Breakpoints . . . . . . . . . . . . . . . . . . . . 2-24
Defining a Software Breakpoint . . . . . . . . . . . . . . . . 2-25
Displaying Software Breakpoints . . . . . . . . . . . . . . . . 2-26
Setting a Software Breakpoint . . . . . . . . . . . . . . . . . 2-26
Clearing a Software Breakpoint . . . . . . . . . . . . . . . . . 2-26
Using the Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Resetting the Analysis Specification . . . . . . . . . . . . . . 2-27
Specifying a Simple Trigger . . . . . . . . . . . . . . . . . . 2-27
Starting the Trace . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Displaying the Trace . . . . . . . . . . . . . . . . . . . . . . 2-31
For a Complete Description . . . . . . . . . . . . . . . . . . . 2-33
Using a Command File . . . . . . . . . . . . . . . . . . . . . . . 2-33
Resetting the Emulator . . . . . . . . . . . . . . . . . . . . . . . 2-34
Exiting the PC Interface . . . . . . . . . . . . . . . . . . . . . . 2-35
3 In-Circuit Emulation
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Installing the Target System Probe . . . . . . . . . . . . . . . . . . 3-2
Installing into a PLCC Type Socket . . . . . . . . . . . . . . . . . 3-3
Running the Emulator from Target Reset . . . . . . . . . . . . . . 3-4
12-Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Accessing the Emulator Configuration Options . . . . . . . . . . . 4-2
Internal Emulator Clock? . . . . . . . . . . . . . . . . . . . . . . . 4-3
Enable Real-Time Mode? . . . . . . . . . . . . . . . . . . . . . . 4-3
Enable Breaks on Writes to ROM? . . . . . . . . . . . . . . . . . . 4-5
Enable Software Breakpoints? . . . . . . . . . . . . . . . . . . . . 4-6
Enable CMB Interaction? . . . . . . . . . . . . . . . . . . . . . . . 4-7
Enable Bus Arbitration? . . . . . . . . . . . . . . . . . . . . . . . 4-8
Drive Background Cycles to Target? . . . . . . . . . . . . . . . . . 4-9
Enable NMI Input from Target? . . . . . . . . . . . . . . . . . . 4-10
Enable /RES Input from Target? . . . . . . . . . . . . . . . . . . 4-11
Drive Emulation Reset to Target? . . . . . . . . . . . . . . . . . 4-12
Trace Bus Release Cycles? . . . . . . . . . . . . . . . . . . . . . 4-12
Processor type . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Processor Operation Mode . . . . . . . . . . . . . . . . . . . . . 4-13
Monitor Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
Foreground Monitor Address . . . . . . . . . . . . . . . . . . . . 4-15
Reset Value for Stack Pointer? . . . . . . . . . . . . . . . . . . . 4-16
Storing an Emulator Configuration . . . . . . . . . . . . . . . . . 4-17
Loading an Emulator Configuration . . . . . . . . . . . . . . . . 4-17
Contents-13
pwm3 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
wdt Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
sci1 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
sci2 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
adc Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
Illustrations
14-Contents
Tables
Contents-15
Notes
16-Contents
1
Purpose of the The H8/536 emulator is designed to replace the H8/536 microprocessor
in your target system to help you debug/integrate target system
H8/536 Emulator software and hardware. The emulator performs just like the processor
which it replaces, but at the same time, it gives you information about
the bus cycle operation of the processor. The emulator gives you
control over target system execution and allows you to view or modify
the contents of processor registers, target system memory.
Introduction 1-17
Figure 1-1. HP 64739 Emulator for the H8/536 Processor
1-18 Introduction
Features of the This section introduces you to the features of the emulator. The
chapters which follow show you how to use these features.
H8/536 Emulator
Supported The H8/536 emulator supports the microprocessors listed in Table 1-1.
Microprocessors
Clock Speeds You can select whether the emulator will be clocked by the internal
clock source or by the external clock source on your target system. You
must use a clock input conforming to the specification of Table 1-2.
When you use an external crystal, you need to input conforming to the
specification of microprocessor.
Introduction 1-19
Table 1-2. Clock Speeds
Emulation memory The H8/536 emulator is used with one of the following Emulation
Memory Cards.
HP 64726A 128K byte Emulation Memory Card
HP 64727A 512K byte Emulation Memory Card
HP 64728A 1M byte Emulation Memory Card
You can define up to 16 memory ranges (at 256 byte boundaries and
least 256 byte in length.) The emulator occupies 2K byte, which is
used for monitor program, leaving 126K, 510K, 1022K byte of
emulation memory which you may use. You can characterize memory
range as emulation RAM (eram), emulation ROM (erom), target
system RAM (tram), target system ROM (trom), or guarded memory
(grd). The emulator generates an error message when accesses are
made to guarded memory locations. You can also configure the
emulator so that writes to memory defined as ROM cause emulator
execution to break out of target program execution.
1-20 Introduction
Analysis The H8/536 emulator is used with one of the following analyzers
which allows you to trace code execution and processor activity.
HP 64704A 80-channel Emulation Bus Analyzer
HP 64703A 64-channel Emulation Bus Analyzer and
16-channel State/Timing Analyzer.
HP 64794x 80-channel 8K/64K/256K Emulation Bus
Analyzer.
Registers You can display or modify the H8/536 internal register contents. This
includes the ability to modify the program counter (PC) and code page
register (CP) so you can control where the emulator begins executing a
target system program.
Single-Step You can direct the emulation processor to execute a single instruction
or a specified number of instructions.
Target System You can set the interface to the target system to be active or passive
Interface during background monitor operation. (See the "Configuring the
Emulator" chapter for further details.)
Breakpoints You can set up the emulator/analyzer interaction so that when the
analyzer finds a specific state, emulator execution will break to the
background monitor.
You can also define software breakpoints in your program. The
emulator uses one of H8/536 undefined opcode (1B hex) as software
breakpoint interrupt instruction. When you define a software
breakpoint, the emulator places the breakpoint interrupt instruction (1B
hex) at the specified address; after the breakpoint interrupt instruction
causes emulator execution to break out of your program, the emulator
replaces the original opcode. Refer to the "Using Software
Breakpoints" section of "Getting Started" chapter for more information.
Introduction 1-21
Reset Support The emulator can be reset from the emulation system under your
control; or your target system can reset the emulation processor.
Limitations,
Restrictions
DMA Support Direct memory access to H8/536 emulation memory is not permitted.
Sleep and Software When the emulator breaks into the emulation monitor, H8/536
Stand-by Mode microprocessor sleep or software stand-by mode is released and comes
to normal processor mode.
Watch Dog Timer in Watch dog timer suspends count up while the emulator is running in
Background background monitor.
RAM Enable Bit The internal RAM of H8/536 processor can be enabled/disabled by
RAME (RAM enable bit). However, once you map the internal RAM
area to emulation RAM, the emulator accesses emulation RAM even if
the internal RAM is disabled by RAME.
1-22 Introduction
2
Getting Started
Introduction This chapter leads you through a basic, step by step tutorial that shows
how to use the HP 64739 emulator with the PC Interface.
This chapter will:
Tell you what must be done before you can use the emulator
as shown in the tutorial examples.
Prerequisites Before beginning the tutorial presented in this chapter, you must have
completed the following tasks:
1. Connected the emulator to your computer. The HP 64700
Emulators: Hardware Installation and Configuration manual
shows you how to do this.
A Look at the Sample The sample program used in this chapter is listed in Figure 2-1. The
Program program is a primitive command interpreter.
Using the various features of the emulator, we will show you how to
load this program into emulation memory, execute it, monitor the
program’s operation with the analyzer, and simulate entry of different
commands by using the "Memory Modify" emulation command.
.SECTION Table,DATA
Msgs
Msg_A .SDATA "Command A entered "
Msg_B .SDATA "Entered B command "
Msg_I .SDATA "Invalid Command "
End_Msgs
.SECTION Prog,CODE
;***********************************************
;* Sets up the stack pointer.
;***********************************************
Init MOV:G.W #Stack,R7
;***********************************************
;* Clear previous command.
;***********************************************
Read_Cmd MOV:G.B #0,@Cmd_Input
;***********************************************
;* Read command input byte. If no command has
;* been entered, continue to scan for input.
;***********************************************
Scan MOV:G.B @Cmd_Input,R0
BEQ Scan
;***********************************************
;* A command has been entered. Check if it is
;* command A, command B, or invalid.
;***********************************************
Exe_Cmd CMP:E.B #H’41,R0
BEQ Cmd_A
CMP:E.B #H’42,R0
BEQ Cmd_B
BRA Cmd_I
;***********************************************
;* Command A is entered. R1 = the number of
;* bytes in message A. R4 = location of the
;* message. Jump to the routine which writes
;* the messages.
;***********************************************
Cmd_A MOV:I.W #Msg_B-Msg_A-1,R1
MOV:I.W #Msg_A,R4
BRA Write_Msg
;***********************************************
;* Command B is entered.
;***********************************************
Cmd_B MOV:I.W #Msg_I-Msg_B-1,R1
MOV:I.W #Msg_B,R4
BRA Write_Msg
.SECTION Data,COMMON
;***********************************************
;* Command input byte.
;***********************************************
Cmd_Input .RES.B 1
.RES.B 1
;***********************************************
;* Destination of the command messages.
;***********************************************
Msg_Dest .RES.W H’3E
Stack .RES.W 1 ; Stack area.
Data Declarations
The program instruction at the Init label initializes the stack pointer.
Reading Input
Processing Commands
Linking the Sample The sample program can be linked with following command and
Program generates an absolute file. The contents of "cmd_rds.k" linkage editor
subcommand file is shown in Figure 2-2.
C>h8lnk /SUBCOMMAND=cmd_rds.k <RETURN>
In addition to the linker load map listing (cmd_rds.map), the
"cmd_rds.abs" absolute file is created.
debug
input cmd_rds
start Prog(1000),Table(1100),Data(0FC00)
print cmd_rds
output cmd_rds
exit
Note You need to specify DEBUG command line option to both assembler
and linker command to generate local symbol information. The
DEBUG option for the assembler and linker direct to include local
symbol information to the object file.
Emulator Status The status of the emulator is shown on the line above the command
options. The PC Interface periodically checks the status of the
emulator and updates the status line.
Modifying You need to set up the emulation configuration before using the sample
program. To access the emulation configuration display, enter:
Configuration
Config, General
Defining the Reset Even though the H8/536 emulator has a background monitor, it
Value for the Stack requires you to define a stack pointer.
Pointer
Use the arrow keys to move the cursorto the "Reset value for Stack
Pointer" field, type 0fc80 and press Enter.
The stack pointer value will be set to the stack pointer (SP) on entrance
to the emulation monitor initiated RESET state (the "Emulation reset"
status).
Selecting your You need to select the processor you are going to emulate. Use the
Processor arrow keys to move the cursor to the "Processor type?" field. Use the
TAB key to select the processor you are going to emulate.
Mapping Memory The H8/536 emulator contains 126 kilobytes of high-speed emulation
memory (no wait states required) that can be mapped at a resolution of
256 bytes.
The memory mapper allows you to characterize memory locations. It
allows you specify whether a certain range of memory is present in the
target system or whether you will be using emulation memory for that
address range. You can also specify whether the target system memory
is ROM or RAM, and you can specify that emulation memory be
treated as ROM or RAM. You can include function code information
with address ranges to further characterize the memory block.
Note When you use the H8/536 internal ROM and RAM, you must map
memory space where internal ROM and RAM are located as each
emulation ROM and RAM.
Which Memory Typically, assemblers generate relocatable files and linkers combine
Locations Should Be relocatable files to form the absolute file. The linker load map listing
Mapped? will show what locations your program will occupy in memory. A part
of linker load map listing for the sample program (cmd_rds.map) is
shown in Figure 2-4.
From the load map listing, you can see that the sample program
occupies locations in three address ranges. The code area, which
contains the opcodes and operands which make up the sample program,
occupies locations 1000 hex through 1042 hex. The data area, which
contains the ASCII values of the messages the program displays, is
occupies locations 1100 hex through 1133 hex. The destination area,
which contains the command input byte and the locations of the
message destination and the stack, occupies locations FC00 hex
through FC7F hex.
Two mapper terms will be specified for the example program. Since
the program writes to the destination locations, the mapper block
containing the destination locations should not be characterized as
ROM memory.
To map memory for the sample program, select:
Config, Map, Modify
Move the cursor to the "memory type" field of term 1, and press the
TAB key to select the erom (emulation ROM) type. Move the cursor
to the "address range" field of term 2 and enter:
0fc00..0fcff
Move the cursor to the "memory type" field of term 2, and press the
TAB key to select the eram (emulation RAM) type. To save your
memory map, use the Enter key to exit the field in the lower right
corner. (The End key on Vectra keyboards moves the cursor directly
to the last field.) The memory configuration display is shown in Figure
2-5.
Note The memory mapper re-assigns blocks of emulation memory after the
insertion or deletion of mapper terms. For example, if you modified
the contents of FC00 hex through FCFF hex above, deleted term 1, and
displayed locations FC00 hex through FCFF hex, you would notice the
contents of those locations are not the same as they were before
deleting the mapper term.
Loading Programs If you have already assembled and linked the sample program, you can
load the absolute file by selecting:
into Memory
Memory, Load
File Format Enter the format of your absolute file. The emulator will accept
absolute files in the following formats:
HP 64869 absolute.
HP absolute.
Raw HP64000 absolute.
Intel hexadecimal.
Tektronix hexadecimal.
Motorola S-records.
Memory Type The second field allows you to selectively load the portions of the
absolute file which reside in emulation memory, target system
memory, or both.
Since emulation memory is mapped for sample program locations, you
can enter either "emulation" or "both".
Force Absolute File This option is only available for HP 64869 and HP64000 formats. It
Read forces the file format readers to regenarate the emulator absolute file
(.hpa) and symbol data base (.hps) before loading the code. Normally,
these files are only regenarated whenever the file you specify (the
output of your language tools) is newer than the emulator absolute file
and symbol data base.
For more information, refer to the "Using the HP 64869 Format
Reader" section in Appendix A.
Absolute File Name For most formats, you enter the name of your absolute file in the last
field. Type cmd_rds.abs, and press Enter to start the memory load.
Displaying Global When you load HP 64869 or HP64000 format absolute files into the
Symbols emulator, the corresponding symbol database is also loaded.
The symbols database can also be loaded with the "System Symbols
Global Load" command. This command is provided for situations
where multiple absolute files are loaded into the emulator; it allows
you to load the various sets of global symbols corresponding to the
various absolute files. When global symbols are loaded into the
emulator, information about previous global symbols is lost (that is,
only one set of global symbols can be loaded at a time).
After global symbols are loaded, both global and local symbols can be
used when entering expressions. Global symbols are entered as they
appear in the source file or in the global symbols display.
To display global symbols, select:
System, Symbols, Global, Display
Transfer Symbols to You can use the emulator’s symbol-handling capability to improve
the Emulator measurement displays. You do this by transferring the symbol database
information to the emulator. To transfer the global symbol information
to the emulator, use the command:
System, Symbols, Global, Transfer
Transfer the local symbol information for all modules by entering:
System, Symbols, Local, Transfer, All
You can find more information on emulator symbol handling
commands in the Emulator PC Interface Reference.
Enter the address range "1000..1029". (You could also specify this
address range using symbols, for example, "Init..Cmd_I" or
"Init..Init+29".) The emulation window automatically becomes the
active window as a result of this command. You can press <CTRL>z
to zoom the emulation window. The resulting display follows.
Enter a step count of 1, enter the symbol Init (defined as a global in the
source file), and press Enter to step from program’s first address, 1000
hex. The executed instruction, the program counter address, and the
resulting register contents are displayed as shown in the following
listing.
Specifying a Step If you wish to continue to step a number of times from the current
Count program counter, select:
Processor, Step, Pc
The previous step count is displayed in the "number of instructions"
field. You can enter a number from 1 through 99 to specify the number
of times to step. Type 5 into the field, and press Enter. The resulting
display follows.
Modifying Memory The preceding step commands show the sample program is executing
in the Scan loop, where it continually reads the command input byte to
check if a command has been entered. To simulate the entry of a
sample program command, you can modify the command input byte by
selecting:
Memory, Modify, Byte
Now enter the address of the memory location to be modified, an equal
sign, and new value of that location, for example, "Cmd_Input=41".
(The Cmd_Input label was defined as a global symbol in the source
file.)
To verify that 41 hex was indeed written to Cmd_Input (FC00 hex),
select:
Memory, Display, Byte
You can continue to step through the program as shown earlier in this
chapter to view the instructions which are executed when an "A" (41
hex) command is entered.
Running the To start the emulator executing the sample program, select:
Program
Processor, Go, Pc
The status line will show that the emulator is "Running user program".
Breaking into the To break emulator execution from the sample program to the monitor
program, select:
Monitor
Processor, Break
The status line shows that the emulator is "Running in monitor".
While the break will occur as soon as possible, the actual stopping
point may be many cycles after the break request (dependent on the
type of instruction being executed and whether the processor is in a
hold state).
Note You must set software breakpoints only at memory locations which
contain instruction opcodes (not operands or data). If a software
breakpoint is set at a memory location which is not an instruction
opcode, the software breakpoint instruction will never be executed and
the break will never occur.
Defining a Software To define a breakpoint at the address of the Cmd_I label of the sample
Breakpoint program (1029 hex), select:
Breakpoints, Add
Enter the local symbol "Cmd_I". After the breakpoint is added, the
breakpoint window becomes active and shows that the breakpoint is set.
You can add multiple breakpoints in a single command by separating
each one with a semicolon. For example, you could type
"1019;1021;1029" to set three breakpoints.
Breakpoints, Display
The resulting display will show that the breakpoint has been cleared.
Clearing a Software If you wish to clear a software breakpoint that does not get hit during
Breakpoint program execution, you can select:
Note Emulators which have the optional external analyzer will display the
Interna/External options after the commands in the following
examples. Enter Internal to execute the examples.
Resetting the To be sure that the analyzer is in its default or power-up state, select:
Analysis
Specification
Specifying a Simple Suppose you wish to trace the states of the sample program which
Trigger follow the read of a "B" (42 hex) command from the command input
byte. To do this, you must modify the default analysis specification by
selecting:
Analysis, Trace, Modify
The emulation analysis specification is shown. Use the right arrow key
to move the cursor to the "Trigger on" field. Type "a" and press Enter.
You’ll enter the pattern expression menu. Press the up arrow key until
the addr field directly opposite the pattern a= is highlighted. Type the
address of the command input byte, using either the global symbol
Cmd_Input or address 0fc00, and press Enter.
The "Data" field is now highlighted. Type 42xx and press Enter. 42 is
the value of the "B" command and the "x"s specify "don’t care" values.
You may want to trigger the emulation analyzer when specific data
appears on the data bus. You can accomplish this by specifying "Data"
in the "Find State" field of analysis specification display.
There are some points to be noticed when you trigger the analyzer in
this way. You always need to specify the "Data" with 16 bits value
even when access to the data is performed by byte access. This is
because the analyzer is designed so that it can capture data on internal
data bus (which has 16 bits width). The following table shows the
way to specify the trigger condition by data.
(DATA READ/WRITE)
=====================================================
| | Available
Location of data | Accesses | <DATA> Specification
=====================================================
Internal ROM,RAM | Word | HHLL *1
+----------+---------------------
| Byte | DDxx *2
-------------------+----------+---------------------
Others | DDxx
=====================================================
(INSTRUCTION FETCH)
=====================================================
| | Available
Location of data | Address | <DATA> Specification
=====================================================
Internal ROM,RAM | EVEN | HHLL *1
+----------+---------------------
| ODD | xxDD *2
--------------------+----------+---------------------
Others | DDxx *2
=====================================================
*1 HHLL means 16 bits data
*2 DD means 8 bits data
For example, to trigger the analyzer when the processor performs word
access to data 1234 hex in internal ROM, you can use 1234h as the
"Data" specification.
To trigger the analyzer when the processor accesses data 12 hex in
external ROM, you can use 12xxh as "Data" specification.
Now the "Status" field is highlighted. Use the Tab key to view the
status qualifiers which may be entered. The status qualifiers are
defined as follows.
Select the read status and press Enter. Figure 2-6 and 2-7 show the
resulting analysis specification. To save the new specification, use
End Enter to exit the field in the lower right corner. You’ll return to
the trace specification. Press End to move to the trriger spec field.
Press Enter to exit the trace specification.
Analysis, Begin
A message on the status line will show you that the trace is running.
You do not expect the trigger to be found because no commands have
been entered. Modify the command input byte to "B" by selecting:
Memory, Modify, Byte
Enter "Cmd_Input=42". The status line now shows that the trace is
complete.
Analysis, Display
You are now given two fields in which to specify the states to display.
Use the right arrow key to move the cursor to the "Ending state to
display" field. Type "60" into the ending state field, press Enter, and
use <CTRL>z to zoom the trace window.
Note If you choose to dump a complete trace into the trace buffer, it will
take a few minutes to display the trace.
Use the Home key to get the top of the trace. The resulting trace is
similar to the trace shown in the following display.
To list the next lines of the trace, press the PgDn or Next key.
For a Complete For a complete description of using the HP 64700 Series analyzer with
Description the PC Interface, refer to the HP 64700 Emulators PC Interface:
Analyzer User’s Guide.
Using a Command You can use a command file to perform many functions for you,
without having to manually type each function. For example, you
File might want to create a command file that modifies configuration, maps
memory and loads program into memory for the sample program. To
create such a command file:
System, Log, Input, Enable
Enter command file name "cmd_rds.cmd", and press Enter. This sets
up a file to record all commands you execute. The commands will be
logged to the file cmd_rds.cmd in the current directory. You can then
use this file as a command file to execute these commands
automatically.
First, to set up the reset value for the stack pointer:
Config, General
Use the arrow keys to move the cursor to the "Reset value for Stack
Pointer" field, type 0fc80, and press End and Enter.
To map the memory:
Config, Map, Memory
Map 1000 hex through 1fff hex to erom and fc00 hex through fcff hex
to eram. (As shown in Figure 2-5.)
To load the program into memory:
Memory, Load
Enter file format, memory type, and absolute file name, and press
Enter.
Now we’re finished logging commands to the file. To disable logging:
In-Circuit Emulation
Prerequisites Before performing the tasks described in this chapter, you should be
familiar with how the emulator operates in general. Refer to the HP
64700 Emulators: System Overview manual and the "Getting Started"
chapter of this manual.
Power Down Target System. Turn off power to the user target
system and to the H8/536 emulator before inserting the user plug to
avoid circuit damage resulting from voltage transients or mis-insertion
of the user plug.
Verify User Plug Orientation. Make certain that Pin 1 of the target
system microprocessor socket and Pin 1 of the user plug are properly
aligned before inserting the user plug in the socket. Failure to do so
may result in damage to the emulator circuitry.
Running the You can specify that the emulator begins executing from target system
reset. When the target system /RES line becomes active and then
Emulator from inactive, the emulator will start reset sequence (operation) as actual
Target Reset microprocessor.
At First, you must specify the emulator responds to /RES signal by the
target system (see the "Enable /RES input from Target" configuration
in Chapter 4 of this manual).
Introduction The H8/536 emulator can be used in all stages of target system
development. For instance, you can run the emulator out-of-circuit
when developing target system software, or you can use the emulator
in-circuit when integrating software with target system hardware.
Emulation memory can be used in place of, or along with, target
system memory. You can use the emulator’s internal clock or the
target system clock. You can execute target programs in real-time or
allow emulator execution to be diverted into the monitor when
commands request access of target system resources (target system
memory, register contents, etc.)
The emulator is a flexible instrument and it may be configured to suit
your needs at any stage of the development process. This chapter
describes the options available when configuring the H8/536 emulator.
Note Changing the clock source drives the emulator into the reset state.
Enable Real-Time If it is important that the emulator execute target system programs in
real-time, you can enable the real-time emulator mode. In other words,
Mode? when you execute target programs (with the "Processor, Go"
command), the emulator will execute in real-time.
Register display/modification.
Note The wrrom analysis specification status option allows you to use
"write to ROM" cycles as trigger and storage qualifiers.
command is entered.
Note Changing this configuration drives the emulator into the reset state.
Note Changing this configuration drives the emulator into the reset state.
While running the background monitor, the emulator ignores /RES and
/STBY signals except that the emulator’s status is "Awaiting target
reset".
Note Changing this configuration drives the emulator into the reset state.
Note If you specify that the emulator will drive the /RES signal to the target
system during emulation reset or by the overflow of Watch Dog Timer,
the emulator should be configured to respond to the /RES input to the
target system.
Trace Bus You can direct the emulator to send bus release cycle data to emulation
analyzer or not to send it.
Release Cycles?
Note Changing this configuration drives the emulator into the reset state.
<mode_num> Description
Note Changing this configuration drives the emulator into the reset state.
Monitor Type
bg Specify monitor type as background monitor.
When you select background monitor,
configuration question of foreground monitor
address have no effect to emulator’s operation.
Note Changing this configuration drives the emulator into the reset state.
Foreground You must specify foreground monitor start address when you select
"fg" by above configuration question "Monitor type". This address
Monitor Address specification must be same with the address specification when you
assemble the foreground monitor program.
The address must be specified in a 20-bit hexadecimal address, and
must be located on a 2K byte boundary other than 0 hex.
Note We recommend that you use this method of configuring the stack
pointer and the stack page register. Without a stack pointer and a stack
page register, the emulator is unable to make the transition to the run
state, step, or perform many other emulation functions. However,
using this option does not preclude you from changing the stack
pointer value or location within your program; it just sets the initial
conditions to allow a run to begin.
Introduction In the "Getting Started" chapter, you learned how to load code into the
emulator, how to modify memory and view a register, and how to
perform a simple analyzer measurement. In this chapter, we will
discuss in more detail other features of the emulator.
This chapter shows you how to:
Three signal lines on the CMB are active and serve the following
functions when enabled:
Running the Before you can specify that the emulator run upon receipt of the
Emulator at /EXECUTE signal, you must enable CMB interaction. To do this,
/EXECUTE select:
Config, General
Use the arrow keys to move the cursor to the "Enable CMB
Interaction? [n]" question, and type "y". Use the Enter key to exit out
of the lower right-hand field in the configuration display.
The command you enter is saved and is executed when the /EXECUTE
signal becomes active. Also, you will see the message "ALERT: CMB
execute; run started".
Breaking on the To cause emulator execution to break into the monitor when the
Analyzer Trigger analyzer trigger condition is found, you must modify the trigger
configuration. To access the trigger configuration, select:
Config, Trigger
The trigger configuration display contains two diagrams, one for each
of the internal TRIG1 and TRIG2 signals.
Memory, Store
Note The first character of the absolute file name must be a letter. You can
name the absolute file with a total of 8 alphanumeric characters, and
optionally, you can include an extension of up to 3 alphanumeric
characters.
Caution The "Memory Store" command writes over an existing file if it has the
same name that is specified with the command. You may wish to
verify beforehand that the specified filename does not already exist.
Accessing Target You can access target system devices in synchronization with the E
clock. To do this, use the following commands:
System with E
clock synchronous
instruction
Processor, IO, Display
Processor, IO, Modify
The emulator will access the device using the MOVFPE/MOVTPE
instruction.
Summary H8/536 register designators. All available register class names and
register names are listed below.
* (Basic) Class
pc Program counter
cp Code page register
sr Status register
dp Data page register
ep Extended page register
tp Stack page register
br Base register
r0 Register R0
r1 Register R1
r2 Register R2
r3 Register R3
r4 Register R4
r5 Register R5
r6 Register R6
r7 Register R6
r7 Register R7
fp Frame pointer
sp Stack pointer
mdcr Mode control register
Using the HP 64000 An HP 64000 “reader” is provided with the PC Interface. The
Reader HP 64000 Reader converts the files into two files that are usable with
your emulator. This means that you can use available language tools to
create HP 64000 absolute files, then load those files into the emulator
using the PC Interface.
The HP 64000 Reader can operate from within the PC Interface or as a
separate process. When operating the HP 64000 Reader, it may be
necessary to execute it as a separate process if there is not enough
memory on your personal computer to operate the PC Interface and HP
64000 Reader simultaneously. You can also operate the reader as part
of a “make file.”
What the Reader Using the HP 64000 files (<file.X>, <file.L>, <scr1.A>, <scr2.A>, ...)
Accomplishes the HP 64000 Reader will produce two new files, an “absolute” file and
an ASCII symbol file, that will be used by the PC Interface. These new
files are named: “<file>.hpa” and “<file>.hps.”
Note You must use the required options for your specific language tools to
include symbolic (“debug”) information in the HP 64000 symbol files.
The HP 64000 Reader will only convert symbol information present in
the HP 64000 symbol files (<file.L>, <src1.A>, <src2.A>, ...).
module_name1
module_name2
...
module_nameN
global_symbol1 address
global_symbol2 address
...
global_symbolN address
|module_name1|# 1234 address
|module_name1|local_symbol1 address
|module_name1|local_symbol2 address
...
|module_name1|local_symbolN address
Note When the line number symbol is displayed in the emulator, it appears
in brackets. Therefore, the symbol “MODNAME: line 345” will be
displayed as “MODNAME:[345]” in mnemonic memory and trace list
displays.
You access line number symbols by entering the following on one line
in the order shown:
module name
colon (:)
space
the word “line”
space
the decimal line number
For example:
main.c: line 23
Location of the The HP 64000 Reader is located in the directory named \hp64700\bin
HP 64000 Reader by default, along with the PC Interface. This directory must be in the
Program environment variable PATH for the HP 64000 Reader and PC Interface
to operate properly. The PATH is usually defined in the
“\autoexec.bat” file.
The following examples assume that you have “\hp64000\bin”
included in your PATH variable. If not, you must supply the
directory name when executing the Reader program.
Using the Reader The PC Interface has a file format option under the “Memory Load”
from the PC Interface command. After you select HP64000 as the file format, the HP 64000
Reader will operate on the file you specify. After this completes
successfully, the PC Interface will accept the absolute and symbol files
produced by the Reader.
To use the Reader from the PC Interface:
1. Start up the PC Interface.
It checks to see if two files with the same base name and
extensions .HPS and .HPA already exist (for example,
TESTFILE.HPS and TESTFILE.HPA).
If the Reader Won’t If your program is very large, the PC Interface may run out of memory
Run while attempting to create the database file. If this occurs, you will
need to exit the PC Interface and execute the program at the MS-DOS
command prompt to create the files that are downloaded to the
emulator.
Using the A HP 64869 format "reader" is provided with the PC Interface. The
HP 64869 Reader converts a HP 64869 format file into two files that
HP 64869 Reader are usable with the HP 64739 emulator. This means you can use
available language tools to create HP 64869 format absolute files, then
load those files into the emulator using the H8/536 PC Interface.
The HP 64869 Reader can operate from within the PC Interface or as a
separate process. Operation from within the PC Interface is available if
there is enough memory on your personal computer to run the PC
Interface and HP 64869 Reader simultaneously.
What the Reader Using any HP 64869 format absolute file in the form "<file>.<ext>",
Accomplishes the HP 64869 Reader will produce two new files, an "absolute" file and
an ASCII symbol file, that will be used by the H8/536 PC Interface.
Note You must use the required options for you specific language tools to
include symbolic ("debug") information in the HP 64869 format
absolute file.
Note When the line number symbol is displayed in the emulator, it appears
as a bracketed number. Therefore, the symbol "modname:# 345" will
be displayed as "modname:[345]" in mnemonic memory and trace list
displays
Location of the The HP 64869 Reader is located in the directory named \hp64700\bin
HP 64869 Reader by default, along with the PC Interface. This directory must be in the
Program environment variable PATH for the HP 64869 Reader and PC Interface
to operate properly. This is usually defined in "\autoexec.bat" file.
Using the HP 64869 The command name for the HP 64869 Reader is RD64869.EXE. You
Reader from MS-DOS can execute the HP 64869 Reader from the command line with the
command:
C:\HP64700\BIN\RD64869 [-q] <filename>
<RETURN>
where:
Using the HP 64869 format file that you specify (TESTFILE.ABS, for
example), the PC Interface performs the following:
Checks to see if two files with the same base name and
extensions .HPS and .HPA already exist (for example,
TESTFILE.HPS and TESTFILE.HPA).
If the Reader Won’t If your program is very large, then the PC Interface may run out of
Run memory while attempting to create the database file used. If this
condition occurs, you will need to exit the PC Interface and execute the
program at the command prompt to create the files that are downloaded
to the emulator.
Including RD64869 in You may wish to incorporate the "RD64869" process as the last step in
a Make File your "make" file, or as a step in your construction process, so as to
eliminate the possibility of having to exit the PC Interface due to space
limitations describe above. If the "-.HPA" and "-.HPS" files are not
current, the process of loading an HP 64869 format file will
automatically create them.
Index-41
writes to ROM 2-9
bus arbitration
using configuration to isolate target problem 4-8
C cautions
filenames in the memory store command 5-5
installing the target system probe 3-2
characterization of memory 2-9
cim, Terminal Interface command 2-25
clock source
external 4-3
internal 4-3
clock source selection, emulator configuration 4-3
CMB (coordinated measurement bus) 5-2
enabling interaction 4-7
execute signal while emulator is reset 2-34
signals 5-2
command file
creating and using 2-33
commands (PC Interface), selecting 2-8
Configuration
for sample program 2-8
reset value for stack pointer 2-8
configuration (emulator)
accessing 4-2
background cycles to target 4-9
break processor on write to ROM 4-5
clock selection 4-3
enable CMB interaction 4-7
enable NMI input 4-10
enable software breakpoints 4-6
enabling real-time runs 4-3
honor target reset 4-11
loading 4-17
monitor type) 4-14
processor mode 4-13
stack pointer 4-16
storing 4-17
configuration(hardware), installing the emulator 2-2
coordinated measurements
break on analyzer trigger 5-3
definition 5-2
42-Index
multiple emulator start/stop 4-7
run at /EXECUTE 5-3
count, step command 2-20
D device table, emulator 2-7
display command
registers 5-6
displaying the trace 2-31
E E clock) 5-5
emulation memory
RAM and ROM 2-9
size of 2-9
emulator
before using 2-2
device table 2-7
DMA support 1-6, 4-8
features of 1-3
limitations 1-6
memory mapper resolution 2-9
prerequisites 2-2
purpose of 1-1
reset 2-34
running from target reset 3-4
sleep mode 1-6
software stand-by mode 1-6
status 2-8
target system 1-5
watch-dog timer 1-6
emulator configuration
bus arbitration 4-8
Emulator features
analyzer 1-5
clock speeds 1-3
emulation memory 1-4
supported microprocessors 1-3
Emulator limitations
RAM enable bit 1-6
enable real-time runs
emulator configuration 4-3
eram, memory characterization 2-9
erom, memory characterization 2-9
Index-43
EXECUTE
CMB signal 5-3
run at 5-3
executing programs 2-22
exiting the PC Interface 2-35
external clock source 4-3
F features of the emulator 1-3
file format
HP 64869 A-6
file formats
HP64000 A-4
find data in memory 2-23
foreground monitor address 4-15
function codes
memory mapping 2-9
function key macro 2-20
G getting started
prerequisites 2-2
global symbols 2-14, 2-19
grd, memory characterization 2-9
guarded memory accesses 2-9
H hardware installation 2-2
HP 64000 Reader A-1
using with PC Interface A-4
HP 64000 Reader command (RHP64000.EXE) A-3
HP 64869 format 2-13
loading 2-13
HP 64869 Reader A-6
using with PC Interface A-8
HP 64869 Reader command (RD64869.EXE) A-8
HP64000 file format A-4
HP64000 format 2-13
HPTABLES environment variable 2-7
I in-circuit emulation 3-1, 4-1
installation
hardware 2-2
software 2-2
installing target system probe
Seetarget system probe
44-Index
internal clock source 4-3
internal I/O register display/modify 5-6
interrupt
NMI 4-10
L limitations of the emulator 1-6
line numbers 2-32
link the sample program 2-6
linkers 2-9
load map 2-9
loading absolute files 2-12
local symbols 2-15, 2-25, A-3, A-7
location of foreground monitor 4-15
locked, PC Interface exit option 2-35
logging of commands 2-33
M macro 2-20
make file A-1, A-6
mapping memory 2-9
memory
displaying in mnemonic format 2-18
mapping 2-9
modifying 2-21
re-assignment of emulation memory blocks 2-12
searching for data 2-23
memory characterization 2-9
memory mapping
function codes 2-9
ranges, maximum 2-9
monitor type 4-14
MOVFPE instruction 5-5
MOVTPE instruction 5-5
N non-maskable interrupt 4-10
Notes
"Timing" option only with external analyzer 5-4
absolute file names for stored memory 5-5
changing clock source forces reset 4-3
CMB interaction enabled on execute command 4-7
config. option for reset stack pointer recommended 4-16
date checking only in PC Interface A-5, A-10
displaying complete traces 2-31
DMA to emulation memory not supported 4-8
Index-45
internal memory must be assigned as emulation memory 2-9
re-assignment of emul. mem. blocks by mapper 2-12
register command 2-20
setting software bkpts. while running user code 2-25
software breakpoint locations 2-24
software breakpoints and ROM code 2-25
terminal window to modify emul. config. 4-2
use required options to include symbols A-2, A-7
write to ROM analyzer status 4-5
O out-of-circuit emulation 4-1
P PC Interface
exiting the 2-35
HP 64000 Reader A-4
HP 64869 Reader A-8
selecting commands 2-8
starting the 2-7
Pin guard
target system probe 3-2
PLCC socket
connect to the target system 3-3
predefining stack pointer 4-16
prerequisites for getting started 2-2
processor operation mode 4-13
purpose of the emulator 1-1
Q qualifiers, analyzer status 2-29
R RAM, mapping emulation or target 2-9
Raw HP64000 format 2-13
reader
RD64869 A-6
READY, CMB signal 5-2
real-time execution
commands not allowed during 4-4
commands which will cause break 4-4
real-time operation 1-6
real-time runs 4-3
register display/modify 2-20
registers 1-5, 5-6
relocatable files 2-9
reset 2-34
46-Index
reset (emulator)
running from target reset 3-4
reset(emulator) 1-6
resetting the analyzer specifications 2-27
ROM
mapping emulation or target 2-9
writes to 2-9
run at /EXECUTE 5-3
run from target reset 3-4
running programs 2-22
S sample program, linking 2-6
sample programs
for getting started 2-2
saving analysis specifications 2-31
searching for data in memory 2-23
selecting PC Interface commands 2-8
simple trigger, specifying 2-27
single-step 1-5
software breakpoint
H8/536 breakpoint interrupt instruction 4-6
software breakpoints 1-5, 2-24
clearing 2-26
defining (adding) 2-25
displaying 2-26
enabling 4-6
setting 2-26
software installation 2-2
specifications
Seeanalysis specification
stack pointer
reset value 2-8
stack pointer,defining 4-16
starting the trace 2-31
status (analyzer) qualifiers 2-29
status line 2-8
status qualifiers, H8/536/520 2-29
step 2-19
count specification 2-20
supervisor stack pointer
required for proper operation 4-16
symbols 2-14
Index-47
.HPS file format A-2, A-7
global 2-19
local 2-25, A-1, A-6
T target reset
running from 3-4
target system probe
cautions for installation 3-2
installation 3-2
installation procedure 3-3
pin guard 3-2
target system RAM and ROM 2-9
trace
analyzer signals 2-27
description of listing 2-32
displaying the 2-31
starting the 2-31
tram, memory characterization 2-9
TRIG1, TRIG2 internal signals 5-3
trigger 2-27
breaking into monitor on 5-3
specifying a simple 2-27
trigger state 2-32
TRIGGER, CMB signal 5-2
trom, memory characterization 2-9
48-Index