Copyright © 2003 ARM Limited. All rights reserved.
Application Note
The ARMulator
Document number: ARM DAI 0032F
Issued: September 2003
Copyright ARM Limited 2003
32
Table of Contents
2 Copyright © 2003 ARM Limited. All rights reserved. Application Note 32
ARM DAI 0032F
Application Note 32
The ARMulator
Copyright © 1996-2003 ARM Limited. All rights reserved.
Release information
The following changes have been made to this Application Note.
Change history
Date Issue Change
August 1996 A First release
August 1996 B Changes to remove references to integration with hardware modeling environments.
January 1998 C Changes to incorporate new models introduced in SDT version 2.10 and 2.11
April 1999 D Changes to reflect SDT 2.50.
August 2001 E Changes to reflect ADS 1.1.
September 2003 F Changes to reflect ADS 1.2, RVD 1.6.1, RVARMulator ISS 1.3, 1.3.1, and RVCT 2.0.1
Proprietary notice
ARM, the ARM Powered logo, Thumb and StrongARM are registered trademarks of ARM Limited.
The ARM logo, AMBA, Angel, ARMulator, EmbeddedICE, ModelGen, Multi-ICE, ARM7TDMI, ARM9TDMI, TDMI,
STRONG and RealView are trademarks of ARM Limited.
All other products, or services, mentioned herein may be trademarks of their respective owners.
Confidentiality status
This document is Open Access. This document has no restriction on distribution.
Feedback on this Application Note
If you have any comments on this Application Note, please send email to support@arm.com giving:
• the document title
• the document number
• the page number(s) to which your comments refer
• an explanation of your comments.
General suggestions for additions and improvements are also welcome.
ARM web address
http://www.arm.com
Table of Contents
Application Note 32 Copyright © 2003 ARM Limited. All rights reserved. 3
ARM DAI 0032F
Table of Contents
Table of Contents..........................................................................................................3
1 Introduction............................................................................................................4
1.1 The ARMulator Extension Kit...........................................................................4
1.2 RealView ARMulator Instruction Set Simulator ................................................5
1.3 Cached versus Uncached Targets...................................................................5
2 The Structure of the ARMulator ............................................................................6
2.1 The ARM processor core model ......................................................................6
2.2 The memory system........................................................................................7
2.3 The coprocessor interface ...............................................................................7
2.4 The operating system interface........................................................................7
3 Modeling Systems Using the ARMulator ..............................................................9
3.1 Modifying ARMulator.......................................................................................9
3.2 Generating exceptions...................................................................................12
3.3 Event scheduling...........................................................................................12
4 Example: Parallel Port Model ..............................................................................15
4.1 Creating the peripheral model (Windows procedure)......................................15
4.2 Explanation ...................................................................................................16
4.3 ARM application code ...................................................................................17
4.4 Running the application.................................................................................17
4.5 Running the Example on RealView Debugger ...............................................18
5 Example: Exception Generator Memory Model..................................................19
5.1 Creating and modifying the files.....................................................................19
5.2 Writing code to access the memory locations ................................................19
5.3 Writing ARM application code........................................................................19
5.4 Running the application.................................................................................19
6 Example: Coprocessor Model.............................................................................21
6.1 Creating the files ...........................................................................................21
6.2 Editing files....................................................................................................21
6.3 Writing application files..................................................................................21
6.4 Running the code..........................................................................................21
7 Debugging ARMulator models in Visual C++ .....................................................22
7.1 Creating a project..........................................................................................22
7.2 Adding files ...................................................................................................22
7.3 Configure project settings..............................................................................22
7.4 Compile the module ......................................................................................23
7.5 Ensure .dsc and .ami configuration files have been properly
configured..............................................................................................................23
7.6 Set breakpoints .............................................................................................23
7.7 Launch debugger ..........................................................................................23
8 Calling a Peripheral Every Cycle.........................................................................24
9 Communication between ARMulator models .....................................................28
9.1 How to model shared memory.......................................................................28
9.2 How to coordinate execution .........................................................................29
10 Known Issues.......................................................................................................30
Introduction
4 Copyright © 2003 ARM Limited. All rights reserved. Application Note 32
ARM DAI 0032F
1 Introduction
The ARMulator is a family of programs which emulate the instruction sets of various ARM
processors and their supporting architectures.
The ARMulator:
• provides an environment for the development of ARM-targeted software on a
range of non-ARM-based host systems
• allows benchmarking of ARM-targeted software (though its performance is
somewhat slow compared to real hardware)
1
• supports the simulation of prototype ARM-based systems, ahead of the
availability of real hardware, so that software and hardware development can
proceed in parallel.
The ARMulator is transparently connected to compatible ARM debuggers to provide a
hardware-independent ARM software development environment. Communication takes
place via the Remote Debug Interface (RDI)
2
.
This document describes the structure and use of ARMulator, as well as providing a
number of examples to help you to develop your own models. The source files and pre-
built .dlls and images can be downloaded from
http://www.arm.com/arm/Application_Notes.
For further details, refer to the ADS 1.2 Debug Target Guide (ARM DUI 0058D) or the
RealView ARMulator ISS 1.3 User Guide (ARM DUI 0207A).
Notes This Application Note is designed for ARM Developer Suite 1.2 running on
Windows. You will need to generate your own makefiles for use on Solaris, Linux or HP-
UX (if applicable), using the supplied Windows makefile as a guide. For information on
extending the ARMulator for SDT or ADS 1.0 and 1.1 please see previous revisions of
Application Note 32. RealView Debugger interacts with ARMulator in a different way
which means that not all features discussed here may be available. These are noted in
the text.
1.1 The ARMulator Extension Kit
The ARMulator extension kit contains source code for a selection of models. You can
modify these models to generate new peripherals, memory maps and coprocessors, or
interact with the operating system via software interrupts. The ARMulator extension kit is
included if you have made a full installation, or a custom installation which includes the
extension kit. The location of the kit varies, depending on which ARMulator you are
using, and what platform you are working with.
If you are using the ARM Developer Suite on Windows, the extension kit is located in
<install_path>\ARMulate\armulext
If you are using ADS on Unix or Linux, the extension kit can be found in
<install_path>/<platform>/Source/armulext/
where <platform> is one of solaris, hpux or linux.
1
In general, models of the less complex, uncached ARM processor cores are cycle
accurate, but models of the cached variants might not correspond exactly with the actual
hardware.
2
All ARM debuggers including RealView Debugger 1.6.1 on Windows support the RDI
protocol, though RVD’s RDI support is limited. The RDI interface is not available in RVD
on Unix, nor is it expected to be supported in future releases of RVD.
Introduction
Application Note 32 Copyright © 2003 ARM Limited. All rights reserved. 5
ARM DAI 0032F
If you are using RealView ARMulator ISS, the extension kit is in a location similar to
<install_path>/ARM/RVARMulator/ExtensionKit/1.3/release/
<platform>/armulext
where <platform> is one of win_32-pentium, solaris-sparc, or linux-pentium. On
Windows, the / should be replaced by \.
1.2 RealView ARMulator Instruction Set Simulator
This document can be used with RealView ARMulator Instruction Set Simulator version
1.3 and 1.3.1.
The model source directory is located within the ExtensionKit subdirectory of
RVARMulator. You will need to follow this directory structure down until you reach the
win_32-pentium, solaris-sparc or linux-pentium directory, which contains the
armulext source appropriate for your platform. The source directory is present if you
have done a full installation, or a custom installation including the Extension Kit.
After you have built your model you will need to move it to the RVARMulator executables
directory. This is normally a location similar to:
C:\Program Files\ARM\RVARMulator\ARMulator\1.3.1\1310.20030312\win_32-
pentium
or
<$ARMROOT>/RVARMulator/ARMulator/1.3.1/1309.20030208/solaris-sparc
or
<$ARMROOT>/RVARMulator/ARMulator/1.3.1/1309.20030208/linux-pentium
Note Because of known issues with semihosting, you should not develop ARMulator
models for RealView Debugger 1.6.1 using the LocalHost connection on WindowsNT.
1.3 Cached versus Uncached Targets
The examples supplied with this Application Note will work on uncached ARMulator
targets such as the ARM7TDMI. However, even without pagetables enabled, the
examples may not work properly on cached targets.