From 3b51abe63634a16ad72144069db31e5de017d03f Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 21 Jul 2023 12:14:08 +0300 Subject: [PATCH] feat: add --create-efabless-submission option --- caravel.py | 11 +++++++++++ configure.py | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/caravel.py b/caravel.py index 4dbed1a..8d2ae93 100644 --- a/caravel.py +++ b/caravel.py @@ -7,6 +7,7 @@ import shutil import git def copy_print(src: str, dest: str): + os.makedirs(os.path.dirname(dest), exist_ok=True) logging.info(f" -> {dest}") shutil.copy2(src, dest) @@ -129,3 +130,13 @@ class CaravelConfig(): f"{lastrun}/final/spef", f"spef/", copy_function=copy_print, dirs_exist_ok=True ) copy_print(f"{lastrun}/final/spef/nom_/{macro_name}.nom.spef", f"spef/{macro_name}.spef") + + def create_efabless_submission(self): + logging.info("creating efabless submission directory:") + lastrun = self.find_last_run("tt_top") + copy_print("README.md", "efabless/README.md") + copy_print("shuttle_index.json", "efabless/shuttle_index.json") + copy_print("verilog/rtl/user_defines.v", "efabless/verilog/rtl/user_defines.v") + copy_print(f"{lastrun}/final/pnl/user_project_wrapper.pnl.v", f"efabless/verilog/gl/user_project_wrapper.v") + copy_print(f"{lastrun}/final/gds/user_project_wrapper.magic.gds", f"efabless/gds/user_project_wrapper.gds") + copy_print(f"{lastrun}/final/lef/user_project_wrapper.lef", f"efabless/lef/user_project_wrapper.gds") diff --git a/configure.py b/configure.py index 35c00e1..77ad79c 100755 --- a/configure.py +++ b/configure.py @@ -165,6 +165,7 @@ if __name__ == '__main__': parser.add_argument('--update-caravel', help='configure caravel for build', action='store_const', const=True) parser.add_argument('--copy-macros', help='copy macros for building the tt_top project', action='store_const', const=True) parser.add_argument('--copy-final-results', help='copy final project files to gds/lef directories', action='store_const', const=True) + parser.add_argument('--create-efabless-submission', help='create efabless submission files', action='store_const', const=True) parser.add_argument('--harden', help="harden project", action="store_const", const=True) parser.add_argument('--test', help='use test projects', action='store_const', const=True) parser.add_argument('--sta-projects', help='use sta projects', action='store_const', const=True) @@ -225,6 +226,9 @@ if __name__ == '__main__': if args.copy_final_results: caravel.copy_final_results() + if args.create_efabless_submission: + caravel.create_efabless_submission() + if args.update_image: docs.update_image()