From 33c614a8680614a8b93fd168e84d315f312e6dd0 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 27 Jan 2025 15:36:00 +0000 Subject: [PATCH] SFPI test infra --- gcc | 2 +- include/blackhole/sfpi_hw.h | 2 +- include/grayskull/sfpi_hw.h | 2 +- include/sfpi.h | 14 ++++++++++++++ include/wormhole/sfpi_hw.h | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gcc b/gcc index 2d4d309..a2784b3 160000 --- a/gcc +++ b/gcc @@ -1 +1 @@ -Subproject commit 2d4d3093d118d57befcfcb21b3622d9e2c2862e8 +Subproject commit a2784b3d0422beb5979053826296d75a6450b7de diff --git a/include/blackhole/sfpi_hw.h b/include/blackhole/sfpi_hw.h index 92cebbf..89f1d49 100644 --- a/include/blackhole/sfpi_hw.h +++ b/include/blackhole/sfpi_hw.h @@ -109,7 +109,7 @@ namespace sfpi { #elif __GNUC__ #if !__has_builtin(__builtin_rvtt_bh_sfpload) -#error TT builtins not found: compile with -mwormhole -march=rv32iw -mabi=ilp32 +#error TT builtins not found: compile with -march=rv32im_xttbh -mabi=ilp32 #include #endif // !__has_builtin(__builtin_rvtt_bh_sfpload) diff --git a/include/grayskull/sfpi_hw.h b/include/grayskull/sfpi_hw.h index e171bde..f309790 100644 --- a/include/grayskull/sfpi_hw.h +++ b/include/grayskull/sfpi_hw.h @@ -91,7 +91,7 @@ namespace sfpi { #elif __GNUC__ #if !__has_builtin(__builtin_rvtt_gs_sfpload) -#error TT builtins not found: compile with -mgrayskull -march=rv32iy -mabi=ilp32 +#error TT builtins not found: compile with -march=rv32i_xttgs -mabi=ilp32 #include #endif // !__has_builtin(__builtin_rvtt_gs_sfpload) diff --git a/include/sfpi.h b/include/sfpi.h index 7436094..4d57f5a 100644 --- a/include/sfpi.h +++ b/include/sfpi.h @@ -119,10 +119,24 @@ #include +#if __riscv_tt_grayskull +#define ARCH_GRAYSKULL 1 +#endif +#if __riscv_tt_wormhole +#define ARCH_WORMHOLE 1 +#endif +#if __riscv_tt_blackhole +#define ARCH_BLACKHOLE 1 +#endif #if defined(ARCH_WORMHOLE_B0) #define ARCH_WORMHOLE 1 #endif +#if defined(ARCH_GRAYSKULL) + defined(ARCH_WORMHOLE) + defined(ARCH_BLACKHOLE) != 1 +#error "Exactly one SFPI architecture must be selected" +#include "stop now, no good will come" +#endif + #if defined(ARCH_GRAYSKULL) #include #elif defined(ARCH_WORMHOLE) diff --git a/include/wormhole/sfpi_hw.h b/include/wormhole/sfpi_hw.h index 26c2443..1fdecb7 100644 --- a/include/wormhole/sfpi_hw.h +++ b/include/wormhole/sfpi_hw.h @@ -109,7 +109,7 @@ namespace sfpi { #elif __GNUC__ #if !__has_builtin(__builtin_rvtt_wh_sfpload) -#error TT builtins not found: compile with -mwormhole -march=rv32iw -mabi=ilp32 +#error TT builtins not found: compile with -march=rv32im_xttwh -mabi=ilp32 #include #endif // !__has_builtin(__builtin_rvtt_wh_sfpload)