From ee2cd034bc5da48aebb7982caf1347c837a6744c Mon Sep 17 00:00:00 2001 From: Rejeesh Kutty Date: Thu, 26 Mar 2015 10:08:01 -0400 Subject: [PATCH] scripts: add gnd/vcc connections --- projects/scripts/adi_board.tcl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/projects/scripts/adi_board.tcl b/projects/scripts/adi_board.tcl index 4fa105158..59beb14d1 100644 --- a/projects/scripts/adi_board.tcl +++ b/projects/scripts/adi_board.tcl @@ -37,6 +37,29 @@ proc ad_connect_type {p_name} { proc ad_connect {p_name_1 p_name_2} { + if {($p_name_2 eq "GND") || ($p_name_2 eq "VCC")} { + set p_size 1 + set p_msb [get_property left [get_bd_pins $p_name_1]] + set p_lsb [get_property right [get_bd_pins $p_name_1]] + if {($p_msb ne "") && ($p_lsb ne "")} { + set p_size [expr (($p_msb + 1) - $p_lsb)] + } + set p_cell_name [regsub -all {/} $p_name_1 "_"] + set p_cell_name "${p_cell_name}_${p_name_2}" + if {$p_name_2 eq "VCC"} { + set p_value -1 + } else { + set p_value 0 + } + puts "create_bd_cell(xlconstant) size($p_size) value($p_value) name($p_cell_name)" + create_bd_cell -type ip -vlnv xilinx.com:ip:xlconstant:1.1 $p_cell_name + set_property CONFIG.CONST_WIDTH $p_size [get_bd_cells $p_cell_name] + set_property CONFIG.CONST_VAL $p_value [get_bd_cells $p_cell_name] + puts "connect_bd_net $p_cell_name/dout $p_name_1" + connect_bd_net [get_bd_pins $p_cell_name/dout] [get_bd_pins $p_name_1] + return + } + set m_name_1 [ad_connect_type $p_name_1] set m_name_2 [ad_connect_type $p_name_2]