--- tags: CSIE --- # GEM5小教室 ## How to run gem5 ### 0.Download gem5 - 我們會利用git來下載gem5,所以要先準備好[git](https://git-scm.com/) `sudo apt install git` - 之後直接從官網的教學範例下載gem5 `git clone https://gem5.googlesource.com/public/gem5` ### 1.Build gem5 ``` /usr/bin/env python3 /usr/bin/scons build/X86/gem5.opt -j 8 ``` >使用的環境是python3 >X86是指這次模擬的ISA >`-j 4`是指用4個thread去跑 ### 2.Run Hello World ``` build/X86/gem5.opt configs/example/se.py --cmd=tests/test-progs/hello/bin/x86/linux/hello ``` >在gem5的資料夾直接 >上面單純就是讓它跑,下面則是有使用到cache >se : System call emulation mode ``` build/X86/gem5.opt configs/example/se.py --cmd=tests/test-progs/hello/bin/x86/linux/hello --cpu-type=TimingSimpleCPU --l1d_size=64kB --l1i_size=16kB --caches ``` ### 3.Statistics and Output - 在`gem5/build/x86/m5out` >我們在範例是使用x86,但還有ARM、RISCV、MIPS... `config.ini`: 我們設定的系統資訊 `stats.txt`: 模擬出來的output ## run Mibench jpeg encoder/decoder ### 1.先下載Mibench的github ``` git clone https://github.com/embecosm/mibench.git ``` >我們gem5與mibench的資料夾各別都放在家目錄下 ### 2. Make mibench 到`/mibench/consumer/jpeg/jpeg-6a/`裡去打`make` ``` cd ~/mibench/consumer/jpeg/jpeg-6a/ make ``` ### 3.Run 先回到gem5的資料夾 ``` cd ~/gem5/ ``` #### small jpeg encoder ``` build/X86/gem5.opt configs/example/se.py --cmd=../mibench/consumer/jpeg/jpeg-6a/cjpeg --options="-dct int -progressive -opt -outfile output_small_encode.jpeg" --input=../mibench/consumer/jpeg/input_small.ppm ``` #### small jpeg decoder ``` build/X86/gem5.opt configs/example/se.py --cmd=../mibench/consumer/jpeg/jpeg-6a/djpeg --options="-dct int -ppm -outfile output_small_decode.ppm" --input=../mibench/consumer/jpeg/input_small.jpg ``` #### large jpeg encoder ``` build/X86/gem5.opt configs/example/se.py --cmd=../mibench/consumer/jpeg/jpeg-6a/cjpeg --options="-dct int -progressive -opt -outfile output_large_encode.jpeg ../mibench/consumer/jpeg/input_large.ppm" ``` #### large jpeg decoder ``` build/X86/gem5.opt configs/example/se.py --cmd=../mibench/consumer/jpeg/jpeg-6a/djpeg --options="-dct int -ppm -outfile output_large_decode.ppm ../mibench/consumer/jpeg/input_large.jpg" ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up