agorararmard | 6c766a8 | 2020-12-10 18:13:12 +0200 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2020 Efabless Corporation |
Mohamed Kassem | 7a3f478 | 2020-10-27 12:31:18 -0700 | [diff] [blame] | 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. |
agorararmard | afa96ea | 2020-12-09 23:37:31 +0200 | [diff] [blame] | 14 | # SPDX-License-Identifier: Apache-2.0 |
Mohamed Kassem | 7a3f478 | 2020-10-27 12:31:18 -0700 | [diff] [blame] | 15 | set ::env(DESIGN_NAME) openram_tc_1kb |
| 16 | drc off |
| 17 | lef read ../lef/sram_1rw1r_32_256_8_sky130_lp1.lef |
| 18 | load sram_1rw1r_32_256_8_sky130 -dereference |
| 19 | load openram_tc_core -dereference |
| 20 | load openram_tc_1kb -dereference |
| 21 | |
| 22 | drc style drc(full) |
| 23 | drc euclidean on |
| 24 | |
| 25 | set fout [open drc.log w] |
| 26 | set oscale [cif scale out] |
| 27 | set cell_name $::env(DESIGN_NAME) |
| 28 | magic::suspendall |
| 29 | puts stdout "\[INFO\]: Loading $cell_name\n" |
| 30 | flush stdout |
| 31 | load $cell_name |
| 32 | select top cell |
| 33 | drc check |
| 34 | set drcresult [drc listall why] |
| 35 | |
| 36 | |
| 37 | set count 0 |
| 38 | puts $fout "$cell_name" |
| 39 | puts $fout "----------------------------------------" |
| 40 | foreach {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 | |
| 55 | puts $fout "\[INFO\]: COUNT: $count" |
| 56 | puts $fout "\[INFO\]: Should be divided by 3 or 4" |
| 57 | |
| 58 | puts $fout "" |
| 59 | close $fout |
| 60 | |
| 61 | puts stdout "\[INFO\]: COUNT: $count" |
| 62 | puts stdout "\[INFO\]: Should be divided by 3 or 4" |
| 63 | puts stdout "\[INFO\]: DRC Checking DONE ($::env(DESIGN_NAME).drc)" |
| 64 | flush stdout |
| 65 | |
| 66 | puts 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 |
| 68 | save $::env(DESIGN_NAME).drc.mag |
| 69 | puts stdout "\[INFO\]: Saved" |
| 70 | |
| 71 | exit 0 |