fix vexriscv build
authorKurt Kiefer <kekiefer@gmail.com>
Sat, 27 Apr 2019 21:57:35 +0000 (14:57 -0700)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 28 Apr 2019 09:10:20 +0000 (11:10 +0200)
litex/soc/cores/cpu/vexriscv/core.py

index f66473be3d8ca491dabcbbdd9a419448558dc01b..1effc4854dee09f0bbebb830ebb204d6647ccbe9 100644 (file)
@@ -49,7 +49,7 @@ class VexRiscv(Module, AutoCSR):
     def __init__(self, platform, cpu_reset_address, variant="standard"):
         assert variant in CPU_VARIANTS, "Unsupported variant %s" % variant
 
-        self.gcc_flags = GCC_FLAGS[variant]
+        self.gcc_flags = GCC_FLAGS[variant] + " -D__vexriscv__"
 
         self.platform = platform
         self.variant = variant
@@ -184,7 +184,7 @@ class VexRiscv(Module, AutoCSR):
 
     @staticmethod
     def add_sources(platform, variant="standard"):
-        cpu_filename = CPU_VARIANTS[variant]
+        cpu_filename = CPU_VARIANTS[variant] + ".v"
         vdir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "verilog")
         platform.add_source(os.path.join(vdir, cpu_filename))