-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try out Halide to Calyx flow #1585
Comments
Some instructions to get started:
Check that
|
Thanks for adding the information @xerpi! |
I think this is the dissertation that describes the flow (I think): https://upcommons.upc.edu/bitstream/handle/2117/390390/176860.pdf?sequence=2 |
Indeed, that was my thesis dissertation for the project. Here's a summary of the flow: High-level overview of the implemented flow from Halide down to execution on Xilinx FPGAs: Passes executed to convert from generic MLIR to CIRCT’s hardware dialects (after the MLIR to Calyx step, human-readable Calyx code can be emitted): Steps needed to export SystemVerilog targeting Xilinx devices from CIRCT with hardware dialects. First, the needed Xilinx-specific wrappers are added, and then the passes to convert to SystemVerilog are executed. A |
Oh interesting! Did you ever use the native compiler to perform any optimizations to the design? I wonder how the resulting designs would differ. |
At the beginning of development, I indeed emitted human-readable Calyx code and used the native Calyx compiler to check that code produced was at least semantically correct. By that time, I still had to implement Halide's XRT runtime backend so I didn't do any performance comparisons (or even checked visually the difference of the RTL code emitted). Soon after that, I added custom Calyx operations to support vector types and since then unfortunately Calyx code can't be emitted anymore. |
Ah got it! What are the custom vector operations that you ended up adding to Calyx. Maybe we can figure out a way to support them natively. |
To implement the Halide vector I also had to remove the constraint that ensures that a Calyx assign src and dst wires are of the same type, so that I could flatten/unflatten vectors to just a range of bits and vice-versa (needed for example when reading from the memory bus into a vector, and vice versa): xerpi/circt@53d5f7d#diff-129515b0cbde7eccbd6943c9b6f45d597ff0fcc25df9f45b4da60e804815e8c0 I also had to add support for sequential-read memories (extra "read-en" signal): llvm/circt#4857 |
Bringing back this discussion after almost a year :) I'm working on vectors stuff and have relevant questions regarding vector operations.
@xerpi Did you get a chance to implement vector additions and having vectors as return types, especially that Calyx doesn't have vector registers? |
@jiahanxie353 Hi! I didn't get a chance to implement it properly... |
@xerpi has been working a Halide (to MLIR) to Calyx flow and we should give it a try and get a sense of what we need to do to support it.
Some information from on this (courtesy @xerpi):
Other refs:
The text was updated successfully, but these errors were encountered: