Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: src/trusted/validator_mips/dgen/generate_decoder.py

Issue 9979025: [MIPS] Adding validator for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Minor style changes. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_mips/dgen/generate_decoder.py
diff --git a/src/trusted/validator_mips/dgen/generate_decoder.py b/src/trusted/validator_mips/dgen/generate_decoder.py
new file mode 100755
index 0000000000000000000000000000000000000000..1300db6a4acfe5a2e7165b1c8f1f3ae735e3c01a
--- /dev/null
+++ b/src/trusted/validator_mips/dgen/generate_decoder.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+#
+# Copyright 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can
+# be found in the LICENSE file.
+# Copyright 2012, Google Inc.
+#
+
+"""Decoder Generator script.
+
+Usage: generate-decoder.py <table-file> <output-cc-file>
Brad Chen 2012/05/04 22:49:50 So ... I understand this was copied from old ARM d
petarj 2012/05/08 14:54:19 Sure, will do.
+"""
+
+import sys
+import dgen_input
+import dgen_output
+
+def main(argv):
+ table_filename, output_filename = argv[1], argv[2]
+
+ print "Decoder Generator reading ", table_filename
+ f = open(table_filename, 'r')
+ tables = dgen_input.parse_tables(f)
+ f.close()
+
+ print "Successful - got %d tables." % len(tables)
+
+ print "Generating output to %s..." % output_filename
+ f = open(output_filename, 'w')
+ dgen_output.generate_decoder(tables,
+ dgen_output.COutput(f))
+ f.close()
+ print "Completed."
+
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))

Powered by Google App Engine
This is Rietveld 408576698