flow: Automatically run upgrade_arch.py on titan architectures
This will attempt to automatically upgrade the architecture files
from the Titan benchmark release, which should decrease the forced
coupling required between VTR and Titan releases.
diff --git a/vtr_flow/scripts/download_titan.py b/vtr_flow/scripts/download_titan.py
index 400c348..840af89 100755
--- a/vtr_flow/scripts/download_titan.py
+++ b/vtr_flow/scripts/download_titan.py
@@ -59,6 +59,10 @@
choices=["eecg", "google"],
help="Download mirror")
+ parser.add_argument("--upgrade_archs",
+ default=True,
+ help="Try to upgrade included architecture files (using the upgrade_archs.py)")
+
return parser.parse_args()
def main():
@@ -178,6 +182,8 @@
titan_other_benchmarks_extract_dir = os.path.join(benchmarks_dir, 'titan_other_blif')
titan_arch_extract_dir = os.path.join(arch_dir, 'titan')
+ arch_upgrade_script = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'upgrade_arch.py')
+
if not args.force:
#Check that all expected directories exist
expected_dirs = [args.vtr_flow_dir, benchmarks_dir, arch_dir, titan_benchmarks_extract_dir, titan_arch_extract_dir]
@@ -208,6 +214,12 @@
dst_file_path = os.path.join(titan_other_benchmarks_extract_dir, filename)
else:
assert filename.endswith(".xml")
+
+ if args.upgrade_archs:
+ #Apply the Architecture XML upgrade script
+ print "Upgrading architecture file:"
+ os.system("{} {}".format(arch_upgrade_script, src_file_path))
+
dst_file_path = os.path.join(titan_arch_extract_dir, filename)
shutil.move(src_file_path, dst_file_path)