File: drc.tcl

package info (click to toggle)
magic 8.1.218+ds.1-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 16,604 kB
  • sloc: ansic: 160,782; sh: 7,068; tcl: 3,982; lisp: 2,554; makefile: 918; cpp: 587; csh: 149; awk: 140
file content (45 lines) | stat: -rw-r--r-- 1,312 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#----------------------------------------------
# Dump a file of DRC errors from magic
#----------------------------------------------
namespace path {::tcl::mathop ::tcl::mathfunc}

magic::suspendall
set fout [open "drc.out" w]
set oscale [cif scale out]

select top cell
set origcell [cellname list self]
drc check
set celllist [drc list count]
puts stdout "celllist is $celllist"
puts stdout ""
flush stdout
foreach pair $celllist {
   set cellname [lindex $pair 0]
   set count [lindex $pair 1]
   puts stdout "loading $cellname"
   flush stdout
   
   load $cellname
   select top cell
   puts $fout "$cellname $count"
   puts $fout "----------------------------------------"
   set drcresult [drc listall why]
   foreach {errtype coordlist} $drcresult {
      puts $fout $errtype
      puts $fout "----------------------------------------"
      foreach coord $coordlist {
         set bllx [* $oscale [lindex $coord 0]]
         set blly [* $oscale [lindex $coord 1]]
         set burx [* $oscale [lindex $coord 2]]
         set bury [* $oscale [lindex $coord 3]]
         set coords [format "%.3f %.3f %.3f %.3f" $bllx $blly $burx $bury]
         puts $fout "$coords"
      }
      puts $fout "----------------------------------------"
   }
   puts $fout ""
}
close $fout
load $origcell
magic::resumeall