Altera_Forum
Honored Contributor
15 years agoIssue in component editor
Hi all.
I try to write a validation callback for a component I just wrote. I get a weird TCL issue (that I don't get in a classical TCL script, I checked) Here is my code: --- Quote Start --- ... set_module_property NAME pio ... set_module_property VALIDATION_CALLBACK validate ... add_parameter PORT_31_TRISTATE BOOLEAN false set_parameter_property PORT_31_TRISTATE DEFAULT_VALUE false set_parameter_property PORT_31_TRISTATE DISPLAY_NAME PORT_31_TRISTATE set_parameter_property PORT_31_TRISTATE UNITS None set_parameter_property PORT_31_TRISTATE DISPLAY_HINT "" set_parameter_property PORT_31_TRISTATE AFFECTS_GENERATION false set_parameter_property PORT_31_TRISTATE HDL_PARAMETER true ... add_parameter PORT_31_INIT STRING TIE_DOWN set_parameter_property PORT_31_INIT DEFAULT_VALUE TIE_DOWN set_parameter_property PORT_31_INIT DISPLAY_NAME PORT_31_INIT set_parameter_property PORT_31_INIT UNITS None set_parameter_property PORT_31_INIT ALLOWED_RANGES {"TIE_UP" "TIE_DOWN" "HIGH_Z" "INPUT" "INPUT_n"} set_parameter_property PORT_31_INIT DISPLAY_HINT radio set_parameter_property PORT_31_INIT AFFECTS_GENERATION false set_parameter_property PORT_31_INIT HDL_PARAMETER true ... proc validate {} { if {(![get_parameter_value PORT_31_TRISTATE]) && ([get_parameter_value PORT_31_INIT] == "HIGH_Z")} { send_message error "PORT_31_INIT cannot be set to 'HIGH_Z' as PORT_31_TRISTATE has been set to false" }[/INDENT] } ... --- Quote End --- Then I get the following error message at SOPC Builder startup, when the code is sourced: --- Quote Start --- Error: pio_0: can't use non-numeric string as operand of "!" ("if" test expression) invoked from within "if {(![get_parameter_value PORT_31_TRISTATE]) && ([get_parameter_value PORT_31_INIT] == "HIGH_Z")} { send_message error "PORT_31_INIT cannot be set ..." (procedure "validate" line 2) invoked from within "validate" --- Quote End --- Can you tell me what is wrong??? Thx