soc/LiteXSoCArgumentParser: Fix --cpu-type parsing.
Could still be improved.
This commit is contained in:
parent
71a5ef2380
commit
4810cc15da
|
@ -1985,9 +1985,14 @@ class LiteXSoC(SoC):
|
||||||
class LiteXSoCArgumentParser(argparse.ArgumentParser):
|
class LiteXSoCArgumentParser(argparse.ArgumentParser):
|
||||||
def parse_args(self):
|
def parse_args(self):
|
||||||
|
|
||||||
|
# FIXME: Use 2 stages parser?
|
||||||
|
|
||||||
def get_selected_cpu_name():
|
def get_selected_cpu_name():
|
||||||
for name, cpu_cls in cpu.CPUS.items():
|
for name, cpu_cls in cpu.CPUS.items():
|
||||||
if f"--cpu-type={name}" in sys.argv: # FIXME: Improve.
|
if f"--cpu-type={name}" in sys.argv:
|
||||||
|
return cpu_cls
|
||||||
|
if f"--cpu-type" in sys.argv:
|
||||||
|
if name in sys.argv:
|
||||||
return cpu_cls
|
return cpu_cls
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue