aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure4
-rw-r--r--riscv/processor.cc26
-rw-r--r--riscv/riscv.ac4
3 files changed, 22 insertions, 12 deletions
diff --git a/configure b/configure
index 7c46e7b..cb1b5bd 100755
--- a/configure
+++ b/configure
@@ -1362,7 +1362,7 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-isa=RV64IMAFDC Sets the default RISC-V ISA
--with-priv=MSU Sets the default RISC-V privilege modes supported
- --with-varch=v128:e32:s128
+ --with-varch=v128:e64:s128
Sets the default vector config
Some influential environment variables:
@@ -4649,7 +4649,7 @@ _ACEOF
else
cat >>confdefs.h <<_ACEOF
-#define DEFAULT_VARCH "v128:e32:s128"
+#define DEFAULT_VARCH "v128:e64:s128"
_ACEOF
fi
diff --git a/riscv/processor.cc b/riscv/processor.cc
index f92bb2b..a926021 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -68,9 +68,9 @@ static void bad_priv_string(const char* priv)
abort();
}
-static void bad_varch_string(const char* varch)
+static void bad_varch_string(const char* varch, const char *message)
{
- fprintf(stderr, "error: bad --varch option %s\n", varch);
+ fprintf(stderr, "error: bad --varch option %s: %s\n", varch, message);
abort();
}
@@ -80,9 +80,9 @@ static int parse_varch(std::string &str){
std::string sval = str.substr(1);
val = std::stoi(sval);
if ((val & (val - 1)) != 0) // val should be power of 2
- bad_varch_string(str.c_str());
+ bad_varch_string(str.c_str(), "must be a power of 2");
}else{
- bad_varch_string(str.c_str());
+ bad_varch_string(str.c_str(), "must not be empty");
}
return val;
}
@@ -114,14 +114,24 @@ void processor_t::parse_varch_string(const char* s)
}else if (token[0] == 's'){
slen = parse_varch(token);
}else{
- bad_varch_string(str.c_str());
+ bad_varch_string(str.c_str(), "Unsupported token");
}
str.erase(0, pos + delimiter.length());
}
- if (!(vlen >= 32 || vlen <= 4096) && !(slen >= vlen || slen <= vlen) && !(elen >= slen || elen <= slen)){
- bad_varch_string(s);
- }
+ /* Vector spec requirements. */
+ if (vlen < elen)
+ bad_varch_string(s, "vlen must be >= elen");
+ if (vlen < slen)
+ bad_varch_string(s, "vlen must be >= slen");
+ if (slen < 32)
+ bad_varch_string(s, "slen must be >= 32");
+ if ((unsigned) elen < std::max(max_xlen, get_flen()))
+ bad_varch_string(s, "elen must be >= max(xlen, flen)");
+
+ /* spike requirements. */
+ if (vlen > 4096)
+ bad_varch_string(s, "vlen must be <= 4096");
VU.VLEN = vlen;
VU.ELEN = elen;
diff --git a/riscv/riscv.ac b/riscv/riscv.ac
index 747c3e3..fc45732 100644
--- a/riscv/riscv.ac
+++ b/riscv/riscv.ac
@@ -13,10 +13,10 @@ AC_ARG_WITH(priv,
AC_DEFINE_UNQUOTED([DEFAULT_PRIV], "MSU", [Default value for --priv switch]))
AC_ARG_WITH(varch,
- [AS_HELP_STRING([--with-varch=v128:e32:s128],
+ [AS_HELP_STRING([--with-varch=v128:e64:s128],
[Sets the default vector config])],
AC_DEFINE_UNQUOTED([DEFAULT_VARCH], "$withval", [Default value for --varch switch]),
- AC_DEFINE_UNQUOTED([DEFAULT_VARCH], "v128:e32:s128", [Default value for --varch switch]))
+ AC_DEFINE_UNQUOTED([DEFAULT_VARCH], "v128:e64:s128", [Default value for --varch switch]))
AC_SEARCH_LIBS([dlopen], [dl dld], [], [