Skip to content

Commit 410276c

Browse files
committed
Support run until paddr changed to a certain value
1 parent 3a53c80 commit 410276c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

riscv/interactive.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ void sim_t::interactive_until(const std::string& cmd, const std::vector<std::str
721721
if (args.size() < 3)
722722
throw trap_interactive();
723723

724-
if (args.size() == 3)
724+
if (args.size() == 4 || (args[0] == "pc" && args.size() == 3)) //dont check mem with arg len = 3
725725
get_core(args[1]); // make sure that argument is a valid core number
726726

727727
char *end;
@@ -732,7 +732,9 @@ void sim_t::interactive_until(const std::string& cmd, const std::vector<std::str
732732
throw trap_interactive();
733733

734734
// mask bits above max_xlen
735-
int max_xlen = procs[strtol(args[1].c_str(),NULL,10)]->get_isa().get_max_xlen();
735+
bool until_mem_paddr = args[0] == "mem" && args.size() == 3;
736+
size_t procnum = until_mem_paddr ? 0 : strtol(args[1].c_str(), NULL, 10);
737+
int max_xlen = procs[procnum]->get_isa().get_max_xlen();
736738
if (max_xlen == 32) val &= 0xFFFFFFFF;
737739

738740
std::vector<std::string> args2;

0 commit comments

Comments
 (0)