From d90e6df9c3a489a7cd0e8c9b02379e8fd3de3a38 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Sat, 14 Sep 2024 01:11:30 -0700 Subject: [PATCH 1/3] Remove --with-isa compile-time option --- config.h.in | 3 --- configure | 17 ----------------- riscv/platform.h | 1 + riscv/riscv.ac | 6 ------ spike_dasm/spike-dasm.cc | 1 + spike_main/spike-log-parser.cc | 1 + 6 files changed, 3 insertions(+), 26 deletions(-) diff --git a/config.h.in b/config.h.in index aef35963c8..f7098762b7 100644 --- a/config.h.in +++ b/config.h.in @@ -6,9 +6,6 @@ /* Define if subproject MCPPBS_SPROJ_NORM is enabled */ #undef CUSTOMEXT_ENABLED -/* Default value for --isa switch */ -#undef DEFAULT_ISA - /* Default value for --priv switch */ #undef DEFAULT_PRIV diff --git a/configure b/configure index 4ad998a654..4255719dd4 100755 --- a/configure +++ b/configure @@ -737,7 +737,6 @@ with_boost with_boost_libdir with_boost_asio with_boost_regex -with_isa with_priv with_target enable_dual_endian @@ -1403,8 +1402,6 @@ Optional Packages: use the Regex library from boost - it is possible to specify a certain library for the linker e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 - --with-isa=RV64IMAFDC_zicntr_zihpm - Sets the default RISC-V ISA --with-priv=MSU Sets the default RISC-V privilege modes supported --with-target=riscv64-unknown-elf Sets the default target config @@ -6562,20 +6559,6 @@ fi -# Check whether --with-isa was given. -if test ${with_isa+y} -then : - withval=$with_isa; -printf "%s\n" "#define DEFAULT_ISA \"$withval\"" >>confdefs.h - -else $as_nop - -printf "%s\n" "#define DEFAULT_ISA \"RV64IMAFDC_zicntr_zihpm\"" >>confdefs.h - -fi - - - # Check whether --with-priv was given. if test ${with_priv+y} then : diff --git a/riscv/platform.h b/riscv/platform.h index 7fffdc84bb..19813ce022 100644 --- a/riscv/platform.h +++ b/riscv/platform.h @@ -4,6 +4,7 @@ #define DEFAULT_KERNEL_BOOTARGS "console=ttyS0 earlycon" #define DEFAULT_RSTVEC 0x00001000 +#define DEFAULT_ISA "rv64imafdc_zicntr_zihpm" #define CLINT_BASE 0x02000000 #define CLINT_SIZE 0x000c0000 #define PLIC_BASE 0x0c000000 diff --git a/riscv/riscv.ac b/riscv/riscv.ac index 378fd10f9c..81ff73d37f 100644 --- a/riscv/riscv.ac +++ b/riscv/riscv.ac @@ -8,12 +8,6 @@ AC_CHECK_LIB([boost_system], [main], [], []) AC_CHECK_LIB([boost_regex], [main], [], []) -AC_ARG_WITH(isa, - [AS_HELP_STRING([--with-isa=RV64IMAFDC_zicntr_zihpm], - [Sets the default RISC-V ISA])], - AC_DEFINE_UNQUOTED([DEFAULT_ISA], "$withval", [Default value for --isa switch]), - AC_DEFINE_UNQUOTED([DEFAULT_ISA], "RV64IMAFDC_zicntr_zihpm", [Default value for --isa switch])) - AC_ARG_WITH(priv, [AS_HELP_STRING([--with-priv=MSU], [Sets the default RISC-V privilege modes supported])], diff --git a/spike_dasm/spike-dasm.cc b/spike_dasm/spike-dasm.cc index 3e42df5b44..8acf3ba1ab 100644 --- a/spike_dasm/spike-dasm.cc +++ b/spike_dasm/spike-dasm.cc @@ -9,6 +9,7 @@ #include "config.h" #include "disasm.h" #include "extension.h" +#include "platform.h" #include #include #include diff --git a/spike_main/spike-log-parser.cc b/spike_main/spike-log-parser.cc index 55ff9998b3..3b9692ba14 100644 --- a/spike_main/spike-log-parser.cc +++ b/spike_main/spike-log-parser.cc @@ -14,6 +14,7 @@ #include "disasm.h" #include "extension.h" +#include "platform.h" using namespace std; From b47080fea4d5f33df560183a6928f4a9619adadf Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Sat, 14 Sep 2024 01:17:31 -0700 Subject: [PATCH 2/3] Remove --with-priv compile flag --- config.h.in | 3 --- configure | 16 ---------------- disasm/disasm.cc | 1 + riscv/platform.h | 1 + riscv/riscv.ac | 6 ------ 5 files changed, 2 insertions(+), 25 deletions(-) diff --git a/config.h.in b/config.h.in index f7098762b7..a8918c67ff 100644 --- a/config.h.in +++ b/config.h.in @@ -6,9 +6,6 @@ /* Define if subproject MCPPBS_SPROJ_NORM is enabled */ #undef CUSTOMEXT_ENABLED -/* Default value for --priv switch */ -#undef DEFAULT_PRIV - /* Define if subproject MCPPBS_SPROJ_NORM is enabled */ #undef DISASM_ENABLED diff --git a/configure b/configure index 4255719dd4..e701421eda 100755 --- a/configure +++ b/configure @@ -737,7 +737,6 @@ with_boost with_boost_libdir with_boost_asio with_boost_regex -with_priv with_target enable_dual_endian ' @@ -1402,7 +1401,6 @@ Optional Packages: use the Regex library from boost - it is possible to specify a certain library for the linker e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 - --with-priv=MSU Sets the default RISC-V privilege modes supported --with-target=riscv64-unknown-elf Sets the default target config @@ -6559,20 +6557,6 @@ fi -# Check whether --with-priv was given. -if test ${with_priv+y} -then : - withval=$with_priv; -printf "%s\n" "#define DEFAULT_PRIV \"$withval\"" >>confdefs.h - -else $as_nop - -printf "%s\n" "#define DEFAULT_PRIV \"MSU\"" >>confdefs.h - -fi - - - # Check whether --with-target was given. if test ${with_target+y} then : diff --git a/disasm/disasm.cc b/disasm/disasm.cc index f1967d0a27..7042fce412 100644 --- a/disasm/disasm.cc +++ b/disasm/disasm.cc @@ -2,6 +2,7 @@ #include "disasm.h" #include "decode_macros.h" +#include "platform.h" #include #include #include diff --git a/riscv/platform.h b/riscv/platform.h index 19813ce022..c8a5bf4bfb 100644 --- a/riscv/platform.h +++ b/riscv/platform.h @@ -5,6 +5,7 @@ #define DEFAULT_KERNEL_BOOTARGS "console=ttyS0 earlycon" #define DEFAULT_RSTVEC 0x00001000 #define DEFAULT_ISA "rv64imafdc_zicntr_zihpm" +#define DEFAULT_PRIV "MSU" #define CLINT_BASE 0x02000000 #define CLINT_SIZE 0x000c0000 #define PLIC_BASE 0x0c000000 diff --git a/riscv/riscv.ac b/riscv/riscv.ac index 81ff73d37f..cd7cfe294e 100644 --- a/riscv/riscv.ac +++ b/riscv/riscv.ac @@ -8,12 +8,6 @@ AC_CHECK_LIB([boost_system], [main], [], []) AC_CHECK_LIB([boost_regex], [main], [], []) -AC_ARG_WITH(priv, - [AS_HELP_STRING([--with-priv=MSU], - [Sets the default RISC-V privilege modes supported])], - AC_DEFINE_UNQUOTED([DEFAULT_PRIV], "$withval", [Default value for --priv switch]), - AC_DEFINE_UNQUOTED([DEFAULT_PRIV], "MSU", [Default value for --priv switch])) - AC_ARG_WITH(target, [AS_HELP_STRING([--with-target=riscv64-unknown-elf], [Sets the default target config])], From c187be0a1e5a1bbaee1f601001fa16570abb6bab Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Sat, 14 Sep 2024 01:22:35 -0700 Subject: [PATCH 3/3] Remove leftover config.h includes in dasm/log-parser --- spike_dasm/spike-dasm.cc | 1 - spike_main/spike-log-parser.cc | 1 - 2 files changed, 2 deletions(-) diff --git a/spike_dasm/spike-dasm.cc b/spike_dasm/spike-dasm.cc index 8acf3ba1ab..547f044508 100644 --- a/spike_dasm/spike-dasm.cc +++ b/spike_dasm/spike-dasm.cc @@ -6,7 +6,6 @@ // enclosed hexadecimal number, interpreted as a RISC-V // instruction. -#include "config.h" #include "disasm.h" #include "extension.h" #include "platform.h" diff --git a/spike_main/spike-log-parser.cc b/spike_main/spike-log-parser.cc index 3b9692ba14..2c9a543b62 100644 --- a/spike_main/spike-log-parser.cc +++ b/spike_main/spike-log-parser.cc @@ -5,7 +5,6 @@ // in its inputs, then output the RISC-V instruction with the disassembly // enclosed hexadecimal number. -#include "config.h" #include #include #include