Skip to content

Commit

Permalink
build/parser: support set_default(cpu_type="xxx")
Browse files Browse the repository at this point in the history
Ensures args_fill() for new cpu_type is called, allowing for patterns
in a target file like:

    parser.set_defaults(cpu_type="vexriscv_smp")
    parser.set_defaults(cpu_variant="linux")
    parser.set_defaults(with_fpu=True)
  • Loading branch information
Andrew Dennison committed May 31, 2024
1 parent 329bd36 commit 5630334
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion litex/build/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ def parse_args(self, args=None, namespace=None):
self._platform.fill_args(self._toolchain, self)

# Intercept selected CPU to fill arguments.
cpu_cls = cpu.CPUS.get(self.get_value_from_key("--cpu-type"), None)
default_cpu_type = self._args_default.get("cpu_type", None)
cpu_cls = cpu.CPUS.get(self.get_value_from_key("--cpu-type", default_cpu_type))
if cpu_cls is not None and hasattr(cpu_cls, "args_fill"):
cpu_cls.args_fill(self)

Expand Down

0 comments on commit 5630334

Please sign in to comment.