Improve the invalid CPU type error message.

This commit is contained in:
Tim 'mithro' Ansell 2019-12-30 16:10:57 +01:00
parent 85ade2b3b3
commit a738739acd
1 changed files with 5 additions and 1 deletions

View File

@ -167,9 +167,13 @@ class SoCCore(Module):
if cpu_type is not None: if cpu_type is not None:
if cpu_variant is not None: if cpu_variant is not None:
self.config["CPU_VARIANT"] = str(cpu_variant.split('+')[0]).upper() self.config["CPU_VARIANT"] = str(cpu_variant.split('+')[0]).upper()
# Check type # Check type
if cpu_type not in cpu.CPUS.keys(): if cpu_type not in cpu.CPUS.keys():
raise ValueError("Unsupported CPU type: {}".format(cpu_type)) raise ValueError(
"Unsupported CPU type: {} -- supported CPU types: {}".format(
cpu_type, ", ".join(cpu.CPUS.keys())))
# Declare the CPU # Declare the CPU
self.submodules.cpu = cpu.CPUS[cpu_type](platform, self.cpu_variant) self.submodules.cpu = cpu.CPUS[cpu_type](platform, self.cpu_variant)
if cpu_type == "microwatt": if cpu_type == "microwatt":