#Definitional proc to organize widgets for parameters.
proc EvalSubstituting {parameters procedure {numlevels 1}} {
    set paramlist {}
    if {[string index $numlevels 0]!="#"} {
        set numlevels [expr $numlevels+1]
    }
    foreach parameter $parameters {
        upvar 1 $parameter $parameter\_value
        tcl::lappend paramlist \$$parameter [set $parameter\_value]
    }
    uplevel $numlevels [string map $paramlist $procedure]
}

proc SubstituteAndEval { parameters procedures } {
set proCs [string map $parameters $procedures]
eval $proCs
}

proc text15_updated {IPINST PARAM_VALUE.C_NUM_OF_PROBES} {
  if { [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}] <= 64 } {
    return "<b>GUI configuration mode is limited to 64 probe ports."
  } else {
    return "<font color=red>GUI configuration mode is limited to 64 probe ports."
  }
}

proc text16_updated {IPINST PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_MON_TYPE} {

	set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]
	if {$mode_sel == "Interface_Monitor"} {
		return "To configure more than 64 probe ports use Vivado Tcl Console"
	} else {
  		if { [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}] <= 64 } {
    			return "To configure more than 64 probe ports use Vivado Tcl Console"
  		} else {
    			return "<font color=red>To configure more than 64 probe ports use Vivado Tcl Console"
  		}
  	}
}

proc text11_updated {IPINST PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION PARAM_VALUE.C_MON_TYPE} {

	set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]
	set val_prop [get_property value ${PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION}]
	if {$mode_sel != "Interface_Monitor"} {
      if { $val_prop == "AUTO" } {
		return "The width of the probes are set based on AUTO propagation in IP Integrator design. \n Update the Native probe width propagation to MANUAL in general settings page to \n enable setting the individual probe width parameters manually."
	}
  }
}

proc cap_qual_txt_updated {IPINST PARAM_VALUE.C_EN_STRG_QUAL} {
  if { [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}] == 1 } {
    return "<b>To configure Capture Qualification we need atleast 1 Comparator"
  } else {
    return ""
  }
}
set ARGS_INTF ""
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS_INTF "PARAM_VALUE.C_SLOT_${ar}_INTF_TYPE "   
}
set ARGS ""
append ARGS "PARAM_VALUE.C_SLOT "
#append ARGS "PARAM_VALUE.C_SLOT_INTF_TYPE "
for { set ar 0 } { $ar <= 1023 } { incr ar } {
    append ARGS "PARAM_VALUE.C_PROBE${ar}_WIDTH "   
}

for { set ar 0 } { $ar <= 1023 } { incr ar } {
    append ARGS "PARAM_VALUE.C_PROBE${ar}_MU_CNT "   
}

for { set ar 0 } { $ar <= 1023 } { incr ar } {
    append ARGS "PARAM_VALUE.C_PROBE${ar}_TYPE "   
}

for { set ar 0 } { $ar <= 1023 } { incr ar } {
    append ARGS "PARAM_VALUE.C_PROBE${ar}_MU_TYPE "   
}

set ARGS2 ""
#append ARGS2 "PARAM_VALUE.C_SLOT_INTF_TYPE "
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_INTF_TYPE "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_TYPE "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_PROTOCOL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_ID_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_DATA_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_ADDR_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AWUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_ARUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_WUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_RUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_BUSER_WIDTH "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AW_SEL_TRIG "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AR_SEL_TRIG "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_W_SEL_TRIG "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_R_SEL_TRIG "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_B_SEL_TRIG "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AW_SEL_DATA "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AR_SEL_DATA "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_W_SEL_DATA "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_R_SEL_DATA "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_B_SEL_DATA "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AW_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_AR_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_W_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_R_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_B_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_DATA_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_AXI_TRIG_SEL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_APC_EN "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_APC_STS_EN "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_TXN_CNTR_EN "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_MAX_WR_BURSTS "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS2 "PARAM_VALUE.C_SLOT_${ar}_MAX_RD_BURSTS " 
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS2 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TDATA_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS2 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS2 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TID_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS2 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TDEST_WIDTH "   
}

set ARGS_ALL ""
#Appending all the native probes and probe types
append ARGS_ALL $ARGS
#Appending all the AXI MM parameters
append ARGS_ALL $ARGS2
#Appending all the AXI4S parameters
append ARGS_ALL $ARGSS2

set my_width_list ""
for {set i 0} {$i <= 1023} {incr i} {	
	append my_width_list "PARAM_VALUE.C_PROBE${i}_WIDTH "
	append my_width_list "PARAM_VALUE.C_PROBE${i}_MU_CNT " 
    append my_width_list "PARAM_VALUE.C_PROBE${i}_TYPE " 
    append my_width_list "PARAM_VALUE.C_PROBE${i}_MU_TYPE " 
}

set ARGS1 ""
append ARGS1 "PARAM_VALUE.C_SLOT "
#append ARGS1 "PARAM_VALUE.C_SLOT_INTF_TYPE "
for {set i 0} {$i <= 1023} {incr i} {	
	append ARGS1 "PARAM_VALUE.C_PROBE${i}_WIDTH "
	append ARGS1 "PARAM_VALUE.C_PROBE${i}_MU_CNT " 
    append ARGS1 "PARAM_VALUE.C_PROBE${i}_TYPE " 
	append ARGS1 "PARAM_VALUE.C_PROBE${i}_MU_TYPE " 
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_INTF_TYPE "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_TYPE "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_PROTOCOL "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_ID_WIDTH "   
}

for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_DATA_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_ADDR_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_AWUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_ARUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_WUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_RUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGS1 "PARAM_VALUE.C_SLOT_${ar}_AXI_BUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS1 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TDATA_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS1 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TUSER_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS1 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TID_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS1 "PARAM_VALUE.C_SLOT_${ar}_AXIS_TDEST_WIDTH "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS1 "PARAM_VALUE.C_SLOT_${ar}_APC_EN "   
}
for { set ar 0 } { $ar < 16 } { incr ar } {
    append ARGSS1 "PARAM_VALUE.C_SLOT_${ar}_APC_STS_EN "   
}
  

for { set i 0 } { $i < 8 } { incr i } {
EvalSubstituting { my_width_list i} {
proc text$i_updated {PARAM_VALUE.C_NUM_OF_PROBES $my_width_list} {
    set total 0
    set thisvalue 0
    set tot_num_comp 0
    set comp_val 0
    set np [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
    for { set ar 0 } { $ar < 64 } { incr ar } {
	if {$ar < $np} {
        set this "PARAM_VALUE.C_PROBE${ar}_WIDTH"
	    set thisvalue [get_property value [set $this]]
	    set total [expr $total+$thisvalue]
	    set this "PARAM_VALUE.C_PROBE${ar}_MU_CNT"
	    set comp_val [get_property value [set $this]]
	    set tot_num_comp [expr $tot_num_comp+$comp_val]

	   
	}
    }
    if { $total > 65536 } {
        return "<font color=red>Total width of all probes cannot exceed 65536"
    } elseif {$tot_num_comp > 1024} { 
	    return "<font color=red>Total Number of comparators of all probe cannot exceed 1024"
    } else {
	return ""
    }
}	
} 0
}

#Definitional proc to organize widgets for parameters.
proc init_gui { IPINST } {


	variable Table_parameters
    variable hw_parameter_array
	set_property hide_disabled_pins true [ipgui::get_canvasspec -of $IPINST]

	set compPanel [ipgui::add_panel $IPINST -name compPanel -parent $IPINST]
	ipgui::add_param $IPINST -parent  $compPanel  -name Component_Name

	set sttxt16 [ipgui::add_dynamic_text $IPINST -parent $IPINST -name st16 -tclproc text16_updated -is_selectable true]
	ipgui::add_row $IPINST -parent  $IPINST
	set Page0 [ ipgui::add_page $IPINST  -name "General_Options" -layout vertical]

	ipgui::add_param  $IPINST  -parent  $Page0  -name C_EN_AXIS_IF -widget checkBox
        set_property display_name "Enable AXI4-Stream Interfaces for Manual Connection to AXI4 Debug Hub" [ipgui::get_guiparamspec C_EN_AXIS_IF -of $IPINST]

	set mon [ipgui::add_group $IPINST -parent $Page0 -name {ILA Input Type} -layout horizontal] 
	ipgui::add_param  $IPINST  -parent  $mon  -name C_MON_TYPE -widget comboBox
	set_property display_name " " [ipgui::get_guiparamspec C_MON_TYPE -of $IPINST]
	#set_property enabled false [ipgui::get_guiparamspec C_MON_TYPE -of $IPINST]

	set config [ipgui::add_group $IPINST -parent $Page0 -name {General Configuration} ] 
	set c_num_probe_panel [ipgui::add_panel $IPINST -parent $Page0 -name c_num_probe_panel -layout horizontal] 
        set C_PROBE_WIDTH_PROPAGATION [ipgui::add_param $IPINST -parent $c_num_probe_panel -name C_PROBE_WIDTH_PROPAGATION -widget comboBox]
	set_property display_name "Native Probe Width Propagation" [ipgui::get_guiparamspec C_PROBE_WIDTH_PROPAGATION -of $IPINST]
	set_property tooltip "Use to enable manual probe width selection" [ipgui::get_guiparamspec C_PROBE_WIDTH_PROPAGATION -of $IPINST]
	set_property visible false [ipgui::get_guiparamspec  C_PROBE_WIDTH_PROPAGATION -of $IPINST  ]
	ipgui::add_param $IPINST -parent $c_num_probe_panel -name C_NUM_OF_PROBES -show_range true
	set sttxt100 [ipgui::add_dynamic_text $IPINST -parent $c_num_probe_panel -name st100 -tclproc text100_updated]



    set_property tooltip "System ILA supports 1024 probes.But the width and Match Unit Count of only first 64 probes can be configured though GUI. To configure the probe width and Match Unit Count of other probes use Vivado Tcl Console.Else they will have a default width of 1" [ipgui::get_guiparamspec  C_NUM_OF_PROBES -of $IPINST]	
	#ipgui::add_static_text  $IPINST -parent $c_num_probe_panel -name st01 -text "Range 1...1024"
	
	set c_num_slot_panel [ipgui::add_panel $IPINST -parent $Page0 -name c_num_slot_panel -layout horizontal] 
	ipgui::add_param $IPINST -parent $c_num_slot_panel -name C_NUM_MONITOR_SLOTS -show_range false
    set_property visible false [ipgui::get_guiparamspec  C_NUM_MONITOR_SLOTS -of $IPINST  ]

	
	ipgui::add_param  $IPINST  -parent  $Page0  -name C_TRIGOUT_EN -widget checkBox
	set_property display_name "Enable Trigger Output Interface" [ipgui::get_guiparamspec  C_TRIGOUT_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_TRIGOUT_EN -of $IPINST  ]
	#set_property tooltip "Use to enable Trigger Out Port" [ipgui::get_guiparamspec  C_TRIGOUT_EN -of $IPINST]

	ipgui::add_param  $IPINST  -parent  $Page0  -name C_TRIGIN_EN -widget checkBox
	set_property display_name "Enable Trigger Input Interface" [ipgui::get_guiparamspec  C_TRIGIN_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_TRIGIN_EN -of $IPINST  ]
	#set_property tooltip "Use to enable Trigger In Port" [ipgui::get_guiparamspec  C_TRIGIN_EN -of $IPINST]




#	set sttxt15 [ipgui::add_dynamic_text $IPINST -parent $Page0 -name st15 -tclproc text15_updated ]

	
	for {set i 0} {$i <= 63} {incr i} {
	    if {$i%8==0} {
	   	  set page [ipgui::add_page $IPINST -parent $IPINST -name "Probe_Port_Options$i" -layout vertical] 
	  	  set_property display_name "Probe ($i..[expr $i+7]) Options"  $page
		  set j [expr $i / 8 ]
		  if {$j == 0} {
	set apsm [ipgui::add_panel $IPINST -parent $page -name apsm -layout horizontal] 
	set ALL_PROBE_SAME_MU [ipgui::add_param $IPINST -parent $apsm -name ALL_PROBE_SAME_MU -widget checkBox]
	set_property display_name "Same Number of Comparators for All Probe Ports" [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU -of $IPINST]
	set_property tooltip "Use to set the same number of comparators for all probes" [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU -of $IPINST]

	set ALL_PROBE_SAME_MU_CNT [ipgui::add_param $IPINST -parent $apsm -name ALL_PROBE_SAME_MU_CNT -widget comboBox]
	set_property display_name "Number of Comparators" [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
	set_property tooltip "The number of comparators to be used by each probe" [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
                  }
	  	  set table_name  "probe_table_$j"
      	  set curr_table [ipgui::add_table $IPINST -parent $page  -rows 9 -columns 5 -name $table_name -layout horizontal  -table_header true ]
	  	  set sttxt1 [ipgui::add_static_text $IPINST -parent $curr_table  -name sta$i -text "Probe Port	" ]
	  	  set sttxt2 [ipgui::add_static_text $IPINST  -parent $curr_table -name stb$i -text "Probe Width \[1..4096\] " ]
	  	  set sttxt3 [ipgui::add_static_text $IPINST  -parent $curr_table -name stc$i -text "Number of Comparators" ]	
      	  set sttxt4 [ipgui::add_static_text $IPINST  -parent $curr_table -name std$i -text "Data and/or Trigger" ]	
      	  set sttxt5 [ipgui::add_static_text $IPINST  -parent $curr_table -name std$i -text "Comparator Options" ]	
	  	  set_property cell_location "0,0" $sttxt1 
	  	  set_property cell_location "0,1" $sttxt2 
	  	  set_property cell_location "0,2" $sttxt3 
      	  set_property cell_location "0,3" $sttxt4 
      	  set_property cell_location "0,4" $sttxt5 
      	  ipgui::add_row $IPINST  -parent $page
      	  set sttxt11 [ipgui::add_dynamic_text $IPINST -parent $page -name st11 -tclproc text11_updated]
	    }
		set prb_name   [join "prb $i Name" "" ] 
		set prb_width  [join [split "C_PROBE $i _WIDTH" ] ""] 
		set prb_cnt    [join [split "C_PROBE $i _MU_CNT"] "" ]  
        set prb_sw    [join [split "C_PROBE $i _TYPE"] "" ]  
        set prb_type    [join [split "C_PROBE $i _MU_TYPE"] "" ]  
	    set Table_parameter1 [ipgui::add_static_text  $IPINST  -parent $curr_table -name $prb_name -text "probe$i"]
	    set Table_parameter2 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_width -show_range false -show_label false]
	    set Table_parameter3 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_cnt -widget comboBox -show_label false]
        set Table_parameter4 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_sw -widget comboBox -show_label false]
        set Table_parameter5 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_type -widget comboBox -show_label false]
		set j [expr ($i % 8 ) + 1 ]
		set_property cell_location "$j,0" $Table_parameter1
		set_property cell_location "$j,1" $Table_parameter2
		set_property cell_location "$j,2" $Table_parameter3 
        set_property cell_location "$j,3" $Table_parameter4 
        set_property cell_location "$j,4" $Table_parameter5 
#	    ipgui::add_row $IPINST  -parent $page
	    
	}

        set storage [ipgui::add_page $IPINST -parent $IPINST -name "Storage Options" -layout horizontal] 
		set_property display_name "Storage Options"  $storage
	ipgui::add_param $IPINST -parent $storage -name C_DATA_DEPTH -widget comboBox
	set_property display_name "Data Depth" [ipgui::get_guiparamspec  C_DATA_DEPTH -of $IPINST]


        set adv_config [ipgui::add_page $IPINST -parent $IPINST -name "Advance Options" -layout vertical] 
	set C_INPUT_PIPE_STAGES [ipgui::add_param $IPINST -parent $adv_config -name C_INPUT_PIPE_STAGES -widget comboBox]
	set_property display_name "Input Pipe Stages" [ipgui::get_guiparamspec  C_INPUT_PIPE_STAGES -of $IPINST]
	set_property tooltip "Number of input pipe stages" [ipgui::get_guiparamspec  C_INPUT_PIPE_STAGES -of $IPINST]	
    
    ipgui::add_row $IPINST -parent  $adv_config


	#set C_BRAM_CNT [ipgui::add_param $IPINST -parent $Page0 -name C_BRAM_CNT -widget comboBox]
	#set_property visible false [ipgui::get_guiparamspec C_BRAM_CNT -of $IPINST] 

    #set EN_BRAM_DRC [ipgui::add_param $IPINST -parent $Page0 -name EN_BRAM_DRC -widget checkBox]
	#set_property visible false [ipgui::get_guiparamspec EN_BRAM_DRC -of $IPINST] 
		
	

	set C_EN_STRG_QUAL [ipgui::add_param $IPINST -parent $adv_config -name C_EN_STRG_QUAL -widget checkBox]
	set_property display_name "Enable Storage Qualifier" [ipgui::get_guiparamspec  C_EN_STRG_QUAL -of $IPINST]
	set_property tooltip "Use to filter the data that is stored in the ILA capture RAM using capture conditions. When this is selected, 1 comparator is always used by the capture condition.So minimum number of comparators used by each probe will be 2." [ipgui::get_guiparamspec  C_EN_STRG_QUAL -of $IPINST]

	  set C_EN_TIME_TAG [ipgui::add_param $IPINST -parent $adv_config -name C_EN_TIME_TAG -widget checkBox]
	  set_property display_name "Enable Time tagging" [ipgui::get_guiparamspec  C_EN_TIME_TAG -of $IPINST]
	  set_property tooltip "Use to filter the data that is stored in the ILA capture RAM along with time tag information only when there is a transition/activity in the data being monitored." [ipgui::get_guiparamspec C_EN_TIME_TAG -of $IPINST]
	  
      set C_TIME_TAG_WIDTH [ipgui::add_param $IPINST -parent $adv_config -name C_TIME_TAG_WIDTH ]
	  set_property display_name "Time Tag Counter Width" [ipgui::get_guiparamspec  C_TIME_TAG_WIDTH -of $IPINST]
	  set_property tooltip "Width of the time tag counter" [ipgui::get_guiparamspec C_TIME_TAG_WIDTH -of $IPINST]
      
      #set C_ILA_CLK_FREQ [ipgui::add_param $IPINST -parent $adv_config -name C_ILA_CLK_FREQ ]
	  #set_property display_name "ILA Clock Frequency in Hertz" [ipgui::get_guiparamspec  C_ILA_CLK_FREQ -of $IPINST]
	  #set_property tooltip "ILA sampling clock frequency in hertz" [ipgui::get_guiparamspec C_ILA_CLK_FREQ -of $IPINST]

      set_property visible false [ipgui::get_guiparamspec C_EN_TIME_TAG -of $IPINST]
      set_property visible false [ipgui::get_guiparamspec C_TIME_TAG_WIDTH -of $IPINST]
      set_property visible false [ipgui::get_guiparamspec C_EN_STRG_QUAL -of $IPINST]
      #set_property visible false [ipgui::get_guiparamspec C_ILA_CLK_FREQ -of $IPINST]


    set C_ADV_TRIGGER [ipgui::add_param $IPINST -parent $adv_config -name C_ADV_TRIGGER -widget checkBox]
	set_property display_name "Enable Advanced Trigger State Machine" [ipgui::get_guiparamspec  C_ADV_TRIGGER -of $IPINST]
	set_property tooltip "Use to enable ILA Advanced Trigger Features - Trigger Sequencing" [ipgui::get_guiparamspec  C_ADV_TRIGGER -of $IPINST]
      set_property visible false [ipgui::get_guiparamspec C_ADV_TRIGGER -of $IPINST]

        set page_intf [ipgui::add_page $IPINST -parent $IPINST -name "Interface_Options" -layout horizontal] 
		set_property display_name "Interface Options"  $page_intf
        #set panel0 [ipgui::add_panel $IPINST -parent $page_intf -name "panel0" -layout horizontal]
        set panel0 $page_intf
        #set slotparam [ipgui::add_group $IPINST -parent $Panel0 -name {Slot Name} -layout horizontal]
	    set no [ipgui::add_param  $IPINST  -parent $panel0 -name C_SLOT -widget comboBox ]
        set_property display_name "Configuration for Slot "  $no
        add_row -parent $panel0 $IPINST
	    #set intf [ipgui::add_param  $IPINST  -parent $panel0 -name C_SLOT_INTF_TYPE -widget editComboBox ]
        #set_property display_name "Interface Type"  $intf
          add_row -parent $panel0 $IPINST
        #set panel0a [ipgui::add_panel $IPINST -parent $page_intf -name "panel0a" -layout vertical]
        for {set i 0} {$i < 16} {incr i} {
          #add_row -parent $panel0 $IPINST
          set panel0a [ipgui::add_panel $IPINST -parent $page_intf -name "panel_options_$i" -layout vertical ]
          set sl_intf_type [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_INTF_TYPE -widget editComboBox] 
          set_property display_name "Interface Type" $sl_intf_type
          set intf_dttype [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_TYPE -widget comboBox] 
          set_property display_name "Configure Slot as Data and/or Trigger" $intf_dttype
          set sl_proto [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXI_PROTOCOL -widget comboBox] 
          set_property display_name "AXI-MM Protocol" $sl_proto          
	      set sl_idw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXI_ID_WIDTH -widget comboBox] 
          set_property display_name "AXI-MM ID Width" $sl_idw
          set sl_mmdw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXI_DATA_WIDTH -widget comboBox]
          set_property display_name "AXI-MM Data Width" $sl_mmdw
 	      set sl_mmaw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXI_ADDR_WIDTH -widget comboBox] 
          set_property display_name "AXI-MM Address Width" $sl_mmaw
          set sl_tdw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXIS_TDATA_WIDTH -widget comboBox]
          set_property display_name "AXI-Stream TDATA Width" $sl_tdw
          set sl_tidw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXIS_TID_WIDTH -widget comboBox]
          set_property display_name "AXI-Stream TID Width" $sl_tidw
          set sl_tuw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXIS_TUSER_WIDTH -widget comboBox]
          set_property display_name "AXI-Stream TUSER Width" $sl_tuw
          set sl_tdw [ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_AXIS_TDEST_WIDTH -widget comboBox]
          set_property display_name "AXI-Stream TDEST Width" $sl_tdw
        
          ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_APC_EN -widget checkBox 
          set_property display_name "Enable AXI-MM/Stream Protocol Checker" [ipgui::get_guiparamspec C_SLOT_${i}_APC_EN -of $IPINST]

          ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_APC_STS_EN -widget checkBox 		
          set_property display_name "Monitor APC Status signals" [ipgui::get_guiparamspec C_SLOT_${i}_APC_STS_EN -of $IPINST]

          ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_TXN_CNTR_EN -widget checkBox 		
          set_property display_name "Enable Transaction Tracking Counters" [ipgui::get_guiparamspec C_SLOT_${i}_TXN_CNTR_EN -of $IPINST]
          ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_MAX_RD_BURSTS -widget comboBox 		
          set_property display_name "Number Of Outstanding Read Transactions" [ipgui::get_guiparamspec C_SLOT_${i}_MAX_RD_BURSTS -of $IPINST]
          ipgui::add_param  $IPINST  -parent $panel0a -name C_SLOT_${i}_MAX_WR_BURSTS -widget comboBox 		
          set_property display_name "Number Of Outstanding Write Transactions" [ipgui::get_guiparamspec C_SLOT_${i}_MAX_WR_BURSTS -of $IPINST]
          #set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_RD_BURSTS -of $IPINST]
          #set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_WR_BURSTS -of $IPINST]

        }
        add_row -parent $panel0 $IPINST
	    set txtdt [ipgui::add_dynamic_text $IPINST -parent $page_intf -name dt1 -tclproc textdt_updated ]
        add_row -parent $panel0 $IPINST

        set panel1 [ipgui::add_panel $IPINST -parent $page_intf -name "panel1" -layout vertical]

       
        set page1c [ipgui::add_page $IPINST -parent $panel1 -name "Read_Address" -layout vertical]         
        set page1d [ipgui::add_page $IPINST -parent $panel1 -name "Read_Data" -layout vertical]
        set page1 [ipgui::add_page $IPINST -parent $panel1 -name "Write_Address" -layout vertical]         
        set page1a [ipgui::add_page $IPINST -parent $panel1 -name "Write_Data" -layout vertical]         
        set page1b [ipgui::add_page $IPINST -parent $panel1 -name "Write_Response" -layout vertical]  

        set panels1 [ipgui::add_panel $IPINST -parent $page_intf -name "panels1" -layout vertical]

        set pages1 [ipgui::add_page $IPINST -parent $panels1 -name "AXI Streaming Signals" -layout vertical] 

     	for {set i 0} {$i <= 15} {incr i} {

        #ipgui::add_param  $IPINST  -parent $page1 -name C_SLOT_${i}_INTF_TYPE -widget ComboBox 
        ipgui::add_param  $IPINST  -parent $page1 -name C_SLOT_${i}_AXI_AW_SEL -widget checkBox 
        set_property display_name "Monitor AXI Write Address Channel signals" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL -of $IPINST]

        ipgui::add_param  $IPINST  -parent $page1c -name C_SLOT_${i}_AXI_AR_SEL -widget checkBox
        set_property display_name "Monitor AXI Read Address Channel signals" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL -of $IPINST]
 
        ipgui::add_param  $IPINST  -parent $page1a -name C_SLOT_${i}_AXI_W_SEL -widget checkBox 
        set_property display_name "Monitor AXI Write Data Channel signals" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL -of $IPINST]
 
        ipgui::add_param  $IPINST  -parent $page1d -name C_SLOT_${i}_AXI_R_SEL -widget checkBox
        set_property display_name "Monitor AXI Read Data Channel signals" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL -of $IPINST]
  
        ipgui::add_param  $IPINST  -parent $page1b -name C_SLOT_${i}_AXI_B_SEL -widget checkBox 
        set_property display_name "Monitor AXI Write Response Channel signals" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL -of $IPINST]


        ipgui::add_param  $IPINST  -parent $page1 -name C_SLOT_${i}_AXI_AW_SEL_DATA -widget checkBox 
        set_property display_name "Configure AXI Write Address Channel signals as Data" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_DATA -of $IPINST]

        ipgui::add_param  $IPINST  -parent $page1c -name C_SLOT_${i}_AXI_AR_SEL_DATA -widget checkBox
        set_property display_name "Configure AXI Read Address Channel signals as Data" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_DATA -of $IPINST]
  
        ipgui::add_param  $IPINST  -parent $page1a -name C_SLOT_${i}_AXI_W_SEL_DATA -widget checkBox 
        set_property display_name "Configure AXI Write Data Channel signals as Data" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_DATA -of $IPINST]
 
        ipgui::add_param  $IPINST  -parent $page1d -name C_SLOT_${i}_AXI_R_SEL_DATA -widget checkBox
        set_property display_name "Configure AXI Read Data Channel signals as Data" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_DATA -of $IPINST]
  
        ipgui::add_param  $IPINST  -parent $page1b -name C_SLOT_${i}_AXI_B_SEL_DATA -widget checkBox 
        set_property display_name "Configure AXI Write Response Channel signals as Data" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_DATA -of $IPINST]

        ipgui::add_param  $IPINST  -parent $page1 -name C_SLOT_${i}_AXI_AW_SEL_TRIG -widget checkBox 
        set_property display_name "Configure AXI Write Address Channel signals as Trigger" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_TRIG -of $IPINST]
# 	set sttxta1 [ipgui::add_dynamic_text $IPINST -parent $Page1 -name st15 -tclproc texta1_updated ]

        ipgui::add_param  $IPINST  -parent $page1c -name C_SLOT_${i}_AXI_AR_SEL_TRIG -widget checkBox
        set_property display_name "Configure AXI Read Address Channel signals as Trigger" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_TRIG -of $IPINST]
# 	set sttxta2 [ipgui::add_dynamic_text $IPINST -parent $Page1c -name st15 -tclproc texta2_updated ]
  
        ipgui::add_param  $IPINST  -parent $page1a -name C_SLOT_${i}_AXI_W_SEL_TRIG -widget checkBox 
        set_property display_name "Configure AXI Write Data Channel signals as Trigger" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_TRIG -of $IPINST]
# 	set sttxta3 [ipgui::add_dynamic_text $IPINST -parent $Page1a -name st15 -tclproc texta3_updated ]
 
        ipgui::add_param  $IPINST  -parent $page1d -name C_SLOT_${i}_AXI_R_SEL_TRIG -widget checkBox
        set_property display_name "Configure AXI Read Data Channel signals as Trigger" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_TRIG -of $IPINST]
# 	set sttxta4 [ipgui::add_dynamic_text $IPINST -parent $Page1d -name st15 -tclproc texta4_updated ]
  
        ipgui::add_param  $IPINST  -parent $page1b -name C_SLOT_${i}_AXI_B_SEL_TRIG -widget checkBox 
        set_property display_name "Configure AXI Write Response Channel signals as Trigger" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_TRIG -of $IPINST]
# 	set sttxta5 [ipgui::add_dynamic_text $IPINST -parent $Page1b -name st15 -tclproc texta5_updated ]
        

        ipgui::add_param  $IPINST  -parent $pages1 -name C_SLOT_${i}_AXI_DATA_SEL -widget checkBox
        set_property display_name "Configure AXIS signals as Data" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_DATA_SEL -of $IPINST]
        ipgui::add_param  $IPINST  -parent $pages1 -name C_SLOT_${i}_AXI_TRIG_SEL -widget checkBox 
        set_property display_name "Configure AXIS signals as Trigger" [ipgui::get_guiparamspec C_SLOT_${i}_AXI_TRIG_SEL -of $IPINST]

####

	
    }
        ipgui::add_static_text  $IPINST -parent $page1c -name st1c -text "Read Address Channel arid, arvalid and arready signals are configured as Data & Trigger "
        ipgui::add_static_text  $IPINST -parent $page1d -name st1d -text "Read Data Channel rid, rvalid and rready signals are configured as Data & Trigger "
        ipgui::add_static_text  $IPINST -parent $page1 -name st1 -text "Write Address Channel awid, awvalid and awready signals are configured as Data & Trigger "
        ipgui::add_static_text  $IPINST -parent $page1a -name st1a -text "Write Data Channel wid (AXI3), wvalid and wready signals are configured as Data & Trigger "
        ipgui::add_static_text  $IPINST -parent $page1b -name st1b -text "Write Response Channel bid, bvalid and bready signals are configured as Data & Trigger "

     
      for {set i 0} {$i <= 15} {incr i} {
        set panel0a_t [ipgui::add_panel $IPINST -parent $page_intf -name "panel_options_t_$i" -layout vertical ]

	    ipgui::add_param  $IPINST  -parent $panel0a_t -name C_SLOT_${i}_AXI_AWUSER_WIDTH -widget comboBox 
	    ipgui::add_param  $IPINST  -parent $panel0a_t -name C_SLOT_${i}_AXI_WUSER_WIDTH -widget comboBox 
	    ipgui::add_param  $IPINST  -parent $panel0a_t -name C_SLOT_${i}_AXI_BUSER_WIDTH -widget comboBox 
		ipgui::add_param  $IPINST  -parent $panel0a_t -name C_SLOT_${i}_AXI_ARUSER_WIDTH -widget comboBox 
	    ipgui::add_param  $IPINST  -parent $panel0a_t -name C_SLOT_${i}_AXI_RUSER_WIDTH -widget comboBox 

      }
  # Resource estimates
  #set Resource_Estimates_tab [ipgui::add_page  $IPINST  -left -name "Resources"]
  #set_property default_page "Resources" [ipgui::get_canvasspec -of $IPINST]



  #set Resource_Estimates [ipgui::add_panel $IPINST -parent $Resource_Estimates_tab -name "Resource Graph" -layout horizontal]
  #set_property tooltip {<html>Here the resource estimates for frequency, <br/>area and performance are shown.</html>} $Resource_Estimates
  #set Resource_Graph [ipgui::add_graph $IPINST  -name Resource_Graph -display_name "Resource Estimates" -type "BAR" -parent $Resource_Estimates]
  
  #ipgui::add_xaxis -parent $Resource_Graph -value "0,1" -name " "
  #ipgui::add_yaxis -parent $Resource_Graph -value "0,100" -name "Percent (%)" -step 10
  #set_property width 30 $Resource_Graph

  #set BRAM_LUT_USAGE [ipgui::add_group $IPINST -parent $Resource_Estimates_tab -name "Resource Usage" -layout horizontal]
  #set_property tooltip {<html>These values are the total number of Block RAMs and LUTs used by System debug core.</html>} $BRAM_LUT_USAGE


  #set BRAM_Text [ipgui::add_dynamic_text $IPINST -name BRAMs -parent $BRAM_LUT_USAGE -tclproc gui_set_bram_size]
  #set_property tooltip {This value is the total number of Block RAMs used by System Debug core.} $BRAM_Text

}

EvalSubstituting {ARGS} {
proc text100_updated {IPINST PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_ADV_TRIGGER PARAM_VALUE.ALL_PROBE_SAME_MU PARAM_VALUE.ALL_PROBE_SAME_MU_CNT $ARGS} {

	set num_probe [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
	set strg_qual [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}]
	set tran_strg [get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]
	set adv_trig [get_property value ${PARAM_VALUE.C_ADV_TRIGGER}]
	set same_mu [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}]
	set same_mu_cnt [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}]
    set mon_type [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    set tot_num_comp 0
    set comp_val 0
    set probe_limit 0
	for { set ar 0 } { $ar <= 1023 } { incr ar } {
	  if {$ar < $num_probe} {
		set this "PARAM_VALUE.C_PROBE${ar}_MU_CNT"
		set comp_val [get_property value [set $this]]
		set tot_num_comp [expr $tot_num_comp+$comp_val]
	
	  }
        if {$tot_num_comp < 1024} {
          set probe_limit $ar
        }
	}

    if { $same_mu == "true" || $same_mu == "TRUE" } {
      if {$strg_qual == [expr 1] } {
        if { $tran_strg == [expr 1]} {
          set val [expr [expr 1024 / $same_mu_cnt] - 1]
        } else {
          set val [expr 1024 / $same_mu_cnt ]
        }
	  } else {
        set val [expr 1024 / $same_mu_cnt ]
      }
   	  return "\[1...$val\]"
    } else {

        if {$tot_num_comp < 1025 } {
          set bal_mu [expr 1024 - $tot_num_comp]
          if { $tran_strg == [expr 1]} {
            set val [expr [expr $bal_mu + $num_probe] - 1 ]
          } else {
            set val [expr $bal_mu + $num_probe] 
          }
        } else {
          set val [expr 0] 
          set max_comp [expr 1024]
    	  for { set i 0 } { $i < $num_probe } { incr i } {
	        if {$max_comp > [expr 0]} {
		      set this "PARAM_VALUE.C_PROBE${i}_MU_CNT"
  		      set comp_val [get_property value [set $this]]
		      set max_comp [expr $max_comp-$comp_val]

	          set val [expr $val + 1]
	        }
	      }
          if { $tran_strg == [expr 1]} {
            set val [expr $val - 1]
          }
        }
        
        return "\[1...$val\]"
      
    }

}
} 

proc init_meta_params {IPINST} {
#	add_meta_param $IPINST -name bram_bits -type  string
#    add_meta_param $IPINST -name slot_intf_type -type list 
#    add_meta_param $IPINST -name get_current_slot -type string 
}



EvalSubstituting { ARGS_ALL} {

proc update_gui { IPINST PARAM_VALUE.C_DATA_DEPTH PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_NUM_OF_PROBES $ARGS_ALL } {
#variable bram_size

#update_bram_bits
 set num_probes [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
 set num_slots [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]
 set mon_mode [get_property value ${PARAM_VALUE.C_MON_TYPE}]
 set data_depth [get_property value ${PARAM_VALUE.C_DATA_DEPTH}]
# set w_prop [get_property value ${PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION}]

 set native_sizek [expr $data_depth / 1024]
 set width_val 0
 # initialized with 1 as 1 bit is required for trigger mark
 set total_native_bits [expr 0]
 set type "0" 
 set p [expr 0]

  if { $mon_mode != "Interface_Monitor" } {

    for {set j 0} {$j < $num_probes} {incr j} {
        set type "PARAM_VALUE.C_PROBE${j}_TYPE"
        set width "PARAM_VALUE.C_PROBE${j}_WIDTH"
        set type_val [get_property value [set $type]]
        set width_val [get_property value [set $width]]
        if {$type_val != [expr 2]} {
          set total_native_bits [expr $total_native_bits + $width_val]
        }  

    }

  }

set total_slot_probes [expr $total_native_bits]

if { $mon_mode != "Net_Probes" } {

###########################################################################################################################################
###########################################################################################################################################  

set i [expr 0]
set vlnv ""
set vbresp ""
set vburst ""
set vcache ""
set vlock ""
set vprot ""
set vqos ""
set vregion ""
set vrresp ""
set vwstrb ""
set vtstrb ""
set vtkeep ""
set aw "32"
set dw "32"
set idw "32"
set tdw "32"
set tidw "32"
set tuw "32"
set tdestw "32"
set aruw 0
set ruw  0
set awuw 0
set wuw 0
set buw 0 
set sum_axi4 0
set sum_axis 0
set apc_bits 0
set intf_probe_cnt 0 
set txn_trk_bits [expr 0]
set intf "xilinx.com:interface:aximm_rtl:1.0"

#set interfaceStruct [get_interface_information]
    set interfaceStruct ""
#send_msg INFO 23 "843 $interfaceStruct"

foreach interface [dict keys $interfaceStruct] {
   if {$interface != "RST.resetn" && $interface != "CLK.clk" } {
     set interfaceInfo [dict get $interfaceStruct $interface]
     foreach prop [dict keys $interfaceInfo] {
       if { $prop == "ABSTRACTION_TYPE_VLNV" || $prop == "parameters" || $prop == "ports"} {  
       ##each prop key is the vlnv of interfaces
       if { $prop == "ABSTRACTION_TYPE_VLNV"} {
         set vlnv [dict get $interfaceInfo $prop]
       }
       if {$i < 16 } {
         set apc "PARAM_VALUE.C_SLOT_${i}_APC_EN"
         set apc_e [get_property value [set $apc]]
         
         set apc_sts "PARAM_VALUE.C_SLOT_${i}_APC_STS_EN"
         set apc_sts_e  [get_property value [set $apc_sts]]

         set txn_cntr "PARAM_VALUE.C_SLOT_${i}_TXN_CNTR_EN"
         set txn_cntr_e  [get_property value [set $txn_cntr]]

         set rdtxn_cnt "PARAM_VALUE.C_SLOT_${i}_MAX_RD_BURSTS"
         set rdtxn_cntr [get_property value [set $rdtxn_cnt]]
         set rdtxn_cntr_w [expr int(log($rdtxn_cntr) /log(2)) + 1]

         set wrtxn_cnt "PARAM_VALUE.C_SLOT_${i}_MAX_WR_BURSTS"
         set wrtxn_cntr [get_property value [set $wrtxn_cnt]]
         set wrtxn_cntr_w [expr int(log($wrtxn_cntr) /log(2)) + 1]
         
         if {$txn_cntr_e == 1 } {
           set txn_trk_bits [expr $rdtxn_cntr_w + $wrtxn_cntr_w]
         } else {
           set txn_trk_bits [expr 0]
         }         


         set awsel "PARAM_VALUE.C_SLOT_${i}_AXI_AW_SEL_DATA"
         set aw_sel [get_property value [set $awsel]]
         
         set arsel "PARAM_VALUE.C_SLOT_${i}_AXI_AR_SEL_DATA"
         set ar_sel [get_property value [set $arsel]]
        
         set wsel "PARAM_VALUE.C_SLOT_${i}_AXI_W_SEL_DATA"
         set w_sel [get_property value [set $wsel]]
        
         set rsel "PARAM_VALUE.C_SLOT_${i}_AXI_R_SEL_DATA"
         set r_sel [get_property value [set $rsel]]
         
         set bsel "PARAM_VALUE.C_SLOT_${i}_AXI_B_SEL_DATA"
         set b_sel [get_property value [set $bsel]]
        
         set protocol "PARAM_VALUE.C_SLOT_${i}_AXI_PROTOCOL"
         set proto [get_property value [set $protocol]] 
         
         set addr_width "PARAM_VALUE.C_SLOT_${i}_AXI_ADDR_WIDTH"
         set aw_w [get_property value [set $addr_width]]

         set data_width "PARAM_VALUE.C_SLOT_${i}_AXI_DATA_WIDTH"
         set dw_w [get_property value [set $data_width]]
      
         set id_width "PARAM_VALUE.C_SLOT_${i}_AXI_ID_WIDTH"
         set idw_w [get_property value [set $id_width]] 

         set awuser_width "PARAM_VALUE.C_SLOT_${i}_AXI_AWUSER_WIDTH"
         set awuw_w [get_property value [set $awuser_width]]
        
         set wuser_width "PARAM_VALUE.C_SLOT_${i}_AXI_WUSER_WIDTH"
         set wuw_w [get_property value [set $wuser_width]]
        
         set buser_width "PARAM_VALUE.C_SLOT_${i}_AXI_BUSER_WIDTH"
         set buw_w [get_property value [set $buser_width]] 
        
         set aruser_width "PARAM_VALUE.C_SLOT_${i}_AXI_ARUSER_WIDTH"
         set aruw_w [get_property value [set $aruser_width]] 
        
         set ruser_width "PARAM_VALUE.C_SLOT_${i}_AXI_RUSER_WIDTH"
         set ruw_w [get_property value [set $ruser_width]] 
        
         set tdata_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TDATA_WIDTH"
         set tdw_w [get_property value [set $tdata_width]]       

         set tid_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TID_WIDTH"
         set tidw_w [get_property value [set $tid_width]] 

         set tuser_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TUSER_WIDTH"
         set tuw_w [get_property value [set $tuser_width]] 

         set tdest "PARAM_VALUE.C_SLOT_${i}_AXIS_TDEST_WIDTH"
         set tdestw_w [get_property value [set $tdest]]

         set axis_data "PARAM_VALUE.C_SLOT_${i}_AXI_DATA_SEL"
         set axis_d [get_property value [set $axis_data]]

         set intf_type "PARAM_VALUE.C_SLOT_${i}_INTF_TYPE" 
         set intf [get_property value [set $intf_type]]

         set dt_type "PARAM_VALUE.C_SLOT_${i}_TYPE" 
         set dt_i [get_property value [set $dt_type]]
         
         set vwstrb ""
         set vtstrb ""
       ## AXI interfaces
       if {$vlnv == "xilinx.com:interface:aximm_rtl:1.0" || $vlnv == "xilinx.com:interface:axis_rtl:1.0"} {
         if { $prop == "parameters" } {

           set params [dict get $interfaceInfo $prop]
           foreach keyValue [dict key $params] {

             if { $keyValue == "HAS_BRESP"} { 
               set vbresp [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_BURST"} { 
               set vburst [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_CACHE"} { 
               set vcache [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_LOCK"} { 
               set vlock [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_PROT"} { 
               set vprot [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_QOS"} { 
               set vqos [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_REGION"} { 
               set vregion [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_RRESP"} { 
               set vrresp [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_WSTRB"} { 
               set vwstrb [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TKEEP"} { 
               set vtkeep [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TLAST"} { 
               set vtast [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TREADY"} { 
               set vtready [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TSTRB"} { 
               set vtstrb [dict get [dict get $params $keyValue] VALUE]
             }
          
            
             if { $keyValue == "ARUSER_WIDTH"} { 
               set aruw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "RUSER_WIDTH"} { 
               set ruw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "AWUSER_WIDTH"} { 
               set awuw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "WUSER_WIDTH"} { 
               set wuw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "BUSER_WIDTH"} { 
               set buw [dict get [dict get $params $keyValue] VALUE]
             }
                         
             if {$aw_w == "AUTO"} { 
               if { $keyValue == "ADDR_WIDTH"} { 
                 set aw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set aw $aw_w
             }
             
             if {$dw_w == "AUTO"} { 
               if { $keyValue == "DATA_WIDTH"} { 
                 set dw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set dw $dw_w
             }
             set w_strb [expr $dw / 8]
             
             if {$idw_w == "AUTO" } { 
               if { $keyValue == "ID_WIDTH"} { 
                 set idw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set idw $idw_w
             }

             if {$tdw_w == "AUTO" } { 
               if { $keyValue == "TDATA_NUM_BYTES"} { 
                 set tdw [expr [dict get [dict get $params $keyValue] VALUE] * 8]
               }
             } else {
               set tdw $tdw_w
             }
             set tstrb_w [expr $tdw / 8]
            

             if {$tidw_w == "AUTO" } { 
               if { $keyValue == "TID_WIDTH"} { 
                 set tidw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set tidw $tidw_w
             }

             if {$tuw_w == "AUTO" } { 
               if { $keyValue == "TUSER_WIDTH"} { 
                 set tuw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set tuw $tuw_w
             }
            
             if {$tdestw_w == "AUTO" } { 
               if { $keyValue == "TDEST_WIDTH"} { 
                 set tdestw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set tdestw $tdestw_w
             }  

             if {$vtkeep == [expr 1]} {
              set tkeep $tstrb_w
             } else {
              set tkeep [expr 0]
             }
             if {$vtstrb == [expr 1]} {
              set tstrb $tstrb_w
             } else {
              set tstrb [expr 0]
             }
             if {$vbresp == [expr 1]} {
              set bresp [expr 2]
             } else {
              set bresp [expr 0]
             }
             if {$vburst == [expr 1] && $proto != "AXI4LITE"} {
              set burst [expr 2]
             } else {
              set burst [expr 0]
             }
             if {$vcache == [expr 1] && $proto != "AXI4LITE"} {
              set cache [expr 4]
             } else {
              set cache [expr 0]
             }
             if {$vlock == [expr 1] && $proto != "AXI4LITE"} {
              if {$proto == "AXI3" } {
                set lock [expr 2]
              } else {
                set lock [expr 1]
              }
             } else {
              set lock [expr 0]
             }
             if {$vprot == [expr 1]} {
              set prot [expr 3]
             } else {
              set prot [expr 0]
             }
             if {$vqos == [expr 1] && $proto != "AXI4LITE"} {
              set qos [expr 4]
             } else {
              set qos [expr 0]
             }
             if {$vregion == [expr 1]} {
              if {$proto == "AXI4" } {
                set region [expr 4]
              } else {
                set region [expr 0]
              }
             } else {
              set region [expr 0]
             }
             if {$vrresp == [expr 1]} {
              set rresp [expr 2]
             } else {
              set rresp [expr 0]
             }
             if {$vwstrb == [expr 1]} {
              set wstrb $w_strb
             } else {
              set wstrb [expr 0]
             }
            
             if { $proto != "AXI4LITE"} {
              set size [expr 3]
             } else {
              set size [expr 0]
             }
            
             if {$proto == "AXI4LITE"} {
               set axi4_c [expr 10]
             } else {   
               set axi4_c [expr 12]
             }
             
             if {$proto == "AXI4"} {
               set len [expr 8]
             } elseif {$proto == "AXI3"} {   
               set len [expr 4]
             } else {
               set len [expr 0]
             }
             if {$proto == "AXI3"} {
               set wid $idw
             } else {   
               set wid [expr 0]
             }
             
             if {$aw_sel == 1} { 
               set axi4_aw [expr $burst + $cache + $lock + $prot + $qos + $region + $idw + $awuw + $len + $size + $aw]
             } else {
               set axi4_aw [expr $idw]
             }
             
             if {$ar_sel == 1} { 
               set axi4_ar [expr $burst + $cache + $lock + $prot + $qos + $region + $idw + $awuw + $len + $size + $aw]
             } else {
               set axi4_ar [expr $idw]
             }
             
             if {$w_sel == 1} { 
               set axi4_w [expr $wid + $wstrb + $wuw + $dw]
             } else {
               set axi4_w [expr $wid]
             }
             
             if {$r_sel == 1} { 
               set axi4_r [expr $ruw + $dw + $rresp + $idw]
             } else {
               set axi4_r [expr $idw]
             }
             
             if {$b_sel == 1} { 
               set axi4_b [expr $bresp + $idw + $buw]
             } else {
               set axi4_b [expr $idw]
             }
             
             
             if {$apc_e == [expr 1] } {
               if {$apc_sts_e == [expr 1] } {
                 set apc_bits [expr 98]
               } else {
                 set apc_bits [expr 1]
               }
             } else {
               set apc_bits [expr 0]
             }
            
             set sum_axi4 [expr $axi4_aw + $axi4_ar + $axi4_w + $axi4_r + $axi4_b + $axi4_c ] 
            
            
             if {$axis_d == [expr 1]} {
               set sum_axis [expr $tdw + $tidw + $tuw + $tstrb + $tkeep + $tdestw + 3]
             } else {
               set sum_axis [expr 3]
             } 
            
            
             if {$apc_e == [expr 1] } {
               if {$apc_sts_e == [expr 1] } {
                 set apc_bits_s [expr 12]
               } else {
                 set apc_bits_s [expr 1]
               }
             } else {
               set apc_bits_s [expr 0]
             }
           }

         }

         ## Non-AXI interfaces 
         } elseif {$vlnv != "xilinx.com:interface:aximm_rtl:1.0" && $vlnv != "xilinx.com:interface:axis_rtl:1.0" && $vlnv != ""} {

           if { $prop == "ports" } {
             set ports [dict get $interfaceInfo $prop]
             foreach keyValue [dict key $ports] {
               set intf_probe_cnt [expr [expr [dict get [dict get $ports $keyValue] PHYSICAL_LEFT]+1] + $intf_probe_cnt]
             }
           }

         }
       }
      }
     }
     
     set i [expr $i + 1]

  ################# ESTIMATION LOGIC ####################
      
      # The following code selects the appropriate set of control or data signals for each protocol
      if {$vlnv == "xilinx.com:interface:aximm_rtl:1.0"} {
        set num_slot_bits [expr $sum_axi4 + $apc_bits + $txn_trk_bits]
      } elseif {$vlnv == "xilinx.com:interface:axis_rtl:1.0"} {
        set num_slot_bits [expr $sum_axis + $apc_bits_s]
      } elseif {$vlnv != "xilinx.com:interface:aximm_rtl:1.0" && $vlnv != "xilinx.com:interface:axis_rtl:1.0" && $vlnv != ""} {
        if {$dt_i != [expr 2] } {
          set num_slot_bits $intf_probe_cnt
        } else {
          set num_slot_bits [expr 0]
        }
      }
      set total_slot_probes [expr $total_slot_probes + $num_slot_bits] 
      ################# ESTIMATION ENDS #####################

   
    }
  }
  
}
##############################################
#set total_slot_probes 100
set size36 [expr $native_sizek * $total_slot_probes / 36 ]
set size36sub [expr [expr $native_sizek * $total_slot_probes ] - [expr 36 * $size36]]
set size18 [expr $size36sub / 18 ]
set size18sub [expr [expr $size36sub ] - [expr $size18 * 18]]


if {$size36sub > [expr 18] && $size18sub > [expr 0]} {
  set size [expr $size36 + 1]
} elseif { $size36sub < [expr 18] && $size18sub > [expr 0] } {
  set size [expr $size36 + 0.5]
} elseif { $size36sub == [expr 18] && $size18sub == [expr 0] } {
  set size [expr $size36 + 0.5]
} else {
  set size [expr $size36]
}

set bram_size [expr $size]

#gui_set_resource_data $IPINST $bram_size

}



#########################################################
#########################################################
#proc gui_set_bram_size  {IPINST PARAM_VALUE.C_DATA_DEPTH PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_NUM_OF_PROBES $ARGS_ALL PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION} {
##update_bram_bits
# set num_probes [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
# set num_slots [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]
# set mon_mode [get_property value ${PARAM_VALUE.C_MON_TYPE}]
# set data_depth [get_property value ${PARAM_VALUE.C_DATA_DEPTH}]
# set w_prop [get_property value ${PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION}]
#
# set native_sizek [expr $data_depth / 1024]
# set width_val 0
# # initialized with 1 as 1 bit is required for trigger mark
# set total_native_bits [expr 0]
# set type "0" 
# set p [expr 0]
#
#  if { $mon_mode != "Interface_Monitor" } {
#
#    for {set j 0} {$j < $num_probes} {incr j} {
#        set type "PARAM_VALUE.C_PROBE${j}_TYPE"
#        set width "PARAM_VALUE.C_PROBE${j}_WIDTH"
#        set type_val [get_property value [set $type]]
#        set width_val [get_property value [set $width]]
#        if {$type_val != [expr 2]} {
#          set total_native_bits [expr $total_native_bits + $width_val]
#        }  
#
#    }
#
#  }
#
#set total_slot_probes [expr $total_native_bits]
#
#if { $mon_mode != "Net_Probes" } {
#
############################################################################################################################################
############################################################################################################################################  
#
#set i [expr 0]
#set vlnv ""
#set vbresp ""
#set vburst ""
#set vcache ""
#set vlock ""
#set vprot ""
#set vqos ""
#set vregion ""
#set vrresp ""
#set vwstrb ""
#set vtstrb ""
#set vtkeep ""
#set aw "32"
#set dw "32"
#set idw "32"
#set tdw "32"
#set tidw "32"
#set tuw "32"
#set tdestw "32"
#set aruw 0
#set ruw  0
#set awuw 0
#set wuw 0
#set buw 0 
#set sum_axi4 0
#set sum_axis 0
#set apc_bits 0
#set intf_probe_cnt 0 
#set txn_trk_bits [expr 0]
#set intf "xilinx.com:interface:aximm_rtl:1.0"
#
#set interfaceStruct [get_interface_information]
##send_msg INFO 23 "843 $interfaceStruct"
#
#foreach interface [dict keys $interfaceStruct] {
#   if {$interface != "RST.resetn" && $interface != "CLK.clk" } {
#     set interfaceInfo [dict get $interfaceStruct $interface]
#     foreach prop [dict keys $interfaceInfo] {
#       if { $prop == "ABSTRACTION_TYPE_VLNV" || $prop == "parameters" || $prop == "ports"} {  
#       ##each prop key is the vlnv of interfaces
#       if { $prop == "ABSTRACTION_TYPE_VLNV"} {
#         set vlnv [dict get $interfaceInfo $prop]
#       }
#       if {$i < 16 } {
#         set apc "PARAM_VALUE.C_SLOT_${i}_APC_EN"
#         set apc_e [get_property value [set $apc]]
#         
#         set apc_sts "PARAM_VALUE.C_SLOT_${i}_APC_STS_EN"
#         set apc_sts_e  [get_property value [set $apc_sts]]
#
#         set txn_cntr "PARAM_VALUE.C_SLOT_${i}_TXN_CNTR_EN"
#         set txn_cntr_e  [get_property value [set $txn_cntr]]
#
#         set rdtxn_cnt "PARAM_VALUE.C_SLOT_${i}_MAX_RD_BURSTS"
#         set rdtxn_cntr [get_property value [set $rdtxn_cnt]]
#         set rdtxn_cntr_w [expr int(log($rdtxn_cntr) /log(2)) + 1]
#
#         set wrtxn_cnt "PARAM_VALUE.C_SLOT_${i}_MAX_WR_BURSTS"
#         set wrtxn_cntr [get_property value [set $wrtxn_cnt]]
#         set wrtxn_cntr_w [expr int(log($wrtxn_cntr) /log(2)) + 1]
#         
#         if {$txn_cntr_e == 1 } {
#           set txn_trk_bits [expr $rdtxn_cntr_w + $wrtxn_cntr_w]
#         } else {
#           set txn_trk_bits [expr 0]
#         }         
#
#
#         set awsel "PARAM_VALUE.C_SLOT_${i}_AXI_AW_SEL_DATA"
#         set aw_sel [get_property value [set $awsel]]
#         
#         set arsel "PARAM_VALUE.C_SLOT_${i}_AXI_AR_SEL_DATA"
#         set ar_sel [get_property value [set $arsel]]
#        
#         set wsel "PARAM_VALUE.C_SLOT_${i}_AXI_W_SEL_DATA"
#         set w_sel [get_property value [set $wsel]]
#        
#         set rsel "PARAM_VALUE.C_SLOT_${i}_AXI_R_SEL_DATA"
#         set r_sel [get_property value [set $rsel]]
#         
#         set bsel "PARAM_VALUE.C_SLOT_${i}_AXI_B_SEL_DATA"
#         set b_sel [get_property value [set $bsel]]
#        
#         set protocol "PARAM_VALUE.C_SLOT_${i}_AXI_PROTOCOL"
#         set proto [get_property value [set $protocol]] 
#         
#         set addr_width "PARAM_VALUE.C_SLOT_${i}_AXI_ADDR_WIDTH"
#         set aw_w [get_property value [set $addr_width]]
#
#         set data_width "PARAM_VALUE.C_SLOT_${i}_AXI_DATA_WIDTH"
#         set dw_w [get_property value [set $data_width]]
#      
#         set id_width "PARAM_VALUE.C_SLOT_${i}_AXI_ID_WIDTH"
#         set idw_w [get_property value [set $id_width]] 
#
#         set awuser_width "PARAM_VALUE.C_SLOT_${i}_AXI_AWUSER_WIDTH"
#         set awuw_w [get_property value [set $awuser_width]]
#        
#         set wuser_width "PARAM_VALUE.C_SLOT_${i}_AXI_WUSER_WIDTH"
#         set wuw_w [get_property value [set $wuser_width]]
#        
#         set buser_width "PARAM_VALUE.C_SLOT_${i}_AXI_BUSER_WIDTH"
#         set buw_w [get_property value [set $buser_width]] 
#        
#         set aruser_width "PARAM_VALUE.C_SLOT_${i}_AXI_ARUSER_WIDTH"
#         set aruw_w [get_property value [set $aruser_width]] 
#        
#         set ruser_width "PARAM_VALUE.C_SLOT_${i}_AXI_RUSER_WIDTH"
#         set ruw_w [get_property value [set $ruser_width]] 
#        
#         set tdata_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TDATA_WIDTH"
#         set tdw_w [get_property value [set $tdata_width]]       
#
#         set tid_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TID_WIDTH"
#         set tidw_w [get_property value [set $tid_width]] 
#
#         set tuser_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TUSER_WIDTH"
#         set tuw_w [get_property value [set $tuser_width]] 
#
#         set tdest "PARAM_VALUE.C_SLOT_${i}_AXIS_TDEST_WIDTH"
#         set tdestw_w [get_property value [set $tdest]]
#
#         set axis_data "PARAM_VALUE.C_SLOT_${i}_AXI_DATA_SEL"
#         set axis_d [get_property value [set $axis_data]]
#
#         set intf_type "PARAM_VALUE.C_SLOT_${i}_INTF_TYPE" 
#         set intf [get_property value [set $intf_type]]
#
#         set dt_type "PARAM_VALUE.C_SLOT_${i}_TYPE" 
#         set dt_i [get_property value [set $dt_type]]
#         
#         set vwstrb ""
#         set vtstrb ""
#       ## AXI interfaces
#       if {$vlnv == "xilinx.com:interface:aximm_rtl:1.0" || $vlnv == "xilinx.com:interface:axis_rtl:1.0"} {
#         if { $prop == "parameters" } {
#
#           set params [dict get $interfaceInfo $prop]
#           foreach keyValue [dict key $params] {
#
#             if { $keyValue == "HAS_BRESP"} { 
#               set vbresp [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_BURST"} { 
#               set vburst [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_CACHE"} { 
#               set vcache [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_LOCK"} { 
#               set vlock [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_PROT"} { 
#               set vprot [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_QOS"} { 
#               set vqos [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_REGION"} { 
#               set vregion [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_RRESP"} { 
#               set vrresp [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_WSTRB"} { 
#               set vwstrb [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_TKEEP"} { 
#               set vtkeep [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_TLAST"} { 
#               set vtast [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_TREADY"} { 
#               set vtready [dict get [dict get $params $keyValue] VALUE]
#             }
#             if { $keyValue == "HAS_TSTRB"} { 
#               set vtstrb [dict get [dict get $params $keyValue] VALUE]
#             }
#          
#            
#             if { $keyValue == "ARUSER_WIDTH"} { 
#               set aruw [dict get [dict get $params $keyValue] VALUE]
#             }
#            
#             if { $keyValue == "RUSER_WIDTH"} { 
#               set ruw [dict get [dict get $params $keyValue] VALUE]
#             }
#            
#             if { $keyValue == "AWUSER_WIDTH"} { 
#               set awuw [dict get [dict get $params $keyValue] VALUE]
#             }
#            
#             if { $keyValue == "WUSER_WIDTH"} { 
#               set wuw [dict get [dict get $params $keyValue] VALUE]
#             }
#            
#             if { $keyValue == "BUSER_WIDTH"} { 
#               set buw [dict get [dict get $params $keyValue] VALUE]
#             }
#                         
#             if {$aw_w == "AUTO"} { 
#               if { $keyValue == "ADDR_WIDTH"} { 
#                 set aw [dict get [dict get $params $keyValue] VALUE]
#               }
#             } else {
#               set aw $aw_w
#             }
#             
#             if {$dw_w == "AUTO"} { 
#               if { $keyValue == "DATA_WIDTH"} { 
#                 set dw [dict get [dict get $params $keyValue] VALUE]
#               }
#             } else {
#               set dw $dw_w
#             }
#             set w_strb [expr $dw / 8]
#             
#             if {$idw_w == "AUTO" } { 
#               if { $keyValue == "ID_WIDTH"} { 
#                 set idw [dict get [dict get $params $keyValue] VALUE]
#               }
#             } else {
#               set idw $idw_w
#             }
#
#             if {$tdw_w == "AUTO" } { 
#               if { $keyValue == "TDATA_NUM_BYTES"} { 
#                 set tdw [expr [dict get [dict get $params $keyValue] VALUE] * 8]
#               }
#             } else {
#               set tdw $tdw_w
#             }
#             set tstrb_w [expr $tdw / 8]
#            
#
#             if {$tidw_w == "AUTO" } { 
#               if { $keyValue == "TID_WIDTH"} { 
#                 set tidw [dict get [dict get $params $keyValue] VALUE]
#               }
#             } else {
#               set tidw $tidw_w
#             }
#
#             if {$tuw_w == "AUTO" } { 
#               if { $keyValue == "TUSER_WIDTH"} { 
#                 set tuw [dict get [dict get $params $keyValue] VALUE]
#               }
#             } else {
#               set tuw $tuw_w
#             }
#            
#             if {$tdestw_w == "AUTO" } { 
#               if { $keyValue == "TDEST_WIDTH"} { 
#                 set tdestw [dict get [dict get $params $keyValue] VALUE]
#               }
#             } else {
#               set tdestw $tdestw_w
#             }  
#
#             if {$vtkeep == [expr 1]} {
#              set tkeep $tstrb_w
#             } else {
#              set tkeep [expr 0]
#             }
#             if {$vtstrb == [expr 1]} {
#              set tstrb $tstrb_w
#             } else {
#              set tstrb [expr 0]
#             }
#             if {$vbresp == [expr 1]} {
#              set bresp [expr 2]
#             } else {
#              set bresp [expr 0]
#             }
#             if {$vburst == [expr 1] && $proto != "AXI4LITE"} {
#              set burst [expr 2]
#             } else {
#              set burst [expr 0]
#             }
#             if {$vcache == [expr 1] && $proto != "AXI4LITE"} {
#              set cache [expr 4]
#             } else {
#              set cache [expr 0]
#             }
#             if {$vlock == [expr 1] && $proto != "AXI4LITE"} {
#              if {$proto == "AXI3" } {
#                set lock [expr 2]
#              } else {
#                set lock [expr 1]
#              }
#             } else {
#              set lock [expr 0]
#             }
#             if {$vprot == [expr 1]} {
#              set prot [expr 3]
#             } else {
#              set prot [expr 0]
#             }
#             if {$vqos == [expr 1] && $proto != "AXI4LITE"} {
#              set qos [expr 4]
#             } else {
#              set qos [expr 0]
#             }
#             if {$vregion == [expr 1]} {
#              if {$proto == "AXI4" } {
#                set region [expr 4]
#              } else {
#                set region [expr 0]
#              }
#             } else {
#              set region [expr 0]
#             }
#             if {$vrresp == [expr 1]} {
#              set rresp [expr 2]
#             } else {
#              set rresp [expr 0]
#             }
#             if {$vwstrb == [expr 1]} {
#              set wstrb $w_strb
#             } else {
#              set wstrb [expr 0]
#             }
#            
#             if { $proto != "AXI4LITE"} {
#              set size [expr 3]
#             } else {
#              set size [expr 0]
#             }
#            
#             if {$proto == "AXI4LITE"} {
#               set axi4_c [expr 10]
#             } else {   
#               set axi4_c [expr 12]
#             }
#             
#             if {$proto == "AXI4"} {
#               set len [expr 8]
#             } elseif {$proto == "AXI3"} {   
#               set len [expr 4]
#             } else {
#               set len [expr 0]
#             }
#             if {$proto == "AXI3"} {
#               set wid $idw
#             } else {   
#               set wid [expr 0]
#             }
#             
#             if {$aw_sel == 1} { 
#               set axi4_aw [expr $burst + $cache + $lock + $prot + $qos + $region + $idw + $awuw + $len + $size + $aw]
#             } else {
#               set axi4_aw [expr $idw]
#             }
#             
#             if {$ar_sel == 1} { 
#               set axi4_ar [expr $burst + $cache + $lock + $prot + $qos + $region + $idw + $awuw + $len + $size + $aw]
#             } else {
#               set axi4_ar [expr $idw]
#             }
#             
#             if {$w_sel == 1} { 
#               set axi4_w [expr $wid + $wstrb + $wuw + $dw]
#             } else {
#               set axi4_w [expr $wid]
#             }
#             
#             if {$r_sel == 1} { 
#               set axi4_r [expr $ruw + $dw + $rresp + $idw]
#             } else {
#               set axi4_r [expr $idw]
#             }
#             
#             if {$b_sel == 1} { 
#               set axi4_b [expr $bresp + $idw + $buw]
#             } else {
#               set axi4_b [expr $idw]
#             }
#             
#             
#             if {$apc_e == [expr 1] } {
#               if {$apc_sts_e == [expr 1] } {
#                 set apc_bits [expr 98]
#               } else {
#                 set apc_bits [expr 1]
#               }
#             } else {
#               set apc_bits [expr 0]
#             }
#            
#             set sum_axi4 [expr $axi4_aw + $axi4_ar + $axi4_w + $axi4_r + $axi4_b + $axi4_c ] 
#            
#            
#             if {$axis_d == [expr 1]} {
#               set sum_axis [expr $tdw + $tidw + $tuw + $tstrb + $tkeep + $tdestw + 3]
#             } else {
#               set sum_axis [expr 3]
#             } 
#            
#            
#             if {$apc_e == [expr 1] } {
#               if {$apc_sts_e == [expr 1] } {
#                 set apc_bits_s [expr 12]
#               } else {
#                 set apc_bits_s [expr 1]
#               }
#             } else {
#               set apc_bits_s [expr 0]
#             }
#           }
#
#         }
#
#         ## Non-AXI interfaces 
#         } elseif {$vlnv != "xilinx.com:interface:aximm_rtl:1.0" && $vlnv != "xilinx.com:interface:axis_rtl:1.0" && $vlnv != ""} {
#
#           if { $prop == "ports" } {
#             set ports [dict get $interfaceInfo $prop]
#             foreach keyValue [dict key $ports] {
#               set intf_probe_cnt [expr [expr [dict get [dict get $ports $keyValue] PHYSICAL_LEFT]+1] + $intf_probe_cnt]
#             }
#           }
#
#         }
#       }
#      }
#     }
#     
#     set i [expr $i + 1]
#
#  ################# ESTIMATION LOGIC ####################
#      
#      # The following code selects the appropriate set of control or data signals for each protocol
#      if {$vlnv == "xilinx.com:interface:aximm_rtl:1.0"} {
#        set num_slot_bits [expr $sum_axi4 + $apc_bits + $txn_trk_bits]
#      } elseif {$vlnv == "xilinx.com:interface:axis_rtl:1.0"} {
#        set num_slot_bits [expr $sum_axis + $apc_bits_s]
#      } elseif {$vlnv != "xilinx.com:interface:aximm_rtl:1.0" && $vlnv != "xilinx.com:interface:axis_rtl:1.0" && $vlnv != ""} {
#        if {$dt_i != [expr 2] } {
#          set num_slot_bits $intf_probe_cnt
#        } else {
#          set num_slot_bits [expr 0]
#        }
#      }
#      set total_slot_probes [expr $total_slot_probes + $num_slot_bits] 
#      ################# ESTIMATION ENDS #####################
#
#   
#    }
#  }
#  
#}
###############################################
##set total_slot_probes 100
#set size36 [expr $native_sizek * $total_slot_probes / 36 ]
#set size36sub [expr [expr $native_sizek * $total_slot_probes ] - [expr 36 * $size36]]
#set size18 [expr $size36sub / 18 ]
#set size18sub [expr [expr $size36sub ] - [expr $size18 * 18]]
#
#
#if {$size36sub > [expr 18] && $size18sub > [expr 0]} {
#  set size [expr $size36 + 1]
#} elseif { $size36sub < [expr 18] && $size18sub > [expr 0] } {
#  set size [expr $size36 + 0.5]
#} elseif { $size36sub == [expr 18] && $size18sub == [expr 0] } {
#  set size [expr $size36 + 0.5]
#} else {
#  set size [expr $size36]
#}
#
#set bram_size [expr $size]
#
#return "<h3>BRAM Slice:  <b>${bram_size}</b></h3>"
#
#}

} 0



#proc gui_set_resource_data {IPINST bram_size} {
##variable bram_size
#
#  set Resource_Graph [ipgui::get_graphspec "Resource_Graph" -of $IPINST]
# 
# #set bram_size [get_metaparam_value bram_bits] 
#  
#  set area_tooltip {<html><p>This value is the estimated area percentage in BRAMs relative<br/>to the maximum area using this architecture, which gives an<br/>indication of the relative System Debug Core area that can be achieved<br/>with the current settings.</p><br/><p><i>Please note that this is an estimate, which can deviate up to 5%<br/>from the actual value, and should not be taken as a guarantee that<br/>the implemented area matches this value</i>.</p></html>}
#  
#
##  set bram_size [get_metaparam_value bram_bits]
#  set max_bram_size [xit::get_device_data D_BRAM_COUNT -of [xit::current_scope]] 
#  set area_value [expr $bram_size * 100 / $max_bram_size]
##send_msg INFO 23 "43 ------ $bram_size $max_bram_size $area_value"
#
#  if {[expr $bram_size] > [expr $max_bram_size] } {
#    ipgui::add_graph_data -name "BRAM" -parent $Resource_Graph -color "RED" -list "0 $area_value" -tooltip $area_tooltip
#  } else {
#    ipgui::add_graph_data -name "BRAM" -parent $Resource_Graph -color "GRAY" -list "0 $area_value" -tooltip $area_tooltip
#  }
# }


######################################################################################################################
######################################################################################################################
######################################################################################################################
EvalSubstituting { ARGS } {
proc validate_PARAM_VALUE.C_PROBE0_WIDTH { PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_DATA_DEPTH PARAM_VALUE.EN_BRAM_DRC $ARGS } {
    set total 0
    set thisvalue 0
    set tot_num_comp 0
    set comp_val 0
    set np [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
	for { set ar 0 } { $ar <= 1023 } { incr ar } {
	    if {$ar < $np} {
		set this "PARAM_VALUE.C_PROBE${ar}_WIDTH"
		set thisvalue [get_property value [set $this]]
		set total [expr $total+$thisvalue]
	
	    }
	}
    if { $total > 65536 } {
	set_property errmsg "Total width of all probes cannot exceed 65536"  ${PARAM_VALUE.C_PROBE0_WIDTH}
	return false
    }
    if {[get_property value ${PARAM_VALUE.EN_BRAM_DRC}] == "true"} {
     set bram_count 0
     set devicefamily [get_project_property FAMILY]
  set sum 0
  set num_of_prb [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
  set num_of_ports [expr $num_of_prb - 1]

  foreach i [range 0 $num_of_ports] {
   EvalSubstituting {i} {
        set probe${i}_width [get_property value ${PARAM_VALUE.C_PROBE$i_WIDTH}]
        set sum [expr $sum + ${probe$i_width}]
    } 0
   }
  set depth [get_property value ${PARAM_VALUE.C_DATA_DEPTH}]
  set width [expr $sum +1.0]
  if {$depth <= 4096} {
  	set bram_count [expr int(ceil(($width*$depth)/(36*1024)))]
  } else {
  	set bram_count [expr int(ceil(($width*$depth)/(32*1024)))]
  }

     }
    return true
}




set kk { proc update_PARAM_VALUE.C_SLOT_<<k0>>_INTF_TYPE { PARAM_VALUE.C_SLOT_<<k0>>_INTF_TYPE PARAM_VALUE.C_SLOT PARAM_VALUE.C_MON_TYPE } {

    set debug_param_name "CAN_DEBUG"

    set busdef_list [ipx::get_ipfiles -type busabs *]
    set vlnv_list {}
    foreach busdef $busdef_list {
      set abs_vlnv "[get_property BUS_TYPE_VLNV $busdef]"
      # The following API get_param_from_vlnv can return:
      # 1. empty string (if the interface vlnv has not explicitly specified it) => interpret it as "true" OR
      # 2. true OR
      # 3. false
      set can_debug [ipgui::get_param_from_vlnv -quiet -vlnv $abs_vlnv $debug_param_name]
      #   send_msg INFO 123 "vlnv_each_busdef $abs_vlnv can_debug $can_debug"

      set vlnv_each_busdef "[get_property VLNV $busdef]"
      if { $can_debug != "false" } {
        lappend vlnv_list $vlnv_each_busdef
      }
    
    }

    set list_of_val [regsub -all " " $vlnv_list ","]
    set_property range "$list_of_val" ${PARAM_VALUE.C_SLOT_<<k0>>_INTF_TYPE}
  }
}

for {set k1 0} {$k1 < 16} {incr k1} {
  set K11 [regsub -all <<k0>> $kk $k1  ]
  eval $K11 

}

set prc_1 { proc update_gui_for_PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN { IPINST PARAM_VALUE.C_SLOT_<<k>>_MAX_WR_BURSTS PARAM_VALUE.C_SLOT_<<k>>_MAX_RD_BURSTS PARAM_VALUE.C_SLOT_<<k>>_APC_EN PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN PARAM_VALUE.C_NUM_MONITOR_SLOTS } {

  set apc_<<k>>_en [get_property value ${PARAM_VALUE.C_SLOT_<<k>>_APC_EN}]
  set txn_cnt_<<k>>_en [get_property value ${PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN}]
  #set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_MAX_RD_BURSTS -of $IPINST]
  #set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_MAX_WR_BURSTS -of $IPINST]
  if { ${apc_<<k>>_en} == [expr 1] || ${txn_cnt_<<k>>_en} == [expr 1]} {
    set_property visible true [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
    set_property visible true [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
  } else {
    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]

  }

  }
}

for {set k1 0} {$k1 < 16} {incr k1} {
  set APCK11 [regsub -all <<k>> $prc_1 $k1  ]
  eval $APCK11 

}


set apc_vis { proc update_gui_for_PARAM_VALUE.C_SLOT_<<k>>_APC_EN { IPINST PARAM_VALUE.C_SLOT_<<k>>_APC_EN PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN PARAM_VALUE.C_SLOT_<<k>>_MAX_WR_BURSTS PARAM_VALUE.C_SLOT_<<k>>_MAX_RD_BURSTS PARAM_VALUE.C_SLOT_<<k>>_APC_STS_EN PARAM_VALUE.C_NUM_MONITOR_SLOTS } {

  set apc_<<k>>_en [get_property value ${PARAM_VALUE.C_SLOT_<<k>>_APC_EN}]
  #set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_MAX_RD_BURSTS -of $IPINST]
  #set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_MAX_WR_BURSTS -of $IPINST]
  if { ${apc_<<k>>_en} == [expr 1] } {
    set_property visible true [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_STS_EN -of $IPINST]
  } else {
    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_STS_EN -of $IPINST]
  }
  set txn_cnt_<<k>>_en [get_property value ${PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN}]
  #set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_MAX_RD_BURSTS -of $IPINST]
  #set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_MAX_WR_BURSTS -of $IPINST]
  if { ${apc_<<k>>_en} == [expr 1] || ${txn_cnt_<<k>>_en} == [expr 1]} {
    set_property visible true [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
    set_property visible true [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
  } else {
    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]

  }
  

  }
}

for {set k1 0} {$k1 < 16} {incr k1} {
  set APCK11 [regsub -all <<k>> $apc_vis $k1  ]
  eval $APCK11 

}

set apc_val { proc update_PARAM_VALUE.C_SLOT_<<k>>_APC_STS_EN { IPINST PARAM_VALUE.C_SLOT_<<k>>_APC_EN PARAM_VALUE.C_SLOT_<<k>>_APC_STS_EN PARAM_VALUE.C_SLOT PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_MON_TYPE } {

  set apc_<<k>>_en [get_property value ${PARAM_VALUE.C_SLOT_<<k>>_APC_EN}]
  if { ${apc_<<k>>_en} != [expr 1] } {
    set_property value {0} ${C_SLOT_<<k>>_APC_STS_EN}
  }
  }
}

for {set k1 0} {$k1 < 16} {incr k1} {
  set APCK11 [regsub -all <<k>> $apc_val $k1  ]
 # eval $APCK11 

}
proc validate_PARAM_VALUE.C_PROBE0_MU_CNT { PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_NUM_OF_PROBES $ARGS } {
    set tot_num_comp 0
    set comp_val 0
    set np [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
    set time_tag [get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]
    set total_np [expr $np + $time_tag]
	for { set ar 0 } { $ar <= 1023 } { incr ar } {
	    if {$ar < $total_np} {
		set this "PARAM_VALUE.C_PROBE${ar}_MU_CNT"
		set comp_val [get_property value [set $this]]
		set tot_num_comp [expr $tot_num_comp+$comp_val]
	
	    }
	}
    #if { $tot_num_comp > 1024 } {
	#set_property errmsg "Total Number of comparators of all probes cannot exceed 1024"  ${PARAM_VALUE.C_PROBE0_MU_CNT}
	#return false
    #}
    return true
}
} 0

proc init_params {IPINST} {
  set param_list {}
  tcl::lappend param_list "MODELPARAM_VALUE.C_XDEVICEFAMILY"
  tcl::lappend param_list "MODELPARAM_VALUE.C_MAJOR_VERSION"
  tcl::lappend param_list "MODELPARAM_VALUE.C_MINOR_VERSION" 
  tcl::lappend param_list "PARAM_VALUE.ALL_PROBE_SAME_MU_CNT"
  #for {set j 0} {$j <= 1023 } {incr j} {
  #tcl::lappend param_list "PARAM_VALUE.C_PROBE${j}_MU_CNT"
  #}
  ipgui::update_params -params_list $param_list $IPINST 
}

set kk1 {
proc update_gui_for_PARAM_VALUE.C_SLOT_<<k>>_INTF_TYPE { IPINST PARAM_VALUE.C_SLOT PARAM_VALUE.C_SLOT_<<k>>_INTF_TYPE PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_SLOT_<<k>>_APC_EN PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN PARAM_VALUE.C_SLOT_<<k>>_MAX_WR_BURSTS PARAM_VALUE.C_SLOT_<<k>>_MAX_RD_BURSTS } { 

    set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    set slot_sel [get_property value ${PARAM_VALUE.C_SLOT}]
    set intf "PARAM_VALUE.C_SLOT_<<k>>_INTF_TYPE"
    set intf_type [get_property value [set $intf]]
    set ii <<k>>
    set apc "PARAM_VALUE.C_SLOT_<<k>>_APC_EN"
    set apc_en [get_property value [set $apc]]
    
    set txn_cnt "PARAM_VALUE.C_SLOT_<<k>>_TXN_CNTR_EN"
    set txn_cnt_en [get_property value [set $txn_cnt]]

    set visible_val false
    if { $ii == $slot_sel } {
      set visible_val true 
    }
      if {$intf_type == "xilinx.com:interface:aximm_rtl:1.0"} {
        set_property visible $visible_val [ipgui::get_panelspec  "panel_options_<<k>>" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_<<k>>" -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TDEST_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST]
        set_property visible true [ipgui::get_panelspec "panel1" -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_PROTOCOL -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_ID_WIDTH -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_EN -of $IPINST]
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_TXN_CNTR_EN -of $IPINST]        
        if {$txn_cnt_en == 1} {
          set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
          set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
        } 
	    if {$apc_en == 1} {
          set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_STS_EN -of $IPINST]
          set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
          set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
        }

        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_TYPE -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXI_TRIG_SEL -of $IPINST]
      } elseif {$intf_type == "xilinx.com:interface:axis_rtl:1.0"} {
        set_property visible $visible_val [ipgui::get_panelspec  "panel_options_<<k>>" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_<<k>>" -of $IPINST]

	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_ADDR_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_PROTOCOL -of $IPINST]
        set_property visible true [ipgui::get_panelspec "panels1" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel1" -of $IPINST]
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_AXIS_TDEST_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_TYPE -of $IPINST]
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_TXN_CNTR_EN -of $IPINST]
        if {$txn_cnt_en == 1} {
          set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
        } 
	    if {$apc_en == 1} {
          set_property visible true [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_STS_EN -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
        }

        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible $visible_val [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXI_DATA_SEL -of $IPINST]      
        set_property visible $visible_val [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXI_TRIG_SEL -of $IPINST]
      } else {

	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_ADDR_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_PROTOCOL -of $IPINST]      
        set_property visible true [ipgui::get_panelspec  "panel_options_<<k>>" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_<<k>>" -of $IPINST]
        
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXIS_TDEST_WIDTH -of $IPINST]
        set_property visible $visible_val [ipgui::get_guiparamspec C_SLOT_<<k>>_TYPE -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_WR_BURSTS -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_MAX_RD_BURSTS -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_TXN_CNTR_EN -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_APC_STS_EN -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_<<k>>_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST]
        set_property visible false [ipgui::get_panelspec "panels1"  -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_<<k>>_AXI_TRIG_SEL -of $IPINST]
      }
}
} 

for {set k1 0} {$k1 < 16} {incr k1} {
  set K11 [regsub -all <<k>> $kk1 $k1  ]
  eval $K11 

}


proc update_PARAM_VALUE.C_SLOT {IPINST PARAM_VALUE.C_SLOT PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_MON_TYPE } {
	set num_slots [expr  [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]  ]
    set slot_list "0"
    for {set i 1 } {$i < $num_slots } {incr i } {
      append slot_list ","
      append slot_list $i
    } 
    set slot_list [lsort -unique $slot_list]
    set_property range "$slot_list" ${PARAM_VALUE.C_SLOT}

}

EvalSubstituting { ARGS2 } {
proc update_gui_for_PARAM_VALUE.C_SLOT {IPINST $ARGS2 PARAM_VALUE.C_SLOT PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS } {
  
    set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    set slot_sel [get_property value ${PARAM_VALUE.C_SLOT}]
    set intf "PARAM_VALUE.C_SLOT_${slot_sel}_INTF_TYPE"
    set intf_type [get_property value [set $intf]]
    set ii $slot_sel
    set apc "PARAM_VALUE.C_SLOT_${slot_sel}_APC_EN"
    set apc_en [get_property value [set $apc]]
    set txn_cnt "PARAM_VALUE.C_SLOT_${slot_sel}_TXN_CNTR_EN"
    set txn_cnt_en [get_property value [set $txn_cnt]]
    for {set i 0 } {$i < 16 } {incr i } {
        set_property visible false [ipgui::get_panelspec  "panel_options_${i}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_${i}" -of $IPINST]

        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_INTF_TYPE -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXIS_TDEST_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_PROTOCOL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_TYPE -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_APC_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_TXN_CNTR_EN -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_RD_BURSTS -of $IPINST]        
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_APC_STS_EN -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_TRIG_SEL -of $IPINST]
      }
      set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_INTF_TYPE -of $IPINST]
      if {$intf_type == "xilinx.com:interface:aximm_rtl:1.0"} {
        set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
        set_property visible true [ipgui::get_panelspec "panel1" -of $IPINST]  
        set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_PROTOCOL -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
          if {$txn_cnt_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          } 
    	  if {$apc_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          }

	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
      } elseif {$intf_type == "xilinx.com:interface:axis_rtl:1.0"} {
        set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST] 
        set_property visible true [ipgui::get_panelspec "panels1" -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]


    	  if {$apc_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          }

        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
        set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
      } else {
        set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST]  
        set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]        
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]        
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
      }



}
} 0

EvalSubstituting { ARGS2 } {
proc update_gui_for_PARAM_VALUE.C_MON_TYPE {IPINST $ARGS2 PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_SLOT PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION } {

    set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    set slot_sel [get_property value ${PARAM_VALUE.C_SLOT}]
    set intf_ty "PARAM_VALUE.C_SLOT_${slot_sel}_INTF_TYPE"
    set intf_type [get_property value [set $intf_ty]]

    set ii $slot_sel
    set apc "PARAM_VALUE.C_SLOT_${slot_sel}_APC_EN"
    set apc_en [get_property value [set $apc]]
    set txn_cnt "PARAM_VALUE.C_SLOT_${slot_sel}_TXN_CNTR_EN"
    set txn_cnt_en [get_property value [set $txn_cnt]]
	if {$mode_sel != "Interface_Monitor"} {
	  #set_property visible true [ipgui::get_guiparamspec C_PROBE_WIDTH_PROPAGATION -of $IPINST]
	  set_property visible false [ipgui::get_guiparamspec C_PROBE_WIDTH_PROPAGATION -of $IPINST]
	} else {
	  set_property visible false [ipgui::get_guiparamspec C_PROBE_WIDTH_PROPAGATION -of $IPINST]
	}
	if {$mode_sel == "Interface_Monitor"} {
		set_property visible true [ipgui::get_guiparamspec  C_NUM_MONITOR_SLOTS -of $IPINST  ]
		set_property visible false [ipgui::get_guiparamspec  C_NUM_OF_PROBES -of $IPINST  ]

		for {set i 0 } {$i <= 63 } {incr i } {
		  if {$i%8==0} {
		   set_property visible false [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST ]
		  # set_property visible false [ipgui::get_textspec stc$i -of $IPINST]
		  }
		  set_property visible false [ipgui::get_textspec  prb${i}Name -of $IPINST]
		  set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_WIDTH -of $IPINST]
		  set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_TYPE -of $IPINST]
          
		}
      for {set i 0 } {$i < 16 } {incr i } {
        set_property visible false [ipgui::get_panelspec  "panel_options_${i}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_${i}" -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_AWUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_WUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_BUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_ARUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_RUSER_WIDTH -of $IPINST  ]
     
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_TRIG_SEL -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TDEST_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_PROTOCOL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_TXN_CNTR_EN -of $IPINST]
        
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_APC_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_APC_STS_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_TYPE -of $IPINST]

          set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_WR_BURSTS -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_RD_BURSTS -of $IPINST]

        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_INTF_TYPE -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_TRIG -of $IPINST]

      }
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_INTF_TYPE -of $IPINST]
        if {$intf_type == "xilinx.com:interface:aximm_rtl:1.0"} {
         set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
         set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
         set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST] 
         set_property visible true [ipgui::get_panelspec "panel1" -of $IPINST]

	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_PROTOCOL -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
          if {$txn_cnt_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          } 
    	  if {$apc_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          }
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]

        } elseif {$intf_type == "xilinx.com:interface:axis_rtl:1.0"} {
          set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
          set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
          set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST] 
          set_property visible true [ipgui::get_panelspec "panels1" -of $IPINST]

	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL -of $IPINST]

          set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]

    	  if {$apc_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          }
 
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
          set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
        } else {
          set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
          set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
          set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST] 
          set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]          
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
        }
        

		set C_NUM_MONITOR_SLOTS  [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]  
        set_property visible true [ipgui::get_pagespec  Interface_Options -of $IPINST  ] 

	} elseif { $mode_sel == "Net_Probes"} {
				set_property visible false [ipgui::get_guiparamspec  C_NUM_MONITOR_SLOTS -of $IPINST  ]
				set_property visible true [ipgui::get_guiparamspec  C_NUM_OF_PROBES -of $IPINST  ]

			   set_property visible false [ipgui::get_pagespec  Interface_Options -of $IPINST ]
		


#########################################################################
			set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]  
			set C_NUM_OF_PROBES [expr $C_NUM_OF_PROBES]
        	set PROBES_pages [expr $C_NUM_OF_PROBES / 8 ]
        	set probe_n_last [expr $C_NUM_OF_PROBES % 8 ]
        	for {set i 0 } { $i <= 63} {incr i } {
        	 
        	 set table_no [ expr $i / 8 ]
        	 	  set hidden_rows ""
        	  if {$table_no >=  $PROBES_pages } {
        	    for {set j 9 } {[ expr ((($i/8) * 8) +$j ) -1 ] >=  $C_NUM_OF_PROBES && $j > 0} {incr j -1} {   lappend hidden_rows $j  }
        		}
        
        		 
        	  if {$i%8==0} {
        	    set_property visible true [ipgui::get_textspec stc$i -of $IPINST]	
        		set tno [expr $i / 8 ]
        		
        		 set table_name  "probe_table_$tno"
                 set_property hidden_rows [join $hidden_rows ","]   [ipgui::get_tablespec $table_name -of $IPINST   ] 
                 set_property visible true [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST  ] 
          	
        	     if { [expr $i + 8 ] >= $C_NUM_OF_PROBES } {
        		     
        		     set page [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST  ]
        		     set numprobes [expr $C_NUM_OF_PROBES - 1]
        		      
        		     set_property display_name "Probe($i..$numprobes) Options" $page 
        	     }
        	     set z [expr $i / 8]
        	     for {set j 0} {$j < $z} {incr j} { 
        		
        		    set page [ipgui::get_pagespec  Probe_Port_Options[expr $j * 8] -of $IPINST  ]
        		    set start_val [expr $j * 8]
        		    set end_val [expr $start_val + 7]
        		    set_property display_name "Probe($start_val..$end_val) Options" $page
        	    
        
        	     } 
             
             }
        	  

        	  set_property visible true [ipgui::get_textspec  prb${i}Name -of $IPINST]
        	  set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_WIDTH -of $IPINST]
        	  set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
              set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_TYPE -of $IPINST]
        	
        	  
        	}
        
        	for {set i $C_NUM_OF_PROBES } { $i  <= 63 } {incr i } {
        	  if {$i%8==0} {
        	   set_property visible false [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST ]
        	   }
        	}
#########################################################################
	   } else {

		set_property visible true [ipgui::get_guiparamspec  C_NUM_MONITOR_SLOTS -of $IPINST  ]
		set_property visible true [ipgui::get_guiparamspec  C_NUM_OF_PROBES -of $IPINST  ]
		set C_NUM_MONITOR_SLOTS  [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]  
        set_property visible true [ipgui::get_pagespec  Interface_Options -of $IPINST  ]

      for {set i 0 } {$i < 16 } {incr i } {
        set_property visible false [ipgui::get_panelspec  "panel_options_${i}" -of $IPINST]
        set_property visible false [ipgui::get_panelspec  "panel_options_t_${i}" -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_AWUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_WUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_BUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_ARUSER_WIDTH -of $IPINST  ]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_RUSER_WIDTH -of $IPINST  ]
     
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_DATA_SEL -of $IPINST]      
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_TRIG_SEL -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TDATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TUSER_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXIS_TDEST_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_PROTOCOL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_ID_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_DATA_WIDTH -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_AXI_ADDR_WIDTH -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_TXN_CNTR_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_APC_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec  C_SLOT_${i}_APC_STS_EN -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_TYPE -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_MAX_RD_BURSTS -of $IPINST]
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_INTF_TYPE -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${i}_AXI_B_SEL_TRIG -of $IPINST]

      }
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_INTF_TYPE -of $IPINST]
        if {$intf_type == "xilinx.com:interface:aximm_rtl:1.0"} {
         set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
         set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
         set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST] 
         set_property visible true [ipgui::get_panelspec "panel1" -of $IPINST]

	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_PROTOCOL -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
          if {$txn_cnt_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          } 
    	  if {$apc_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          }
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
        } elseif {$intf_type == "xilinx.com:interface:axis_rtl:1.0"} {
          set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
          set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
          set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST] 
          set_property visible true [ipgui::get_panelspec "panels1" -of $IPINST]

	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL -of $IPINST]

          set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	      set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
    	  if {$apc_en == 1} {
            set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
            set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          }
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
        set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	    set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
        set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
        set_property visible true [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
        } else {
          set_property visible false [ipgui::get_panelspec  "panel_options_t_${ii}" -of $IPINST]
          set_property visible true [ipgui::get_panelspec  "panel_options_${ii}" -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ID_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_DATA_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_ADDR_WIDTH -of $IPINST]
          set_property visible false [ipgui::get_panelspec "panel1" -of $IPINST] 
          set_property visible false [ipgui::get_panelspec "panels1" -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDATA_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TID_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TUSER_WIDTH -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXIS_TDEST_WIDTH -of $IPINST]
          set_property visible true [ipgui::get_guiparamspec C_SLOT_${ii}_TYPE -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_TXN_CNTR_EN -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_WR_BURSTS -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_MAX_RD_BURSTS -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_APC_EN -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_APC_STS_EN -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_DATA -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_DATA -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_DATA -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_DATA -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_DATA -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AW_SEL_TRIG -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_W_SEL_TRIG -of $IPINST]
	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_AR_SEL_TRIG -of $IPINST]  
          set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_R_SEL_TRIG -of $IPINST]
  	      set_property visible false [ipgui::get_guiparamspec C_SLOT_${ii}_AXI_B_SEL_TRIG -of $IPINST]
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_DATA_SEL -of $IPINST]      
          set_property visible false [ipgui::get_guiparamspec  C_SLOT_${ii}_AXI_TRIG_SEL -of $IPINST]
        }
			set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]  
			set C_NUM_OF_PROBES [expr $C_NUM_OF_PROBES]
         	set PROBES_pages [expr $C_NUM_OF_PROBES / 8 ]
         	set probe_n_last [expr $C_NUM_OF_PROBES % 8 ]
         	for {set i 0 } { $i <= 63} {incr i } {
         	 
         	 set table_no [ expr $i / 8 ]
         	 	  set hidden_rows ""
         	  if {$table_no >=  $PROBES_pages } {
         	    for {set j 9 } {[ expr ((($i/8) * 8) +$j ) -1 ] >=  $C_NUM_OF_PROBES && $j > 0} {incr j -1} {   lappend hidden_rows $j  }
         		}
         
         		 
         	  if {$i%8==0} {
         		set tno [expr $i / 8 ]
         		
         		 set table_name  "probe_table_$tno"
                  set_property hidden_rows [join $hidden_rows ","]   [ipgui::get_tablespec $table_name -of $IPINST   ] 
                  set_property visible true [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST  ] 
              set_property visible true [ipgui::get_textspec stc$i -of $IPINST]           	
         	     if { [expr $i + 8 ] >= $C_NUM_OF_PROBES } {
         		     
         		     set page [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST  ]
         		     set numprobes [expr $C_NUM_OF_PROBES - 1]
         		      
         		     set_property display_name "Probe($i..$numprobes) Options" $page 
         	     }
         	     set z [expr $i / 8]
         	     for {set j 0} {$j < $z} {incr j} { 
         		
         		    set page [ipgui::get_pagespec  Probe_Port_Options[expr $j * 8] -of $IPINST  ]
         		    set start_val [expr $j * 8]
         		    set end_val [expr $start_val + 7]
         		    set_property display_name "Probe($start_val..$end_val) Options" $page
         	    
         
         	     } 
              
              }
         	  

        	  set_property visible true [ipgui::get_textspec  prb${i}Name -of $IPINST]
        	  set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_WIDTH -of $IPINST]
        	  set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
              set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_TYPE -of $IPINST]
        	
        	  
        	}
        
        	for {set i $C_NUM_OF_PROBES } { $i  <= 63 } {incr i } {
        	  if {$i%8==0} {
        	   set_property visible false [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST ]
        	   }
        	}

	}
  }
} 0
set temp 1

proc update_PARAM_VALUE.C_NUM_OF_PROBES { PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_OF_PROBES} {

}

proc update_PARAM_VALUE.C_NUM_MONITOR_SLOTS {PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS} {

}

proc update_PARAM_VALUE.C_MON_TYPE {PROJECT_PARAM.ARCHITECTURE PARAM_VALUE.C_MON_TYPE} {
	set_property enabled true ${PARAM_VALUE.C_MON_TYPE}
	set mode {}
	tcl::lappend mode "Net_Probes"
	set rangelist [regsub -all " " $mode ","]
	set_property range $rangelist ${PARAM_VALUE.C_MON_TYPE}
}

proc update_PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION {PROJECT_PARAM.ARCHITECTURE PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION} {
	set mode {}
	tcl::lappend mode "MANUAL"
	set rangelist [regsub -all " " $mode ","]
	set_property range $rangelist ${PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION}
	set_property enabled false ${PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION}
}


EvalSubstituting { ARGS } {
proc update_gui_for_PARAM_VALUE.C_NUM_OF_PROBES {IPINST  PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_ADV_TRIGGER $ARGS } {
		set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]

    
	if {$mode_sel == "Interface_Monitor"} {
		for {set i 0 } {$i <= 63 } {incr i } {
	  if {$i%8==0} {
	   set_property visible false [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST ]
	   #set_property visible false [ipgui::get_textspec stc$i -of $IPINST]
	  }
	  set_property visible false [ipgui::get_textspec  prb${i}Name -of $IPINST]
	  set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_WIDTH -of $IPINST]
	  set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
      set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_TYPE -of $IPINST]
      set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_MU_TYPE -of $IPINST]
	}
	} else {

	set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]  
	set C_ADV_TRIGGER  [get_property value ${PARAM_VALUE.C_ADV_TRIGGER}]
	set PROBES_pages [expr $C_NUM_OF_PROBES / 8 ]
	set probe_n_last [expr $C_NUM_OF_PROBES % 8 ]
	
	
	
	for {set i 0 } { $i <= 63} {incr i } {
	 
	 set table_no [ expr $i / 8 ]
	 	  set hidden_rows ""
	  if {$table_no >=  $PROBES_pages } {
	    for {set j 9 } {[ expr ((($i/8) * 8) +$j ) -1 ] >=  $C_NUM_OF_PROBES && $j > 0} {incr j -1} {   lappend hidden_rows $j  }
		}

		 
	  if {$i%8==0} {
		
		set tno [expr $i / 8 ]
		
		 set table_name  "probe_table_$tno"
         set_property hidden_rows [join $hidden_rows ","]   [ipgui::get_tablespec $table_name -of $IPINST   ] 
         set_property visible true [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST  ] 
  	
	     if { [expr $i + 8 ] >= $C_NUM_OF_PROBES } {
		     
		     set page [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST  ]
		     set numprobes [expr $C_NUM_OF_PROBES - 1]
		      
		     set_property display_name "Probe($i..$numprobes) Options" $page 
	     }
	     set z [expr $i / 8]
	     for {set j 0} {$j < $z} {incr j} { 
		
		    set page [ipgui::get_pagespec  Probe_Port_Options[expr $j * 8] -of $IPINST  ]
		    set start_val [expr $j * 8]
		    set end_val [expr $start_val + 7]
		    set_property display_name "Probe($start_val..$end_val) Options" $page
	    

	     } 
     
     }
	  

	  set_property visible true [ipgui::get_textspec  prb${i}Name -of $IPINST]
	  set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_WIDTH -of $IPINST]
	  set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
      set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_TYPE -of $IPINST]
      set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_MU_TYPE -of $IPINST]
	
	  
	}
	for {set i $C_NUM_OF_PROBES } { $i  <= 63 } {incr i } {
	  if {$i%8==0} {
	   set_property visible false [ipgui::get_pagespec  Probe_Port_Options$i -of $IPINST ]
	   }
	}

}
}

} 0


proc update_gui_for_PARAM_VALUE.ALL_PROBE_SAME_MU {IPINST  PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.ALL_PROBE_SAME_MU PARAM_VALUE.ALL_PROBE_SAME_MU_CNT  } {

	## Add ARGS to arguments if needed
	
	#	set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}] 
		if {[get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "TRUE" || [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "true"} {
			set_property visible true [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
			#for {set i 0} {$i < $C_NUM_OF_PROBES && $i <= 63 } {incr i} {
			 # set_property enabled false [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
		  	#}
			
		  } elseif {[get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "false" || [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "FALSE"}  {
			  set_property visible false [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
			  # for {set i 0} {$i < $C_NUM_OF_PROBES && $i <= 63 } {incr i} {
			  #set_property enabled true [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
		  	  # }
			  
		  }
}


#proc update_gui_for_PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION {IPINST  PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION  } {
#
#	for {set i 0} {$i <= 63} {incr i} {
#	    if {$i%8==0} {
#	   	set page [ipgui::add_page $IPINST -parent $IPINST -name "Probe_Port_Options$i" -layout horizontal] 
#		set_property display_name "Probe Ports($i..[expr $i+7])"  $page
#		set j [expr $i / 8 ]
#		set table_name  "probe_table_$j"
#        set curr_table [ipgui::add_table $IPINST -parent $page  -rows 8 -columns 4 -name $table_name -layout horizontal  -table_header true ]
#		set sttxt1 [ipgui::add_static_text $IPINST -parent $curr_table  -name sta$i -text "Probe Port	" ]
#		set sttxt2 [ipgui::add_static_text $IPINST  -parent $curr_table -name stb$i -text "Probe Width \[1..4096\] " ]
#		set sttxt3 [ipgui::add_static_text $IPINST  -parent $curr_table -name stc$i -text "Number of Comparators" ]	
#        set sttxt4 [ipgui::add_static_text $IPINST  -parent $curr_table -name std$i -text "Data and/or Trigger" ]	
#		set_property cell_location "0,0" $sttxt1 
#		set_property cell_location "0,1" $sttxt2 
#		set_property cell_location "0,2" $sttxt3 
#        set_property cell_location "0,3" $sttxt4 
#	    }
#		set prb_name   [join "prb $i Name" "" ] 
#		set prb_width  [join [split "C_PROBE $i _WIDTH" ] ""] 
#		set prb_cnt    [join [split "C_PROBE $i _MU_CNT"] "" ]  
#        set prb_sw    [join [split "C_PROBE $i _TYPE"] "" ]  
#	    set Table_parameter1 [ipgui::add_static_text  $IPINST  -parent $curr_table -name $prb_name -text "PROBE$i"]
#	    set Table_parameter2 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_width -show_range false -show_label false]
#	    set Table_parameter3 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_cnt -widget comboBox -show_label false]
#        set Table_parameter4 [ipgui::add_param  $IPINST  -parent $curr_table -name $prb_sw -widget comboBox -show_label false]
#		set j [expr ($i % 8 ) + 1 ]
#		set_property cell_location "$j,0" $Table_parameter1
#		set_property cell_location "$j,1" $Table_parameter2
#		set_property cell_location "$j,2" $Table_parameter3 
#        set_property cell_location "$j,3" $Table_parameter4 
#	    ipgui::add_row $IPINST  -parent $page
#	    
#	}
#}


proc update_gui_for_PARAM_VALUE.C_ADV_TRIGGER {IPINST  PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_ADV_TRIGGER PARAM_VALUE.ALL_PROBE_SAME_MU PARAM_VALUE.ALL_PROBE_SAME_MU_CNT} {
	## Add ARGS to arguments if needed
	
	set C_ADV_TRIGGER  [get_property value ${PARAM_VALUE.C_ADV_TRIGGER}] 
        #set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]  	
	
	
       if {$C_ADV_TRIGGER == "true" || $C_ADV_TRIGGER == "TRUE"} {
	       
	       set_property visible true [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU -of $IPINST]
	       #set_property value "true" ${PARAM_VALUE.ALL_PROBE_SAME_MU}
	       #set_property enabled true ${PARAM_VALUE.ALL_PROBE_SAME_MU}
	       #set_property visible true [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
	       
	       
	       #for {set i 0} {$i < $C_NUM_OF_PROBES  && $i <= 63} {incr i} {       
	       	#set_property visible true [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
		#if ($i%8==0) {
		#set_property visible true [ipgui::get_textspec stc$i -of $IPINST]
		#}
		#}
       } else {
	      
	       set_property visible true [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU -of $IPINST]
	        #set_property value "true" ${PARAM_VALUE.ALL_PROBE_SAME_MU}
		#set_property enabled false ${PARAM_VALUE.ALL_PROBE_SAME_MU}
		set_property visible true [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
	       #for {set i 0} {$i < $C_NUM_OF_PROBES  && $i <= 63} {incr i} {
		#set_property visible false [ipgui::get_guiparamspec  C_PROBE${i}_MU_CNT -of $IPINST]
		#if ($i%8==0) {
		#set_property visible false [ipgui::get_textspec stc$i -of $IPINST]
		#}
	       #}
       }

}


proc update_PARAM_VALUE.C_EN_STRG_QUAL {PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_EN_STRG_QUAL} {
	set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
	set C_NUM_OF_PROBES [expr $C_NUM_OF_PROBES]
	if {$C_NUM_OF_PROBES > 512 } {
		
		set_property value 0 ${PARAM_VALUE.C_EN_STRG_QUAL}
		set_property enabled false ${PARAM_VALUE.C_EN_STRG_QUAL}

	} else {
		set_property enabled true ${PARAM_VALUE.C_EN_STRG_QUAL}
	}
}


proc update_gui_for_PARAM_VALUE.C_EN_STRG_QUAL {IPINST PARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_EN_TIME_TAG} {
	set strg_qual [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}]

	if {$strg_qual == [expr 1] } {
		set_property visible false [ipgui::get_guiparamspec C_EN_TIME_TAG -of $IPINST] 
	} else {
		set_property visible false [ipgui::get_guiparamspec C_EN_TIME_TAG -of $IPINST]
        
	}

}

proc update_gui_for_PARAM_VALUE.C_EN_TIME_TAG {IPINST PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_TIME_TAG_WIDTH} {
	set time_tag [get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]

	if {$time_tag == [expr 1] } {
        set_property visible false [ipgui::get_guiparamspec C_TIME_TAG_WIDTH -of $IPINST]
        #set_property visible false [ipgui::get_guiparamspec C_ILA_CLK_FREQ -of $IPINST] 
	} else {
		set_property visible false [ipgui::get_guiparamspec C_TIME_TAG_WIDTH -of $IPINST] 
        #set_property visible false [ipgui::get_guiparamspec C_ILA_CLK_FREQ -of $IPINST] 
	}

}


proc update_PARAM_VALUE.C_EN_TIME_TAG {PARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_EN_TIME_TAG} {
	set strg_qual [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}]

	if {$strg_qual == [expr 1] } {
		set_property enabled true ${PARAM_VALUE.C_EN_TIME_TAG}

	} else {
		set_property enabled false ${PARAM_VALUE.C_EN_TIME_TAG}
	}
}

proc update_PARAM_VALUE.C_TIME_TAG_WIDTH {PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_TIME_TAG_WIDTH} {
	set strg_qual [get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]

	if {$strg_qual == [expr 1] } {
		set_property enabled true ${PARAM_VALUE.C_TIME_TAG_WIDTH}
	} else {
		set_property enabled false ${PARAM_VALUE.C_TIME_TAG_WIDTH}
	}
}

proc update_PARAM_VALUE.ALL_PROBE_SAME_MU_CNT {PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_ADV_TRIGGER PARAM_VALUE.ALL_PROBE_SAME_MU_CNT} {
	
	set capqual [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}]
	set advtrig [get_property value ${PARAM_VALUE.C_ADV_TRIGGER}]
		set_property enabled true ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}
		if {$capqual == 0 && ($advtrig == "FALSE" || $advtrig == "false")} {
			set_property range_value "1,1,16" ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}

		} elseif {$capqual == 1 && ($advtrig == "FALSE" || $advtrig == "false")} {
			set_property range_value "2,2,16" ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}
		} elseif {$capqual == 0  && ($advtrig == "true" || $advtrig == "TRUE")} {
			set_property range_value "1,1,16" ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}
		} else {
			set_property range_value "2,2,16" ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}
		}
}
proc update_PARAM_VALUE.EN_BRAM_DRC {PARAM_VALUE.EN_BRAM_DRC } {
		
		set_property value [get_property value ${PARAM_VALUE.EN_BRAM_DRC}] ${PARAM_VALUE.EN_BRAM_DRC}
	
}



proc update_gui_for_PARAM_VALUE.ALL_PROBE_SAME_MU {IPINST  PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.ALL_PROBE_SAME_MU PARAM_VALUE.ALL_PROBE_SAME_MU_CNT  } {

	## Add ARGS to arguments if needed
	
		if {[get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "TRUE" || [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "true"} {
			set_property visible true [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
			
		  } elseif {[get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "false" || [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "FALSE"}  {
			  set_property visible false [ipgui::get_guiparamspec  ALL_PROBE_SAME_MU_CNT -of $IPINST]
			  
		  }
}

for {set j 0} {$j <= 1023} {incr j} {
EvalSubstituting { j } {
  proc update_PARAM_VALUE.C_PROBE$j_WIDTH {IPINST PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_PROBE$j_WIDTH PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION} {
	set mode_sel [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    set val_prop [get_property value ${PARAM_VALUE.C_PROBE_WIDTH_PROPAGATION}]
	set x "PARAM_VALUE.C_PROBE$j_WIDTH"

    if {$val_prop != "AUTO"} {
      set_property enabled true [set $x]

  	  if {$mode_sel == "Interface_Monitor"} {
	    set_property value 1 [set $x]
	  } else {
	    set C_NUM_OF_PROBES  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]  
	    set C_NUM_OF_PROBES [expr $C_NUM_OF_PROBES]
	    if {$j >= $C_NUM_OF_PROBES } {
	      set_property value 1 [set $x] 
	    }
	  }
    } else {
      set_property value 1 [set $x]
      set_property enabled false [set $x]
    }

  }
} 0
}


EvalSubstituting {ARGS} {
proc validate_PARAM_VALUE.C_NUM_OF_PROBES {IPINST $ARGS PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_ADV_TRIGGER PARAM_VALUE.ALL_PROBE_SAME_MU PARAM_VALUE.ALL_PROBE_SAME_MU_CNT PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_NUM_MONITOR_SLOTS} {


    set num_slot_ports [expr 0]
	set strg_qual [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}]
	set np [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
    set ns [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]
    set mode [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    #set interfaceStruct [get_interface_information]
    set interfaceStruct ""

    set tot_no [expr 0] 
    set intf_cnt_p [expr 0]
    if {$mode == "Mixed"} {

      foreach interface [dict keys $interfaceStruct] {
        if {$interface != "RST.resetn" && $interface != "CLK.clk" } {
          if {$intf_cnt_p < $ns} { 
            set interfaceInfo [dict get $interfaceStruct $interface]
              foreach prop [dict keys $interfaceInfo] {
                if { $prop == "ports" } {
                  set ports [dict get $interfaceInfo $prop]
                  foreach keyValue [dict key $ports] {
                    set num_slot_ports [expr $num_slot_ports + 1]
                  }
                }
              }

              set intf_cnt_p [expr $intf_cnt_p + 1]
            }
          }
        }

       set tot_no [expr $np + $num_slot_ports]
       #if {$tot_no >1024} {
       #  set_property errmsg "Total number of individual Probes and Ports within Slots must not exceed 1024." ${PARAM_VALUE.C_NUM_OF_PROBES}
       #  return false
       #}   
    }
    if {$mode != "Interface_Monitor" && $np == [expr 0]} {
      set_property errmsg "The number of Probes should be a non-zero value" ${PARAM_VALUE.C_NUM_OF_PROBES}
      return false
    }
	set tran_strg [get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]
	set adv_trig [get_property value ${PARAM_VALUE.C_ADV_TRIGGER}]
	set same_mu [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}]
	set same_mu_cnt [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}]
    set tot_num_comp 0
	for { set ar 0 } { $ar <= 1023 } { incr ar } {
	  if {$ar < $np} {
		set this "PARAM_VALUE.C_PROBE${ar}_MU_CNT"
		set comp_val [get_property value [set $this]]
		set tot_num_comp [expr $tot_num_comp+$comp_val]
	
	  }

	}

    if {$same_mu == "true" || $same_mu == "TRUE" } {
  	  if {$strg_qual == [expr 0] } { 
        set val [expr 1024 / $same_mu_cnt]
        #if {$np > $val} {
	    #  set_property errmsg "When Comparators count set to $same_mu_cnt the number of Probes selection is limited to only $val as every probe is associated with $same_mu_cnt Comparators accounting for 1024 Max " ${PARAM_VALUE.C_NUM_OF_PROBES}
        #  return false
        #} else {
          return true
        #}
	  } else {
        #if {$same_mu_cnt == [expr 16] } {
        #  set same_mu_cnt [expr 15]
        #}
        if {$tran_strg == [expr 1]} {
          set val [expr [expr $ar / $same_mu_cnt ] - 1]
        } else {
          set val [expr $ar / $same_mu_cnt ]
        }
        #if {$np > $val} {
	    #  set_property errmsg "When Capture Control mode is on with Comparators count set to $same_mu_cnt the number of Probes selection is limited to only $val as every probe is associated with $same_mu_cnt Comparators accounting for 1024 Max " ${PARAM_VALUE.C_NUM_OF_PROBES}
        #  return false
        #} else {
          return true
        #}
      }  
	} else {
      if {$strg_qual == [expr 1] } { 
        if {$tot_num_comp < 1025 } {
          set bal_mu [expr 1024 - $tot_num_comp]
          if {$tran_strg == [expr 1]} {
            set val [expr [expr $bal_mu + $np] - 1]
          } else {
            set val [expr $bal_mu + $np]
          }
        } else {
#          set bal_mu [expr $tot_num_comp - 1024]
          set val [expr 0] 
          set max_comp [expr 1024]
    	  for { set i 0 } { $i < $np } { incr i } {
	        if {$max_comp > [expr 0]} {
		      set this "PARAM_VALUE.C_PROBE${i}_MU_CNT"
  		      set comp_val [get_property value [set $this]]
		      set max_comp [expr $max_comp-$comp_val]

	          set val [expr $val + 1]
	        }
	      }
          if {$tran_strg == [expr 1]} {
            set val [expr $val - 1]
          } 

        }
        #if {$np > $val} {
	    #  set_property errmsg "When Capture Control mode is on, the number of Probes selection is limited to only $val as every probe is associated with Comparators accounting for 1024 Max " ${PARAM_VALUE.C_NUM_OF_PROBES}
        #  return false
        #} else {
          return true
        #}
        
      } else {
        if {$tot_num_comp < 1025 } {
          set bal_mu [expr 1024 - $tot_num_comp]
          set val [expr $bal_mu + $np]
        } else {
          set val [expr 0] 
          set max_comp [expr 1024]
    	  for { set i 0 } { $i < $np } { incr i } {
	        if {$max_comp > [expr 0]} {
		      set this "PARAM_VALUE.C_PROBE${i}_MU_CNT"
  		      set comp_val [get_property value [set $this]]
		      set max_comp [expr $max_comp-$comp_val]

	          set val [expr $val + 1]
	        }
	      }
        }

        #if {$np > $val} {
	    #  set_property errmsg "The number of Probes selection is limited to only $val as every probe is associated with Comparators accounting for 1024 Max " ${PARAM_VALUE.C_NUM_OF_PROBES}
        #  return false
        #} else {
          return true
        #}

      }
    }
    set intf_cnt_p [expr 0]
}

} 0


for {set j 0} {$j <= 1023} {incr j} {
	EvalSubstituting { j } {
proc update_PARAM_VALUE.C_PROBE$j_MU_CNT {IPINST PARAM_VALUE.C_EN_TIME_TAG PARAM_VALUE.C_NUM_OF_PROBES PARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_ADV_TRIGGER PARAM_VALUE.ALL_PROBE_SAME_MU PARAM_VALUE.ALL_PROBE_SAME_MU_CNT PARAM_VALUE.C_PROBE$j_MU_CNT} {
	set np  [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}] 
    set time_tag [get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]

    if {$time_tag == 1} {
      set total_np [expr $np + 1]
    } else {
      set total_np $np
    }
	if { $j < $total_np } {
		if {[get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "TRUE" || [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU}] == "true"} {
		
      		set x "PARAM_VALUE.C_PROBE$j_MU_CNT"
			set default_value [get_property value ${PARAM_VALUE.ALL_PROBE_SAME_MU_CNT}]
			set_property range_value "$default_value,$default_value,$default_value" [set $x]
		
		  
		  } else {
			  set x "PARAM_VALUE.C_PROBE$j_MU_CNT"
			  set capqual [get_property value ${PARAM_VALUE.C_EN_STRG_QUAL}]
			  set advtrig [get_property value ${PARAM_VALUE.C_ADV_TRIGGER}] 
	
			  	if {$capqual == 0 && ($advtrig == "FALSE" || $advtrig == "false")} {
					set_property range_value "1,1,16" [set $x]
				} elseif {$capqual == 1 && ($advtrig == "FALSE" || $advtrig == "false")} {
					set_property range_value "2,2,16" [set $x]
				} elseif {$capqual == 0 && ($advtrig == "true" || $advtrig == "TRUE")} {
					set_property range_value "1,1,16" [set $x]
				} else {
					set_property range_value "2,2,16" [set $x]
				}
			 
		
		  } 
	  } 
}
} 0
}

proc update_MODELPARAM_VALUE.C_EN_TIME_TAG {PARAM_VALUE.C_EN_STRG_QUAL MODELPARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_EN_TIME_TAG MODELPARAM_VALUE.C_EN_TIME_TAG } {

# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	
	if {[get_property value ${PARAM_VALUE.C_EN_TIME_TAG}]} {
		set value 1
	} else {
		set value 0
	}
  set_property value $value ${MODELPARAM_VALUE.C_EN_TIME_TAG}
}


proc update_MODELPARAM_VALUE.C_TIME_TAG_WIDTH {PARAM_VALUE.C_EN_STRG_QUAL MODELPARAM_VALUE.C_EN_STRG_QUAL PARAM_VALUE.C_TIME_TAG_WIDTH MODELPARAM_VALUE.C_TIME_TAG_WIDTH } {

# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	
	if {[get_property value ${PARAM_VALUE.C_TIME_TAG_WIDTH}]} {
		set value 1
	} else {
		set value 0
	}
  set_property value $value ${MODELPARAM_VALUE.C_TIME_TAG_WIDTH}
}


set probes_Width_list {}

for {set i 0} {$i <= 1023} {incr i} {
	tcl::lappend probes_Width_list "MODELPARAM_VALUE.C_PROBE${i}_WIDTH"
	tcl::lappend probes_Width_list "PARAM_VALUE.C_PROBE${i}_MU_CNT"
    tcl::lappend probes_Width_list "PARAM_VALUE.C_PROBE${i}_TYPE"
    tcl::lappend probes_Width_list "PARAM_VALUE.C_PROBE${i}_MU_TYPE"
}





# shorthand proc for generating a list of values across a range
proc range {start end} {
   if {$start > $end} {
      set inc -1
   } else {
      set inc 1
   }
   for {set i $start} {$i!=$end+$inc} {incr i} {
      tcl::lappend lr $i
   }
   return [join $lr " "]
}

EvalSubstituting { ARGS2 } {
proc textdt_updated {IPINST PARAM_VALUE.C_SLOT $ARGS2} {
  set slot [get_property value ${PARAM_VALUE.C_SLOT}]
  set name "PARAM_VALUE.C_SLOT_${slot}_INTF_TYPE"
  if { [get_property value [set $name]] == "xilinx.com:interface:aximm_rtl:1.0" } {
    return "<b>Data and/or Trigger configurion for AXI-MM Interface channel"
  } elseif { [get_property value [set $name]] == "xilinx.com:interface:axis_rtl:1.0" } {
    return "<b>Data and/or Trigger configurion for AXI-MM Interface"
  }
}
} 0


proc validate_PARAM_VALUE.C_NUM_MONITOR_SLOTS { IPINST PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_OF_PROBES } {
	# Procedure called to validate C_NUM_MONITOR_SLOTS
	set np [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
    set ns [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]
    set mode [get_property value ${PARAM_VALUE.C_MON_TYPE}]
    #set interfaceStruct [get_interface_information]
    set interfaceStruct ""
    set num_slot_ports_i [expr 0]
    set tot_no_i [expr 0] 
    set intf_cnt [expr 0]
    if {$mode != "Net_Probes"} {

      foreach interface [dict keys $interfaceStruct] {
        if {$interface != "RST.resetn" && $interface != "CLK.clk" } {
          if {$intf_cnt < $ns} { 
            set interfaceInfo [dict get $interfaceStruct $interface]
              foreach prop [dict keys $interfaceInfo] {
                if { $prop == "ports" } {
                  set ports [dict get $interfaceInfo $prop]
                  foreach keyValue [dict key $ports] {
                    set num_slot_ports_i [expr $num_slot_ports_i + 1]
                  }
                }
              }

              set intf_cnt [expr $intf_cnt + 1]
            }
          }
        }
      
  
  #send_msg INFO 999 "$num_slot_ports_i"
  if {$ns > $intf_cnt } {
    set tot_no_i [expr $np + [expr $ns * 45]]
  } else {
    set tot_no_i [expr $np + $num_slot_ports_i]
  }

	  if {$ns > 16 || $ns == [expr 0]} {
	    set_property errmsg "valid number of interfaces must be within 1 to 16"  ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}
	    return false
	  } elseif {$tot_no_i > [expr 1024] } {
        set_property errmsg "Total number of individual Probes and Ports within Slots ($ns) must not exceed 1024." ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}
        return false
      } else {
        return true
      }
    
  }  
    set intf_cnt [expr 0]
}

proc update_PARAM_VALUE.C_EN_AXIS_IF { PARAM_VALUE.C_EN_AXIS_IF } {
	# Procedure called to update C_EN_AXIS_IF when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.C_EN_AXIS_IF { PARAM_VALUE.C_EN_AXIS_IF } {
	# Procedure called to validate C_EN_AXIS_IF 
	return true
}

set p { proc update_PARAM_VALUE.C_SLOT_<<i>>_AXI_DATA_WIDTH { PARAM_VALUE.C_SLOT_<<i>>_AXI_DATA_WIDTH PARAM_VALUE.C_SLOT_<<i>>_INTF_TYPE PARAM_VALUE.C_SLOT_<<i>>_AXI_PROTOCOL} {
	# Procedure called to update C_SLOT_<<i>>_AXI_DATA_WIDTH when any of the dependent parameters in the arguments change

  set intf [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_INTF_TYPE}]
  
  if {$intf == "xilinx.com:interface:aximm_rtl:1.0"} {
    set proto [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_PROTOCOL}]
 
    if {$proto == "AXI4LITE" } {
      set temp_list "AUTO,32,64"
      set_property range "$temp_list" ${PARAM_VALUE.C_SLOT_<<i>>_AXI_DATA_WIDTH}
    } else {  
      set temp_list " AUTO,32,64,128,256,512,1024"
      set_property range "$temp_list" ${PARAM_VALUE.C_SLOT_<<i>>_AXI_DATA_WIDTH}
    }
#send_msg INFO 999 "mon_mode = $intf, proto = $proto" 
  }
}




proc update_PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL { PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL_TRIG PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL_DATA } {
	# Procedure called to update C_SLOT_<<i>>_AXI_AW_SEL when any of the dependent parameters in the arguments change
    set d [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL_DATA}]
    set t [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL_TRIG}]

    if {$d == 1 || $t == 1} {
      set_property value {1} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL}
    } else {
      set_property value {0} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL}
    }
}
proc validate_PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL { PARAM_VALUE.C_SLOT_<<i>>_AXI_AW_SEL } {
	# Procedure called to validate C_SLOT_<<i>>_AXI_AW_SEL
	return true
}

proc update_PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL { PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL  PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL_TRIG PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL_DATA } {
	# Procedure called to update C_SLOT_<<i>>_AXI_AR_SEL when any of the dependent parameters in the arguments change
    set d [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL_DATA}]
    set t [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL_TRIG}]
    if {$d == 1 || $t == 1} {
      set_property value {1} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL}
    } else {
      set_property value {0} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_AR_SEL}
    }
    
}
proc update_PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL { PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL  PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL_TRIG PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL_DATA } {
	# Procedure called to update C_SLOT_<<i>>_AXI_W_SEL when any of the dependent parameters in the arguments change
    set d [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL_DATA}]
    set t [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL_TRIG}]
    if {$d == 1 || $t == 1} {
      set_property value {1} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL}
    } else {
      set_property value {0} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_W_SEL}
    }

}


proc update_PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL { PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL  PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL_TRIG PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL_DATA } {
	# Procedure called to update C_SLOT_<<i>>_AXI_R_SEL when any of the dependent parameters in the arguments change
    set d [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL_DATA}]
    set t [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL_TRIG}]
    if {$d == 1 || $t == 1} {
      set_property value {1} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL}
    } else {
      set_property value {0} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_R_SEL}
    }

}
proc update_PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL { PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL  PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL_TRIG PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL_DATA } {
	# Procedure called to update C_SLOT_<<i>>_AXI_B_SEL when any of the dependent parameters in the arguments change
    set d [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL_DATA}]
    set t [get_property value ${PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL_TRIG}]
    if {$d == 1 || $t == 1} {
      set_property value {1} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL}
    } else {
      set_property value {0} ${PARAM_VALUE.C_SLOT_<<i>>_AXI_B_SEL}
    }

}


}


for {set i 0} {$i < 16} {incr i} {
 

set P1  [regsub -all <<i>> $p $i  ]
eval $P1 

}


EvalSubstituting { ARGS_ALL} {

proc update_PARAM_VALUE.C_BRAM_CNT  {IPINST PARAM_VALUE.C_BRAM_CNT PARAM_VALUE.C_DATA_DEPTH PARAM_VALUE.C_MON_TYPE PARAM_VALUE.C_NUM_MONITOR_SLOTS PARAM_VALUE.C_NUM_OF_PROBES $ARGS_ALL } {
#variable bram_size

#update_bram_bits
 set num_probes [get_property value ${PARAM_VALUE.C_NUM_OF_PROBES}]
 set num_slots [get_property value ${PARAM_VALUE.C_NUM_MONITOR_SLOTS}]
 set mon_mode [get_property value ${PARAM_VALUE.C_MON_TYPE}]
 set data_depth [get_property value ${PARAM_VALUE.C_DATA_DEPTH}]

 set native_sizek [expr $data_depth / 1024]
 set width_val 0
 # initialized with 1 as 1 bit is required for trigger mark
 set total_native_bits [expr 0]
 set type "0" 
 set p [expr 0]

  if { $mon_mode != "Interface_Monitor" } {

    for {set j 0} {$j < $num_probes} {incr j} {
        set type "PARAM_VALUE.C_PROBE${j}_TYPE"
        set width "PARAM_VALUE.C_PROBE${j}_WIDTH"
        set type_val [get_property value [set $type]]
        set width_val [get_property value [set $width]]
        if {$type_val != [expr 2]} {
          set total_native_bits [expr $total_native_bits + $width_val]
        }  

    }

  }

set total_slot_probes [expr $total_native_bits]

if { $mon_mode != "Net_Probes" } {

###########################################################################################################################################
###########################################################################################################################################  

set i [expr 0]
set vlnv ""
set vbresp ""
set vburst ""
set vcache ""
set vlock ""
set vprot ""
set vqos ""
set vregion ""
set vrresp ""
set vwstrb ""
set vtstrb ""
set vtkeep ""
set aw "32"
set dw "32"
set idw "32"
set tdw "32"
set tidw "32"
set tuw "32"
set tdestw "32"
set aruw 0
set ruw  0
set awuw 0
set wuw 0
set buw 0 
set sum_axi4 0
set sum_axis 0
set apc_bits 0
set intf_probe_cnt 0 
set txn_trk_bits [expr 0]
set intf "xilinx.com:interface:aximm_rtl:1.0"

#set interfaceStruct [get_interface_information]
    set interfaceStruct ""
#send_msg INFO 23 "843 $interfaceStruct"

foreach interface [dict keys $interfaceStruct] {
   if {$interface != "RST.resetn" && $interface != "CLK.clk" } {
     set interfaceInfo [dict get $interfaceStruct $interface]
     foreach prop [dict keys $interfaceInfo] {
       if { $prop == "ABSTRACTION_TYPE_VLNV" || $prop == "parameters" || $prop == "ports"} {  
       ##each prop key is the vlnv of interfaces
       if { $prop == "ABSTRACTION_TYPE_VLNV"} {
         set vlnv [dict get $interfaceInfo $prop]
       }
       if {$i < 16 } {
         set apc "PARAM_VALUE.C_SLOT_${i}_APC_EN"
         set apc_e [get_property value [set $apc]]
         
         set apc_sts "PARAM_VALUE.C_SLOT_${i}_APC_STS_EN"
         set apc_sts_e  [get_property value [set $apc_sts]]

         set txn_cntr "PARAM_VALUE.C_SLOT_${i}_TXN_CNTR_EN"
         set txn_cntr_e  [get_property value [set $txn_cntr]]

         set rdtxn_cnt "PARAM_VALUE.C_SLOT_${i}_MAX_RD_BURSTS"
         set rdtxn_cntr [get_property value [set $rdtxn_cnt]]
         set rdtxn_cntr_w [expr int(log($rdtxn_cntr) /log(2)) + 1]

         set wrtxn_cnt "PARAM_VALUE.C_SLOT_${i}_MAX_WR_BURSTS"
         set wrtxn_cntr [get_property value [set $wrtxn_cnt]]
         set wrtxn_cntr_w [expr int(log($wrtxn_cntr) /log(2)) + 1]
         
         if {$txn_cntr_e == 1 } {
           set txn_trk_bits [expr $rdtxn_cntr_w + $wrtxn_cntr_w]
         } else {
           set txn_trk_bits [expr 0]
         }         


         set awsel "PARAM_VALUE.C_SLOT_${i}_AXI_AW_SEL_DATA"
         set aw_sel [get_property value [set $awsel]]
         
         set arsel "PARAM_VALUE.C_SLOT_${i}_AXI_AR_SEL_DATA"
         set ar_sel [get_property value [set $arsel]]
        
         set wsel "PARAM_VALUE.C_SLOT_${i}_AXI_W_SEL_DATA"
         set w_sel [get_property value [set $wsel]]
        
         set rsel "PARAM_VALUE.C_SLOT_${i}_AXI_R_SEL_DATA"
         set r_sel [get_property value [set $rsel]]
         
         set bsel "PARAM_VALUE.C_SLOT_${i}_AXI_B_SEL_DATA"
         set b_sel [get_property value [set $bsel]]
        
         set protocol "PARAM_VALUE.C_SLOT_${i}_AXI_PROTOCOL"
         set proto [get_property value [set $protocol]] 
         
         set addr_width "PARAM_VALUE.C_SLOT_${i}_AXI_ADDR_WIDTH"
         set aw_w [get_property value [set $addr_width]]

         set data_width "PARAM_VALUE.C_SLOT_${i}_AXI_DATA_WIDTH"
         set dw_w [get_property value [set $data_width]]
      
         set id_width "PARAM_VALUE.C_SLOT_${i}_AXI_ID_WIDTH"
         set idw_w [get_property value [set $id_width]] 

         set awuser_width "PARAM_VALUE.C_SLOT_${i}_AXI_AWUSER_WIDTH"
         set awuw_w [get_property value [set $awuser_width]]
        
         set wuser_width "PARAM_VALUE.C_SLOT_${i}_AXI_WUSER_WIDTH"
         set wuw_w [get_property value [set $wuser_width]]
        
         set buser_width "PARAM_VALUE.C_SLOT_${i}_AXI_BUSER_WIDTH"
         set buw_w [get_property value [set $buser_width]] 
        
         set aruser_width "PARAM_VALUE.C_SLOT_${i}_AXI_ARUSER_WIDTH"
         set aruw_w [get_property value [set $aruser_width]] 
        
         set ruser_width "PARAM_VALUE.C_SLOT_${i}_AXI_RUSER_WIDTH"
         set ruw_w [get_property value [set $ruser_width]] 
        
         set tdata_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TDATA_WIDTH"
         set tdw_w [get_property value [set $tdata_width]]       

         set tid_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TID_WIDTH"
         set tidw_w [get_property value [set $tid_width]] 

         set tuser_width "PARAM_VALUE.C_SLOT_${i}_AXIS_TUSER_WIDTH"
         set tuw_w [get_property value [set $tuser_width]] 

         set tdest "PARAM_VALUE.C_SLOT_${i}_AXIS_TDEST_WIDTH"
         set tdestw_w [get_property value [set $tdest]]

         set axis_data "PARAM_VALUE.C_SLOT_${i}_AXI_DATA_SEL"
         set axis_d [get_property value [set $axis_data]]

         set intf_type "PARAM_VALUE.C_SLOT_${i}_INTF_TYPE" 
         set intf [get_property value [set $intf_type]]

         set dt_type "PARAM_VALUE.C_SLOT_${i}_TYPE" 
         set dt_i [get_property value [set $dt_type]]
         
         set vwstrb ""
         set vtstrb ""
       ## AXI interfaces
       if {$vlnv == "xilinx.com:interface:aximm_rtl:1.0" || $vlnv == "xilinx.com:interface:axis_rtl:1.0"} {
         if { $prop == "parameters" } {

           set params [dict get $interfaceInfo $prop]
           foreach keyValue [dict key $params] {

             if { $keyValue == "HAS_BRESP"} { 
               set vbresp [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_BURST"} { 
               set vburst [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_CACHE"} { 
               set vcache [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_LOCK"} { 
               set vlock [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_PROT"} { 
               set vprot [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_QOS"} { 
               set vqos [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_REGION"} { 
               set vregion [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_RRESP"} { 
               set vrresp [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_WSTRB"} { 
               set vwstrb [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TKEEP"} { 
               set vtkeep [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TLAST"} { 
               set vtast [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TREADY"} { 
               set vtready [dict get [dict get $params $keyValue] VALUE]
             }
             if { $keyValue == "HAS_TSTRB"} { 
               set vtstrb [dict get [dict get $params $keyValue] VALUE]
             }
          
            
             if { $keyValue == "ARUSER_WIDTH"} { 
               set aruw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "RUSER_WIDTH"} { 
               set ruw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "AWUSER_WIDTH"} { 
               set awuw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "WUSER_WIDTH"} { 
               set wuw [dict get [dict get $params $keyValue] VALUE]
             }
            
             if { $keyValue == "BUSER_WIDTH"} { 
               set buw [dict get [dict get $params $keyValue] VALUE]
             }
                         
             if {$aw_w == "AUTO"} { 
               if { $keyValue == "ADDR_WIDTH"} { 
                 set aw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set aw $aw_w
             }
             
             if {$dw_w == "AUTO"} { 
               if { $keyValue == "DATA_WIDTH"} { 
                 set dw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set dw $dw_w
             }
             set w_strb [expr $dw / 8]
             
             if {$idw_w == "AUTO" } { 
               if { $keyValue == "ID_WIDTH"} { 
                 set idw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set idw $idw_w
             }

             if {$tdw_w == "AUTO" } { 
               if { $keyValue == "TDATA_NUM_BYTES"} { 
                 set tdw [expr [dict get [dict get $params $keyValue] VALUE] * 8]
               }
             } else {
               set tdw $tdw_w
             }
             set tstrb_w [expr $tdw / 8]
            

             if {$tidw_w == "AUTO" } { 
               if { $keyValue == "TID_WIDTH"} { 
                 set tidw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set tidw $tidw_w
             }

             if {$tuw_w == "AUTO" } { 
               if { $keyValue == "TUSER_WIDTH"} { 
                 set tuw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set tuw $tuw_w
             }
            
             if {$tdestw_w == "AUTO" } { 
               if { $keyValue == "TDEST_WIDTH"} { 
                 set tdestw [dict get [dict get $params $keyValue] VALUE]
               }
             } else {
               set tdestw $tdestw_w
             }  

             if {$vtkeep == [expr 1]} {
              set tkeep $tstrb_w
             } else {
              set tkeep [expr 0]
             }
             if {$vtstrb == [expr 1]} {
              set tstrb $tstrb_w
             } else {
              set tstrb [expr 0]
             }
             if {$vbresp == [expr 1]} {
              set bresp [expr 2]
             } else {
              set bresp [expr 0]
             }
             if {$vburst == [expr 1] && $proto != "AXI4LITE"} {
              set burst [expr 2]
             } else {
              set burst [expr 0]
             }
             if {$vcache == [expr 1] && $proto != "AXI4LITE"} {
              set cache [expr 4]
             } else {
              set cache [expr 0]
             }
             if {$vlock == [expr 1] && $proto != "AXI4LITE"} {
              if {$proto == "AXI3" } {
                set lock [expr 2]
              } else {
                set lock [expr 1]
              }
             } else {
              set lock [expr 0]
             }
             if {$vprot == [expr 1]} {
              set prot [expr 3]
             } else {
              set prot [expr 0]
             }
             if {$vqos == [expr 1] && $proto != "AXI4LITE"} {
              set qos [expr 4]
             } else {
              set qos [expr 0]
             }
             if {$vregion == [expr 1]} {
              if {$proto == "AXI4" } {
                set region [expr 4]
              } else {
                set region [expr 0]
              }
             } else {
              set region [expr 0]
             }
             if {$vrresp == [expr 1]} {
              set rresp [expr 2]
             } else {
              set rresp [expr 0]
             }
             if {$vwstrb == [expr 1]} {
              set wstrb $w_strb
             } else {
              set wstrb [expr 0]
             }
            
             if { $proto != "AXI4LITE"} {
              set size [expr 3]
             } else {
              set size [expr 0]
             }
            
             if {$proto == "AXI4LITE"} {
               set axi4_c [expr 10]
             } else {   
               set axi4_c [expr 12]
             }
             
             if {$proto == "AXI4"} {
               set len [expr 8]
             } elseif {$proto == "AXI3"} {   
               set len [expr 4]
             } else {
               set len [expr 0]
             }
             if {$proto == "AXI3"} {
               set wid $idw
             } else {   
               set wid [expr 0]
             }
             
             if {$aw_sel == 1} { 
               set axi4_aw [expr $burst + $cache + $lock + $prot + $qos + $region + $idw + $awuw + $len + $size + $aw]
             } else {
               set axi4_aw [expr $idw]
             }
             
             if {$ar_sel == 1} { 
               set axi4_ar [expr $burst + $cache + $lock + $prot + $qos + $region + $idw + $awuw + $len + $size + $aw]
             } else {
               set axi4_ar [expr $idw]
             }
             
             if {$w_sel == 1} { 
               set axi4_w [expr $wid + $wstrb + $wuw + $dw]
             } else {
               set axi4_w [expr $wid]
             }
             
             if {$r_sel == 1} { 
               set axi4_r [expr $ruw + $dw + $rresp + $idw]
             } else {
               set axi4_r [expr $idw]
             }
             
             if {$b_sel == 1} { 
               set axi4_b [expr $bresp + $idw + $buw]
             } else {
               set axi4_b [expr $idw]
             }
             
             
             if {$apc_e == [expr 1] } {
               if {$apc_sts_e == [expr 1] } {
                 set apc_bits [expr 98]
               } else {
                 set apc_bits [expr 1]
               }
             } else {
               set apc_bits [expr 0]
             }
            
             set sum_axi4 [expr $axi4_aw + $axi4_ar + $axi4_w + $axi4_r + $axi4_b + $axi4_c ] 
            
            
             if {$axis_d == [expr 1]} {
               set sum_axis [expr $tdw + $tidw + $tuw + $tstrb + $tkeep + $tdestw + 3]
             } else {
               set sum_axis [expr 3]
             } 
            
            
             if {$apc_e == [expr 1] } {
               if {$apc_sts_e == [expr 1] } {
                 set apc_bits_s [expr 12]
               } else {
                 set apc_bits_s [expr 1]
               }
             } else {
               set apc_bits_s [expr 0]
             }
           }

         }

         ## Non-AXI interfaces 
         } elseif {$vlnv != "xilinx.com:interface:aximm_rtl:1.0" && $vlnv != "xilinx.com:interface:axis_rtl:1.0" && $vlnv != ""} {

           if { $prop == "ports" } {
             set ports [dict get $interfaceInfo $prop]
             foreach keyValue [dict key $ports] {
               set intf_probe_cnt [expr [expr [dict get [dict get $ports $keyValue] PHYSICAL_LEFT]+1] + $intf_probe_cnt]
             }
           }

         }
       }
      }
     }
     
     set i [expr $i + 1]

  ################# ESTIMATION LOGIC ####################
      
      # The following code selects the appropriate set of control or data signals for each protocol
      if {$vlnv == "xilinx.com:interface:aximm_rtl:1.0"} {
        set num_slot_bits [expr $sum_axi4 + $apc_bits + $txn_trk_bits]
      } elseif {$vlnv == "xilinx.com:interface:axis_rtl:1.0"} {
        set num_slot_bits [expr $sum_axis + $apc_bits_s]
      } elseif {$vlnv != "xilinx.com:interface:aximm_rtl:1.0" && $vlnv != "xilinx.com:interface:axis_rtl:1.0" && $vlnv != ""} {
        if {$dt_i != [expr 2] } {
          set num_slot_bits $intf_probe_cnt
        } else {
          set num_slot_bits [expr 0]
        }
      }
      set total_slot_probes [expr $total_slot_probes + $num_slot_bits] 
      ################# ESTIMATION ENDS #####################

   
    }
  }
  
}
##############################################
#set total_slot_probes 100
set size36 [expr $native_sizek * $total_slot_probes / 36 ]
set size36sub [expr [expr $native_sizek * $total_slot_probes ] - [expr 36 * $size36]]
set size18 [expr $size36sub / 18 ]
set size18sub [expr [expr $size36sub ] - [expr $size18 * 18]]


if {$size36sub > [expr 18] && $size18sub > [expr 0]} {
  set size [expr $size36 + 1]
} elseif { $size36sub < [expr 18] && $size18sub > [expr 0] } {
  set size [expr $size36 + 0.5]
} elseif { $size36sub == [expr 18] && $size18sub == [expr 0] } {
  set size [expr $size36 + 0.5]
} else {
  set size [expr $size36]
}

set bram_size [expr $size]

set temp_list $bram_size 
set_property range "$temp_list" ${PARAM_VALUE.C_BRAM_CNT}
set_property enabled false ${PARAM_VALUE.C_BRAM_CNT}

}
} 0

  
proc validate_PARAM_VALUE.C_BRAM_CNT { PARAM_VALUE.C_BRAM_CNT } {
   set bram_size [get_property value ${PARAM_VALUE.C_BRAM_CNT}]
   set max_bram_size [xit::get_device_data D_BRAM_COUNT -of [xit::current_scope]] 


    #if {[expr $bram_size] > [expr $max_bram_size] } {
	#  set_property errmsg "The maximum BRAM utilization cannot exceed $max_bram_size BRAMs in this device" ${PARAM_VALUE.C_BRAM_CNT}
	#  return false
    #} else {
      return true
    #}
}    



