proc fix_drc {} {
drc on
drc check
drc catchup
redirect_variable drccount {puts [drc count total]}
set drcc [string map {"Total DRC errors found: " ""} $drccount]
puts $drccount
puts $drcc
if {$drcc > 0} {
redirect_variable drcresult {puts [drc find]}
puts $drcresult
if {[string first "Local interconnect spacing" $drcresult] != -1} {
erase li
drc check
drc catchup
redirect_variable drccountnew {puts [drc count total]}
set drccn [string map {"Total DRC errors found: " ""} $drccountnew]
if {$drccn < $drcc} {
puts "Hoory, we fixed a DRC issue"
} else {
puts "Trying to fix this DRC issue caused more issues so we undo and try something else"
undo
}
}
}
}