Git Product home page Git Product logo

tuinannan / gem5 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrewzigerelli/gem5

0.0 2.0 0.0 351.77 MB

This is an read-only mirror of the gem5 simulator. The upstream repository is stored in https://gem5.googlesource.com, code reviews should be submitted to https://gem5-review.googlesource.com/. The mirrors are synchronized every 15 minutes.

Home Page: http://gem5.org

License: BSD 3-Clause "New" or "Revised" License

Python 13.54% Shell 0.25% C 3.88% C++ 79.81% Makefile 0.15% CMake 0.18% M4 0.17% sed 0.01% HTML 0.31% Visual Basic 0.01% Objective-C 0.06% Scala 0.03% Assembly 1.46% Awk 0.01% Forth 0.04% Perl 0.08% Emacs Lisp 0.01% Java 0.01% Roff 0.02% Vim Script 0.01%

gem5's Introduction

Compilation

See gem5 wiki for downloading and compiling gem5 with scons.

Note: you must also set an m5 folder somewhere on your system for the disk and kernel.

For speed, checkpoint with TimingSimpleCPU.

Install stuff

For Ciro's setup, you need to muck around with buildroot.

Since we need to get SPEC to run, boot the image in qemu and install using the guest compiler. Here's a script which can help you boot: https://gist.github.com/andrewzigerelli/5c0c82d5bc304ed28ac972c9254edb54

System setup

  1. Use qemu to create a disk image, see Jason's blog: http://www.lowepower.com/jason/setting-up-gem5-full-system.html

BE SURE to note what disk root is on! (e.g. /dev/sda1)

Compile the kernel. Look up how to use an oldconfig; here is one that I got to work: https://gist.github.com/andrewzigerelli/6e0084af628a38e658320a1ff2d9ebd9. Note: vmlinux will work with gem5. You also need to make bzImage to use with qemu later.

Make sure to also install the gem5 tools, covered in Jason's post.

Further, if these are installed:

Lxcfs is a fuse filesystem mainly designed for use by lxc containers. We don't need it, and it always fails to startup with: [FAILED] Failed to start FUSE filesystem for LXC. Remove it

sudo apt remove lxcfs -y --purge

Also remove snappy, which also fails during startup:

sudo apt purge snapd ubuntu-core-launcher squashfs-tools
  1. Alternatively, use Ciro Santilli's excellent setup: https://github.com/************/linux-kernel-module-cheat Even if you don't use this, at least check it out because he has excellent notes.

Modify run_gem.sh in my_script accordingly.

As of now, the automatic checkpoint doesn't work. Take it manually (boot and run m5 checkpoint from the simulated system).

For the initial setup, should only have to be concerned with changing the m5 and gem5 locations, as well as the disk you want to boot, plus the root variable.

Also, you need to edit cache, mem_size, etc parameters per experiment.

Boot problems

No internet

Boot in the gui where host networking should be set up for you. e.g. look at run_qemu_gui.sh and modify appropriately (image name). This may be used in the case where you need to apt-get to fix things.

In qemu, during boot, if you get

[FAILED] Failed to start Load Kernel Modules.

Hopefully, it still boots and you can debug. Login as root and:

systemctl status systemd-modules-load.service

Example output:

  Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; ven
  Active: failed (Result: exit-code) since Wed 2019-01-23 16:41:59 EST; 12min a
  Docs: man:systemd-modules-load.service(8)
        man:modules-load.d(5)
  Process: 57 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=1
  Main PID: 57 (code=exited, status=1/FAILURE)

Get the PID (in this case, 57) and run (replace 57 with your PID)

journalctl _PID=57 | less

This will give you failure messages than you can google. In my case, I got, among other messages :

could not open moddep file '/lib/modules/4.19.0/modules.dep.bin'

For ubuntu, doing

apt-get install linux-image-4.19.0

will fix it, but this probably won't work. Either compile it yourself: https://stackoverflow.com/questions/22783793/how-to-install-kernel-modules-from-source-code-error-while-make-process Look at Ciro's answer (he is everywhere!)

Or you need to install libssl1.1 here: https://packages.ubuntu.com/bionic/amd64/libssl1.1/download

Or direct link here: http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4.3_amd64.deb

and install it very dpkg -i package_name

Also install

http://ubuntuhandbook.org/index.php/2018/10/linux-kernel-4-19-released-install-ubuntu/

and make a softlink like so:

cd /lib/modules
ln -s 4.19.0-041900-generic 4.19.0

You may still have the service fail to load. Check the journal again following the above steps.

In may case, the following failed to load: iscsi_tcp ib_iser

In this case, the fix:

cd /lib/modules-load.d
vim open-isci.conf

and comment out the files that were complained about by appending #.

Next time, the service started on boot!

bb513da20643fad707cc42ec040388629a9ae6ee

gem5's People

Contributors

binkert avatar ennobler avatar gabemblack avatar ahansson-arm avatar andysan avatar nilayvaish avatar rdreslin avatar steve-reinhardt avatar beckmabd avatar giactra avatar relokin avatar cdunham avatar odanrc avatar bkp avatar powerjg avatar aroelke avatar atgutier avatar pdudnik avatar jthestness avatar ************2 avatar benash avatar spwilson2 avatar qtt2 avatar sticklyman1936 avatar deater avatar alexdutu avatar gabordzs avatar cmnrd avatar baz21 avatar matt2909 avatar

Watchers

James Cloos avatar Yanan Guo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.