soc_core: fix cpu_variant definition
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 22 Jul 2019 10:38:16 +0000 (12:38 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 22 Jul 2019 10:46:39 +0000 (12:46 +0200)
litex/soc/integration/soc_core.py

index fd7d265da4297a58a4bf721d2348c5a68b69758b..3e5a59fd07bfaee72428b65e9dab030d1648922b 100644 (file)
@@ -245,8 +245,9 @@ class SoCCore(Module):
 
         # Add CPU
         self.config["CPU_TYPE"] = str(cpu_type).upper()
-        self.config["CPU_VARIANT"] = str(cpu_variant.split('+')[0]).upper()
         if cpu_type is not None:
+            if cpu_variant is not None:
+                self.config["CPU_VARIANT"] = str(cpu_variant.split('+')[0]).upper()
             # CPU selection / instance
             if cpu_type == "lm32":
                 self.add_cpu(cpu.lm32.LM32(platform, self.cpu_reset_address, self.cpu_variant))