From: Florent Kermarrec Date: Thu, 16 Aug 2018 08:03:43 +0000 (+0200) Subject: cpu_interace: use riscv64-unknown-elf if available else riscv32-unknown-elf X-Git-Tag: 24jan2021_ls180~1652 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0831ad54923a3947d43cd8e85bde217a21e57dc4;p=litex.git cpu_interace: use riscv64-unknown-elf if available else riscv32-unknown-elf --- diff --git a/litex/soc/integration/cpu_interface.py b/litex/soc/integration/cpu_interface.py index 1684e07a..ad4e8a33 100644 --- a/litex/soc/integration/cpu_interface.py +++ b/litex/soc/integration/cpu_interface.py @@ -1,4 +1,5 @@ import os +from shutil import which from migen import * @@ -35,12 +36,18 @@ def get_cpu_mak(cpu): cpuflags += "-mffl1 -maddc" elif cpu == "picorv32": assert not clang, "picorv32 not supported with clang." - triple = "riscv64-unknown-elf" + if which("riscv64-unknown-elf-gcc"): + triple = "riscv64-unknown-elf" + else: + triple = "riscv32-unknown-elf" cpuflags = "-D__picorv32__ -mno-save-restore -march=rv32im -mabi=ilp32" clang = False elif cpu == "vexriscv": assert not clang, "vexriscv not supported with clang." - triple = "riscv64-unknown-elf" + if which("riscv64-unknown-elf-gcc"): + triple = "riscv64-unknown-elf" + else: + triple = "riscv32-unknown-elf" cpuflags = "-D__vexriscv__ -march=rv32im -mabi=ilp32" clang = False else: