Skip to content

miladHakimi/gem5-SALAM

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.9%
  • Python 12.8%
  • C 9.4%
  • Assembly 0.7%
  • Makefile 0.3%
  • HTML 0.2%
  • Other 0.7%