build/sim/verilator: don't use THEADS parameters when threads=1
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 27 Oct 2018 09:06:34 +0000 (11:06 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 27 Oct 2018 09:06:34 +0000 (11:06 +0200)
Allow using old (non multi-threaded) version of Verilator

litex/build/sim/verilator.py

index 833685e1d80d47e1a7f9e600800fc999dfc41060..608a2f62c7aa11f78f16bfc59c37b5cd3981924b 100644 (file)
@@ -107,9 +107,9 @@ def _build_sim(platform, build_name, threads, verbose):
     makefile = os.path.join(core_directory, 'Makefile')
     build_script_contents = """\
 rm -rf obj_dir/
-make -C . -f {} THREADS={}
+make -C . -f {} {}
 mkdir -p modules && cp obj_dir/*.so modules
-""".format(makefile, threads)
+""".format(makefile, "THREADS={}".format(threads) if int(threads) > 1 else "")
     build_script_file = "build_" + build_name + ".sh"
     tools.write_to_file(build_script_file, build_script_contents, force_unix=True)