diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-09-04 20:45:34 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-09-04 20:53:46 -0700 |
commit | f7e20c491c82d39a8d6097257ea12c95c2f003a7 (patch) | |
tree | 9d680c43d5a206f6718b88a852f08dce55352563 /spike_main | |
parent | a4347c82a86454af5fc39ef44601b2404bff53c6 (diff) | |
download | spike-f7e20c491c82d39a8d6097257ea12c95c2f003a7.zip spike-f7e20c491c82d39a8d6097257ea12c95c2f003a7.tar.gz spike-f7e20c491c82d39a8d6097257ea12c95c2f003a7.tar.bz2 |
rvv: refine check logic to use string as input
allow "any", "1905", "e27"
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'spike_main')
-rw-r--r-- | spike_main/spike.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spike_main/spike.cc b/spike_main/spike.cc index 0dbfa16..cf3c649 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -31,7 +31,7 @@ static void help(int exit_code = 1) fprintf(stderr, " --isa=<name> RISC-V ISA string [default %s]\n", DEFAULT_ISA); fprintf(stderr, " --varch=<name> RISC-V Vector uArch string [default %s]\n", DEFAULT_VARCH); #ifdef RISCV_ENABLE_IMPL_CHECK - fprintf(stderr, " --check-impl Check vector instruction implementation\n"); + fprintf(stderr, " --check-impl Check vector instruction implementation(\"any\", \'1905\", \"e27\")\n"); #endif fprintf(stderr, " --pc=<address> Override ELF entry point\n"); fprintf(stderr, " --hartids=<a,b,...> Explicitly specify hartids, default is 0,1,...\n"); @@ -226,7 +226,19 @@ int main(int argc, char** argv) parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);}); parser.option(0, "dump-dts", 0, [&](const char *s){dump_dts = true;}); #ifdef RISCV_ENABLE_IMPL_CHECK - parser.option(0, "check-impl", 1, [&](const char *s){g_check_impl = strtoul(s, NULL, 0);}); + parser.option(0, "check-impl", 1, [&](const char *s) + { + if (strcmp(s, "any") == 0) + g_check_impl = 'a' << 16 | 'n' << 8 | 'y'; + else if (strcmp(s, "1905") == 0) + g_check_impl = 1905; + else if (strcmp(s, "e27") == 0) + g_check_impl = 'e' << 16 | '2' << 8 | '7'; + else { + fprintf(stderr, "unsupport check-impl value %s\n", s); + exit(1); + } + }); #endif parser.option(0, "vector-mistrap", 0, [&](const char *s){g_vector_mistrap = true;}); parser.option(0, "disable-dtb", 0, [&](const char *s){dtb_enabled = false;}); |