Install SimpleScalar_PISA in Ubuntu12.04

Source: Internet
Author: User
Tags parse error sendmsg
(1) first prepare the required installation file. If not, download simpletools-2v0. tgz: Success

(1) first, prepare the required installation file. If not, download it from the following address:

Simpletools-2v0. tgz:

Http://www.simplescalar.com/tools.html

Simplesim%3v0d%with%cheetah.tar.gz:

Http://www.ict.kth.se/courses/IS2202/software

Simpleutils‐990811.tar.gz:

Http://www.eecs.umich.edu/mirv/software

Gccw.2.7.2.3.ss.tar.gz:

Http://american.cs.ucdavis.edu/rad/gcc4242.7.2.3.ss.tar.gz

(2) Open the terminal and set the environment variable:

(Installation directory)

$ ExportIDIR =/home/student/simplescalar

(Host)

$ Export HOST = i686-pc‐linux

(Target machine)

$ Export TARGET = sslittle-na‐sstrix


(3) create the directory simplescalar in the student home directory and move the four installation packages to the directory:

$ Mkdir $ IDIR

$ Mv simplesim%3v0d%with%cheetah.tar.gz $ IDIR

$ Mv simpletools-2v0. tgz $ IDIR

$ Mv simpleutils0000990811.tar.gz $ IDIR

$ Mv gcc1_2.7.2.3.ss.tar.gz $ IDIR

 


(4) use the command to update the Ubuntu Software Package build-essential, flex, bison:

$ Sudo apt-get installbuild-essential flex bison

Gcc-multilib is also required in ubuntu12.04.

$ Sudo apt-get install gcc-multilib

(5) install SimpleTools:

Decompress the package file and remove the old gcc Folder:

$ Cd $ IDIR

$ Tar xvfz simpletools-2v0. tgz

$ Rm-rf gcc-2.6.3

(6) install SimpleUtils:

First, extract the package file.

$ Cd $ IDIR

$ Tar xvfz simpleutils‐990811.tar.gz

$ Cd simpleutils ‐990811

You need to modify a code error before compiling:

Find the ldlex. l file in the simpleutils-990811/ld directory and

Replace yy_current_buffer with YY_CURRENT_BUFFER.

Next, configure and compile:

$./Configure ‐‐host = $ host ‐‐target = $ target ‐with ‐gnu ‐as ‐with ‐gnu ‐ld ‐prefix = $ IDIR

$ Make CFLAGS = ‐o

$ Make install

(7) install the simulator:

$ Cd $ IDIR

$ Tar xvfzsimplesim%3v0d%with%cheetah.tar.gz

$ Cd simplesim‐3.0

$ Make config-pisa

$ Make

Test:

$./Sim-safetests/bin. little/test-math

(8) install the gcc Cross Compiler:

Decompress the source code, configure the installation, and modify the read and write permissions of the code file:

$ Cd $ IDIR

$ Tar xvfz gcc‐2.7.2.3.ss.tar.gz

$ Cd gcc-2.7.2.3

$./Configure ‐‐host = $ host ‐‐target = $ target ‐with ‐gnu ‐as ‐with ‐gnu ‐ld ‐prefix = $ IDIR

$ Chmod-R + w.

Next, to make the compilation smooth, you need to make the following changes:

Modify the 130th rows of Makefile and add-I/usr/include at the end of the line;

Modify row 60th of protoize. c and set "# include "With" # include ";


1. To solve a decl. c error message named "invalidlvalue in increment", make the following changes:

Edit row 341st of obstack. h and set:

* (Void **) _ o-> next_free) ++ = (void *) datum );\

Replace:

* (Void **) _ o-> next_free ++) = (void *) datum );\

And run the following command:

$ Cp./patched/sys/cdefs. h ../sslittle-na-sstrix/include/sys/cdefs. h

$ Cp ../sslittle ‐na‐sstrix/lib/libc. a ../lib/

$ Cp ../sslittle ‐na‐sstrix/lib/crt0.o ../lib/


Next, build the compiler:

$ Make versions ages = c CFLAGS = ‐o CC = "gcc-m32"


After this command is executed, an error message may be generated and the following changes may be required:

Append '\' to the end of rows 675,750 and 823 of insn-output. c;

2. Run "make packages ages..." again, and the error "buffer overflow" is reported. This is because of the Ubuntu version.

Relatively new.

Download the following files and place them in $ IDIR/sslittle ‐na‐sstrix/bin:

L‐http://www.ict.kth.se/courses/IS2202/ar

L‐http://www.ict.kth.se/courses/IS2202/ranlib

Then, modify the permissions of ar and ranlib to be executable. Otherwise, the message "Permissiondenied" will be displayed "!

Run the following command:

$ Chmod + x ar ranlib

Or modify it in the ar and ranlib attributes.

3. After "makeLANGUAGES..." is executed again, the system prompts that the file stubs-32.h is missing.

$ Apt-file update

$ Apt-file search stubs-32.h

Libc6-dev:/usr/include/i386-linux-gnu/gnu/stubs-32.h

The new ubuntu version changes the location where the stubs-32.h is stored. Executable

$ Sudo cp/usr/include/i386-linux-gnu/gnu/stubs-32.h/usr/include/gnu/stubs-32.h


4. After "makeLANGUAGES..." is executed again, Delete row 2978-2979 of cxxmain. c if necessary.

Now, run:

$ Make versions ages = c CFLAGS = ‐occ = "gcc-m32"

$ Make enquire

$ ../Simplesim-3.0/sim-safe./enquire-f> float. h‐cross

$ Make versions ages = c CFLAGS = ‐occ = "gcc-m32" install


5. There may be an error "sendmsg. c: 36: parse error"

Add "# defineSTRUCT_VALUE 0" to the row 35th of the object objc/sendmsg. c"

Then makeinstall should be fine.

Test: Create hello. c with the following content:

# Include

Int main (int argc, char * argv)

{

Printf ("HelloWorld! \ N ");

Return 0;

}

Then compile with the following command:

$ IDIR/bin/sslittle-na‐sstrix-gcc-o hello. c

The generated file hello can be run as follows:

$ IDIR/simplesim ‐3.0/sim-safehello

If "HelloWorld!" Is output! ", Indicating that the installation is successful!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.