-
Notifications
You must be signed in to change notification settings - Fork 146
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
Build system integration is complex #44
Comments
Note that BSC has a There are two scripts that you might want to look at: In In I will have to look back at what bluetcl provides, but if it doesn't provide easy access to lists of inputs and outputs, that would certainly be reasonable to add, to bluetcl or bsc (since the Haskell code already exists for computing this). |
Can (Edit: The "in half" is relative to a serial separate compile by invoking Thanks for the other pointers, I will investigate! |
The link step for Bluesim ( |
Interesting. Is there any way to get bsc to emit the commands rather than running them, so that they could be handled by the build system? |
You can run I do see, in The place where this is all computed is in I suspect that you could use the current commands by running |
Connectal has a script to generate a Makefile from a collection of BSV files so to enable parallel make. I think something similar based on src/comp/Depend.hs would be very useful: to generate Makefile or ninja file containing the dependences to enable parallel builds. |
As another note, my utility yosys-bsv is a plugin for Yosys that allows you read Bluespec designs. It's been improved a lot since the FOSS release, and you can probably use it in combination with Yosys to coax out some of this information when they're combined. Broadly, if you install the plugin and use yosys, you can do something like:
This transparently invokes the Bluespec compiler in a temporary directory, emits Verilog, then reads all the Verilog into the current synthesis design in a single step. (The compilation step is recursive and because a fresh tempdir is used every time, it can be expensive to do this.) If multiple #! /usr/bin/env bash
yosys -v3 -l synth.log -p "plugin -i $YOSYS_BLUESPEC_DIR/bluespec.so; script build.ys" The Yosys script (which is simply a linear list of Yosys commands, an alternative to Tcl/Python APIs) is:
You could also use So once you have that I'm guessing you have a few options. There are things like the These are definitely some tractable problems and workarounds for now, though first-class support would be excellent. |
Currently, bsc emits Verilog files that are named after modules defined within a source file, rather than the name of the source file. This complicates its use in build systems, which need to be able to precisely determine which artifacts are from which inputs in order to support correct incremental/parallel builds.
For build systems that support dynamic dependencies (e.g. make, or things built atop ninja), there are two features that would help with this.
gcc -MF
.Ideally, these could be done without compiling the module, but if that's hard, doing both would be okay.
(Perhaps this can be done today with bluetcl -- the bluetcl docs are ungoogleable if they exist, and there's no Docs link on the Bluespec site. Edit: managed to find a copy of an old user guide posted on the UCSB website which includes docs on Bluetcl toward the end -- I see no facilities that seem relevant to this, but I may not be thinking creatively enough.)
For build systems that mandate static dependencies -- such as Bazel -- an option to control naming of Verilog outputs based on a pattern, or even concatenate all the outputs from
Foo.bs
intoFoo.v
, would help. I personally am not using such build systems, so this is lower on my priority list.Other suggestions welcome!
@arjenroodselaar @bpfoley
The text was updated successfully, but these errors were encountered: