Rename riscv-dis to spike-dasm
authorAndrew Waterman <aswaterman@gmail.com>
Mon, 5 Jan 2015 01:31:11 +0000 (17:31 -0800)
committerAndrew Waterman <aswaterman@gmail.com>
Mon, 5 Jan 2015 02:48:04 +0000 (18:48 -0800)
This is a better name, since it looks for the string DASM(xxx), and it
fixes tab completion for the cross compiler.

spike_main/riscv-dis.cc [deleted file]
spike_main/spike-dasm.cc [new file with mode: 0644]
spike_main/spike_main.mk.in

diff --git a/spike_main/riscv-dis.cc b/spike_main/riscv-dis.cc
deleted file mode 100644 (file)
index d0af451..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// See LICENSE for license details.
-
-// This little program finds occurrences of strings like
-//  DASM(ffabc013)
-// in its input, then replaces them with the disassembly
-// enclosed hexadecimal number, interpreted as a RISC-V
-// instruction.
-
-#include "disasm.h"
-#include "extension.h"
-#include <iostream>
-#include <string>
-#include <cstdint>
-#include <fesvr/option_parser.h>
-using namespace std;
-
-int main(int argc, char** argv)
-{
-  string s;
-  disassembler_t d;
-
-  std::function<extension_t*()> extension;
-  option_parser_t parser;
-  parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);});
-
-  while (getline(cin, s))
-  {
-    for (size_t start = 0; (start = s.find("DASM(", start)) != string::npos; )
-    {
-      size_t end = s.find(')', start);
-      if (end == string::npos)
-        break;
-
-      size_t numstart = start + strlen("DASM(");
-      insn_bits_t bits = strtoull(&s[numstart], NULL, 16);
-      string dis = d.disassemble(bits);
-      s = s.substr(0, start) + dis + s.substr(end+1);
-      start += dis.length();
-    }
-
-    cout << s << '\n';
-  }
-
-  return 0;
-}
diff --git a/spike_main/spike-dasm.cc b/spike_main/spike-dasm.cc
new file mode 100644 (file)
index 0000000..d0af451
--- /dev/null
@@ -0,0 +1,45 @@
+// See LICENSE for license details.
+
+// This little program finds occurrences of strings like
+//  DASM(ffabc013)
+// in its input, then replaces them with the disassembly
+// enclosed hexadecimal number, interpreted as a RISC-V
+// instruction.
+
+#include "disasm.h"
+#include "extension.h"
+#include <iostream>
+#include <string>
+#include <cstdint>
+#include <fesvr/option_parser.h>
+using namespace std;
+
+int main(int argc, char** argv)
+{
+  string s;
+  disassembler_t d;
+
+  std::function<extension_t*()> extension;
+  option_parser_t parser;
+  parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);});
+
+  while (getline(cin, s))
+  {
+    for (size_t start = 0; (start = s.find("DASM(", start)) != string::npos; )
+    {
+      size_t end = s.find(')', start);
+      if (end == string::npos)
+        break;
+
+      size_t numstart = start + strlen("DASM(");
+      insn_bits_t bits = strtoull(&s[numstart], NULL, 16);
+      string dis = d.disassemble(bits);
+      s = s.substr(0, start) + dis + s.substr(end+1);
+      start += dis.length();
+    }
+
+    cout << s << '\n';
+  }
+
+  return 0;
+}
index 0ac70ef0189fec3957ce5ca50529913e033987ee..dd67998c1b60af93170b15fb19d71183ab78402e 100644 (file)
@@ -4,7 +4,7 @@ spike_main_subproject_deps = \
 
 spike_main_install_prog_srcs = \
        spike.cc \
-       riscv-dis.cc \
+       spike-dasm.cc \
        xspike.cc \
        termios-xspike.cc \