diff options
| -rw-r--r-- | doc/monitor.txt | 3 | ||||
| -rw-r--r-- | rvcontroller.lua | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/monitor.txt b/doc/monitor.txt index 9496c9e..d5d7c13 100644 --- a/doc/monitor.txt +++ b/doc/monitor.txt @@ -80,3 +80,6 @@ endian [big|little] With no arguments, displays the current endianness. With the argument "big" or "little", sets the current endianness to big-endian or little-endian respectively. This can also be viewed or changed using the MBE bit in the mstatush CSR. + +exec <instruction> +Executes an arbitrary instruction immediately diff --git a/rvcontroller.lua b/rvcontroller.lua index 942504c..8319b5c 100644 --- a/rvcontroller.lua +++ b/rvcontroller.lua @@ -4024,6 +4024,18 @@ elseif event.channel == "monitorkb" then else digiline_send("monitordisp","Invalid argument") end + elseif argv[1] == "exec" then + local instruction = tonumber(argv[2] or "",16) + if not instruction then + digiline_send("monitordisp","Bad instruction") + else + if instruction%4 == 3 then + runinst(instruction) + else + runcinst(instruction) + end + digiline_send("monitordisp","OK") + end elseif argv[1] == "help" then if argc == 1 or argv[2] == "1" then digiline_send("monitordisp","Use: help <command>") @@ -4055,7 +4067,7 @@ elseif event.channel == "monitorkb" then elseif argv[2] == "help" then digiline_send("monitordisp","help [command]\nShows information\nabout the specified\ncommand, or a list\nof commands if none\nis supplied") elseif argv[2] == "2" then - digiline_send("monitordisp","Page 2\nreset stop help\nsetbreak clearbreak\nrdcsr wrcsr endian") + digiline_send("monitordisp","Page 2\nreset stop help\nsetbreak clearbreak\nrdcsr wrcsr endian\nexec") elseif argv[2] == "h" then digiline_send("monitordisp","h\nhhhhhhhhhh") elseif argv[2] == "setbreak" then @@ -4068,6 +4080,8 @@ elseif event.channel == "monitorkb" then digiline_send("monitordisp","wrcsr <addr> <data>\nWrites the specifed\nvalue into the\nspecified CSR") elseif argv[2] == "endian" then digiline_send("monitordisp","endian [b | e]\nDisplays or changes\nthe current\nendianness") + elseif argv[2] == "exec" then + digiline_send("monitordisp","exec <instruction>\nExecutes an\narbitrary\ninstruction") else digiline_send("monitordisp","No such command or\nno help available") end |
