dslx/stdlib: implement synthesis friendly variants of division
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Current division implementation in #932 is based on:
https://github.com/google/xls/blob/fa7af6cbda69d02d2d50b28fa5d95f51fe8cdfb1/xls/ir/abstract_evaluator.h#L513-L581
which is expected to use a large number of gates and have a slow critical path when using combinational codegen.
We should investigate alternative (and more hardware friendly?) algorithms:
- https://en.wikipedia.org/wiki/Division_algorithm#Restoring_division
- https://en.wikipedia.org/wiki/Division_algorithm#Non-restoring_division
- https://en.wikipedia.org/wiki/Division_algorithm#SRT_division
- https://people.eecs.berkeley.edu/~kubitron/courses/cs152-F01/lectures/lec06-div-fp.pdf
and consider making them accessible thru https://google.github.io/xls/dslx_reference/#parametric-functions partial specialization.
Contributor guide
Assessment
This issue has not been assessed yet.