summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2017-03-17 12:49:24 +0000
committerRuben Undheim <ruben.undheim@gmail.com>2017-03-17 12:49:24 +0000
commit548aa8a30317aade2d08d55499cf8860513bd081 (patch)
tree6df0934e60b9ee84719d2186991780c2f15806e0 /scripts
parentf8a8647330f1d9b1216d7b485783e4819ef0f502 (diff)
New upstream version 1.1.44
Diffstat (limited to 'scripts')
-rw-r--r--[-rwxr-xr-x]scripts/blif2cel.tcl.in825
-rwxr-xr-xscripts/placement.sh11
-rw-r--r--scripts/qflow.sh.in2
-rwxr-xr-xscripts/synthesize.sh20
4 files changed, 539 insertions, 319 deletions
diff --git a/scripts/blif2cel.tcl.in b/scripts/blif2cel.tcl.in
index 37f8c8c..3be8256 100755..100644
--- a/scripts/blif2cel.tcl.in
+++ b/scripts/blif2cel.tcl.in
@@ -18,6 +18,8 @@
#
# Written by Tim Edwards July 25, 2006 MultiGiG, Inc.
# Modified October 8, 2013 to use blif netlists as input
+# Modified December 6, 2016 with hard macro extensions
+# courtesy of David Lanzendorfer
#------------------------------------------------------------
# LEF dimensions are microns unless otherwise stated.
@@ -27,47 +29,106 @@ set pitchy 0 ;# value overridden from LEF file
set trackskip 0 ;# reduce number of implicit feedthroughs
;# to avoid routing congestion
-set bliffile [lindex $argv 0]
-set cellname [file rootname [file tail $bliffile]]
-if {"$cellname" == "$bliffile"} {
- set bliffile ${cellname}.blif
+
+set arglen [llength $argv]
+set index 0
+while {$index < $arglen} {
+ set arg [lindex $argv $index]
+ switch -exact $arg {
+
+ --hard-macro {
+ lappend args(hard_macros) [lindex $argv [incr index]]
+ }
+
+ --lef {
+ #lappend args(lefs) [lindex $argv [incr index]]
+ set args(lef) [lindex $argv [incr index]]
+ }
+
+ --blif {
+ set args(blif) [lindex $argv [incr index]]
+ }
+
+ --cel {
+ set args(cel) [lindex $argv [incr index]]
+ }
+
+ default {
+ set filename [lindex $argv $index]
+ }
+ }
+ incr index
+}
+
+if {[info exists args(hard_macros)]} {
+ set hardmacros $args(hard_macros)
+} else {
+ set hardmacros {}
+}
+
+if {[info exists args(lef)]} {
+ set leffile $args(lef)
+} else {
+ puts stderr "No LEF file defined"
+ exit
}
-if {$argc > 1} {
- set leffile [lindex $argv 1]
+if {[info exists args(blif)]} {
+ set bliffile $args(blif)
+ set cellname [file rootname [file tail $bliffile]]
} else {
- set leffile "-"
+ puts stderr "No BLIF file defined"
+ exit
}
-if {$argc == 3} {
- set celfile [lindex $argv 2]
+if {[info exists args(cel)]} {
+ set celfile $args(cel)
} else {
- set celfile ${cellname}.cel
+ puts stderr "No CEL file defined"
+ exit
}
+
#-------------------------------------------------------------
set lefname [file rootname $leffile]
if {"$lefname" == "$leffile"} {
- set leffile ${lefname}.lef
+ set leffile ${lefname}.lef
}
#-------------------------------------------------------------
# Open files for read and write
if [catch {open $leffile r} flef] {
- puts stderr "Error: second argument is not a LEF file!"
- exit 0
+ puts stderr "Error: second argument is not a LEF file ($leffile)!"
+ exit 0
+} else {
+ puts "Loaded LEF file ($leffile) for reading..."
}
if [catch {open $bliffile r} fnet] {
- puts stderr "Error: can't open file $bliffile for reading!"
- exit 0
+ puts stderr "Error: can't open file $bliffile for reading!"
+ exit 0
+} else {
+ puts "Loaded BLIF file ($bliffile) for reading ..."
}
if [catch {open $celfile w} fcel] {
- puts stderr "Error: can't open file $celfile for writing!"
- exit 0
+ puts stderr "Error: can't open file $celfile for writing!"
+ exit 0
+} else {
+ puts "Loaded CEL file ($celfile) for writing..."
+}
+
+set fhardmacro {}
+foreach hardmacro $hardmacros {
+ if [catch {open $hardmacro r} fhardmacro_tmp] {
+ puts stderr "Error: can't open file $hardmacro for reading!"
+ exit 0
+ } else {
+ puts "Loaded $hardmacro file for reading..."
+ lappend fhardmacro $fhardmacro_tmp
+ }
}
#----------------------------------------------------------------
@@ -80,9 +141,9 @@ flush stdout
set macrolist {}
while {[gets $fnet line] >= 0} {
- if [regexp {^[ \t]*\.gate[ \t]+([^ \t]+)} $line lmatch macro] {
- lappend macrolist $macro
- }
+ if [regexp {^[ \t]*\.gate[ \t]+([^ \t]+)} $line lmatch macro] {
+ lappend macrolist $macro
+ }
}
set macrolist [lsort -unique $macrolist]
close $fnet
@@ -96,37 +157,37 @@ close $fnet
#----------------------------------------------------------------
proc parse_port {pinname macroname leffile ox oy} {
- global $macroname units
-
- while {[gets $leffile line] >= 0} {
- if [regexp {[ \t]*LAYER[ \t]+(.+)[\t ]*;} $line lmatch layername] {
- if {![regexp {.*(\d).*} $layername lmatch layernum]} {set layernum 0}
- set ${macroname}(${pinname},layer) $layernum
- } elseif [regexp {[ \t]*RECT[ \t]+(.+)[ \t]+(.+)[ \t]+(.+)[ \t]+(.+)[ \t]*;} \
- $line lmatch llx lly urx ury] {
- set llx [expr {int($llx * $units)}]
- set lly [expr {int($lly * $units)}]
- set urx [expr {int($urx * $units)}]
- set ury [expr {int($ury * $units)}]
- set xp [expr {(($llx + $urx) / 2) - $ox}]
- set yp [expr {(($lly + $ury) / 2) - $oy}]
- set ${macroname}(${pinname},xp) $xp
- set ${macroname}(${pinname},yp) $yp
- } elseif [regexp {[ \t]*POLYGON[ \t]+([^ \t]+)[ \t]+([^ \t]+)[ \t]+.*;} \
- $line lmatch llx lly] {
- set llx [expr {int($llx * $units)}]
- set lly [expr {int($lly * $units)}]
- set xp [expr {$llx - $ox}]
- set yp [expr {$lly - $oy}]
- set ${macroname}(${pinname},xp) $xp
- set ${macroname}(${pinname},yp) $yp
- } elseif [regexp {[ \t]*END[ \t]*$} $line lmatch] { break }
- }
- puts -nonewline stdout "${pinname}"
- puts -nonewline stdout " [set ${macroname}(${pinname},xp)]"
- puts -nonewline stdout " [set ${macroname}(${pinname},yp)]"
- puts -nonewline stdout " [set ${macroname}(${pinname},layer)]"
- puts stdout ""
+ global $macroname units
+
+ while {[gets $leffile line] >= 0} {
+ if [regexp {[ \t]*LAYER[ \t]+(.+)[\t ]*;} $line lmatch layername] {
+ if {![regexp {.*(\d).*} $layername lmatch layernum]} {set layernum 0}
+ set ${macroname}(${pinname},layer) $layernum
+ } elseif [regexp {[ \t]*RECT[ \t]+(.+)[ \t]+(.+)[ \t]+(.+)[ \t]+(.+)[ \t]*;} \
+ $line lmatch llx lly urx ury] {
+ set llx [expr {int($llx * $units)}]
+ set lly [expr {int($lly * $units)}]
+ set urx [expr {int($urx * $units)}]
+ set ury [expr {int($ury * $units)}]
+ set xp [expr {(($llx + $urx) / 2) - $ox}]
+ set yp [expr {(($lly + $ury) / 2) - $oy}]
+ set ${macroname}(${pinname},xp) $xp
+ set ${macroname}(${pinname},yp) $yp
+ } elseif [regexp {[ \t]*POLYGON[ \t]+([^ \t]+)[ \t]+([^ \t]+)[ \t]+.*;} \
+ $line lmatch llx lly] {
+ set llx [expr {int($llx * $units)}]
+ set lly [expr {int($lly * $units)}]
+ set xp [expr {$llx - $ox}]
+ set yp [expr {$lly - $oy}]
+ set ${macroname}(${pinname},xp) $xp
+ set ${macroname}(${pinname},yp) $yp
+ } elseif [regexp {[ \t]*END[ \t]*$} $line lmatch] { break }
+ }
+ puts -nonewline stdout "${pinname}"
+ puts -nonewline stdout " [set ${macroname}(${pinname},xp)]"
+ puts -nonewline stdout " [set ${macroname}(${pinname},yp)]"
+ puts -nonewline stdout " [set ${macroname}(${pinname},layer)]"
+ puts stdout ""
}
#----------------------------------------------------------------
@@ -134,21 +195,27 @@ proc parse_port {pinname macroname leffile ox oy} {
#----------------------------------------------------------------
proc parse_pin {pinname macroname leffile ox oy} {
- global $macroname
-
- while {[gets $leffile line] >= 0} {
- if [regexp {[ \t]*PORT} $line lmatch] {
- parse_port $pinname $macroname $leffile $ox $oy
- } elseif [regexp {[ \t]*DIRECTION[ \t]+([^ \t]+)[ \t]*;} $line lmatch porttype] {
- set ${macroname}(${pinname},type) $porttype
- } elseif [regexp {[ \t]*END[ \t]+([^ \t]+)[ \t]*$} $line lmatch pintest] {
- if {"$pintest" == "$pinname"} {
- break
- } else {
- puts stdout "Unexpected END statement $line while parsing pin $pinname"
- }
- }
- }
+ global $macroname
+ puts "parse_pin"
+ puts "macroname: $macroname, pinname: $pinname"
+
+ while {[gets $leffile line] >= 0} {
+ if [regexp {[ \t]*PORT} $line lmatch] {
+ parse_port $pinname $macroname $leffile $ox $oy
+ } elseif [regexp {[ \t]*DIRECTION[ \t]+([^ \t]+)[ \t]*;} $line lmatch porttype] {
+ puts "Port type: $porttype"
+ set ${macroname}(${pinname},type) $porttype
+ } elseif [regexp {[ \t]*DIRECTION[ \t]+([^:]+);} $line lmatch porttype] {
+ puts "Port type: $porttype"
+ set ${macroname}(${pinname},type) $porttype
+ } elseif [regexp {[ \t]*END[ \t]+([^ \t]+)[ \t]*$} $line lmatch pintest] {
+ if {"$pintest" == "$pinname"} {
+ break
+ } else {
+ puts stdout "Unexpected END statement $line while parsing pin $pinname"
+ }
+ }
+ }
}
#----------------------------------------------------------------
@@ -156,15 +223,15 @@ proc parse_pin {pinname macroname leffile ox oy} {
#----------------------------------------------------------------
proc skip_section {leffile sectionname} {
- while {[gets $leffile line] >= 0} {
- if [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch sectiontest] {
- if {"$sectiontest" != "$sectionname"} {
- puts -nonewline stderr "Unexpected END statement $line "
- puts stderr "while reading section $sectionname"
- }
- break
- }
- }
+ while {[gets $leffile line] >= 0} {
+ if [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch sectiontest] {
+ if {"$sectiontest" != "$sectionname"} {
+ puts -nonewline stderr "Unexpected END statement $line "
+ puts stderr "while reading section $sectionname"
+ }
+ break
+ }
+ }
}
#----------------------------------------------------------------
@@ -172,184 +239,310 @@ proc skip_section {leffile sectionname} {
#----------------------------------------------------------------
proc parse_layer {leffile layername} {
- global pitchx pitchy units
+ global pitchx pitchy units
- set pitch 0
- set type NONE
+ set pitch 0
+ set type NONE
- while {[gets $leffile line] >= 0} {
- regexp {[ \t]*TYPE[ \t]+(.+)[ \t]*;} $line lmatch type
- regexp {[ \t]*DIRECTION[ \t]+(.+)[ \t]*;} $line lmatch direc
- regexp {[ \t]*WIDTH[ \t]+(.+)[ \t]*;} $line lmatch width
- regexp {[ \t]*SPACING[ \t]+(.+)[ \t]*;} $line lmatch space
- set p2 [regexp {[ \t]*PITCH[ \t]+(.+)[ \t]+(.+)[ \t]*;} $line \
+ while {[gets $leffile line] >= 0} {
+ regexp {[ \t]*TYPE[ \t]+(.+)[ \t]*;} $line lmatch type
+ regexp {[ \t]*DIRECTION[ \t]+(.+)[ \t]*;} $line lmatch direc
+ regexp {[ \t]*WIDTH[ \t]+(.+)[ \t]*;} $line lmatch width
+ regexp {[ \t]*SPACING[ \t]+(.+)[ \t]*;} $line lmatch space
+ set p2 [regexp {[ \t]*PITCH[ \t]+(.+)[ \t]+(.+)[ \t]*;} $line \
lmatch xpitch ypitch]
- set p1 [regexp {[ \t]*PITCH[ \t]+(.+)[ \t]*;} $line lmatch pitch]
- if [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch layertest] {
- if {"$layertest" != "$layername"} {
- puts stderr "Unexpected END statement $line while reading layer $layername"
- }
- break
- }
- }
-
- # All we want to do here is determine the horizontal and vertical
- # route pitches
-
- if {$p2 == 1} {
- set tpitch [expr int($units * $xpitch)]
- set pitchx $tpitch
- set tpitch [expr int($units * $ypitch)]
- set pitchy $tpitch
- } elseif {$p1 == 1} {
- set tpitch [expr int($units * $pitch)]
- if {$tpitch > 0} {
- if {[string first "HORIZONTAL" $direc] == 0} {
- if {$pitchy == 0} {
- puts stdout "LEF file specifies route layer Y pitch as $pitch"
- set pitchy $tpitch
- } elseif {$tpitch < $pitchy} {
- set pitchy $tpitch
- puts stdout "LEF file specifies route layer Y pitch as $pitch"
+ set p1 [regexp {[ \t]*PITCH[ \t]+(.+)[ \t]*;} $line lmatch pitch]
+ if [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch layertest] {
+ if {"$layertest" != "$layername"} {
+ puts -nonewline stderr "Unexpected END statement $line while "
+ puts stderr "reading layer $layername"
}
- } else {
- if {$pitchx == 0} {
- puts stdout "LEF file specifies route layer X pitch as $pitch"
- set pitchx $tpitch
- } elseif {$tpitch < $pitchx} {
- puts stdout "LEF file specifies route layer X pitch as $pitch"
- set pitchx $tpitch
+ break
+ }
+ }
+
+ # All we want to do here is determine the horizontal and vertical
+ # route pitches
+
+ if {$p2 == 1} {
+ set tpitch [expr int($units * $xpitch)]
+ set pitchx $tpitch
+ set tpitch [expr int($units * $ypitch)]
+ set pitchy $tpitch
+ } elseif {$p1 == 1} {
+ set tpitch [expr int($units * $pitch)]
+ if {$tpitch > 0} {
+ if {[string first "HORIZONTAL" $direc] == 0} {
+ if {$pitchy == 0} {
+ puts stdout "LEF file specifies route layer Y pitch as $pitch"
+ set pitchy $tpitch
+ } elseif {$tpitch < $pitchy} {
+ set pitchy $tpitch
+ puts stdout "LEF file specifies route layer Y pitch as $pitch"
+ }
+ } else {
+ if {$pitchx == 0} {
+ puts stdout "LEF file specifies route layer X pitch as $pitch"
+ set pitchx $tpitch
+ } elseif {$tpitch < $pitchx} {
+ puts stdout "LEF file specifies route layer X pitch as $pitch"
+ set pitchx $tpitch
+ }
}
- }
- }
- } elseif {$type == "ROUTING"} {
- puts stdout "LEF file route layer ${layername} has no pitch information"
- }
+ }
+ } elseif {$type == "ROUTING"} {
+ puts stdout "LEF file route layer ${layername} has no pitch information"
+ }
}
#----------------------------------------------------------------
+# Parse the hard macro contents of the LEF file and retain the information
+# about cell size and pin positions.
+#----------------------------------------------------------------
+
+proc parse_hard_macro {leffile macroname} {
+ global $macroname units
+
+ puts stderr "Parsing hard macro $macroname: Ports are:"
+ while {[gets $leffile line] >= 0} {
+ if [regexp {[ \t]*SYMMETRY[ \t]+(.+)[ \t]*;} $line lmatch symmetry] {
+ set ${macroname}(symmetry) $symmetry
+ } elseif [regexp {[ \t]*ORIGIN[ \t]+(.+)[ \t]+(.+)[ \t]*;} $line lmatch x y] {
+ set x [expr {round($x * $units)}]
+ set y [expr {round($y * $units)}]
+ set ${macroname}(x) $x
+ set ${macroname}(y) $y
+ } elseif [regexp {[ \t]*SIZE[ \t]+(.+)[ \t]+BY[ \t]+(.+)[ \t]*;} \
+ $line lmatch w h] {
+ set w [expr {round($w * $units)}]
+ set h [expr {round($h * $units)}]
+ set ${macroname}(w) $w
+ set ${macroname}(h) $h
+
+ # Compute derived values
+ # ox, oy are the LEF coordinates where GrayWolf expects the "origin"
+ set ox [expr {$x + ($w / 2)}]
+ set oy [expr {$y + ($h / 2)}]
+ set left [expr {-($w / 2)}]
+ set right [expr {$left + $w}]
+ set bottom [expr {-($h / 2)}]
+ set top [expr {$bottom + $h}]
+ set ${macroname}(ox) $ox
+ set ${macroname}(oy) $oy
+ set ${macroname}(left) $left
+ set ${macroname}(right) $right
+ set ${macroname}(top) $top
+ set ${macroname}(bottom) $bottom
+ } elseif [regexp {[ \t]*PIN[ \t]+(.+)[ \t]*$} $line lmatch pinname] {
+ # Ignore additional information from LEF version 5.6 syntax
+ set pinname [lindex $pinname 0]
+ parse_pin $pinname $macroname $leffile $ox $oy
+ } elseif [regexp {[ \t]*END[ \t]+(^:+)[ \t]*$} $line lmatch macrotest] {
+ if {"$macrotest" == "$macroname"} {
+ break
+ } else {
+ puts -nonewline stderr "Unexpected END statement $line while "
+ puts stderr "reading macro $macroname"
+ }
+ }
+ }
+}
+
+
+#----------------------------------------------------------------
# Parse the macro contents of the LEF file and retain the information
# about cell size and pin positions.
#----------------------------------------------------------------
proc parse_macro {leffile macroname} {
- global $macroname units
-
- puts stderr "Parsing macro $macroname: Ports are:"
- while {[gets $leffile line] >= 0} {
- if [regexp {[ \t]*SYMMETRY[ \t]+(.+)[ \t]*;} $line lmatch symmetry] {
- set ${macroname}(symmetry) $symmetry
- } elseif [regexp {[ \t]*ORIGIN[ \t]+(.+)[ \t]+(.+)[ \t]*;} $line lmatch x y] {
- set x [expr {round($x * $units)}]
- set y [expr {round($y * $units)}]
- set ${macroname}(x) $x
- set ${macroname}(y) $y
- } elseif [regexp {[ \t]*SIZE[ \t]+(.+)[ \t]+BY[ \t]+(.+)[ \t]*;} \
+ global $macroname units
+
+ puts stderr "Parsing macro $macroname: Ports are:"
+ while {[gets $leffile line] >= 0} {
+ if [regexp {[ \t]*SYMMETRY[ \t]+(.+)[ \t]*;} $line lmatch symmetry] {
+ set ${macroname}(symmetry) $symmetry
+ } elseif [regexp {[ \t]*ORIGIN[ \t]+(.+)[ \t]+(.+)[ \t]*;} $line lmatch x y] {
+ set x [expr {round($x * $units)}]
+ set y [expr {round($y * $units)}]
+ set ${macroname}(x) $x
+ set ${macroname}(y) $y
+ } elseif [regexp {[ \t]*SIZE[ \t]+(.+)[ \t]+BY[ \t]+(.+)[ \t]*;} \
$line lmatch w h] {
- set w [expr {round($w * $units)}]
- set h [expr {round($h * $units)}]
- set ${macroname}(w) $w
- set ${macroname}(h) $h
-
- # Compute derived values
- # ox, oy are the LEF coordinates where GrayWolf expects the "origin"
- set ox [expr {$x + ($w / 2)}]
- set oy [expr {$y + ($h / 2)}]
- set left [expr {-($w / 2)}]
- set right [expr {$left + $w}]
- set bottom [expr {-($h / 2)}]
- set top [expr {$bottom + $h}]
- set ${macroname}(ox) $ox
- set ${macroname}(oy) $oy
- set ${macroname}(left) $left
- set ${macroname}(right) $right
- set ${macroname}(top) $top
- set ${macroname}(bottom) $bottom
- } elseif [regexp {[ \t]*PIN[ \t]+(.+)[ \t]*$} $line lmatch pinname] {
- # Ignore additional information from LEF version 5.6 syntax
- set pinname [lindex $pinname 0]
- parse_pin $pinname $macroname $leffile $ox $oy
- } elseif [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch macrotest] {
- if {"$macrotest" == "$macroname"} {
- break
- } else {
- puts stderr "Unexpected END statement $line while reading macro $macroname"
- }
- }
- }
+ set w [expr {round($w * $units)}]
+ set h [expr {round($h * $units)}]
+ set ${macroname}(w) $w
+ set ${macroname}(h) $h
+
+ # Compute derived values
+ # ox, oy are the LEF coordinates where GrayWolf expects the "origin"
+ set ox [expr {$x + ($w / 2)}]
+ set oy [expr {$y + ($h / 2)}]
+ set left [expr {-($w / 2)}]
+ set right [expr {$left + $w}]
+ set bottom [expr {-($h / 2)}]
+ set top [expr {$bottom + $h}]
+ set ${macroname}(ox) $ox
+ set ${macroname}(oy) $oy
+ set ${macroname}(left) $left
+ set ${macroname}(right) $right
+ set ${macroname}(top) $top
+ set ${macroname}(bottom) $bottom
+ } elseif [regexp {[ \t]*PIN[ \t]+(.+)[ \t]*$} $line lmatch pinname] {
+ # Ignore additional information from LEF version 5.6 syntax
+ set pinname [lindex $pinname 0]
+ parse_pin $pinname $macroname $leffile $ox $oy
+ } elseif [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch macrotest] {
+ if {"$macrotest" == "$macroname"} {
+ break
+ } else {
+ puts -nonewline stderr "Unexpected END statement $line while "
+ puts stderr "reading macro $macroname"
+ }
+ }
+ }
}
puts stdout "Reading macros from LEF file. . ."
flush stdout
while {[gets $flef line] >= 0} {
- if [regexp {[ \t]*LAYER[ \t]+(.+)[ \t]*$} $line lmatch layername] {
- parse_layer $flef $layername
- } elseif [regexp {[ \t]*MACRO[ \t]+(.+)[ \t]*$} $line lmatch macroname] {
- if {[lsearch $macrolist $macroname] >= 0} {
- # Parse the "macro" statement
- parse_macro $flef $macroname
- } else {
- # This macro is not used. . . skip to end of macro
- while {[gets $flef line] >= 0} {
- if [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch macrotest] {
- if {"$macroname" == "$macrotest"} {
- break
- }
+ if [regexp {[ \t]*LAYER[ \t]+(.+)[ \t]*$} $line lmatch layername] {
+ parse_layer $flef $layername
+ } elseif [regexp {[ \t]*MACRO[ \t]+(.+)[ \t]*$} $line lmatch macroname] {
+ if {[lsearch $macrolist $macroname] >= 0} {
+ # Parse the "macro" statement
+ parse_macro $flef $macroname
+ } else {
+ # This macro is not used. . . skip to end of macro
+ while {[gets $flef line] >= 0} {
+ if [regexp {[ \t]*END[ \t]+(.+)[ \t]*$} $line lmatch macrotest] {
+ if {"$macroname" == "$macrotest"} {
+ break
+ }
+ }
}
- }
- }
- } elseif [regexp {[ \t]*VIA[ \t]+([^ \t]+)} $line lmatch vianame] {
- skip_section $flef $vianame
- } elseif [regexp {[ \t]*VIARULE[ \t]+([^ \t]+)} $line lmatch viarulename] {
- skip_section $flef $viarulename
- } elseif [regexp {[ \t]*NONDEFAULTRULE[ \t]+([^ \t]+)} $line lmatch rulename] {
- skip_section $flef $rulename
- } elseif [regexp {[ \t]*SITE[ \t]+(.+)[ \t]*$} $line lmatch sitename] {
- skip_section $flef $sitename
- } elseif [regexp {[ \t]*UNITS[ \t]*$} $line lmatch] {
- skip_section $flef UNITS
- } elseif [regexp {[ \t]*SPACING[ \t]*$} $line lmatch] {
- skip_section $flef SPACING
- } elseif [regexp {[ \t]*PROPERTYDEFINITIONS[ \t]*$} $line lmatch] {
- skip_section $flef PROPERTYDEFINITIONS
- } elseif [regexp {[ \t]*END[ \t]+LIBRARY[ \t]*$} $line lmatch] {
- break
- } elseif [regexp {^[ \t]*#} $line lmatch] {
- # Comment line, ignore.
- } elseif ![regexp {^[ \t]*$} $line lmatch] {
- # Other things we don't care about
- set matches 0
- if [regexp {[ \t]*NAMESCASESENSITIVE} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*VERSION} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*BUSBITCHARS} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*DIVIDERCHAR} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*USEMINSPACING} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*CLEARANCEMEASURE} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*MANUFACTURINGGRID} $line lmatch] {
- incr matches
- } elseif [regexp {[ \t]*MAXVIASTACK} $line lmatch] {
- # We *should* care about this one; need to pass it on to the router
- incr matches
- } else {
- puts stderr "Unexpected input in LEF file: Only macro defs were expected!"
- puts stdout "Line is: $line"
- }
- }
+ }
+ } elseif [regexp {[ \t]*VIA[ \t]+([^ \t]+)} $line lmatch vianame] {
+ skip_section $flef $vianame
+ } elseif [regexp {[ \t]*VIARULE[ \t]+([^ \t]+)} $line lmatch viarulename] {
+ skip_section $flef $viarulename
+ } elseif [regexp {[ \t]*NONDEFAULTRULE[ \t]+([^ \t]+)} $line lmatch rulename] {
+ skip_section $flef $rulename
+ } elseif [regexp {[ \t]*SITE[ \t]+(.+)[ \t]*$} $line lmatch sitename] {
+ skip_section $flef $sitename
+ } elseif [regexp {[ \t]*UNITS[ \t]*$} $line lmatch] {
+ skip_section $flef UNITS
+ } elseif [regexp {[ \t]*SPACING[ \t]*$} $line lmatch] {
+ skip_section $flef SPACING
+ } elseif [regexp {[ \t]*PROPERTYDEFINITIONS[ \t]*$} $line lmatch] {
+ skip_section $flef PROPERTYDEFINITIONS
+ } elseif [regexp {[ \t]*END[ \t]+LIBRARY[ \t]*$} $line lmatch] {
+ break
+ } elseif [regexp {^[ \t]*#} $line lmatch] {
+ # Comment line, ignore.
+ } elseif ![regexp {^[ \t]*$} $line lmatch] {
+ # Other things we don't care about
+ set matches 0
+ if [regexp {[ \t]*NAMESCASESENSITIVE} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*VERSION} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*BUSBITCHARS} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*DIVIDERCHAR} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*USEMINSPACING} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*CLEARANCEMEASURE} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*MANUFACTURINGGRID} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*MAXVIASTACK} $line lmatch] {
+ # We *should* care about this one; need to pass it on to the router
+ incr matches
+ } else {
+ puts stderr "Unexpected input in LEF file: Only macro defs were expected!"
+ puts stdout "Line is: $line"
+ }
+ }
+}
+
+set label_hard_macro {}
+foreach fhardmacro $fhardmacro {
+ puts stdout "Reading macros from hard macro LEF file. . ."
+ flush stdout
+
+ while {[gets $fhardmacro line] >= 0} {
+ if [regexp {[ \t]*LAYER[ \t]+(.+)[ \t]*$} $line lmatch layername] {
+ parse_layer $fhardmacro $layername
+ } elseif [regexp {[ \t]*MACRO[ \t]+(.+)[ \t]*$} $line lmatch macroname] {
+ if {[lsearch $macrolist $macroname] >= 0} {
+ # Parse the "macro" statement
+ parse_hard_macro $fhardmacro $macroname
+ lappend label_hard_macro $macroname
+ } else {
+ # This macro is not used. . . skip to end of macro
+ while {[gets $fhardmacro line] >= 0} {
+ if [regexp {[ \t]*END[ \t]+(^:+)[ \t]*$} $line lmatch macrotest] {
+ if {"$macroname" == "$macrotest"} {
+ break
+ }
+ }
+ }
+ }
+ } elseif [regexp {[ \t]*VIA[ \t]+([^ \t]+)} $line lmatch vianame] {
+ skip_section $fhardmacro $vianame
+ } elseif [regexp {[ \t]*VIARULE[ \t]+([^ \t]+)} $line lmatch viarulename] {
+ skip_section $fhardmacro $viarulename
+ } elseif [regexp {[ \t]*NONDEFAULTRULE[ \t]+([^ \t]+)} $line lmatch rulename] {
+ skip_section $fhardmacro $rulename
+ } elseif [regexp {[ \t]*SITE[ \t]+(.+)[ \t]*$} $line lmatch sitename] {
+ skip_section $fhardmacro $sitename
+ } elseif [regexp {[ \t]*UNITS[ \t]*$} $line lmatch] {
+ skip_section $fhardmacro UNITS
+ } elseif [regexp {[ \t]*SPACING[ \t]*$} $line lmatch] {
+ skip_section $fhardmacro SPACING
+ } elseif [regexp {[ \t]*PROPERTYDEFINITIONS[ \t]*$} $line lmatch] {
+ skip_section $fhardmacro PROPERTYDEFINITIONS
+ } elseif [regexp {[ \t]*END[ \t]+LIBRARY[ \t]*$} $line lmatch] {
+ break
+ } elseif [regexp {^[ \t]*#} $line lmatch] {
+ # Comment line, ignore.
+ } elseif ![regexp {^[ \t]*$} $line lmatch] {
+ # Other things we don't care about
+ set matches 0
+ if [regexp {[ \t]*NAMESCASESENSITIVE} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*VERSION} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*BUSBITCHARS} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*DIVIDERCHAR} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*USEMINSPACING} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*CLEARANCEMEASURE} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*MANUFACTURINGGRID} $line lmatch] {
+ incr matches
+ } elseif [regexp {[ \t]*MAXVIASTACK} $line lmatch] {
+ # We *should* care about this one; need to pass it on to the router
+ incr matches
+ } else {
+ puts -nonewline stderr "Unexpected input in LEF file: Only "
+ puts stderr "macro defs were expected!"
+ puts stdout "Line is: $line"
+ }
+ }
+ }
}
# If leffile didn't set pitch, then use defaults
if {$pitchx == 0} {
- set pitchx 160
+ set pitchx 160
}
if {$pitchy == 0} {
- set pitchy 200
+ set pitchy 200
}
#----------------------------------------------------------------
@@ -363,59 +556,85 @@ set fnet [open $bliffile r]
set mode none
set i 0
while {[gets $fnet line] >= 0} {
- if [regexp {^[ \t]*\.gate[ \t]+([^ \t]+)[ \t]+(.*)$} $line lmatch macroname rest] {
- set mode $macroname
- set left [set ${mode}(left)]
- set right [set ${mode}(right)]
- set width [set ${mode}(w)]
- set top [set ${mode}(top)]
- set bottom [set ${mode}(bottom)]
- if {[catch {incr ${mode}(count)}]} {set ${mode}(count) 0}
- set j [set ${mode}(count)]
- puts $fcel "cell $i ${mode}_$j"
- puts $fcel "left $left right $right bottom $bottom top $top"
- incr i
- # Follow this with implicit feedthroughs, as many as will fit
- # set feedx [expr {$left + ($pitchx / 2)}]
- set feedx [expr {$left + ($pitchx / 2) + ($trackskip * $pitchx)}]
- set k 1
- while {$feedx < $right} {
- puts $fcel "pin name twfeed${k} signal TW_PASS_THRU layer 1 $feedx $bottom"
- puts $fcel " equiv name twfeed${k} layer 1 $feedx $top"
- set feedx [expr {$feedx + $pitchx}]
- incr k
- }
- # In the middle of parsing an instance; mode = instance name (in lowercase).
- foreach pinsig $rest {
- if [regexp {([^ \t=]+)=([^ \t]+)} $pinsig lmatch pinname netname] {
- set pinx [set ${mode}(${pinname},xp)]
- set piny [set ${mode}(${pinname},yp)]
- set pinlayer [set ${mode}(${pinname},layer)]
- set pintype [set ${mode}(${pinname},type)]
- # Is signal a buffer tree? If so, make it swappable, if it's an input
- if [regexp {(.*)_bF\$buf[0-9]+$} $netname lmatch sigpfix] {
- if {$pintype == "INPUT"} {
- puts $fcel "pin_group"
- puts $fcel "pin name ${sigpfix}_bF\$pin/$pinname signal $netname layer $pinlayer $pinx $piny"
- puts $fcel "end_pin_group"
- } else {
- puts $fcel "pin name $pinname signal $netname layer $pinlayer $pinx $piny"
- }
- } else {
- puts $fcel "pin name $pinname signal $netname layer $pinlayer $pinx $piny"
+ if [regexp {^[ \t]*\.gate[ \t]+([^ \t]+)[ \t]+(.*)$} $line lmatch macroname rest] {
+ set mode $macroname
+ set left [set ${mode}(left)]
+ set right [set ${mode}(right)]
+ set width [set ${mode}(w)]
+ set top [set ${mode}(top)]
+ set bottom [set ${mode}(bottom)]
+ if {[catch {incr ${mode}(count)}]} {set ${mode}(count) 0}
+ set j [set ${mode}(count)]
+
+ set is_hard_macro False
+ foreach testname $label_hard_macro {
+ if {$testname==$macroname} {
+ set is_hard_macro True
+ }
+ }
+
+ if $is_hard_macro {
+ puts "$macroname is a hard macro"
+ #puts $fcel "fixed neighborhood 0 from L"
+ #puts $fcel "corners 4 $left $bottom $right $bottom $left $top $right $top"
+ #puts $fcel "class 0 orientations 0 2"
+ puts $fcel "hardcell $i ${mode}_$j"
+ puts $fcel "left $left right $right bottom $bottom top $top"
+ } else {
+ puts $fcel "cell $i ${mode}_$j"
+ puts $fcel "left $left right $right bottom $bottom top $top"
+ }
+ incr i
+
+ # Follow this with implicit feedthroughs, as many as will fit
+ # set feedx [expr {$left + ($pitchx / 2)}]
+ set feedx [expr {$left + ($pitchx / 2) + ($trackskip * $pitchx)}]
+ set k 1
+ while {$feedx < $right} {
+ puts $fcel "pin name twfeed${k} signal TW_PASS_THRU layer 1 $feedx $bottom"
+ puts $fcel " equiv name twfeed${k} layer 1 $feedx $top"
+ set feedx [expr {$feedx + $pitchx}]
+ incr k
+ }
+
+ # In the middle of parsing an instance; mode = instance name (in lowercase).
+ foreach pinsig $rest {
+ if [regexp {([^ \t=]+)=([^ \t]+)} $pinsig lmatch pinname netname] {
+ regsub -all "<" $pinname "\[" pinname
+ regsub -all ">" $pinname "\]" pinname
+ set pinx [set ${mode}(${pinname},xp)]
+ set piny [set ${mode}(${pinname},yp)]
+ set pinlayer [set ${mode}(${pinname},layer)]
+ set pintype [set ${mode}(${pinname},type)]
+
+ # Is signal a buffer tree? If so, make it swappable, if it's an input
+ if [regexp {(.*)_bF\$buf[0-9]+$} $netname lmatch sigpfix] {
+ if {$pintype == "INPUT"} {
+ puts $fcel "pin_group"
+ puts -nonewline $fcel "pin name ${sigpfix}_bF\$pin/$pinname "
+ puts $fcel "signal $netname layer $pinlayer $pinx $piny"
+ puts $fcel "end_pin_group"
+ } else {
+ puts -nonewline $fcel "pin name $pinname signal $netname "
+ puts $fcel "layer $pinlayer $pinx $piny"
+ }
+ } else {
+ puts -nonewline $fcel "pin name $pinname signal $netname layer "
+ puts $fcel "$pinlayer $pinx $piny"
+ }
}
- }
- }
- } elseif [regexp {^[ \t]*\.inputs} $line lmatch] {
- set mode "pins"
- } elseif [regexp {^[ \t]*\.outputs} $line lmatch] {
- set mode "pins"
- } elseif [regexp {^[ \t]*\.model[ \t]+([^ \t]+)} $line lmatch cellverify] {
- if {"$cellname" != "$cellverify"} {
- puts -nonewline stderr "WARNING: model name ${cellverify} does not"
- puts stderr " match filename ${cellname}!"
- }
- }
+ flush stdout
+ }
+ } elseif [regexp {^[ \t]*\.inputs} $line lmatch] {
+ set mode "pins"
+ } elseif [regexp {^[ \t]*\.outputs} $line lmatch] {
+ set mode "pins"
+ } elseif [regexp {^[ \t]*\.model[ \t]+([^ \t]+)} $line lmatch cellverify] {
+ if {"$cellname" != "$cellverify"} {
+ puts -nonewline stderr "WARNING: model name ${cellverify} does not"
+ puts stderr " match filename ${cellname}!"
+ }
+ }
}
close $fnet
@@ -433,31 +652,31 @@ set fnet [open $bliffile r]
set mode none
set padnum 1
while {[gets $fnet line] >= 0} {
- if [regexp {^[ \t]*\.inputs[ \t]+(.*)$} $line lmatch rest] {
- set mode inputs
- set line $rest
- } elseif [regexp {^[ \t]*\.outputs[ \t]+(.*)$} $line lmatch rest] {
- set mode outputs
- set line $rest
- } elseif [regexp {^[\ t]*\.gate} $line lmatch] {
- break;
- } elseif [regexp {^[\ t]*\.end} $line lmatch] {
- break;
- }
-
- if [regexp {^(.*)[\\]+$} $line lmatch rest] {
- set line $rest
- }
-
- if {$mode == "inputs" || $mode == "outputs"} {
- foreach pinname $line {
- puts $fcel "pad $padnum name twpin_$pinname"
- puts $fcel "corners 4 -$px -$py -$px $py $px $py $px -$py"
- puts $fcel "pin name $pinname signal $pinname layer 1 0 0"
- puts $fcel ""
- incr padnum
- }
- }
+ if [regexp {^[ \t]*\.inputs[ \t]+(.*)$} $line lmatch rest] {
+ set mode inputs
+ set line $rest
+ } elseif [regexp {^[ \t]*\.outputs[ \t]+(.*)$} $line lmatch rest] {
+ set mode outputs
+ set line $rest
+ } elseif [regexp {^[\ t]*\.gate} $line lmatch] {
+ break;
+ } elseif [regexp {^[\ t]*\.end} $line lmatch] {
+ break;
+ }
+
+ if [regexp {^(.*)[\\]+$} $line lmatch rest] {
+ set line $rest
+ }
+
+ if {$mode == "inputs" || $mode == "outputs"} {
+ foreach pinname $line {
+ puts $fcel "pad $padnum name twpin_$pinname"
+ puts $fcel "corners 4 -$px -$py -$px $py $px $py $px -$py"
+ puts $fcel "pin name $pinname signal $pinname layer 1 0 0"
+ puts $fcel ""
+ incr padnum
+ }
+ }
}
puts stdout "Done!"
diff --git a/scripts/placement.sh b/scripts/placement.sh
index c2eb2e2..5425720 100755
--- a/scripts/placement.sh
+++ b/scripts/placement.sh
@@ -129,8 +129,8 @@ cd ${projectpath}
echo "Running blif2cel.tcl" |& tee -a ${synthlog}
-${scriptdir}/blif2cel.tcl ${synthdir}/${rootname}.blif \
- ${lefpath} ${layoutdir}/${rootname}.cel >>& ${synthlog}
+${scriptdir}/blif2cel.tcl --blif ${synthdir}/${rootname}.blif \
+ --lef ${lefpath} --cel ${layoutdir}/${rootname}.cel >>& ${synthlog}
#---------------------------------------------------------------------
# Spot check: Did blif2cel produce file ${rootname}.cel?
@@ -200,9 +200,10 @@ else
endif
# Add fill cells for the power bus stripes
+# (this is work in progress, commented out for now)
-echo "Running powerbus to add spacers for power bus stripes" |& tee -a ${synthlog}
-${scriptdir}/powerbus.tcl ${rootname} ${lefpath} ${fillcell} |& tee -a ${synthlog}
+# echo "Running powerbus to add spacers for power bus stripes" |& tee -a ${synthlog}
+# ${scriptdir}/powerbus.tcl ${rootname} ${lefpath} ${fillcell} |& tee -a ${synthlog}
# powerbus.tcl creates a .acel file if successful. If not, then
# leave the .cel file in place
@@ -350,7 +351,7 @@ if ($makedef == 1) then
echo "read_lef ${techlefpath}" >> ${rootname}.cfg
endif
echo "read_lef ${lefpath}" >> ${rootname}.cfg
- echo "layers ${route_layers}" >> ${rootname}.cfg
+ echo "catch layers ${route_layers}" >> ${rootname}.cfg
if ( ${?via_pattern} ) then
echo "" >> ${rootname}.cfg
echo "via pattern ${via_pattern}" >> ${rootname}.cfg
diff --git a/scripts/qflow.sh.in b/scripts/qflow.sh.in
index f067735..b78cd20 100644
--- a/scripts/qflow.sh.in
+++ b/scripts/qflow.sh.in
@@ -301,7 +301,7 @@ if ( ! -f ${userfile} ) then
echo ""
echo "" >> ${userfile}
echo "# Minimum operating period of the clock (in ps)" >> ${userfile}
- echo "# set vesta_options = --period 1E5" >> ${userfile}
+ echo '# set vesta_options = "--period 1E5"' >> ${userfile}
echo "" >> ${userfile}
echo "#------------------------------------------------------------" >> ${userfile}
echo "" >> ${userfile}
diff --git a/scripts/synthesize.sh b/scripts/synthesize.sh
index 86e171f..c5f2808 100755
--- a/scripts/synthesize.sh
+++ b/scripts/synthesize.sh
@@ -571,16 +571,16 @@ endif
#---------------------------------------------------------------------
# Spot check: Did blif2cel produce file ${rootname}.cel?
#---------------------------------------------------------------------
-
-if ( !( -f ${layoutdir}/${rootname}.cel || ( -M ${layoutdir}/${rootname}.cel \
- < -M ${rootname}.blif ))) then
- echo "blif2cel failure: No file ${rootname}.cel." |& tee -a ${synthlog}
- echo "blif2cel was called with arguments: ${synthdir}/${rootname}.blif "
- echo " ${lefpath} ${layoutdir}/${rootname}.cel"
- echo "Premature exit." |& tee -a ${synthlog}
- echo "Synthesis flow stopped due to error condition." >> ${synthlog}
- exit 1
-endif
+#
+# if ( !( -f ${layoutdir}/${rootname}.cel || ( -M ${layoutdir}/${rootname}.cel \
+# < -M ${rootname}.blif ))) then
+# echo "blif2cel failure: No file ${rootname}.cel." |& tee -a ${synthlog}
+# echo "blif2cel was called with arguments: ${synthdir}/${rootname}.blif "
+# echo " ${lefpath} ${layoutdir}/${rootname}.cel"
+# echo "Premature exit." |& tee -a ${synthlog}
+# echo "Synthesis flow stopped due to error condition." >> ${synthlog}
+# exit 1
+# endif
#---------------------------------------------------------------------