cpu/minerva: add pythondata and use it to compile the sources.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 1 May 2020 18:12:02 +0000 (20:12 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 1 May 2020 18:12:02 +0000 (20:12 +0200)
litex/soc/cores/cpu/minerva/core.py
litex_setup.py

index a4b63e629fa161a2aa1cf3014b9beee59cf629d9..b703f2f135365d886503e67514df482ecec0830c 100644 (file)
@@ -7,6 +7,7 @@ import subprocess
 
 from migen import *
 
+from litex import get_data_mod
 from litex.soc.interconnect import wishbone
 from litex.soc.cores.cpu import CPU
 
@@ -98,8 +99,8 @@ class Minerva(CPU):
             cli_params.append("--with-dcache")
         if with_muldiv:
             cli_params.append("--with-muldiv")
-        os.system("git clone http://github.com/lambdaconcept/minerva") # FIXME: create pythondata.
-        if subprocess.call(["python3", os.path.join("minerva", "cli.py"), *cli_params, "generate"],
+        sdir = get_data_mod("cpu", "minerva").data_location
+        if subprocess.call(["python3", os.path.join(sdir, "cli.py"), *cli_params, "generate"],
             stdout=open(verilog_filename, "w")):
             raise OSError("Unable to elaborate Minerva CPU, please check your nMigen/Yosys install")
 
index b0ef1f137f86f434eb198843ef80f7478ef5a3e8..f6d6b39371368a7f5c1632edbeb011a1cad1d573 100755 (executable)
@@ -46,6 +46,7 @@ repos = [
     ("pythondata-cpu-serv",        ("https://github.com/litex-hub/", False, True)),
     ("pythondata-cpu-vexriscv",    ("https://github.com/litex-hub/", False, True)),
     ("pythondata-cpu-rocket",      ("https://github.com/litex-hub/", False, True)),
+    ("pythondata-cpu-minerva",     ("https://github.com/litex-hub/", False, True)),
 ]
 
 repos = OrderedDict(repos)