0

I am new to TCL and hardware design. I am currently doing a script that could verify all the ports at an edge and make a rectangle box that cover all the ports at an edge.

Since I am new to TCL, I think there is something wrong in the syntax. enter image description here

The error msg is:

Error: Invalid coordinates '$bbox_coor_x1 [expr $bbox_coor_y2-30]' in list. (NDMUI-100) Error: Empty or invalid geometry specified for the '-boundary' argument of the command. (NDMUI-337).

Please help me.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215

1 Answers1

1

Your problem is that variables and commands are not interpolated inside curly braces. Please learn the difference between curlies and double quotes.

For example:

set x 5
set y 10

# Curlies
puts {$x $y}
   --> $x $y  (literally)
puts {$x [expr $y+1]}
   --> $x [expr $y+1]  (literally)

# Double quotes
puts "$x $y"
   --> 5 10

# List command
puts [list $x $y]
   --> 5 10
puts [list $x [expr $y+1]]
   --> 5 11

When making a list of lists, like a bbox, anything inside outer-most curlies will interpolate:

puts "{$x $x} {$y $y}"
   --> {5 5} {10 10}

One more thing, note that lindex can take multiple indexes. Do this instead of calling lindex twice.

lindex $bbox 0 1  
Chris Heithoff
  • 1,787
  • 1
  • 5
  • 14