integration/soc_core: change disable parameters to no-xxyy.

This commit is contained in:
Florent Kermarrec 2020-03-02 09:31:32 +01:00
parent 156a85b15b
commit a67e19c660
1 changed files with 10 additions and 7 deletions

View File

@ -281,8 +281,8 @@ def soc_core_args(parser):
parser.add_argument("--ident-version", default=None, type=bool, parser.add_argument("--ident-version", default=None, type=bool,
help="add date/time to SoC identifier (default=False)") help="add date/time to SoC identifier (default=False)")
# UART parameters # UART parameters
parser.add_argument("--with-uart", default=None, type=bool, parser.add_argument("--no-uart", action="store_true",
help="with UART (default=True)") help="Disable UART (default=False)")
parser.add_argument("--uart-name", default="serial", type=str, parser.add_argument("--uart-name", default="serial", type=str,
help="UART type/name (default=serial)") help="UART type/name (default=serial)")
parser.add_argument("--uart-baudrate", default=None, type=auto_int, parser.add_argument("--uart-baudrate", default=None, type=auto_int,
@ -290,11 +290,11 @@ def soc_core_args(parser):
parser.add_argument("--uart-fifo-depth", default=16, type=auto_int, parser.add_argument("--uart-fifo-depth", default=16, type=auto_int,
help="UART FIFO depth (default=16)") help="UART FIFO depth (default=16)")
# Timer parameters # Timer parameters
parser.add_argument("--with-timer", default=None, type=bool, parser.add_argument("--no-timer", action="store_true",
help="with Timer (default=True)") help="Disable Timer (default=False)")
# Controller parameters # Controller parameters
parser.add_argument("--with-ctrl", default=None, type=bool, parser.add_argument("--no-ctrl", action="store_true",
help="with Controller (default=True)") help="Disable Controller (default=False)")
def soc_core_argdict(args): def soc_core_argdict(args):
r = dict() r = dict()
@ -304,7 +304,10 @@ def soc_core_argdict(args):
args.integrated_rom_size = len(args.integrated_rom_init)*4 args.integrated_rom_size = len(args.integrated_rom_init)*4
for a in inspect.getargspec(SoCCore.__init__).args: for a in inspect.getargspec(SoCCore.__init__).args:
if a not in ["self", "platform"]: if a not in ["self", "platform"]:
arg = getattr(args, a, None) if a in ["with_uart", "with_timer", "with_ctrl"]:
arg = not getattr(args, a.replace("with", "no"), True)
else:
arg = getattr(args, a, None)
if arg is not None: if arg is not None:
r[a] = arg r[a] = arg
return r return r