Running simplescalar on Ubuntu in alpha config

I have to post this for future reference as there were so many pain points just getting simplescalar running that I needed to mirror some links and consolidate some tutorials.

Here's a good guide to installing simplescalar. I'll mirror some of the information from another guide that worked for me as well. The first link also contains the files you'd need to get it running. I'll also rehost them here.

Here's a tutorial taken from here.

Download the packages here.

simplesim-3v0d.tgz

simpleutils-990811.tar.gz

simpletools-2v0.tgz

gcc-2.7.2.3.ss.tar.gz

Untar the source code into a simplesim directory

mkdir simplesim (wherever you want to put this...you can name it whatever)
tar xzvf (the z flag unzips a gzip file as well as untars it.... if you have straight tar files then use tar xvf )


In simpetools-2v0.tgz, there is a gcc-2.6.3 compiler. Since we don't need this, delete it.

rm -rf gcc-2.6.3


Note:
Before installing simple scalar package, make sure your system has the following packages installed:
C library header: libc6-dev

build-essential
flex
bison

In Ubuntu you can just say:

sudo apt-get install #all the packages above#

Install

uname -a

Depending on that change the Host id below as either
HOST=i686-pc-linux or HOST=i386-pc-linux

Setup environment variables for easy install.

export HOST=i386-unknown-linux
export IDIR=/home/your-login-name/simplesim (or your install directory's name)



Install simpleutils.


cd $IDIR/simpleutils-990811

Before building the code, you need to fix some sources of errors. In directory ld find file ldlex.l and replace all instances of
yy_current_buffer with YY_CURRENT_BUFFER.

./configure --host=$HOST --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld prefix=$IDIR

--If errors show up during the process, apply the following fixes:
insert a semi-colon (;) at line 77 of simpleutils-990811/binutils/arparse.y file.
insert a semi-colon (;) at line 168 of simpleutils-990811/ld/ldgram.y file.

make install


Install simplesim.


cd $IDIR/simplesim-3.0
make config-alpha
make



If it throws an error, and it most likely will you have to change some more source code.

Open machine.h in the simplesim folder.

Move the line (line 224): extern enum md_opcode md_mask2op[];
below the definition of md_opcode (14 lines down line 238 I believe. It just needs to be after the full definition of md_opcode )

make config-alpha
make
make sim-tests


to test

./sim-outorder tests-alpha/bin/test-math

it should spit back some data. If you want to test it on other benchmarks you can download some pre compiled alpha benchmarks with arg files already created here.

binghamton.edu

or rehosted on this site naasen.org

untar it.

to run one of these you would type something similar to the following.

~/simplesim/simplesim-3.0/sim-outorder -cache:il1 il1:32:32:1:l -cache:dl1 dl1:32:32:1:l -redir:sim MSHK ./automotive/qsort/qsort_small ./automotive/qsort/input_small.dat > ./automotive/qsort/output_small.txt

basically

#path/to/simplesim# #cache parameters# #redir:sim(redirects output to file)# #name of your file# #path/to/alpha/bench/binary# #arguments for the binary or an arg file#

If you want to get the cross compiler running, try the tutorials at the following 2 locations. These were the sources for this tutorial anyway.

zhenyu-ye.net
igoy.in

Comments

Popular posts from this blog

Phoebe loves shoes

I Don't Mind