Giter Club home page Giter Club logo

percival's Introduction

PERCIVAL: Open-Source Posit RISC-V Core with Quire Capability

PERCIVAL is an application-level posit capable RISC-V core based on CVA6 that can execute all posit instructions, including the quire fused operations.

You can find the Xposit RISC-V custom extension for posit arithmetic used together with this repository here: https://github.com/artecs-group/llvm-xposit

You can find the original CVA6 repo with additional documentation here: https://github.com/openhwgroup/cva6

64-bit version (Big-PERCIVAL)

Here you can also find Big-PERCIVAL, an updated version of PERCIVAL which adds posit64 operations and increased flexibility in the PAU. You can read about it in our pre-print: https://doi.org/10.48550/arXiv.2305.06946

For the original PERCIVAL code switch to the posit-master branch. However, we recommend using the current default big-percival-main branch, as this also supports 32-bit posits.

Publication

If you use PERCIVAL in your academic work you can cite us:

D. Mallasén, R. Murillo, A. A. D. Barrio, G. Botella, L. Piñuel, and M. Prieto-Matias, “PERCIVAL: Open-Source Posit RISC-V Core With Quire Capability,” IEEE Transactions on Emerging Topics in Computing, vol. 10, no. 3, pp. 1241–1252, 2022, doi: 10.1109/TETC.2022.3187199.

D. Mallasén, A. A. Del Barrio, and M. Prieto-Matias, “Big-PERCIVAL: Exploring the Native Use of 64-Bit Posit Arithmetic in Scientific Computing.” arXiv [cs.AR], 2023. Available: http://arxiv.org/abs/2305.06946

@article{mallasen2022PERCIVAL,
  title = {PERCIVAL: Open-Source Posit RISC-V Core With Quire Capability},
  author = {Mallasén, David and Murillo, Raul and Del Barrio, Alberto A. and Botella, Guillermo and Piñuel, Luis and Prieto-Matias, Manuel},
  year = {2022},
  journal = {IEEE Transactions on Emerging Topics in Computing},
  volume = {10},
  number = {3},
  pages = {1241-1252},
  issn = {2168-6750},
  doi = {10.1109/TETC.2022.3187199}
}

@misc{mallasen2023BigPERCIVAL,
  title = {Big-PERCIVAL: Exploring the Native Use of 64-Bit Posit Arithmetic in Scientific Computing},
  author = {Mallasén, David and Del Barrio, Alberto A. and Prieto-Matias, Manuel},
  year = {2023},
  month = may,
  eprint = {2305.06946},
  primaryclass = {cs.AR},
  archiveprefix = {arXiv}
}

Posit Arithmetic Unit (PAU)

The top-level module of the PAU can be found in core/pau_top.sv. The individual arithmetic modules are in core/pau/. You can configure the PAU changing the parameters in core/include/ariane_pkg.sv.

Getting Started

The following instructions will get you a copy of the project up and running on your local machine and run the posit testsuite using the QuestaSim simulator. If you run into problems, look at the troubleshooting section.

Prerequisites

These instructions assume you have the LLVM Xposit compiler and the QuestaSim simulator installed in your system. Also, on a fresh Ubuntu 20.04 installation you will need to install the following packages:

sudo apt install -y git curl gcc g++ make autoconf

Make sure you have the $RISCV environment variable pointing to the directory where you installed the RISC-V gcc toolchain. E.g. export RISCV="/opt/riscv. Consider adding this permanently in your .bashrc file.

Checkout the repository

git clone https://github.com/artecs-group/PERCIVAL.git
cd PERCIVAL
git submodule update --init --recursive
mkdir tmp
./ci/install-riscvpk.sh

Compile the posit testsuite

clang --target=riscv64 -march=rv64gcxposit posit64_testsuite_llvm.c -c -o posit64_testsuite_llvm.o
riscv64-unknown-elf-gcc posit64_testsuite_llvm.o -o posit64_testsuite_llvm.elf

Simulate the posit testsuite

make sim elf-bin=$RISCV/riscv64-unknown-elf/bin/pk target-options=posit64_testsuite_llvm.elf batch-mode=1

Note: If you want to use the QuestaSim GUI, remove the batch-mode=1 option.

Troubleshooting the installation

If QuestaSim does not find the libfesvr.so, you can generate it by running the ./ci/install-fesvr.sh script. If it still doesn't generate the library, add the line fesvr_install_shared_lib = yes to the ./tmp/riscv-isa-sim/fesvr/fesvr.mk.in file and follow the ./ci/install-fesvr.sh script instructions manually.

If QuestaSim fails with the following error: Fatal: Unexpected signal: 11, run with:

make sim elf-bin=posit64_testsuite_llvm.elf QUESTASIM_FLAGS="-novopt -suppress 12110" batch-mode=1

This fix follows the instructions here. It should be fixed with newer versions of QuestaSim (2022.4 or later).

FPGA Synthesis

To generate the FPGA bitstream for the Genesys II board run make fpga. This will produce a bitstream file and memory configuration file in corev_apu/fpga/work-fpga/.

Programming the Memory Configuration File

  1. Open Vivado.
  2. Open the Hardware Manager and open the target board (Genesys II xc7k325t).
  3. Tools -> Add Configuratin Memory Device -> xc7k325t.
  4. Select Configuration Memory Part -> Spansion SPI flash s25fl256sxxxxxx0.
  5. Program the configuration memory device with the configuration file ariane_xilinx.mcs generated in corev_apu/fpga/work-fpga/.
  6. Press ok. Flashing will take a couple of minutes.
  7. Right click on the FPGA device -> Boot from Configuration Memory Device (or press the program button on the FPGA).

Booting linux

To prepare the SD card and boot linux follow the instructions available here. You can build your own posit applications and include them in the linux image following the instructions available here.

Acknowledgments

This work was supported in part by the 2020 Leonardo Grant for Researchers and Cultural Creators, from BBVA Foundation under Grant PR2003_20/01, in part by the Spanish MINECO, the EU(FEDER), and Comunidad de Madrid under Grants RTI2018-093684-B-I00 and S2018/TCS-4423, and in part by grants PID2021-123041OB-I00 and PID2021-126576NB-I00 funded by MCIN/AEI/ 10.13039/501100011033 and by “ERDF A way of making Europe”.

percival's People

Contributors

andreaskuster avatar asintzoff avatar atraber avatar colluca avatar danielmlynek avatar davidmallasen avatar e-poulin avatar edgarigl avatar flaviens avatar gchauvon avatar jeanrochcoulon avatar jimmysitu avatar jmason827 avatar lingscale avatar lucazulberti avatar lvcargnini avatar moschn avatar msfschaffner avatar niwis avatar ottg avatar pawelkudlakaldec avatar raulbehl avatar sjthales avatar steinegger avatar stmach avatar suehtamacv avatar whutddk avatar xushengj avatar yanicasa avatar zarubaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

percival's Issues

Eliminate CVA6 dependencies within the PAU

To make a more flexible code (so the PAU could be extended with new features, or adapted to other cores), there are some dependencies that should be removed. More precisely, all the params within the pau_top.sv referencing ariane_pkg and riscv_pkg should be replaced.
This would make the PAU to be core-agnostic, in a similar way as FPnew works. Then, a specialization layer should be included to adapt the PAU to the different cores (in this case, the CVA6), similarly as fpu_wrap.sv.

P.S.: Ideally, the PAU could be an independent repo, but I know this implies much extra work.

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.