wiki:TBR/BSP/Psim

Version 68 (modified by E.begov, on 12/18/10 at 01:06:59) (diff)

Psim

<!-- When filling in the box,

+ Try to include links to other Wiki pages and websites. + If a field is not applicable, not setting the variable will result in it not being displayed + If Simulator is not set, then No. is displayed.

-->

{{Infobox BSP |BSP_name = Example BSP |Manufacturer = Who made me? |image = ADSP BF537 STAMP color dark.jpg |caption = optional image caption |Board_URL = http:/manufacturer.com/ExampleBoard |Architecture = Architecture |CPU_model = Model name |Monitor = uBoot, uMon |Simulator = Yes. Skyeye |Aliases = Any RTEMS BSP Aliases? |RAM = XXX MB |NVMEM = 32 MB Flash, 16 KB EEPROM |Serial = one. UART part name. |NICs = one. NIC part name. |Other = anything else you need to say }}

Overview

PSIM is a program written in extended ANSI-C that emulates the Instruction Set Architecture of the PowerPC microprocessor family. It is freely available in source code form under the terms of the GNU General Public License (version 2 or later).

The publication The PowerPC Architecture: A specification for a new family of RISC processors </cite> describes the PowerPC Instruction Set Architecture has having three levels of compliance:

UEA - User Instruction Set Architecture "<cite>the registers, instructions, storage model, and execution model that are available to all application programs</cite>" VEA - Virtual Environment Architecture "<cite>the features of the architecture that permit application programs to create or modify code, to share data among programs in a multiprocessing system, and to optimize the performance of storage accesses</cite>" OEA - Operating Environment Architecture "<cite>the features of the architecture that permit operating systems to allocate and manage storage, to handle errors encountered by application programs, to support I/O devices, and to provide the other services expected of secure, modern, multiprocessor operating systems</cite>" PSIM, both implements all three levels of the <strong>PowerPC</strong> Instruction Set Architecture, and includes, for each level, a number of simulated run-time environments:

UEA <strong>PSIM</strong> can run static programs compiled for any of the following operating systems: <UL> <LI>NetBSD <LI>Solaris <LI>LINIX </UL> VEA Support for environmental features of the Instruction Set Architecture including: Symetric multi-processing Cache manipulation Time base registers OEA Details of the target <cite>PowerPC Platform</cite> being modeled can be specified including: firmware (Motorola BUG or OpenFirmware?) memory and I/O address maps attached devices interrupt controller (OpenPIC) configuration In addition, <strong>PSIM</strong>, to the execution unit level, models the performance of most of the current PowerPC implementations (contributed by Michael Meissner). This detailed performance monitoring (unlike many other simulators) resulting in only a relatively marginal reduction in the simulators performance.

This document, firstly explains how to build and run PSIM. It then goes on to discuss the details of the internals of this simulator.

The most recent formal release of PSIM is version 2.1. In addition to describing that release of PSIM, this document also describes extensions that have been proposed for a future release of the PSIM Architecture

Board Setup

If there are special jumper or ROM monitor settings, describe them.

Downloading and Executing

Installing PSIM

To build PSIM you will need the following:

gdb-4.16.tar.gz Available from your favorite GNU ftp site gcc GCC version two includes suport for long long (64bit integer) arrithemetic which PSIM uses. Hence it is recommended that you build PSIM using GCC.

Updates to GDB

From time to time, problems involving the integration of PSIM into gdb are found. While eventually each of these problems is resolved there can be periouds during which a local hack may be needed.

At the time of writing the following were outstanding:

ATTACH command

ftp://ftp.ci.com.au/pub/psim/gdb-4.15+attach.diff.gz

or ftp://cambridge.cygnus.com/pub/psim/gdb-4.15+attach.diff.gz PSIM, unlike the other simulators included with GDB, is able to load the description of a target machine (including the initial state of all processor registers) from a file. Unfortunatly GDB does not yet have a standard command that facilitates the use of this feature. Until such a command is added, the above patch (hack?) can be used to extend GDB's attach command so that it can be used to initialize the simulators configuration from a file. GDB insns, stalls and cycles pseudo registers

ftp://ftp.ci.com.au/pub/psim/gdb-4.16+count.diff.gz

or ftp://cambridge.cygnus.com/pub/psim/gdb-4.16+count.diff.gz More recent versions of PSIM include partial support for the pseudo registers cycles, insns and stalls which are used to access profiling information. Before they can be used with gdb-4.16 (built with a more recent PSIM), the above patch should be applied. Reconize svr4 target

ftp://ftp.ci.com.au/pub/psim/gdb-4.16+svr4.diff.gz

or ftp://cambridge.cygnus.com/pub/psim/gdb-4.16+svr4.diff.gz This patch to gdb's configuration files adds additional targets for which PSIM will be built.

Debugging

How do you debug code on this board? What gdb setup? BDM, stub, etc?

Test Reports

{{Test Report |Version = CVS head |Date = DATE |User = User:WhoTestedThis? |Report = reports that something happened. }}

References

  • TBD

{{Navbox_BSPs}}