Coder Social home page Coder Social logo

liuqyou / gem5-salam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tecsar-uncc/gem5-salam

0.0 0.0 0.0 186.31 MB

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

Shell 0.18% C++ 75.62% Python 12.85% Perl 0.04% C 9.45% Emacs Lisp 0.01% Java 0.01% Scala 0.01% Fortran 0.03% SuperCollider 0.02% Assembly 0.72% Awk 0.01% Forth 0.01% Hack 0.23% Makefile 0.25% HTML 0.24% CMake 0.23% M4 0.05% Dockerfile 0.04% Roff 0.02%

gem5-salam's Introduction

gem5-SALAM

gem5-SALAM (System Architecture for LLVM-based Accelerator Modeling), is a novel system architecture designed to enable LLVM-based modeling and simulation of custom hardware accelerators.

Requirements

  • gem5 dependencies
  • LLVM-9 or newer
  • Frontend LLVM compiler for preferred development language (eg. clang for C)

gem5-SALAM Setup

All Required Dependencies for gem5-SALAM (Ubuntu 20.04)

sudo apt install build-essential git m4 scons zlib1g zlib1g-dev \
    libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \
    python3-dev python-is-python3 libboost-all-dev pkg-config

LLVM/Clang Setup

For a quick start, one can simply run the following to install LLVM and Clang on Ubuntu 20.04.

sudo apt install llvm-9 llvm-9-tools clang-9

After installing these specific libraries, simply run the update alternatives script in docs/.

Alternatively, you can install the latest version of LLVM via your system package manager or build from source found at https://github.com/llvm/llvm-project.

Building gem5-SALAM

Once you have successfully installed all of the necessary dependencies, you can go ahead and clone the gem5-SALAM repository to begin working with it.

git clone https://github.com/TeCSAR-UNCC/gem5-SALAM

When building gem5-SALAM, there are multiple different binary types that can be created. Just like in gem5 the options are debug, opt, fast, prof, and perf. We recommend that users either use the opt or debug builds, as these are the build types we develop and test on.

Below are the bash commands you would use to build the opt or debug binary.

scons build/ARM/gem5.opt -j`nproc`
scons build/ARM/gem5.debug -j`nproc`

For more information regarding the binary types, and other build information refer to the gem5 build documentation here.

Using gem5-SALAM

To use gem5-SALAM you need to define the computation model of you accelerator in your language of choice,and compile it to LLVM IR. Any control and dataflow graph optimization (eg. loop unrolling) should be handled by the compiler. You can construct accelerators by associating their LLVM IR with an LLVMInterface and connecting it to the desired CommInterface in the gem5 memory map.

Below are some resources in the gem5-SALAM directory that can be used when getting started:

  • Examples for system-level configuration can be found in configs/common/HWAcc.py.
  • Accelerator benchmarks and examples can be found in the benchmarks directory.
  • The benchmarks/common directory contains basic drivers and syscalls for baremetal simulation.
  • benchmarks/sys_validation contains examples for configuring and using gem5-SALAM with different algorithms.

System Validation Examples

The system validation examples under benchmarks/sys_validation are good examples for how you interface with the gem5-SALAM simulation objects.

In order to use the system validation benchmarks, it is required to have the ARM GCC cross-compiler installed. If you didn't already install it when you setup the dependencies, you can install it in Ubuntu by running the below command:

sudo apt-get install gcc-arm-none-eabi

systemValidation.sh requires an environment variable named M5_PATH to be set. You will want to point it to your gem5-SALAM path as shown below.

export M5_PATH=/path/to/gem5-SALAM

Next, compile your desired example.

cd $M5_PATH/benchmarks/sys_validation/[benchmark]
make

Finally, you can run any of the benchmarks you have compiled by running the system validation script.

./systemValidation.sh -b [benchmark]

If you would like to see the gem5-SALAM command created by the shell file you would just need to inspect the RUN_SCRIPT variable in the shell file.

Resources

gem5 Documentation

https://www.gem5.org/documentation/

gem5 Tutorial

The gem5 documentation has a tutorial for working with gem5 that will help get you started with the basics of creating your own sim objects.

Building and Integrating Accelerators in gem5-SALAM

We have written a guide on how to create the GEMM system validation example. This will help you get started with creating your own benchmarks and systems. It can be viewed here.

SALAM Object Overview

The SALAM Object Overview covers what various Sim Objects in gem5-SALAM are and their purpose.

Full-system OS Simulation

Please download the latest version of the Linux Kernel for ARM from the gem5 ARM kernel page. You will also need the ARM disk images for full system simulation. Devices operate in the physical memory address space.

gem5-salam's People

Contributors

jsslycord avatar zephan-spencer avatar josh-slycord avatar ronakvraheja avatar ashriram avatar hamedtabkhi avatar dependabot[bot] avatar sacusa 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.