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