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.
main
Istvan Csomortani 2016-10-21 16:55:35 +03:00
parent 707038937a
commit aa46de5e5e
1 changed files with 19 additions and 0 deletions

View File

@ -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
}