Line 3... |
Line 3... |
@afourpaper
|
@afourpaper
|
@include version.texi
|
@include version.texi
|
@include config.texi
|
@include config.texi
|
@dircategory Embedded development
|
@dircategory Embedded development
|
@direntry
|
@direntry
|
* Or1ksim: (or32-uclinux-or1ksim). The OpenRISC 1000 Architectural
|
* Or1ksim: (or32-elf-or1ksim). The OpenRISC 1000 Architectural
|
Simulator
|
Simulator
|
@end direntry
|
@end direntry
|
|
|
@copying
|
@copying
|
This file documents the OpenRISC Architectural Simulator, @value{OR1KSIM}.
|
This file documents the OpenRISC Architectural Simulator, @value{OR1KSIM}.
|
Line 100... |
Line 100... |
The most significant argument is @code{--target}, which should specify
|
The most significant argument is @code{--target}, which should specify
|
the OpenRISC 1000 32-bit architecture. If this argument is omitted, it will
|
the OpenRISC 1000 32-bit architecture. If this argument is omitted, it will
|
default to OpenRISC 1000 32-bit with a warning
|
default to OpenRISC 1000 32-bit with a warning
|
|
|
@example
|
@example
|
../or1ksim-@value{VERSION}/configure --target=or32-uclinux ...
|
../or1ksim-@value{VERSION}/configure --target=or32-elf ...
|
@end example
|
@end example
|
|
|
There are several other options available, many of which are standard
|
There are several other options available, many of which are standard
|
to GNU @command{configure} scripts. Use @kbd{configure --help} to see
|
to GNU @command{configure} scripts. Use @kbd{configure --help} to see
|
all the options. The most useful is @code{--prefix} to specify a
|
all the options. The most useful is @code{--prefix} to specify a
|
Line 303... |
Line 303... |
@example
|
@example
|
make install
|
make install
|
@end example
|
@end example
|
|
|
This will install the three variations of the @value{OR1KSIM} tool,
|
This will install the three variations of the @value{OR1KSIM} tool,
|
@command{or32-uclinux-sim}, @command{or32-uclinux-psim} and
|
@command{or32-elf-sim}, @command{or32-elf-psim} and
|
@command{or32-uclinux-mpsim}, the @value{OR1KSIM} library, @file{libsim}, the
|
@command{or32-elf-mpsim}, the @value{OR1KSIM} library, @file{libsim}, the
|
header file, @file{or1ksim.h} and this documentation in @command{info} format.
|
header file, @file{or1ksim.h} and this documentation in @command{info} format.
|
|
|
The documentation may be created and installed in alternative formats (PDF,
|
The documentation may be created and installed in alternative formats (PDF,
|
Postscript, DVI, HTML) with for example:
|
Postscript, DVI, HTML) with for example:
|
|
|
Line 350... |
Line 350... |
|
|
@menu
|
@menu
|
* Standalone Simulator::
|
* Standalone Simulator::
|
* Profiling Utility::
|
* Profiling Utility::
|
* Memory Profiling Utility::
|
* Memory Profiling Utility::
|
|
* Trace Generation::
|
* Simulator Library::
|
* Simulator Library::
|
* Ethernet TUN/TAP Interface::
|
* Ethernet TUN/TAP Interface::
|
@end menu
|
@end menu
|
|
|
@node Standalone Simulator
|
@node Standalone Simulator
|
Line 361... |
Line 362... |
@cindex command line for @value{OR1KSIM} standalone use
|
@cindex command line for @value{OR1KSIM} standalone use
|
|
|
The general form the standalone command is:
|
The general form the standalone command is:
|
|
|
@example
|
@example
|
or32-uclinux-sim [-vhiqVt] [-f @var{file}] [--nosrv] [--srv=[@var{n}]]
|
or32-elf-sim [-vhiqVt] [-f @var{file}] [--nosrv] [--srv=[@var{n}]]
|
[-m <n>][-d @var{str}]
|
[-m <n>][-d @var{str}]
|
[--enable-profile] [--enable-mprofile] [@var{file}]
|
[--enable-profile] [--enable-mprofile] [@var{file}]
|
@end example
|
@end example
|
|
|
Many of the options have both a short and a long form. For example
|
Many of the options have both a short and a long form. For example
|
Line 515... |
Line 516... |
This utility analyses instruction profile data generated by
|
This utility analyses instruction profile data generated by
|
@value{OR1KSIM}. It may be invoked as a standalone command, or from
|
@value{OR1KSIM}. It may be invoked as a standalone command, or from
|
the @value{OR1KSIM} CLI. The general form the standalone command is:
|
the @value{OR1KSIM} CLI. The general form the standalone command is:
|
|
|
@example
|
@example
|
or32-uclinux-profile [-vhcq] [-g=@var{file}]
|
or32-elf-profile [-vhcq] [-g=@var{file}]
|
@end example
|
@end example
|
|
|
Many of the options have both a short and a long form. For example
|
Many of the options have both a short and a long form. For example
|
@code{-h} or @code{--help}.
|
@code{-h} or @code{--help}.
|
|
|
Line 566... |
Line 567... |
This utility analyses memory profile data generated by
|
This utility analyses memory profile data generated by
|
@value{OR1KSIM}. It may be invoked as a standalone command, or from
|
@value{OR1KSIM}. It may be invoked as a standalone command, or from
|
the @value{OR1KSIM} CLI. The general form the standalone command is:
|
the @value{OR1KSIM} CLI. The general form the standalone command is:
|
|
|
@example
|
@example
|
or32-uclinux-mprofile [-vh] [-m=@var{m}] [-g=@var{n}] [-f=@var{file}] @var{from} @var{to}
|
or32-elf-mprofile [-vh] [-m=@var{m}] [-g=@var{n}] [-f=@var{file}] @var{from} @var{to}
|
@end example
|
@end example
|
|
|
Many of the options have both a short and a long form. For example
|
Many of the options have both a short and a long form. For example
|
@code{-h} or @code{--help}.
|
@code{-h} or @code{--help}.
|
|
|
Line 635... |
Line 636... |
@var{from} and @var{to} are respectively the start and end address of
|
@var{from} and @var{to} are respectively the start and end address of
|
the region of memory to be analysed.
|
the region of memory to be analysed.
|
|
|
@end table
|
@end table
|
|
|
|
@node Trace Generation
|
|
@section Trace Generation
|
|
@cindex trace generation of @value{OR1KSIM}
|
|
|
|
An execution trace can be generated at run time with options passed by the command line, or via the operating system's signal passing mechanism.
|
|
|
|
The following, passed at run time, can be used to create an execution dump.
|
|
|
|
@table @code
|
|
|
|
@item -t
|
|
@itemx --trace
|
|
@cindex @code{-t}
|
|
@cindex @code{--trace}
|
|
Dump instruction just executed and any register/memory location chaged
|
|
after each instruction (one line per instruction).
|
|
@end table
|
|
|
|
Passing a signal @code{SIGUSR1} while the simulator is running toggles trace generation. This can be done with the following command, assuming @value{OR1KSIM}'s executable name is @code{or32-elf-sim}:
|
|
|
|
@example
|
|
pkill -SIGUSR1 or32-elf-sim
|
|
@end example
|
|
|
|
This is useful in the case where trace output is desired after a significant amount of simulation time, where it would be inconvenient to generate trace up to that point.
|
|
|
|
If the @code{pkill} utility is not available, the @code{kill} utility can be used if @value{OR1KSIM}'s process number is known. Use the following to determine the process ID of the @code{or32-elf-sim} and then send the @code{SIGUSR1} command to toggle execution trace generation:
|
|
|
|
@example
|
|
ps a | grep or32-elf-sim
|
|
kill -SIGUSR1 @emph{process-number}
|
|
@end example
|
|
|
|
|
@node Simulator Library
|
@node Simulator Library
|
@section Simulator Library
|
@section Simulator Library
|
@cindex library version of @value{OR1KSIM}
|
@cindex library version of @value{OR1KSIM}
|
|
|
@value{OR1KSIM} may be used as a static of dynamic library,
|
@value{OR1KSIM} may be used as a static of dynamic library,
|