aboutsummaryrefslogtreecommitdiff
path: root/fesvr
diff options
context:
space:
mode:
authorJerry Zhao <jerryz123@berkeley.edu>2023-03-07 13:16:50 -0800
committerJerry Zhao <jerryz123@berkeley.edu>2023-03-07 13:16:50 -0800
commit0243455b2702838a4efe6a14f1a74fc08013c431 (patch)
treef4fcc10582f87802120cd5176f1312a3d596a4d0 /fesvr
parent422d297ef0ed9a6ca8517a746b54c8ab4c6c4e23 (diff)
downloadriscv-isa-sim-0243455b2702838a4efe6a14f1a74fc08013c431.zip
riscv-isa-sim-0243455b2702838a4efe6a14f1a74fc08013c431.tar.gz
riscv-isa-sim-0243455b2702838a4efe6a14f1a74fc08013c431.tar.bz2
fesvr: Add +target-argument= flag to htif parsing
Diffstat (limited to 'fesvr')
-rw-r--r--fesvr/htif.cc7
-rw-r--r--fesvr/htif.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/fesvr/htif.cc b/fesvr/htif.cc
index 831efa6..46dfaac 100644
--- a/fesvr/htif.cc
+++ b/fesvr/htif.cc
@@ -328,6 +328,9 @@ void htif_t::parse_arguments(int argc, char ** argv)
case HTIF_LONG_OPTIONS_OPTIND + 5:
line_size = atoi(optarg);
break;
+ case HTIF_LONG_OPTIONS_OPTIND + 6:
+ targs.push_back(optarg);
+ break;
case '?':
if (!opterr)
break;
@@ -366,6 +369,10 @@ void htif_t::parse_arguments(int argc, char ** argv)
c = HTIF_LONG_OPTIONS_OPTIND + 5;
optarg = optarg + 23;
}
+ else if (arg.find("+target-argument=") == 0) {
+ c = HTIF_LONG_OPTIONS_OPTIND + 6;
+ optarg = optarg + 17;
+ }
else if (arg.find("+permissive-off") == 0) {
if (opterr)
throw std::invalid_argument("Found +permissive-off when not parsing permissively");
diff --git a/fesvr/htif.h b/fesvr/htif.h
index 8dc8dd9..e493477 100644
--- a/fesvr/htif.h
+++ b/fesvr/htif.h
@@ -145,6 +145,7 @@ TARGET (RISC-V BINARY) OPTIONS\n\
{"chroot", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 3 }, \
{"payload", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 4 }, \
{"signature-granularity", optional_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 5 }, \
+{"target-argument", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 6 }, \
{0, 0, 0, 0}
#endif // __HTIF_H