Why Am I Getting a Different Behavior Between the set_app_var Command and the set Command in a Procedure? Doc Id:033324 Product:Design Compiler Last Modified:07/07/2011 Average User Rating:
Question:I wrote the following Tcl procedure and noticed a different behavior between the set_app_var command and the set command.proc.tcl:proc abc {} {set bind_unused_hierarchical_pins false}proc def {} {set_app_var bind_unused_hierarchical_pins false}When I ran the following commands in Design Compiler,dc_shell> source ./proc.tcldc_shell> set bind_unused_hierarchical_pins truedc_shell> abc dc_shell> printvar bind_unused_hierarchical_pinsdc_shell> defdc_shell> printvar bind_unused_hierarchical_pinsthe first printvar command returned a true value, and the second printvar command returned a false value.It seems that the set command fails to set a Design Compiler application variable in a procedure and that only the set_app_var command correctly sets a Design Compiler application variable in a procedure. Is this the expected behavior? Answer:All variables within a procedure are local unless you set them as global. Using the set_app_var command correctly sets the scope to global automatically.The following update to your procedure will resolve the problem:proc abc {} {global bind_unused_hierarchical_pinsset bind_unused_hierarchical_pins false}