blob: 554a4c6aae1af410f655a7252540da2169e7b370 [file] [log] [blame]
agorararmard6c766a82020-12-10 18:13:12 +02001# SPDX-FileCopyrightText: 2020 Efabless Corporation
Mohamed Kassem7a3f4782020-10-27 12:31:18 -07002#
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.
agorararmardafa96ea2020-12-09 23:37:31 +020014# SPDX-License-Identifier: Apache-2.0
Mohamed Kassem7a3f4782020-10-27 12:31:18 -070015set ::env(DESIGN_NAME) openram_tc_1kb
16drc off
17lef read ../lef/sram_1rw1r_32_256_8_sky130_lp1.lef
18load sram_1rw1r_32_256_8_sky130 -dereference
19load openram_tc_core -dereference
20load openram_tc_1kb -dereference
21
22drc style drc(full)
23drc euclidean on
24
25set fout [open drc.log w]
26set oscale [cif scale out]
27set cell_name $::env(DESIGN_NAME)
28magic::suspendall
29puts stdout "\[INFO\]: Loading $cell_name\n"
30flush stdout
31load $cell_name
32select top cell
33drc check
34set drcresult [drc listall why]
35
36
37set count 0
38puts $fout "$cell_name"
39puts $fout "----------------------------------------"
40foreach {errtype coordlist} $drcresult {
41 puts $fout $errtype
42 puts $fout "----------------------------------------"
43 foreach coord $coordlist {
44 set bllx [expr {$oscale * [lindex $coord 0]}]
45 set blly [expr {$oscale * [lindex $coord 1]}]
46 set burx [expr {$oscale * [lindex $coord 2]}]
47 set bury [expr {$oscale * [lindex $coord 3]}]
48 set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury]
49 puts $fout "$coords"
50 set count [expr {$count + 1} ]
51 }
52 puts $fout "----------------------------------------"
53}
54
55puts $fout "\[INFO\]: COUNT: $count"
56puts $fout "\[INFO\]: Should be divided by 3 or 4"
57
58puts $fout ""
59close $fout
60
61puts stdout "\[INFO\]: COUNT: $count"
62puts stdout "\[INFO\]: Should be divided by 3 or 4"
63puts stdout "\[INFO\]: DRC Checking DONE ($::env(DESIGN_NAME).drc)"
64flush stdout
65
66puts stdout "\[INFO\]: Saving mag view with DRC errors($::env(DESIGN_NAME).drc.mag)"
67# WARNING: changes the name of the cell; keep as last step
68save $::env(DESIGN_NAME).drc.mag
69puts stdout "\[INFO\]: Saved"
70
71exit 0