lowRISC / lowRISC/opentitan

[topgen] Add switch to generate register files of top-specific IPs only

Open
#4,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component:MultiTop Component:Tooling Earlgrey-PROD Triaged Priority:P2 Type:Cleanup Type:Enhancement
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

We are discussing to add support for multiple top-levels with #4329. To reduce code duplication and avoid FuseSoC dependency conflicts between top-specific IPs (there would be one auto-generated version per top-level), we use a FuseSoC generator that calls topgen and creates all top-specific IPs at build time. We intend to only check in the version corresponding to the main platform.

To work around cyclic dependencies in FuseSoC, we currently need to run topgen twice: From the first run, we just take the auto-generated register files and from the second run, we take everything else (some packages, top-level). However, topgen generates the full set of sources in each run. So we actually end up with two copies of the auto-generates sources in the build dir. This could be solved by implementing switches in topgen to produce:

  1. All sources as we do now,
  2. Just the register files of top-specific IPs, or
  3. Everything else (e.g. top_pkg.sv, top_earlgrey.sv).

An alternative approach would to allow unresolved dependencies in FuseSoC before the generators (topgen) are run. This is tracked upstream olofk/fusesoc#449.

The idea of this issue is to keep track this task, and/or exchange ideas on alternative approaches. This is also related to #2083 which discusses options to change the flow of topgen for better managing internal dependencies.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the topgen entry point and review how the generator produces the register files, top_pkg.sv, top_earlgrey.sv, and other sources. Compare the two-run FuseSoC flow described here and determine how the proposed generation modes should separate top-specific register files from the remaining sources. Done means the selected mode avoids generating duplicate sources while preserving the existing all-sources behavior.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.