blob: 9ea88fa66e35052899a3559f9f9b28d917e7e7fd [file] [log] [blame]
Mohamed Kassem7a3f4782020-10-27 12:31:18 -07001# Copyright 2020 Efabless Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14set ::env(DESIGN_NAME) openram_tc_1kb
15drc off
16lef read ../lef/sram_1rw1r_32_256_8_sky130_lp1.lef
17load sram_1rw1r_32_256_8_sky130 -dereference
18load openram_tc_core -dereference
19load openram_tc_1kb -dereference
20
21drc style drc(full)
22drc euclidean on
23
24set fout [open drc.log w]
25set oscale [cif scale out]
26set cell_name $::env(DESIGN_NAME)
27magic::suspendall
28puts stdout "\[INFO\]: Loading $cell_name\n"
29flush stdout
30load $cell_name
31select top cell
32drc check
33set drcresult [drc listall why]
34
35
36set count 0
37puts $fout "$cell_name"
38puts $fout "----------------------------------------"
39foreach {errtype coordlist} $drcresult {
40 puts $fout $errtype
41 puts $fout "----------------------------------------"
42 foreach coord $coordlist {
43 set bllx [expr {$oscale * [lindex $coord 0]}]
44 set blly [expr {$oscale * [lindex $coord 1]}]
45 set burx [expr {$oscale * [lindex $coord 2]}]
46 set bury [expr {$oscale * [lindex $coord 3]}]
47 set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury]
48 puts $fout "$coords"
49 set count [expr {$count + 1} ]
50 }
51 puts $fout "----------------------------------------"
52}
53
54puts $fout "\[INFO\]: COUNT: $count"
55puts $fout "\[INFO\]: Should be divided by 3 or 4"
56
57puts $fout ""
58close $fout
59
60puts stdout "\[INFO\]: COUNT: $count"
61puts stdout "\[INFO\]: Should be divided by 3 or 4"
62puts stdout "\[INFO\]: DRC Checking DONE ($::env(DESIGN_NAME).drc)"
63flush stdout
64
65puts stdout "\[INFO\]: Saving mag view with DRC errors($::env(DESIGN_NAME).drc.mag)"
66# WARNING: changes the name of the cell; keep as last step
67save $::env(DESIGN_NAME).drc.mag
68puts stdout "\[INFO\]: Saved"
69
70exit 0