From aa46de5e5e10396536e6e69ba57bb12b9f9df5a1 Mon Sep 17 00:00:00 2001 From: Istvan Csomortani Date: Fri, 21 Oct 2016 16:55:35 +0300 Subject: [PATCH] adi_ip_alt: Add ad_generate_module_inst proc Add a tcl process, which can be used to generate custom module names during the generation phase. This will be used to create different ad_serdes_clk module, in case when independent IOPLLs are needed for TX and RX. --- library/scripts/adi_ip_alt.tcl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/library/scripts/adi_ip_alt.tcl b/library/scripts/adi_ip_alt.tcl index f8e36343d..3fcc3cba8 100644 --- a/library/scripts/adi_ip_alt.tcl +++ b/library/scripts/adi_ip_alt.tcl @@ -70,3 +70,22 @@ proc ad_conduit {if_name if_port port dir width} { add_interface_port $if_name $port $if_port $dir $width } +proc ad_generate_module_inst { inst_name mark source_file target_file } { + + set fp_source [open $source_file "r"] + set fp_target [open $target_file "w+"] + + fconfigure $fp_source -buffering line + + while { [gets $fp_source data] >= 0 } { + + # update the required module name + regsub $inst_name $data "&_$mark" data + puts $data + puts $fp_target $data + } + + close $fp_source + close $fp_target +} +