@@ -865,9 +865,9 @@ proc exclude_io_pin_region { args } {
865865
866866# Define command arguments for create_blockage (region in microns, density 0-100)
867867sta::define_cmd_args " create_blockage" { \
868- [ -region {x1 y1 x2 y2}] \
869- [-inst instance]\
870- [-max_density density]\
868+ -region {x1 y1 x2 y2} \
869+ [-inst instance] \
870+ [-max_density density] \
871871 [-soft]}
872872
873873# Placement blockages with various options
@@ -966,6 +966,93 @@ proc create_blockage { args } {
966966 return $blockage
967967}
968968
969+ # Define command arguments for create_obstruction
970+ sta::define_cmd_args " create_obstruction" { \
971+ -region {x1 y1 x2 y2} \
972+ -layer layer \
973+ [-inst instance] \
974+ [-slot] [-fill] [-except_pg] \
975+ [-min_spacing space] \
976+ [-effective_width width]}
977+
978+ # Placement blockages with various options
979+ proc create_obstruction { args } {
980+ sta::parse_key_args " create_obstruction" args \
981+ keys {-region -layer -inst -min_spacing -effective_width} \
982+ flags {-slot -fill -except_pg}
983+
984+ # Check that no extra arguments remain
985+ sta::check_argc_eq0 " create_obstruction" $args
986+
987+ if { ![info exists keys(-layer)] } {
988+ utl::error ODB 1017 " -layer is required"
989+ }
990+ set layer [[ord::get_db_tech] findLayer $keys(-layer) ]
991+ if { $layer == " NULL" } {
992+ utl::error ODB 1018 " Unable to find $keys(-layer) "
993+ }
994+
995+ # Check if coordinates are valid
996+ if { ![info exists keys(-region)] || [llength $keys(-region) ] != 4 } {
997+ utl::error ODB 1019 " Invalid coordinates. -region must be a list of 4 values {x1 y1 x2 y2}"
998+ }
999+
1000+ set region $keys(-region)
1001+ set x1 [ord::microns_to_dbu [lindex $region 0]]
1002+ set y1 [ord::microns_to_dbu [lindex $region 1]]
1003+ set x2 [ord::microns_to_dbu [lindex $region 2]]
1004+ set y2 [ord::microns_to_dbu [lindex $region 3]]
1005+
1006+ # Validate coordinate ordering
1007+ if { $x1 >= $x2 || $y1 >= $y2 } {
1008+ utl::error ODB 1020 " Invalid coordinates: \
1009+ x1 ([ ord::dbu_to_microns $x1 ] ) must be < x2 ([ ord::dbu_to_microns $x2 ] ) and \
1010+ y1 ([ ord::dbu_to_microns $y1 ] ) must be < y2 ([ ord::dbu_to_microns $y2 ] )"
1011+ }
1012+
1013+ # Get database objects
1014+ set block [ord::get_db_block]
1015+
1016+ # Extract optional arguments
1017+ set inst_obj " NULL"
1018+ if { [info exists keys(-inst)] } {
1019+ set inst_name $keys(-inst)
1020+ set inst_obj [$block findInst $inst_name ]
1021+ if { $inst_obj == " NULL" } {
1022+ utl::error ODB 1021 " Instance '$inst_name ' not found in design"
1023+ }
1024+ }
1025+
1026+ # Create the obstruction
1027+ set obstruction [odb::dbObstruction_create $block $layer $x1 $y1 $x2 $y2 $inst_obj ]
1028+
1029+ if { $obstruction == " NULL" } {
1030+ utl::error ODB 1022 " Failed to create obstruction"
1031+ }
1032+
1033+ if { [info exists flags(-slot)] } {
1034+ $obstruction setSlotObstruction
1035+ }
1036+
1037+ if { [info exists flags(-fill)] } {
1038+ $obstruction setFillObstruction
1039+ }
1040+
1041+ if { [info exists flags(-except_pg)] } {
1042+ $obstruction setExceptPGNetsObstruction
1043+ }
1044+
1045+ if { [info exists keys(-min_spacing)] } {
1046+ $obstruction setMinSpacing [ord::microns_to_dbu $keys(-min_spacing) ]
1047+ }
1048+
1049+ if { [info exists keys(-effective_width)] } {
1050+ $obstruction setEffectiveWidth [ord::microns_to_dbu $keys(-effective_width) ]
1051+ }
1052+
1053+ return $obstruction
1054+ }
1055+
9691056sta::define_cmd_args " clear_io_pin_constraints" {}
9701057
9711058proc clear_io_pin_constraints { args } {
0 commit comments