Skip to content
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

[topgen] All RACL configs are relative to the project root #26122

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
type: top
rnd_cnst_seed: 1017106219537032642877583828875051302543807092889754935647094601236425074047
datawidth: "32"
racl_config: top_darjeeling/data/racl/racl.hjson
racl_config: racl/racl.hjson
power:
{
domains:
Expand Down
20 changes: 10 additions & 10 deletions hw/top_darjeeling/data/top_darjeeling.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
datawidth: "32",

// Enable RACL on Darjeeling based on the following configuration
racl_config: 'top_darjeeling/data/racl/racl.hjson'
racl_config: 'racl/racl.hjson'

// Power information for the design
power: {
Expand Down Expand Up @@ -901,7 +901,7 @@
soc: {soc_mbx: "0x01465000"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson'
soc: 'racl/all_rd_wr_mapping.hjson'
}
},
{ name: "mbx1",
Expand All @@ -914,7 +914,7 @@
soc: {soc_mbx: "0x01465100"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson'
soc: 'racl/all_rd_wr_mapping.hjson'
}
},
{ name: "mbx2",
Expand All @@ -927,7 +927,7 @@
soc: {soc_mbx: "0x01465200"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson'
soc: 'racl/all_rd_wr_mapping.hjson'
}
},
{ name: "mbx3",
Expand All @@ -950,7 +950,7 @@
soc: {soc_mbx: "0x01465400"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson'
soc: 'racl/all_rd_wr_mapping.hjson'
}
},
{ name: "mbx5",
Expand All @@ -963,7 +963,7 @@
soc: {soc_mbx: "0x01465500"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson'
soc: 'racl/all_rd_wr_mapping.hjson'
}
},
{ name: "mbx6",
Expand All @@ -986,7 +986,7 @@
soc: {soc_dbg: "0x1000"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson'
soc: 'racl/all_rd_wr_mapping.hjson'
}
},
{ name: "mbx_pcie0",
Expand All @@ -999,7 +999,7 @@
soc: {soc_mbx: "0x01460100"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/soc_rot_mapping.hjson'
soc: 'racl/soc_rot_mapping.hjson'
}
},
{ name: "mbx_pcie1",
Expand All @@ -1012,7 +1012,7 @@
soc: {soc_mbx: "0x01460200"},
},
racl_mappings: {
soc: 'top_darjeeling/data/racl/soc_rot_mapping.hjson'
soc: 'racl/soc_rot_mapping.hjson'
}
},
{ name: "soc_dbg_ctrl",
Expand Down Expand Up @@ -1049,7 +1049,7 @@
num_ranges: 32
}
attr: "ipgen",
racl_mapping: 'top_darjeeling/data/racl/soc_rot_mapping.hjson'
racl_mapping: 'racl/soc_rot_mapping.hjson'
},
{ name: "rv_core_ibex",
type: "rv_core_ibex",
Expand Down
5 changes: 5 additions & 0 deletions util/topgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,8 +1530,13 @@ def main():
log.info("Generation pass {}".format(pass_idx + 1))
# Use the same seed for each pass to have stable random constants.
secure_prng.reseed(topcfg["rnd_cnst_seed"])
# Insert the config file path of the HJSON to allow parsing files relative
# the config directory
cfg_copy["cfg_path"] = Path(args.topcfg).parent
completecfg, name_to_block, name_to_hjson = _process_top(
cfg_copy, args, cfg_path, out_path_gen, alias_cfgs)
# Delete config path before dumping, not needed
del completecfg["cfg_path"]
dump_path = Path(f"/tmp/top{topname}cfg_{pass_idx}.hjson")
_dump_cfg(dump_path, completecfg)
if pass_idx > 0 and filecmp.cmp(
Expand Down
6 changes: 3 additions & 3 deletions util/topgen/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ def amend_racl(top_cfg: OrderedDict,
return

# Read the top-level RACL information
top_cfg['racl'] = parse_racl_config(top_cfg['racl_config'])
top_cfg["racl"] = parse_racl_config(top_cfg["cfg_path"] / top_cfg["racl_config"])

# Generate the RACL mappings for all subscribing IPs
for m in top_cfg['module']:
Expand All @@ -1467,8 +1467,8 @@ def amend_racl(top_cfg: OrderedDict,
# once and need no further updates.
continue
parsed_register_mapping, parsed_window_mapping, racl_group, _ = (
parse_racl_mapping(top_cfg['racl'], mapping_path, if_name,
block))
parse_racl_mapping(top_cfg["racl"], top_cfg["cfg_path"] / mapping_path,
if_name, block))
m['racl_mappings'][if_name] = {
'racl_group': racl_group,
'register_mapping': parsed_register_mapping,
Expand Down
1 change: 1 addition & 0 deletions util/topgen/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
'l',
'list of wakeup requests each holding name, width, and module'
],
'cfg_path': ['s', 'Path to the folder of the toplevel HJSON file']
}

pinmux_required = {
Expand Down
Loading