copilot-bluespec: Add more configuration options for floating-point code generation
#743
RyanGlScott
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently,
copilot-bluespechas a very specific strategy for generating floating-point operations that is based on Bluespec'sFloatingPointpackage. This approach has the advantage that it is a 100% native Bluespec implementation, but it also comes with some distinct downsides:FloatingPointpackage lacks implementations of certain floating-point operations (e.g., transcendental functions), which forces us to resort to using C code as shim implementations for these operations. These shims can be simulated, but they cannot be run on actual hardware.FloatingPointoperations are quite large due to the complexity of the implementation, combined with how much inlining and pipelining the Bluespec compiler performs. In large examples, using enough floating-point operations can even cause the Bluespec compiler to error out due to the amount of elaboration it has to perform (e.g., seebscoverflows stack space on smallDoubleexample B-Lang-org/bsc#1025).FloatingPointpackage was tailored for writing processors, which may not be as well suited for general numeric computation. For other use cases, it may be desirable to plug in specific floating-point IP libraries written in Verilog.It is unclear if there is any single approach that will solve all of these problems at once, so we should make
copilot-bluespecconfigurable so as to generate different floating-point-related Bluespec code for different use cases. I can foresee having some combination of the following approaches to pick from:FloatingPointBluespec code as-is.+).FloatingPointBluespec code where possible, but usingnoinlinepragmas (as recommended inbscoverflows stack space on smallDoubleexample B-Lang-org/bsc#1025 (comment)) to make the compile times more manageable.I imagine that these options could be folded into
BluespecSettingssomehow.Beta Was this translation helpful? Give feedback.
All reactions