Installation of gem5 Simulator for SE Mode(System Call Emulation Mode)


                                                     Introduction to gem5
gem5 is a modular discrete event driven computer system simulator platform.
That means that:
gem5's components can be rearranged, parameterized, extended or replaced easily to suit your needs.It simulates the passing of time as a series of discrete events.Its intended use is to simulate one or more computer systems in various ways.It's more than just a simulator; it's a simulator platform that lets you use as many of its premade components as you want to build up your own simulation system. gem5 is written primarily in C++ and python and most components are provided under a BSD style license. It can simulate a complete system with devices and an operating system in full system mode (FS mode), or user space only programs where system services are provided directly by the simulator in systemcall emulation mode (SE mode). There are varying levels of support for executing Alpha, ARM, MIPS, Power, SPARC, and 64 bit x86 binaries on CPU models including two simple single CPI models, an out of order model, and an in order pipelined model. A memory system can be flexibly built out of caches and crossbars. Recently the Ruby simulator has been integrated with gem5 to provide even more flexible memory system modeling.
 
Installation of gem5 Simulator for SE Mode
 
Steps-

Step 1: sudo apt-get update
Sudo is Super User Do ,run commands with administrative privilege
Using update command system will install the needed package .
 
Step 2: sudo apt-get install swig gcc m4 python python-dev libgoogle-perftools-dev mercurial scons g++ build-essential SWIG is a set of scripts and libraries which wraps C++ objects and exports them to scripting language, Python.
This command will install all the dependencies for gem5 like swig, python, mercurial , scons, g++,m4,python-dev and
libgoogle-perftools-dev.
 
Step3: hg clone http://repo.gem5.org/gem5
The website provides browser access to history and change and the ability to "clone" i.e create own copy the repository on machine. 
 
Step 4: cd gem5
Cd is used to change directory.
This command helps to enter into gem5 folder.

Step 5: scons build/ARM/gem5.opt -j2
ARM is a ISA which will get installed.

System Call Emulation (SE) Mode RUN Hello program:-

The SE mode simulation focuses on the CPU and memory system, and does not emulate the entire system. We just need to

specify a binary file to be executed. So, we can run a simple simulation using the following command, where starter_se.py

is the simulation script and hello is the binary file passed as a positional argument.



1.In Gem5, below command runs hello Program. 
Code:-Gem5$ ./build/ARM/gem5.opt configs/example/arm/starter_se.py --cpu="minor" \"tests/test-progs/hello/bin/arm/linux/hello"





You can see output in m5out folder under stats.txt.

 

We can then see the gem5 output in the terminal, including some basic information about the simulation and standard output of the test program, which is “Hello world!” in this case. If the specified memory in the configuration is smaller than the memory available, you might get the following warning: Warn: DRAM device capacity (x) does not match the address

range assigned (y) , which can be safely ignored.


You can also run a multi-core example in the SE mode, where you have to specify one 
program per code:

./build/ARM/gem5.opt configs/example/arm/starter_se.py --cpu="minor" \

--num-cores=4 "tests/test-progs/hello/bin/arm/linux/hello" "tests/test-progs/hello/bin/arm/linux/hello" "tests/test-progs/hello/bin/arm/linux/hello" "tests/test-progs/hello/bin/arm/linux/hello"




 

Comments

Popular posts from this blog

Installation of gem5 Simulator for FS Mode(Full System Mode)

Running gem5 with parsec benchmark