Skip to content

Let a lint, CDC or RDC config pass several FuseSoC arguments #259

Description

@andreaskurth

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_arguments to LintCfg, declared as []; CdcCfg and RdcCfg inherit 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions