Giter Club home page Giter Club logo

arches-v2's Introduction

Arches

Arches is a general-purpose and fast cycle-level hardware simulator.

The name is a pun on being able to simulate various architectures and on Arches National Park, Utah (it being traditional at the University of Utah to name software projects after Utah or Salt Lake City features).

Setup (Simulator)

To clone and build the project simply run the following commands:

git clone https://github.com/Haydelj/arches-v2.git
cd arches-v2
mkdir build
cd build
cmake ..

Setup (RISCV, Ubuntu Linux)

Testing programs on the framework requires the use of a RISC-V Cross-Compiler. Fortunately, many many people have devoted numerous hours to getting a decent RISC-V cross compiler implemented using GCC; this is available here. For our own testing, these are the instructions we followed:

sudo apt update
sudo apt install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
git submodule update --init --recursive
sudo mkdir -m 777 /opt/riscv
echo -e "export PATH=\"/opt/riscv/bin:$PATH\"" >> ~/.bashrc
source ~/.bashrc
./configure --prefix=/opt/riscv --with-arch=rv64imfa --with-abi=lp64f
make

After these steps are completed, users are able to use riscv64-uknown-elf-gcc to compile C code and riscv64-unknown-elf-g++ to compile C/C++ code.

Adding custom instructions

A key reason we used RISC-V over other research languages (i.e. MIPS) was the ease with which RISC-V can be extended. This allows researchers to use our framework to test novel hardware designs that may rely on custom instructions for drastic performance improvements. It's important to note that this method allows progams using custom instructions to compile; however, it doesn't act as a true cross-compiler, i.e. users will need to use inline ASM to include their custom instructions.

To add custom instructions, we followed the guide available here. Since the time of this guide's writing, there have been a few notable changes to the build tree of the riscv-gnu-toolchain, so we will only note the differences below:

  • Use riscv-gnu-toolchain/riscv-binutils/include/opcode/riscv-opc.h instead of riscv-gnu-toolchain/riscv-binutils-gdb/include/opcode/riscv-opc.h.
  • Similarly, use riscv-gnu-toolchain/riscv-binutils/opcodes/riscv-opc.c instead of riscv-gnu-toolchain/riscv-binutils-gdb/opcodes/riscv-opc.c. As the original guide notes, after the custom instruction has been added the toolchain will need to be rebuilt. This can be easily accomplished by running the following:
$ cd riscv-gnu-toolchain
$ make clean
$ ./configure --prefix=/opt/riscv --with-arch=rv64imfa --with-abi=lp64f
$ make

After rebuilding, the user should be able to run the cross-compiled programs with their custom instructions on the Arches framework, assuming they have extended the implementation of the RISC-V ISA provided by Arches to contain their custom instruction.

More details about the RISC-V ISA are available by reading the specification, but it's expected that users are at least familiar with RISC-V before they attempt to implement custom instructions.

Contributing

Follow the coding style in the existing code. Additionally, aim for cleanliness above all else.

arches-v2's People

Contributors

haydelj avatar pommpy avatar gauravab92 avatar kunnongzeng avatar

Watchers

 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.