-
Notifications
You must be signed in to change notification settings - Fork 1
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
fud2 support for FIRRTL #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AMAZING!!! I'm so glad this was comparatively straightforward to do; everything looks ship shape. I don't really have any comments on the current implementation (except for one super minor one) and think this is good to go!
At some point, when we have a different approach to the primitives, it seems like it could be possible to avoid having separate icarus-firrtl
and verilator-firrtl
ops, and just rely on the plain ol' icarus
and verilator
ops. (That is, if I can figure out how to decouple Calyx compilation and Icarus simulation.)
As for the documentation: this is already great!! I have really not written any fud2 docs yet, so I suppose whenever we do that, we should put this stuff there. I'll try to remember to move forward the project of merging fud2 into the Calyx repo, I suppose, so we have a good place to do this!
&format!("{}/primitives-for-firrtl.sv", e.config_val("data")?), | ||
)?; | ||
} else { | ||
e.arg("extra_primitives", "")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, you can probably leave off these "empty" assignments; in Ninja, variables that are unassigned are just empty by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see! Thanks for letting me know :) (This will all be gone soon so I'll keep things as is for now but will keep this in mind for the future!)
Awesome!! Thank you for trying everything out and fixing things up :) |
Edit: I also added support for running the generated System-Verilog via Verilator!
This is a first pass at supporting the Calyx-FIRRTL backend in fud2! As a point of note, we can remove the
$extra_primitives
argument and theprimitives-for-firrtl.sv
file once I support primitives in FIRRTL.Please let me know if there's anything I can improve/should fix here! I also included Setup and Usage notes below, but I can put them elsewhere as needed.
Setup
To generate and run System-Verilog from Calyx-translated FIRRTL, we need the FIRRTL compiler.
<ROOT>
is the full path to the parent directory of where your repos live (most likely the parent directory offake
andcalyx
?).Verilator, yosys, and sbt are also needed.
Then, edit the configuration file (
~/.config/fud2.toml
) to include the below:Usage
In the below pseudo-commands,
<IN_FILE>
is the input Calyx file, and<DATA_FILE>
is the JSON file containing data.To generate FIRRTL from Calyx:
To generate System-Verilog from Calyx-translated FIRRTL:
To run System-Verilog from Calyx-translated FIRRTL using Icarus-Verilog:
To run System-Verilog from Calyx-translated FIRRTL using Verilator: