SimpleScalar Install Guide

 1. Introduction
The following text describes the procedure of installing the simulator Simplescalar [1] on a modern Linux distribution. The procedure has been tested on Ubuntu Linux 10.10 (Maverick Meerkat) but should work on most Linux distributions.  The instructions are modified from [2] and [3].

2. Preparations

    You may find these files useful: install_guide_v2.txt, users_guide_v2.pdf

        These can be found on the SimpleScalar website, http://www.simplescalar.com/docs.html

    Download the necessary source code files:

 simpletools-2v0.tgz from http://www.simplescalar.com/tools.html

 simplesim-3v0d-with-cheetah.tar.gz from http://www.ict.kth.se/courses/IS2202/software (you can find single sim-cheetah package also)

 simpleutils-990811.tar.gz from http://csrl.unt.edu/downloads/simplescalar.tgz (In this package, flex-2.5.4a/gcc-2.7.2.3.ss/simplesim-3v0d/simpleutils-990811/simpletools-2v0 and hello.c for test can be found)

 gcc-2.7.2.3.ss.tar.gz from http://american.cs.ucdavis.edu/RAD/gcc-2.7.2.3.ss.tar.gz

    Setup some environment variables (assuming your home directory is /home/matsbror and that you are using a bash-compatible shell):

      $ export IDIR=/home/matsbror/simplescalar
      $ export HOST=i686-pc-linux (or i386-unknown-linux)
      $ export TARGET=sslittle-na-sstrix
    Create the directory “simplescalar” under your home directory, and copy all the four tarballs into it:
      $ mkdir $IDIR
      $ mv simplesim-3v0d-with-cheetah.tgz $IDIR
      $ mv simpletools-2v0.tgz $IDIR
      $ mv simpleutils-990811.tar.gz $IDIR
      $ mv gcc-2.7.2.3.ss.tar.gz $IDIR

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

    In Ubuntu you can just say: sudo apt-get install <all the packages above>

3. Installing SimpleTools
    Just un-pack the package file, and remove the old gcc folder:
      $ cd $IDIR
      $ tar xvfz simpletools-2v0.tgz
      $ rm -rf gcc-2.6.3
4.Installing SimpleUtils
    First un-pack the package file.
      $ cd $IDIR
      $ tar xvfz simpleutils-990811.tar.gz
      $ cd simpleutils-990811

      $ ./configure --host=$HOST --target=$TARGET --with-gnu-as --with-gnu-ld --prefix=$IDIR
      $  make

        --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.
        --If error is about "yy_input", apply the following fix:
         find . -type f -print0 | xargs -0 sed -i -e 's,yy_current_buffer,YY_CURRENT_BUFFER,g'

       $ make install

Note:

    If you experience compilation problems with “'yy_current_buffer ' undeclared” there may be problems with flex. Download and install the following version which is known to work together with Simplescalar. Http://www.ict.kth.se/courses/IS2202/flex.tar.gz. The following command(s) should work for installation: “./configure; make; sudo make install”.
    After installation of flex, if needed you should remove the installation directory of simpleutils and restart unpacking, configuration etc.
    If you have a multicore processor, you may speed up the compilation process by using “make –j 2”  for a dual core and “make –j 4” for a quad core. It may even go faster if you specify a number higher than the core count as compilations are I/O intensive and you then may overlap CPU-intensive parts of the build process with disk operations.

5.Building the simulators
Un-pack the simulator package.
      $ cd $IDIR
      $ tar xvfz simplesim-3v0d-with-cheetah.tar.gz
      $ cd simplesim-3.0
      $ make config-alpha
      $ make

                    --if error encountered "machine.h:224: error: array type has incomplete element type", then
                       Move the line:
                         extern enum md_opcode md_mask2op[];

                       below the definition of md_opcode (about 6 lines below). That should do the trick with gcc 4.x

    If sucess, "my works done here ..." will show

6. Installation of gcc cross-compiler
    Un-pack the source code and configure the installation:
      $ cd $IDIR
      $ tar xvfz gcc-2.7.2.3.ss.tar.gz
      $ cd gcc-2.7.2.3
      $ make LANGUAGES="c c++" CFLAGS="-O3" CC="gcc"

      - For insn-output.c error:
        In insn-output.c, add line breaks ('\') after each of the three FIXME (line 675, 750 and 823)
      - For decl.c "invalid increment"error:
        edit obstack.h (remember to 'chmod +w' this file) at line 341 and
           change "*((void **)__o->next_free)++=((void *)datum);\" to "*((void **)__o->next_free++)=((void *)datum);\"
      - For parse error in libgcc2.c:
          In libgcc2.c, add "#define BITS_PER_UNIT 8" to the 98th line.
      - For parse error in stdio.h:
         update the original cdefs.h (under $IDIR/sslittle-na-sstrix/include/sys) with patched one (under     $IDIR/gcc-2.7.2.3/patched/sys)
         copy files "libc.a" and "crt0.o" $IDIR/sslittle-na-sstrix/lib/ to $IDIR/lib/
      - Edit line 60 of protoize.c, and replace “#include <varargs.h>” with “#include <stdarg.h>”
      - If you encoutered a “buffer overflow”, download the following files and put them in $IDIR/sslittle-na-sstrix/bin:
           - http://www.ict.kth.se/courses/IS2202/ar
           - http://www.ict.kth.se/courses/IS2202/ranlib
      - do all above, then RUN <make LANGUAGES="c c++" CFLAGS="-O3" CC="gcc"> again

    Now, run:

      $ make install LANGUAGES="c c++" CFLAGS="-O3" CC="gcc"

7.  Verify

 (1) First verify that simplesim is installed correctly. 

  cd $IDIR/simplesim-3.0
  ./sim-outorder tests-pisa/bin.little/test-math

 If results are generated from this, simplesim is most likely installed correctly.

 Next verify that the cross-compiler is working.  Create a basic C program (like the "hello world" program), name
        it test.c, and place it in a new directory called dev. 

                
  With that, Simple Scalar has been installed, along with its tools, utils, and compilers. Let’s now test compiling a new code and running it on top of simplescalar:
    In a separate directory, create a new file, hello.c, that has the following code:
    #include<stdio.h>
    main()
    {
      printf("Hello World!\n");
    }
   then compile it using the following command:
      $ $IDIR/bin/sslittle-na-sstrix-gcc –o hello hello.c 
   That should generate a file hello, which we will run over the simulator:
      $ $IDIR/simplesim-3.0/sim-safe hello
    In the output, you should be able to find the following:
      sim: ** starting functional simulation **
      Hello World! 
   If results are generated from this, the cross compiler is most likely installed correctly.

References
[1] SimpleScalar. SimpleSclar home page. [Online] [Cited: July 28, 2011.] http://www.simplescalar.com.

[2] Mats Brorsson. Simplescalar installation instructions. [Online PDF Document] [Cited: July 28, 2011.] http://www.ann.ece.ufl.edu/courses/eel5764_10fal/project/1.36445-Simplescalar-installation-instructios.pdf

[3] Dr. Narahari. SimpleScalar Install Guide.[Online Document] [Cited: July 28, 2011.] http://www.seas.gwu.edu/~cheng/211/Projects/SimpleScalar/simplescalar-ubuntu-install.txt

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用,`pip install`命令用于安装Python包。您可以使用以下命令在终端中执行:`pip install 包名`。例如,如果您想安装名为"opencv-python"的包,可以运行`pip install opencv-python`命令。引用中提供了一个示例命令,该命令将从中国科学技术大学镜像站点(https://pypi.mirrors.ustc.edu.cn/simple)安装"opencv-python"包。 根据引用,您提到在安装"mmseg"包时遇到了错误"NameError: name 'reload' is not defined"。这个错误通常是由于Python版本不兼容或导入模块错误引起的。要解决这个问题,您可以尝试以下方法: 1. 确保您正在使用兼容的Python版本。有些包可能需要特定版本的Python才能正常工作。您可以在包的文档或官方网站上找到关于兼容性的信息。 2. 检查您的导入语句是否正确。可能存在拼写错误或导入路径问题。确保您正确地导入了所需的模块。 3. 如果问题仍然存在,尝试更新您的Python包和依赖项。运行`pip install --upgrade 包名`命令可以更新指定的包。 根据引用,在使用`pip install`安装某些包时,可能会遇到"read timed out"的连接超时问题。这通常是由于网络连接不稳定或下载源服务器延迟引起的。解决这个问题的几种方法如下: 1. 更换下载源:可以尝试使用其他的下载源来替代默认的PyPI源。例如,您可以使用国内的镜像站点(如清华大学的镜像站点)或其他稳定的源来下载安装包。您可以在`pip install`命令中使用`-i`参数指定特定的镜像站点,如示例中的命令`pip install opencv-python -i https://pypi.mirrors.ustc.edu.cn/simple`。 2. 使用代理服务器:如果您使用的是受限制的网络环境,可能需要通过代理服务器来下载安装包。您可以通过设置`HTTP_PROXY`和`HTTPS_PROXY`环境变量来配置代理服务器。 3. 尝试多次:有时连接超时问题是暂时性的,可以尝试多次运行`pip install`命令来解决。 请根据您的具体情况尝试以上方法来解决pip install和mim install的问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值