How to get started with Bliss

This short guide describes how to get started using Bliss. As opposed to the hacking guide, this text is focused on more basic questions such as how to install the tools, what the command line options are, etc.

Installation

To install Bliss you should download 2 files. The Bliss code itself, and the pre-built cross-compilation tools for Linux x86 (that make Linux/Alpha) binaries. Start by installing the cross compilation tools. This guide assumes you have download the two files already and they are in your home directory. From the root directory "/" of your Linux box execute this command:

tar xzvf ~/alpha-linux-cross.tgz

This will make a directory

/projects/alpha-linux-cross

which will contain all of the cross-compilation tools. Note, if you wish to change the directory where the cross compilation tools are located you will need to download the "build" version of the tools, re-execute the "configure" scripts, re-compile the tools, and install them. This is not a process you should undertake with cross-compiler GNU tools unless you have experience with building the GNU gcc compiler for your native system in the first place (i.e. do not expect it to go smoothly). We highly suggest that first time users install the tools into /projects/alpha-linux-cross, but if you really want them somewhere else and don't want / can't re-build them, then investigat the -B command line option for the GNU tools. It may work for you.

After installing the tools, it's a good idea to make sure they work. Try writing a simple "hello world" program. Make a test.c file like:

int main() { printf("Hello there!\n"); }

Then compile it for Linux/Alpha:

/projects/alpha-linux-cross/bin/alpha-unknown-linux-gnu-gcc -c test.c

And link it:

/projects/alpha-linux-cross/bin/alpha-unknown-linux-gnu-gcc -o test test.o

If all is well you should have a binary file named "test" in whatever directory you undertook this adventure (lets set this is your home directory ~). This file is a binary for Linux/Alpha. If you had a real Alpha box sitting around somewhere with Linux installed on it you could take this binary over there and run it. Note that it is statically linked. Bliss requires that the binaries you use be statically linked. This happens by default, but if it doesn't add the -static flag to the command line of the compiler.

Now we should build Bliss. From your home directory execute the following commands:

tar xvzf Bliss.tgz
cd Bliss
make

On some old systems you may have to type "gmake" instead of make. Assuming it builds you should get two binary files made under:

~/Bliss/bin/run-alpha
~/Bliss/bin/sim4

The first binary "run-alpha" is a fast, functional only simulator of the Alpha AXP processor. You can use this simulator to quickly execute Alpha/Linux or Alpha/OSF binaries. For example:

~/Bliss/bin/run-alpha ~/test
Hopefully "Hello there!" pops out on the screen.


Running Bliss

The main simulator included in Bliss (sim4) models a system with a single out of order superscalar processor and an aggressive cache memory hierarchy. To simulate this system on an application you would type:

~/Bliss/bin/sim4 ~/test

(replacing ~/test with the executable you want to run). After sim4 finishes a file will be made, which by default is named "stat.log". This file contains both the configuration of the simulator that was used and some statistics about the execution. Note that this file is cleverally formatted such that it can be used as a configuration file (more on this in just a second).

Bliss can be configured to model a variety of system configurations. To see all of the options that Bliss can take execute the command

~/Bliss/bin/sim4 -h

You can set these options in one of two ways, via the command line, or via a file. Lets examine both. To set an option by the command line (lets say the issue window size), you would execute the following:

~/Bliss/bin/sim4 -System.SuperScalarProcessor.IssueWindowStage.IssueWindowSize:256 ~/test

What this does is set the variable "System.SuperScalarProcessor.IssueWindowStage.IssueWindowSize" to be 256. Bliss uses a hierarchical naming of variables that makes it very clear and explicit what you are setting. This flag modifies the "IssueWindowSize" variable which is part of the IssueWindowStage which is part of the SuperScalarProcessor which is part of the System simulation model. However, sometimes it can be quite long to type out such variable names so Bliss allows you to be sloppy about it. You can type just the postfix:

~/Bliss/bin/sim4 -IssueWindowSize:256 ~/test

Our suggestion is to use the short version when you enter switches via the command line, but to use the full name when you use a configuration file. If you want to make Bliss read configuration parameters from a file, you could enter a command like:

~/Bliss/bin/sim4 -Source:myconfig ~/test

This makes Bliss read the file "myconfig" for parameters. Note that config files can also refer to other config files (via the -Source option), so you can imagine a nice hierarchy of configuration files.

This brings us back to "stat.log". The statistics output file is designed in such a way that you can also use it as a config file. This is so you can very easilly check what parameters you gave the simulator were used to generate particular statistics.

Thats about all there is to it. For additional reading we suggest you examine the hacking guide.