Giter VIP home page Giter VIP logo

ksim's Introduction

Khronos

Khronos is moving to https://github.com/pku-liang.

Introductions

Khronos is a cycle-accurate software RTL simulation tool that exploits the temporal data (hardware state) locality between consecutive cycles. Khronos will fuse state writes and reads with temporal localities, effectively reducing the pressure to the host cache and memory.

As shown in the figure, the queue graph captures temporal data dependencies and enables temporal optimization between cycles. By adjust the simulation order and re-schedule the simulation, Khronos can reducing the memory access and accelerate RTL simulation.

Installation

Setup depedencies:

mkdir install
export INSTALL_PREFIX=$PWD/install
git submodule update --init
cd third_party
./setup-circt.sh
./setup-lemon.sh

Build khronos:

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DCMAKE_BUILD_TYPE=Release
make ksim
make install

Usage

Currently, Khronos has full support for firtool frontend, partly support for moore and calyx frontend.

# add current install prefix to path
export PATH=$PWD/install/bin:$PATH

# first, translate firrtl file to mlir dialect
firtool --ir-hw --disable-all-randomization $design.fir -o $design.mlir

# then, translate mlir to llvm ir
#   generating header and default implementation
ksim $design.mlir -v -o $design.ll --out-header=$design.h --out-driver=$design.cpp

# call LLVM to compile the llvm ir file to binary
llc --relocation-model=dynamic-no-pic -O2 -filetype=obj $design.ll -o $design.o

# link testbench and simulator together
clang++ -O2 $design.o $design.cpp -o $design

Citing Khronos

If you use this software, please cite it as below.

@inproceedings{Khronos,
  author = {Kexing, Zhou and Yun, Liang and Yibo, Lin and Runsheng, Wang and Ru, Huang},
  title = {Khronos: Fusing Memory Access for Improved Hardware RTL Simulation},
  booktitle = {MICRO '23: 55th IEEE/ACM International Symposium on Microarchitecture},
  publisher = {ACM},
  year = {2023},
  url = {https://doi.org/10.1145/3613424.3614301},
  doi = {10.1145/3613424.3614301}
}

ksim's People

Contributors

keke046 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.