opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

Pass discovered modules to fusesoc generators

Open imphil opened this issue 7 years ago • 8 comments

Fusesoc builds a dynamic list of source files, parameters, and other settings by (1) scanning a search path (called CORES_ROOT) for individual *.core files, and (2) resolving a dependency tree from a given top-level module, while taking external constraints (such as the synthesis tool) into consideration. This behavior enables us today to have the right set of source files for a given synthesis or simulation target. Since the search path is dynamic it can be locally extended (on the user's machine) to search code in directories which might or might not be available, such as a private repository or network share containing technology primitives.

Fusesoc also has a feature called "generators", by which it calls an external script to create additional source files on the fly. (https://fusesoc.readthedocs.io/en/master/generators.html)

What's missing is a way to pass (a) all core files fusesoc found, and (b) the resolved dependency tree to a generator. (See the discussion in https://github.com/olofk/fusesoc/issues/250).

We have two use cases for such a feature:

  • The automatic toplevel generation (#230) needs to know the resolved dependency tree, and a list of configuration *.json files which are included in the build.
  • The implementation-dependent primitives code in lowRISC/stwg-base#237 needs to know all core files which match a given name.

Note: we can work-around this missing feature in fusesoc by essentially replicating the search and dependency resolution logic that fusesoc uses. However I'd love to avoid that, and adding this missing feature to fusesoc shouldn't be too hard.

imphil avatar Mar 20 '19 17:03 imphil

Hey Phil, what is the plan around this issue? I recall you mentioning that the goal was to influence fusesoc directly. Is that still the plan? If so, or if not, can you keep this issue fresh with the methods that solve this need?

sjgitty avatar Apr 04 '19 22:04 sjgitty

We're evaluating whether it makes sense to contract Olof (the FuseSoC author) to work on this and other wishlist issues. I'm working through the related issues and docs today in order to move this forwards.

asb avatar Apr 05 '19 05:04 asb

Scrubbing stale issues... @imphil , has this wishlist item been addressed by FuseSoC? Thanks.

aytong avatar Oct 30 '19 23:10 aytong

No, still open and workaround is still in place.

imphil avatar Oct 30 '19 23:10 imphil

One step closer here. The cores in the dependency tree now have a property that list their resolved direct dependencies. The complete resolved dependency tree is also available in the EDAM structure. It should be possible to leverage this to also send that info to the generators. Is the VLNVs enough or do you also need core location?

olofk avatar Nov 05 '19 18:11 olofk

I'm looking into this now. Thanks for the first step @olofk!

imphil avatar Jan 02 '20 09:01 imphil

Fixed in https://github.com/lowRISC/fusesoc/commits/generators, used in #1679. Will need upstreaming to fusesoc once we're happy with it in OT for a bit.

imphil avatar Mar 06 '20 16:03 imphil

Upstream bug is at https://github.com/olofk/fusesoc/pull/391 and waiting for a review from @olofk. We have been running with this patch in our ot branch for over half a year now and it works well.

imphil avatar Oct 15 '20 15:10 imphil