• Stars
    star
    426
  • Rank 101,884 (Top 3 %)
  • Language SystemVerilog
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Parametric floating-point unit with support for standard RISC-V formats and operations as well as transprecision formats.

FPnew - New Floating-Point Unit with Transprecision Capabilities

Parametric floating-point unit with support for standard RISC-V formats and operations as well as transprecision formats, written in SystemVerilog.

Maintainers: Pasquale Davide Schiavone [email protected], Pascal Gouedo [email protected]
Authors: Stefan Mach [email protected], Luca Bertaccini [email protected]

Features

The FPU is a parametric design that allows generating FP hardware units for various use cases. Even though mainly designed for use in RISC-V processors, the FPU or its sub-blocks can easily be utilized in other environments. Our design aims to be compliant with IEEE 754-2008 and provides the following features:

Formats

Any IEEE 754-2008 style binary floating-point format can be supported, including single-, double-, quad- and half-precision (binary32, binary64, binary128, binary16). Formats can be defined with arbitrary number of exponent and mantissa bits through parameters and are always symmetrically biased. Multiple FP formats can be supported concurrently, and the number of formats supported is not limited.

Multiple integer formats with arbitrary number of bits (as source or destionation of conversions) can also be defined.

Operations

  • Addition/Subtraction
  • Multiplication
  • Fused multiply-add in four flavours (fmadd, fmsub, fnmadd, fnmsub)
  • Division1,2
  • Square root1,2
  • Minimum/Maximum3
  • Comparisons
  • Sign-Injections (copy, abs, negate, copySign etc.)
  • Conversions among all supported FP formats
  • Conversions between FP formats and integers (signed & unsigned) and vice versa
  • Classification

Multi-format FMA operations (i.e. multiplication in one format, accumulation in another) are optionally supported.

Optionally, packed-SIMD versions of all the above operations can be generated for formats narrower than the FPU datapath width. E.g.: Support for double-precision (64bit) operations and two simultaneous single-precision (32bit) operations.

It is also possible to generate only a subset of operations if e.g. divisions are not needed.

1Some compliance issues with IEEE 754-2008 are currently known to exist for the PULP DivSqrt unit (Rounding mismatches have been reported in GitHub issues. This can lead to results being off by 1ulp, and the inexact flag not being properly raised in these cases as well)
2Two DivSqrt units are supported: the multi-format PULP DivSqrt unit and a 32-bit unit integrated from the T-Head OpenE906. The PulpDivsqrt parameter can be set to 1 or 0 to select the former or the latter unit, respectively.
3Implementing IEEE 754-201x minimumNumber and maximumNumber, respectively

Rounding modes

All IEEE 754-2008 rounding modes are supported, namely

  • roundTiesToEven
  • roundTiesToAway
  • roundTowardPositive
  • roundTowardNegative
  • roundTowardZero

Status Flags

All IEEE 754-2008 status flags are supported, namely

  • Invalid operation (NV)
  • Division by zero (DZ)
  • Overflow (OF)
  • Underflow (UF)
  • Inexact (NX)

Getting Started

Dependencies

FPnew currently depends on the following:

These two repositories are included in the source code directory as git submodules, use

git submodule update --init --recursive

if you want to load these dependencies there.

Consider using Bender for managing dependencies in your projects. FPnew comes with Bender support!

Usage

The top-level module of the FPU is called fpnew_top and can be directly instantiated in your design. Make sure you compile the package fpnew_pkg ahead of any files making references to types, parameters or functions defined there.

It is discouraged to import all of fpnew_pkg into your source files. Instead, explicitly scope references into the package like so: fpnew_pkg::foo.

Example Instantiation

// FPU instance
fpnew_top #(
  .Features       ( fpnew_pkg::RV64D          ),
  .Implementation ( fpnew_pkg::DEFAULT_NOREGS ),
  .TagType        ( logic                     ),
  .PulpDivsqrt    ( 1'b1                      )
) i_fpnew_top (
  .clk_i,
  .rst_ni,
  .operands_i,
  .rnd_mode_i,
  .op_i,
  .op_mod_i,
  .src_fmt_i,
  .dst_fmt_i,
  .int_fmt_i,
  .vectorial_op_i,
  .simd_mask_i,
  .tag_i,
  .in_valid_i,
  .in_ready_o,
  .flush_i,
  .result_o,
  .status_o,
  .tag_o,
  .out_valid_o,
  .out_ready_i,
  .busy_o
);

Documentation

More in-depth documentation on the FPnew configuration, interfaces and architecture is provided in docs/README.md.

Issues and Contributing

In case you find any issues with FPnew that have not been reported yet, don't hesitate to open a new issue here on Github. Please, don't use the issue tracker for support questions. Instead, consider contacting the maintainers or consulting the PULP forums.

In case you would like to contribute to the project, please refer to the contributing guidelines in docs/CONTRIBUTING.md before opening a pull request.

Repository Structure

HDL source code can be found in the src directory while documentation is located in docs. A changelog is kept at docs/CHANGELOG.md.

This repository loosely follows the GitFlow branching model. This means that the master branch is considered stable and used to publish releases of the FPU while the develop branch contains features and bugfixes that have not yet been properly released.

Furthermore, this repository tries to adhere to SemVer, as outlined in the changelog.

Licensing

FPnew is released under the SolderPad Hardware License, which is a permissive license based on Apache 2.0. Please refer to the SolderPad license file for further information.

The T-Head E906 DivSqrt unit, integrated into FPnew in vendor/opene906, is reseased under the Apache License, Version 2.0. Please refer to the Apache 2.0 license file for further information.

Publication

If you use FPnew in your work, you can cite us:

FPnew Publication

@article{mach2020fpnew,
  title={Fpnew: An open-source multiformat floating-point unit architecture for energy-proportional transprecision computing},
  author={Mach, Stefan and Schuiki, Fabian and Zaruba, Florian and Benini, Luca},
  journal={IEEE Transactions on Very Large Scale Integration (VLSI) Systems},
  volume={29},
  number={4},
  pages={774--787},
  year={2020},
  publisher={IEEE}
}

Acknowledgement

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 732631.

For further information, visit oprecomp.eu.

OPRECOMP

More Repositories

1

cva6

The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
Assembly
2,230
star
2

cv32e40p

CV32E40P is an in-order 4-stage RISC-V RV32IMFCXpulp CPU based on RI5CY from PULP-Platform
SystemVerilog
941
star
3

core-v-verif

Functional verification project for the CORE-V family of RISC-V cores.
Assembly
430
star
4

force-riscv

Instruction Set Generator initially contributed by Futurewei
C++
259
star
5

cvw

CORE-V Wally is a configurable RISC-V Processor associated with RISC-V System-on-Chip Design textbook. Contains a 5-stage pipeline, support for A, B, C, D, F, M and Q extensions, and optional caches, BP, FPU, VM/MMU, AHB, RAMs, and peripherals.
SystemVerilog
251
star
6

cv32e40x

4 stage, in-order, compute RISC-V core based on the CV32E40P
SystemVerilog
210
star
7

core-v-cores

CORE-V Family of RISC-V Cores
202
star
8

programs

Documentation for the OpenHW Group's set of CORE-V RISC-V cores
HTML
187
star
9

core-v-mcu

This is the CORE-V MCU project, hosting CORE-V's embedded-class cores.
SystemVerilog
165
star
10

cv32e40s

4 stage, in-order, secure RISC-V core based on the CV32E40P
SystemVerilog
128
star
11

cva6-sdk

CVA6 SDK containing RISC-V tools and Buildroot
Makefile
59
star
12

core-v-xif

RISC-V eXtension interface that provides a generalized framework suitable to implement custom coprocessors and ISA extensions
SystemVerilog
59
star
13

cva5

The CORE-V CVA5 is an Application class 5-stage RISC-V CPU specifically targetting FPGA implementations.
SystemVerilog
59
star
14

cv-hpdcache

RTL sources of the High-Performance L1 Dcache (HPDcache) for OpenHW CV cores
SystemVerilog
51
star
15

cv32e41p

4 stage, in-order, secure RISC-V core based on the CV32E40P with Zfinx and Zce ISA extentions
SystemVerilog
26
star
16

corev-gcc

C++
22
star
17

core-v-mcu-uvm

CORE-V MCU UVM Environment and Test Bench
SystemVerilog
17
star
18

openhwgroup.org

OpenHW Group is a not-for-profit, global organization driven by its members and individual contributors where hardware and software designers collaborate in the development of open-source cores, related IP, tools and software. OpenHW provides an infrastructure for hosting high quality open-source HW developments in line with industry best practices.
HTML
16
star
19

core-v-sw

Main Repo for the OpenHW Group Software Task Group
15
star
20

riscv_vm

Instructions to import Ubuntu guest Virtual Machine for RISC-V development for the VEGA board
Shell
14
star
21

core-v-sdk

Java
14
star
22

core-v-mcu-devkit

This is the CORE-V MCU DevKit project, hosting the open-source artifacts for the CORE-V MCU Development Kit.
HTML
13
star
23

corev-llvm-project

12
star
24

tristan-isolde-unified-access-page

Unified Access Page for the TRISTAN project
HTML
11
star
25

riscv-ovpsim-corev

11
star
26

cv32e40x-dv

CV32E40X Design-Verification environment
Assembly
11
star
27

corev-binutils-gdb

C
9
star
28

core-v-mcu-cli-test

Eclipse/FreeRTOS/core-v-mcu example program
C
9
star
29

core-v-ide-cdt

Java
9
star
30

cva6-platform

CVA6-platform is a multicore CVA6 with CV-MESH software and regression platform
9
star
31

advanced-riscv-verification-methodologies

Advanced Verification Methodologies for RISC-V and related IP
SystemVerilog
7
star
32

cv-hpdcache-verif

Verification environment for the OpenHW Group's CORE-V High Performance Data Cache controller.
SystemVerilog
5
star
33

obi

Repository that maintain the OpenBus Interface spec
4
star
34

core-v-freertos

C
4
star
35

cv-mesh

3
star
36

u-boot

Unofficial development fork of U-Boot
C
2
star
37

cvw-arch-verif

The purpose of the repo is to support CORE-V Wally architectural verification
SystemVerilog
2
star
38

core-v-freertos-kernel

C
1
star
39

downloads.openhwgroup.org

downloads.openhwgroup.org
SCSS
1
star
40

osdforum.org

The Open Source Developer Forum is a workshop that brings open source software and hardware (chips, boards and systems) developers together to collaborate and learn.
HTML
1
star