Closed
Description
The current state of the numerics operators in Calyx is not great. The goal of this PR is to build a realistic, well-designed, and well-tested numerics library for Calyx that has robust supported for signed and unsigned computations for bitnum and fixedpoint numbers.
Current State
Most of the numeric operators live under primitives/{bitnum,fixed}/{signed,unsigned}.sv
. There are broadly three problems:
- No Standardized Guidelines: For example the
sqrt
implementation used blocking assignments at the time of submission which are widely discouraged when writing synthesizable RTL code. Similarly, the code does minor annoying things like not capitalizing parameter names. - Unspecified Interfaces: The fixedpoint implementations only work with number of the same width and don't really have guarantees on how things overflow.
- Unnecessary Code Duplication: The bitnum implementations should "just work" for FP since the FP format is just powers of two. It shouldn't be necessary to have two separate implementations. Plus, all primitives in the library should be synthesizable; currently they are not (
std_div
,std_fp_div
)
Brave New World
The new numerics library should be carefully redesigned to provide support for all computations that Dahlia supports and support operators like sqrt
and exp
. We should define a standard way to build new primitives and clear guidelines on when things need to be written in Calyx and when they can be written in Verilog.