Skip to content

Commit

Permalink
[tools,topgen] Simplify topgen
Browse files Browse the repository at this point in the history
This is a big change in topgen. Some salient changes:
- It always regenerates from scratch the ipgen in-memory configurations
  (as IpBlock objects) so it is truly incremental: the previous flow
  reused the pre-existing generated ipgen hjson if found.
- It delays the actual ipgen file generation until the complete top config
  is generated. This is a step towards breaking topgen into smaller and
  mutually independent steps, thus enabling parallelizing them.
- On each pass it uses the most up-to-date top config, and detects
  convergence if the top configs from one pass and the previous one match.
- It converges with a single pass of process_top (though a second pass is
  done to enable the comparison).
- The generated RTL with and without these changes is identical.
In order to accomplish this some important changes are made:
- Call some of the merge_top functions suitable for each specific ipgen
  prior to generating the in-memory hjson config. This means not all
  IpBlock objects are available, so these merge functions are instrumented
  to skip missing blocks.
- The generation of ipgens are ordered according to dependencies. This
  order is created from the expected block functionality, so is not derived
  from a constructed graph, but converging in one pass means it is correct.
- Calling merge functions early means some of the objects in the in-memory
  top config are not plain dictionaries but are classes, so the code needs
  to handle either.

Part of lowRISC#25920

Signed-off-by: Guillermo Maturana <[email protected]>
  • Loading branch information
matutem committed Jan 29, 2025
1 parent 2bc8f3e commit 342bbb0
Show file tree
Hide file tree
Showing 18 changed files with 5,035 additions and 4,166 deletions.
3,274 changes: 1,734 additions & 1,540 deletions hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
module: soc_proxy
}
]
NumRstReqs: 2
rst_reqs:
{
int:
Expand Down Expand Up @@ -68,7 +69,6 @@
}
]
}
NumRstReqs: 2
wait_for_external_reset: true
NumRomInputs: 3
top_pkg_vlnv: lowrisc:constants:top_darjeeling_top_pkg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
instance_name: top_darjeeling_rv_plic
param_values:
{
module_instance_name: rv_plic
src: 158
target: 1
prio: 3
module_instance_name: rv_plic
topname: darjeeling
}
}
208 changes: 104 additions & 104 deletions hw/top_darjeeling/rtl/autogen/top_darjeeling_rnd_cnst_pkg.sv

Large diffs are not rendered by default.

Loading

0 comments on commit 342bbb0

Please sign in to comment.