| #set olddir [pwd] |
| #cd $::env(TMP_DIR) |
| |
| lef read $::env(TECH_LEF) |
| #load $::env(magic_result_file_tag).mag |
| if { [info exist ::env(EXTRA_LEFS)] } { |
| set lefs_in $::env(EXTRA_LEFS) |
| foreach lef_file $lefs_in { |
| lef read $lef_file |
| } |
| } |
| def read $::env(CURRENT_DEF) |
| |
| set fout [open $::env(magic_log_file_tag).drc w] |
| set oscale [cif scale out] |
| set cellname $::env(DESIGN_NAME) |
| magic::suspendall |
| puts stdout "loading $cellname\n" |
| flush stdout |
| load $cellname |
| select top cell |
| drc check |
| |
| puts stdout "Saving mag view with drc errors($::env(magic_result_file_tag).drc.mag)" |
| save $::env(magic_result_file_tag).drc.mag |
| puts stdout "saved" |
| |
| set drcresult [drc listall why] |
| set count [llength drcresult] |
| puts $fout "$cellname count: $count" |
| puts $fout "----------------------------------------" |
| foreach {errtype coordlist} $drcresult { |
| puts $fout $errtype |
| puts $fout "----------------------------------------" |
| foreach coord $coordlist { |
| set bllx [expr {$oscale * [lindex $coord 0]}] |
| set blly [expr {$oscale * [lindex $coord 1]}] |
| set burx [expr {$oscale * [lindex $coord 2]}] |
| set bury [expr {$oscale * [lindex $coord 3]}] |
| set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury] |
| puts $fout "$coords" |
| } |
| puts $fout "----------------------------------------" |
| } |
| puts $fout "" |
| close $fout |
| |
| puts stdout "drc checking done ($::env(magic_log_file_tag).drc)" |
| flush stdout |
| |
| #cd $olddir |
| exit 0 |