Go to the first, previous, next, last section; table of contents; home; full screen; PSIM.

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.

Configuring and compiling the software

Unpack gdb

	$ cd .../scratch
	$ gunzip < gdb-4.16.tar.gz | tar xf -

Configure gdb

First consult the gdb documentation

	$ cd .../scratch
	$ cd gdb-4.16
	$ more README
	$ more gdb/README

then something like (I assume SH):

	$ CC=gcc ./configure \
                --enable-sim-powerpc \
                --target=powerpc-unknown-eabi \
                --prefix=/applications/psim

Build (again specifying GCC)

	$ make CC=gcc

alternatively, if you are short on disk space or only want to build the simulator:

        $ ( cd libiberty && make CC=gcc )
	$ ( cd bfd && make CC=gcc )
	$ ( cd sim/ppc && make CC=gcc )

Install

	$ make CC=gcc install

or just

	$ cp gdb/gdb ~/bin/powerpc-unknown-eabisim-gdb
	$ cp sim/ppc/run ~/bin/powerpc-unknown-eabisim-run

Upgrading to the current version

A PSIM is an ongoing development. Occasional snapshots which both contain new features and fix old bugs are made available. See the ftp directory:

	ftp://ftp.ci.com.au/pub/psim
or	ftp://cambridge.cygnus.com/pub/psim

for the latest version. To build/install one of these snapshots, you replace the sim/ppc found in the gdb archive with with one from the snapshot. Then just re-configure and rebuild/install.

Method

A starting point

	$ cd gdb-4.16

Remove the old psim directory

	$ mv sim/ppc sim/old.ppc

Unpack the new one

	$ gunzip < ../psim-NNNNNN-src.tar.gz | tar tf - | more
	$ gunzip < ../psim-NNNNNN-src.tar.gz | tar xf -

Reconfigure/rebuild (as seen above):

	$ CC=gcc ./configure \
		--enable-sim-powerpc \
                --target=powerpc-unknown-eabi \
                --prefix=/applications/psim
        $ make CC=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.

Configuration options

PSIM's compile time configuration is controlled by autoconf. PSIM's configure script recognises options of the form:

	--enable-sim-<option>[=<val>]

And can be specified on the configure command line (at the top level of the gdb directory tree) vis:

	$ cd gdb-4.15
	$ CC=gcc ./configure \
                --target=powerpc-unknown-eabisim \
                --prefix=/applications/psim \
        	--enable-sim-inline
	$ make CC=gcc

For a brief list of PSIM's configuration options, configure --help will list them vis:

	$ cd sim/ppc
	$ ./configure --help

Each PSIM specific option is discussed in detail below.

Typical configuration options

VEA code only

Here of note are:

        CC=gcc ./configure \
                --prefix=/applications/psim \
                --target=powerpc-unknown-eabi \
                --enable-sim-powerpc \
                --enable-sim-warnings \
                --enable-sim-inline \
                --disable-sim-smp \
                --enable-sim-duplicate \
                --enable-sim-endian=big \
                --disable-sim-xor-endian \
                --enable-sim-env=user \
                --disable-sim-reserved-bits \
                --disable-sim-assert \
                --disable-sim-trace \
                --enable-sim-cflags='-g0,-O2,-fno-strength-reduce,-fomit-frame-pointer'

OEA code only

The key configuration changes are:

	CC=gcc ./configure \
                --prefix=/applications/psim \
                --target=powerpc-unknown-eabi \
                --enable-sim-powerpc \
                --enable-sim-inline \
                --disable-sim-smp \
                --enable-sim-duplicate \
                --enable-sim-endian=big \
                --disable-sim-xor-endian \
                --enable-sim-env=operating \
                --disable-sim-reserved-bits \
                --disable-sim-assert \
                --disable-sim-trace \
                --enable-sim-opcode=ppc-opcode-flat \
                --disable-sim-icache \
                --enable-sim-cflags='-g0,-O3,-fno-strength-reduce,-fomit-frame-pointer'

Go to the first, previous, next, last section; table of contents; home; full screen.