From 02119282b8f069c8b1434708999a31f5018aa20f Mon Sep 17 00:00:00 2001 From: occheung Date: Mon, 8 Nov 2021 13:05:30 +0800 Subject: [PATCH] build_soc: build VexRiscv_G if not kasli v1.x --- artiq/build_soc.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/artiq/build_soc.py b/artiq/build_soc.py index e3a1f3360..bdf652948 100644 --- a/artiq/build_soc.py +++ b/artiq/build_soc.py @@ -2,6 +2,7 @@ import os import subprocess from migen import * +from migen.build.platforms.sinara import kasli from misoc.interconnect.csr import * from misoc.integration.builder import * @@ -57,11 +58,17 @@ def build_artiq_soc(soc, argdict): builder = Builder(soc, **argdict) builder.software_packages = [] builder.add_software_package("bootloader", os.path.join(firmware_dir, "bootloader")) + is_kasli_v1 = isinstance(soc.platform, kasli.Platform) and soc.platform.hw_rev in ("v1.0", "v1.1") if isinstance(soc, AMPSoC): - builder.add_software_package("libm") - builder.add_software_package("libprintf") - builder.add_software_package("libunwind") - builder.add_software_package("ksupport", os.path.join(firmware_dir, "ksupport")) + kernel_cpu_type = "vexriscv" if is_kasli_v1 else "vexriscv-g" + builder.add_software_package("libm", cpu_type=kernel_cpu_type) + builder.add_software_package("libprintf", cpu_type=kernel_cpu_type) + builder.add_software_package("libunwind", cpu_type=kernel_cpu_type) + builder.add_software_package("ksupport", os.path.join(firmware_dir, "ksupport"), cpu_type=kernel_cpu_type) + # Generate unwinder for soft float target (ARTIQ runtime) + # If the kernel lacks FPU, then the runtime unwinder is already generated + if not is_kasli_v1: + builder.add_software_package("libunwind") builder.add_software_package("runtime", os.path.join(firmware_dir, "runtime")) else: # Assume DRTIO satellite.