Ahmed Ghazy | 6eaeda8 | 2020-12-31 00:40:03 +0000 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 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 | # SPDX-License-Identifier: Apache-2.0 |
| 15 | |
| 16 | gds read $::env(DESIGN_IN_DRC).gds |
| 17 | set fout [open ./tmp/$::env(DESIGN_IN_DRC).drc w] |
| 18 | set oscale [cif scale out] |
| 19 | set cell_name $::env(DESIGN_IN_DRC) |
| 20 | magic::suspendall |
| 21 | puts stdout "\[INFO\]: Loading $::env(DESIGN_IN_DRC)\n" |
| 22 | flush stdout |
| 23 | load $::env(DESIGN_IN_DRC) |
| 24 | select top cell |
| 25 | drc euclidean on |
| 26 | drc style drc(full) |
| 27 | drc check |
| 28 | set drcresult [drc listall why] |
| 29 | set count 0 |
| 30 | puts $fout "$::env(DESIGN_IN_DRC)" |
| 31 | puts $fout "----------------------------------------" |
| 32 | foreach {errtype coordlist} $drcresult { |
| 33 | puts $fout $errtype |
| 34 | puts $fout "----------------------------------------" |
| 35 | foreach coord $coordlist { |
| 36 | set bllx [expr {$oscale * [lindex $coord 0]}] |
| 37 | set blly [expr {$oscale * [lindex $coord 1]}] |
| 38 | set burx [expr {$oscale * [lindex $coord 2]}] |
| 39 | set bury [expr {$oscale * [lindex $coord 3]}] |
| 40 | set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury] |
| 41 | puts $fout "$coords" |
| 42 | set count [expr {$count + 1} ] |
| 43 | } |
| 44 | puts $fout "----------------------------------------" |
| 45 | } |
| 46 | |
| 47 | puts $fout "\[INFO\]: COUNT: $count" |
| 48 | puts $fout "\[INFO\]: Should be divided by 3 or 4" |
| 49 | |
| 50 | puts $fout "" |
| 51 | close $fout |
| 52 | |
| 53 | puts stdout "\[INFO\]: COUNT: $count" |
| 54 | puts stdout "\[INFO\]: Should be divided by 3 or 4" |
| 55 | puts stdout "\[INFO\]: DRC Checking DONE (./tmp/$::env(DESIGN_IN_DRC).drc)" |
| 56 | flush stdout |
| 57 | |
| 58 | puts stdout "\[INFO\]: Saving mag view with DRC errors(./tmp/$::env(DESIGN_IN_DRC).drc.mag)" |
| 59 | # WARNING: changes the name of the cell; keep as last step |
| 60 | save ./tmp/$::env(DESIGN_IN_DRC).drc.drc.mag |
| 61 | puts stdout "\[INFO\]: Saved" |