Repository navigation
Description
additional_fusesoc_argument holds one argument. LintCfg declares it as a scalar (flow/lint.py:41), and CdcCfg and RdcCfg inherit it. SimCfg, FormalCfg and SynCfg do not have the key; they reach FuseSoC through sv_flist_gen_flags, which dvsim does not declare, so its type comes from the first config that sets it and a list just works. The declaration as "" is what locks these three flows to a single string, and it appears to be the only declared scalar carrying an open-ended list of tool arguments.
Two things follow. A list is rejected outright by set_target_attribute() (flow/hjson.py:113-151), with of unknown type list. And because scalars merge first-non-default-wins and raise on a genuine conflict, a config and one that imports it cannot each contribute an argument:
RuntimeError: '.../common_lint_cfg.hjson': Value for key 'additional_fusesoc_argument' is
'--mapping=lowrisc:prim_generic:all:0.1', but we already had a conflicting value of
'--mapping=lowrisc:systems:top_darjeeling:0.1'.
So every entry needing a mapping has to spell out the mappings of its whole import chain. Lists merge by concatenation, which is the behaviour this key wants.
Independent of #258, which is why the concatenated string cannot even be wrapped today: fixing that makes the string readable, not the imports composable.
Scope
- Add
additional_fusesoc_argumentstoLintCfg, declared as[];CdcCfgandRdcCfginherit it. Little else is needed, as list keys already merge by concatenation and_stringify_wildcard_value()(utils/wildcards.py:35-53) already joins them with spaces on expansion. - Keep the singular key working and expand both wildcards in
build_opts, since every OpenTitan lint config uses the singular form. Deprecating it is a separate decision. - Reject a config setting both: the names differ by one letter and the order would not be predictable from reading the file.
Done when
- A list of two mappings loads and both reach the FuseSoC command line, including when they come from two configs in an import chain.
- The singular key behaves exactly as before, and a config setting both is rejected. Tests cover all three.
Activity
rswarbrick commentedon Sep 3, 2026
This sounds really sensible to me. I'd probably do very slightly less work, and would allow both forms to be used (deciding arbitrarily which order they should appear).