 length $device] } ]
  
  set lastIndx [string last $spd $deviceName  ]
  set lastIndx [expr {$lastIndx-1}]
      
  return [string range $deviceName $firstIndx $lastIndx]  
}

set device [getDevice]
set package [getPackage]
set speedgrade [get_project_property SPEEDGRADE]
proc updateModel_C_NUM_CHANNEL {ipview} {
    variable package
    variable device
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
    if {[string equal $package cpg236]} {
        set value 2
     } elseif {[string equal $package cpg238]} {
        set value 2
     } elseif {[string equal $device xc7a12t] && [string equal $package csg325]} {
        set value 2
     } elseif {[string equal $device xc7a12ti] && [string equal $package csg325]} {
        set value 2
     } elseif {[string equal $device xc7a12tl] && [string equal $package csg325]} {
        set value 2
     } elseif {[string equal $device xa7a12t] && [string equal $package csg325]} {
        set value 2
     } elseif {[string equal $device xa7a12ti] && [string equal $package csg325]} {
        set value 2
     } elseif {[string equal $device xa7a12tl] && [string equal $package csg325]} {
        set value 2
     } else {
        set value 4
     }
      set_property modelparam_value $value [ipgui::get_modelparamspec C_NUM_CHANNEL -of $ipview ]

	return true
}
source_ipfile "xgui/ibert_7series_gtp_v3_0_utils.tcl" 
source_ipfile "xgui/ibert_gtp_core.tcl"
source_ipfile "xgui/pin_locs.tcl"

proc readToArray {filename arraynamename} {
	upvar $arraynamename arrayname
	gets_ipfile $filename columns_line
	set columns [split $columns_line ","]
	set columns [string toupper $columns] ;# column names to upper to avoid case mismatch
	set row_id 0
   
	while {1} {
		set isEOF [gets_ipfile $filename row_line]
		if {$isEOF < 0} {
		break
		}
	
		set row [split $row_line ","]
		for {set colIndex 0} {$colIndex < [llength $columns]} {incr colIndex} {
			set arrayname($row_id,[lindex $columns $colIndex]) [lindex $row $colIndex]
		}
		incr row_id
	}
	
	close_ipfile $filename
	return $row_id ;# =the number of rows in the table
}


################################################################################
# getOutputStandard 
#   Description:
#     Looks for output standards available for the given device.
#
#   Arguments:
#     <deviceName> : Name of device
#
#   Results:
#     retval       : List with the default value and a list of all valid values
#                    or empty list on error
#                    (example:  {LVCMOS33 {LVCMOS12 }} )
#
proc getOutputStandard {deviceName {endPoint "ANY"}} {
  foreach v [info vars] {set $v [string toupper [set $v]]}
  variable iostandards
  variable iostandards_size
  set valueName "IOSTANDARD"
  set valueList {}
  set default {}
  for {set i 0} {$i<$iostandards_size} {incr i} {
    set value $iostandards($i,$deviceName)
    if {$value ne ""} {
      if {$endPoint eq "ANY" || $endPoint eq $iostandards($i,ENDPOINT)} {
        set std $iostandards($i,$valueName)
        if {[lsearch $valueList $std] == -1} 