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

Unified Diff: src/trusted/validator_arm/generate_decoder.py

Issue 9960043: Finish separation of testing from sel_ldr validation. Also, automate (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: 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
« no previous file with comments | « src/trusted/validator_arm/gen/arm32_decode_tests.cc ('k') | src/trusted/validator_arm/inst_classes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_arm/generate_decoder.py
===================================================================
--- src/trusted/validator_arm/generate_decoder.py (revision 8336)
+++ src/trusted/validator_arm/generate_decoder.py (working copy)
@@ -19,7 +19,8 @@
import re
import sys
import dgen_input
-import dgen_output
+import dgen_decoder_output
+import dgen_test_output
def _localize_filename(filename):
""" Strips off directories above 'native_client', returning
@@ -39,38 +40,34 @@
print "Decoder Generator reading ", table_filename
f = open(table_filename, 'r')
- tables = dgen_input.parse_tables(f)
+ decoder = dgen_input.parse_tables(f)
f.close()
- print "Successful - got %d tables." % len(tables)
+ print "Successful - got %d tables." % len(decoder.tables())
print "Generating %s..." % output_filename
f = open(output_filename, 'w')
- if output_filename.endswith('named.h'):
- dgen_output.generate_decoder_h(tables,
- decoder_name,
- _localize_filename(output_filename),
- True,
- dgen_output.COutput(f))
+ if output_filename.endswith('tests.cc'):
+ dgen_test_output.generate_tests_cc(decoder,
+ decoder_name,
+ f)
+ elif output_filename.endswith('named_classes.h'):
+ dgen_test_output.generate_named_classes_h(
+ decoder, decoder_name, _localize_filename(output_filename),
+ f)
+ elif output_filename.endswith('named_decoder.h'):
+ dgen_test_output.generate_named_decoder_h(
+ decoder, decoder_name, _localize_filename(output_filename), f)
elif output_filename.endswith('.h'):
- dgen_output.generate_decoder_h(tables,
- decoder_name,
- _localize_filename(output_filename),
- False,
- dgen_output.COutput(f))
+ dgen_decoder_output.generate_h(
+ decoder, decoder_name, _localize_filename(output_filename), f)
elif output_filename.endswith('named.cc'):
- dgen_output.generate_decoder_cc(tables,
- decoder_name,
- _localize_filename(output_filename),
- True,
- dgen_output.COutput(f))
+ dgen_test_output.generate_named_cc(
+ decoder, decoder_name, _localize_filename(output_filename), f)
elif output_filename.endswith('.cc'):
- dgen_output.generate_decoder_cc(tables,
- decoder_name,
- _localize_filename(output_filename),
- False,
- dgen_output.COutput(f))
+ dgen_decoder_output.generate_cc(
+ decoder, decoder_name, _localize_filename(output_filename), f)
else:
print 'Error: output filename not of form "*.{h,cc}"'
f.close()
« no previous file with comments | « src/trusted/validator_arm/gen/arm32_decode_tests.cc ('k') | src/trusted/validator_arm/inst_classes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698