Here are some fixes/improvements that have been made to the SimpleScalar processor simulator. This started out as a repository for fixes that I contributed, but it now contains contributions from others as well.
binutils-2.5.2/gas/config/tc-ss.c
(the only file that needs to be changed).
CAVEAT EMPTOR: This fix only preserves annotations on instructions that are not macro-expanded by the assembler into sequences of other instructions. I know for a fact that integer loads and simple ALU operations can be annotated using this fix. However, there are other instructions which are treated by the assembler as macros and the expansion can lead to the dropping of annotations. Grep the GNU assembler sources for "macro" to see which instructions are treated in this way. There is no easy fix for this, since you need to define what it means to annotate a macro instruction and this depends on what the annotation is meant to communicate to the simulator. Certain others here at Wisconsin have patched the assembler to annotate macros in a way suitable for their particular research. Let me know if you need this kind of capability and I will forward you to them.
Expansion of supported Alpha ISA:
The Alpha simulator
included in SimpleScalar 3.0a does not implement the entire Alpha ISA, in
particular it does not implement instructions that were introduced in the Alpha
21164 (EV5), 21164A (EV56) and 21264 (EV6). These instructions occur in binaries compiled on the more recent
21164A/21264 machines and are generally handled via traps/emulation on Alphas that
do not support these instructions (or they are treated as a no-ops in a forward-compatible
manner). However, the simulator does not handle them and hence I could not use
binaries compiled on spanking new Alphas with the latest compilers and all optimizations turned on. This happens even if one uses the vendor compiler with the " Using the Alpha Architecture Handbook Rev.4 from Digital(sorry, Compaq)'s
Alpha Documentation Library, I expanded SimpleScalar's Alpha ISA
definition file to include ALL user-mode instructions in the Alpha ISA (as of the 21264). A total of 40 new instructions have been added. Some of these (such as
prefetch hints) are currently no-ops and VAX FP instructions generate "unimplemented" faults. But all 21164A and 21264 instruction extensions (BWX,CIX,FIX,MVI) are implemented and are working to the best of my knowledge.
Misc bug fixes/additions:
Apart from this ISA expansion, the files below contain some bug fixes and
improvements that allowed people to run Alpha binaries on Simplescalar-3.0a.
The fixes include supporting some additional system calls and making
conditional branches use the correct number of bits in an offset (which was
breaking a few programs).
More and better benchmarks: We need something more "real-world"
than SPEC95 (heck, those are nearly 5 years old). Here are some
applications that run on Simplescalar-Alpha thanks to it being able to run
unmodified statically-linked Alpha binaries:
Annotations and Binary Editing for Simplescalar-Alpha:
Currently SimpleScalar does not provide annotation support for the Alpha
simulator because the 32-bit instruction width provides no space for stuffing
annotations. However, one could use some of the new 21264 instructions (e.g., the
multimedia instructions part of the MVI extensions) as dummy annotation-holders. Other options include faking annotations by keeping a per-PC annotation table in the simulator which is consulted to get/set annotations, or by storing annotations in an unused section of the executable and modifying the Simplescalar loader to process this section.
The Alpha ISA of SimpleScalar 3.0
UPDATE:
These source-code changes have been merged by Todd Austin into a new pre-release of Simplescalar version 3.0b, now available via FTP as a gzipped tar file. The release also contains a number of other fixes, so please download the SS-3.0b pre-release instead of using the files and diffs provided below.
-arch ev4
"
option since the standard libraries include such instructions.
Here's what you need to get:
target-alpha/alpha.def
file,
OR a context diff from the original file,
OR a context diff from Todd's updated definition which included the BWX extensions
OR a context diff from my updated definition which defined all the Alpha instructions
target-alpha/alpha.h
file, OR a context diff from the original file.
target-alpha/syscall.c
.
alpha.def, alpha.h
) and syscall (syscall.c
) definition files from the links above in order to use these Quake binaries.
(Quake is a registered trademark of iD Software)
On a related note, some folks in Arizona have
developed an Alpha binary optimizer called Alto. They claim to do a better job than Alpha's OM tool and the best thing of
all is that they provide the full source code for their tool. With some work,
Alto can be converted into a binary editor for Alpha executables allowing you to
traverse a program and insert/modify individual instructions.
If you have any problems obtaining or using these fixes, please let me know via e-mail.