mkk | 91ada92 | 2020-12-02 09:08:26 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | export PDK_ROOT=~/foss/pdks/open_pdks/sky130; |
| 4 | export MAGTYPE=mag ; |
| 5 | export PDKPATH=$PDK_ROOT/sky130A ; |
| 6 | export MAGIC=magic |
| 7 | |
| 8 | $MAGIC -rcfile $PDKPATH/libs.tech/magic/current/sky130A.magicrc -dnull -noconsole <<EOF |
| 9 | drc off |
| 10 | load $1.mag |
| 11 | select top cell |
| 12 | expand |
| 13 | lef write $1.lef -hide |
| 14 | quit -noprompt |
| 15 | EOF |
| 16 | |
| 17 | $MAGIC -rcfile $PDKPATH/libs.tech/magic/current/sky130A.magicrc -dnull -noconsole << EOX |
| 18 | drc off |
| 19 | lef read $1.lef |
| 20 | load $1 |
| 21 | save $1.lef.mag |
| 22 | #writeall force $1.lef.mag |
| 23 | |
| 24 | # copy GDS properties from the MAG view into the MAGLEF view |
| 25 | set gds_properties [list] |
| 26 | set fp [open $1.mag r] |
| 27 | set mag_lines [split [read \$fp] "\n"] |
| 28 | foreach line \$mag_lines { |
| 29 | if { [string first "string GDS_" \$line] != -1 } { |
| 30 | lappend gds_properties \$line |
| 31 | } |
| 32 | } |
| 33 | close \$fp |
| 34 | set fp [open $1.lef.mag r] |
| 35 | set mag_lines [split [read \$fp] "\n"] |
| 36 | set new_mag_lines [list] |
| 37 | foreach line \$mag_lines { |
| 38 | if { [string first "<< end >>" \$line] != -1 } { |
| 39 | lappend new_mag_lines [join \$gds_properties "\n"] |
| 40 | } |
| 41 | lappend new_mag_lines \$line |
| 42 | } |
| 43 | close \$fp |
| 44 | set fp [open $1.lef.mag w] |
| 45 | puts \$fp [join \$new_mag_lines "\n"] |
| 46 | close \$fp |
| 47 | |
| 48 | |
| 49 | quit |
| 50 | EOX |
| 51 | |
| 52 | mv -f $1.lef.mag ../maglef/$1.mag |
| 53 | rm -f $1.lef |