SimMcのインストール

SimMcのコンパイル

SimMc はクリーンなC++で記述されています. Linux, MacOSX, FreeBSD などの多くの環境で動作します. まずは配布パッケージをダウンロードしてください (ダウンロードページ). パッケージのファイル名が SimMc-1.1.tar.gz であることを想定していますが, ダウンロードする版によって異なる名前となることがあります.

シミュレータをコンパイルします. コンパイルには,ncurses が必要です. ncurses のインストール方法は OS によって異なりますが, ncurses-devやncurses-develをインストールすれば良いようです.

        $ tar xvfz SimMc-1.1.tar.gz
        $ cd SimMc-1.1
Linux   $ make
MacOSX  $ make mac
FreeBSD $ make bsd

コンパイルに成功すると,sim ディレクトリの下に SimMc という実行可能ファ イルが生成されます.simディレクトリにパスを通しておくと便利です.

$ echo 'PATH=$PWD/sim:$PATH' >> ~/.bashrc
$ source ~/.bashrc

SimMcの動作確認

引数を与えずに実行することで,使い方に関する次のメッセージが表示されます.

$ sim/SimMc

## SimMc M-Core alpha : Many-Core and NoC Simulator v1.0 2010-03-30
## [SimMips: Simple Computer Simulator of MIPS Version 0.5.0 2008-11-05]
Usage: SimMc [-option] object_file_name
  -b[idx]_[idy]_[object_file_name]: set a binary that core(idx, idy) execute
  -e[num][kmg]: stop simulation after num cycles executed
...(以下省略)

これがうまく表示されない場合には,なんらかの問題が生じています. コンパイルが正しくおこなわれているか確認してください.

app/test ディレクトリ以下には,サンプルプログラムが格納されています. 次のコマンドでサンプルプログラムの一つである app/test/sample/ を実行します.

$ make run -C app/test/sample/

実行すると以下の出力が得られます.

make: Entering directory `/path/to/dir/SimMc-1.0/app/test/sample'
../../../sim/SimMc test.out
## SimMc M-Core alpha : Many-Core and NoC Simulator v1.0 2010-03-30
## [SimMips: Simple Computer Simulator of MIPS Version 0.5.0 2008-11-05]
## DEBUG MODE 0, LOG MODE 0
## comp node (1,1) - (4,4)
## memory node (0,0)
## path node (0,1) - (0,4), (1,0) - (4,0)
## Multi-Core library MClib v1.0.0 2009-12-16
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
## Simulation time    0.072 [sec]
## Simulation cycle    14232
## Simulation  196.895 kilo cycle / sec
make: Leaving directory `/path/to/dir/SimMc-1.0/app/test/sample'

Buildrootのインストール

SimMc用のプログラムをコンパイルするためにBuildrootを導入します. MIPS32のクロス開発環境の構築 を参考にビルドしてください. Buildrootがビルド出来たら, SimMcを展開したディレクトリ戻って, base.mkファイルを変更します. base.mkファイルのBUILDROOTDIRに Buildrootの設定 "Toolchain and header file location"で指定したディレクトリを設定してください. また,BASEDIRにSimMcを展開したディレクトリを設定してください.

$ cd SimMc
$ cat base.mk
##########################################################################
## Many-Core Architecture Research Project         Arch Lab. TOKYO TECH ##
##########################################################################
BUILDROOTDIR   = $(HOME)/buildroot
BASEDIR = $(HOME)/SimMc
.
.
.

Buildrootの動作確認

実際にBuildrootを使ってみましょう. buildrootを使用してテストアプリをコンパイルして,実行します.

$ cd SimMc/app/test/test10
$ make
$ make run
../../../sim/SimMc  test.out
## SimMc M-Core alpha : Many-Core and NoC Simulator v1.0 2010-03-30
## [SimMips: Simple Computer Simulator of MIPS Version 0.5.0 2008-11-05]
## DEBUG MODE 0, LOG MODE 0
## comp node (1,1) - (4,4)
## memory node (0,0)
## path node (0,1) - (0,4), (1,0) - (4,0)
## Multi-Core library MClib v1.0.0 2009-12-16
$$ test10: I am core (2,1).
$$ test10: I am core (3,1).
$$ test10: I am core (4,1).
$$ test10: I am core (2,2).
$$ test10: I am core (3,2).
$$ test10: I am core (4,2).
$$ test10: I am core (2,3).
$$ test10: I am core (3,3).
$$ test10: I am core (4,3).
$$ test10: I am core (2,4).
$$ test10: I am core (3,4).
$$ test10: I am core (4,4).
$$ test10: I am core (1,2).
$$ test10: I am core (1,3).
$$ test10: I am core (1,4).
$$ test10: I am core (1,1).
## Simulation time    0.089 [sec]
## Simulation cycle    17309
## Simulation  193.734 kilo cycle / sec

このような出力がでれば成功です.


M-Coreトップ

Copyright(c) 2010, Tokyo Tech Kise Laboratory. All rights reserved.