soc_core/soc_core_argdict: use inspect to get all parameters and simplify
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 12 Oct 2019 17:18:57 +0000 (19:18 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 12 Oct 2019 17:18:57 +0000 (19:18 +0200)
litex/soc/integration/soc_core.py

index e4a23429d76c852e131f7a4667c9536016388876..4d9288709419e5a7f3e903bc98cb953b1c4b3585 100644 (file)
@@ -527,13 +527,8 @@ def soc_core_args(parser):
 
 def soc_core_argdict(args):
     r = dict()
-    for a in [
-        "cpu_type",
-        "cpu_variant",
-        "integrated_rom_size",
-        "integrated_main_ram_size",
-        "uart_stub"]:
-        arg = getattr(args, a)
+    for a in inspect.getargspec(SoCCore.__init__).args:
+        arg = getattr(args, a, None)
         if arg is not None:
             r[a] = arg
     return r