Skip to content

Commit

Permalink
[tools,topgen] Enhance 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 Feb 7, 2025
1 parent 590f11d commit 1611c22
Show file tree
Hide file tree
Showing 26 changed files with 7,680 additions and 4,679 deletions.
3,845 changes: 2,022 additions & 1,823 deletions hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions hw/top_darjeeling/ip/xbar_dbg/data/autogen/xbar_dbg.gen.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,69 @@
]
clock: clk_dbg_i
type: xbar
inter_signal_list:
[
{
name: tl_dbg
struct: tl
package: tlul_pkg
type: req_rsp
act: rsp
inst_name: dbg
width: 1
default: ""
external: true
top_signame: dbg_tl
conn_type: false
index: -1
}
{
name: tl_rv_dm__dbg
struct: tl
package: tlul_pkg
type: req_rsp
act: req
inst_name: dbg
width: 1
default: ""
top_signame: rv_dm_dbg_tl_d
index: -1
}
{
name: tl_mbx_jtag__soc
struct: tl
package: tlul_pkg
type: req_rsp
act: req
inst_name: dbg
width: 1
default: ""
top_signame: mbx_jtag_soc_tl_d
index: -1
}
{
name: tl_lc_ctrl__dmi
struct: tl
package: tlul_pkg
type: req_rsp
act: req
inst_name: dbg
width: 1
default: ""
top_signame: lc_ctrl_dmi_tl
index: -1
}
{
name: tl_soc_dbg_ctrl__jtag
struct: tl
package: tlul_pkg
type: req_rsp
act: req
inst_name: dbg
width: 1
default: ""
top_signame: soc_dbg_ctrl_jtag_tl
index: -1
}
]
}
Loading

0 comments on commit 1611c22

Please sign in to comment.