From fcb4c7eeb5d5cd182f8e3538d3b41943cca772eb Mon Sep 17 00:00:00 2001 From: Dennis Buchhorn Date: Thu, 30 Jun 2022 16:56:38 +0200 Subject: [PATCH] feat: add flag 'use-bd-files' and create function for bd-wrapper creation --- scripts/git_wrapper.tcl | 4 ++-- scripts/write_project_tcl_git.tcl | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/git_wrapper.tcl b/scripts/git_wrapper.tcl index 2440a73..5df62f9 100644 --- a/scripts/git_wrapper.tcl +++ b/scripts/git_wrapper.tcl @@ -97,7 +97,7 @@ namespace eval ::git_wrapper { set proj_file [current_project].tcl # Generate project and add it - write_project_tcl_git -no_copy_sources -force $proj_file + write_project_tcl_git -no_copy_sources -use_bd_files -force $proj_file puts $proj_file exec git add $proj_file @@ -120,6 +120,6 @@ namespace eval ::git_wrapper { # Generate project set proj_file [current_project].tcl puts $proj_file - write_project_tcl_git -no_copy_sources -force $proj_file + write_project_tcl_git -no_copy_sources -use_bd_files -force $proj_file } } diff --git a/scripts/write_project_tcl_git.tcl b/scripts/write_project_tcl_git.tcl index 3138e79..c2f2b6d 100644 --- a/scripts/write_project_tcl_git.tcl +++ b/scripts/write_project_tcl_git.tcl @@ -375,6 +375,8 @@ proc write_project_tcl_script {} { if { !$a_global_vars(b_arg_use_bd_files) } { wr_bd wr_bd_bc_specific + } else { + wr_bd_create_wrapper } # write BC and RM filesets to handle extra files(ELF, XDC) added @@ -815,6 +817,18 @@ proc add_references { sub_design } { } } +proc wr_bd_create_wrapper {} { + # Get all BD files in the design + set bd_files [get_files -norecurse *.bd -filter "IS_BLOCK_CONTAINER_MANAGED == 0"] + + foreach bd_file $bd_files { + # Add wrapper creation + set bd_filename [file tail $bd_file] + lappend l_script_data "\n# Create wrapper file for $bd_filename" + lappend l_script_data "make_wrapper -files \[get_files $bd_filename\] -import -top\n" + } +} + proc wr_bd {} { # Summary: write procs to create BD's # Return Value: None