[qflow] 01/13: Corrected an error that causes synthesize_yosys.sh to fail due to the version number on yosys 0.4 (due to a lack of following a standard syntax for version numbering). Also, blif2cel.tcl modified to accept a LEF syntax variant containing two values for the PITCH statement.
Ruben Undheim
rubund-guest at moszumanska.debian.org
Thu Apr 16 17:35:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
rubund-guest pushed a commit to branch master
in repository qflow.
commit 053b93b103768daacdd5e83ffb010fb8e5b6c2b3
Author: Tim Edwards <tim at opencircuitdesign.com>
Date: Wed Nov 19 15:51:14 2014 -0500
Corrected an error that causes synthesize_yosys.sh to fail due to
the version number on yosys 0.4 (due to a lack of following a
standard syntax for version numbering). Also, blif2cel.tcl
modified to accept a LEF syntax variant containing two values
for the PITCH statement.
---
scripts/blif2cel.tcl | 51 ++++++++++++++++++++++++++++-----------------
scripts/synthesize_yosys.sh | 22 ++++++++++++++-----
2 files changed, 49 insertions(+), 24 deletions(-)
diff --git a/scripts/blif2cel.tcl b/scripts/blif2cel.tcl
index b09a30a..5c37cc5 100755
--- a/scripts/blif2cel.tcl
+++ b/scripts/blif2cel.tcl
@@ -170,9 +170,11 @@ proc parse_layer {leffile layername} {
while {[gets $leffile line] >= 0} {
regexp {[ \t]*TYPE[ \t]+(.+)[ \t]*;} $line lmatch type
regexp {[ \t]*DIRECTION[ \t]+(.+)[ \t]*;} $line lmatch direc
- regexp {[ \t]*PITCH[ \t]+(.+)[ \t]*;} $line lmatch pitch
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"
@@ -184,25 +186,34 @@ proc parse_layer {leffile layername} {
# All we want to do here is determine the horizontal and vertical
# route pitches
- 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
- }
+ 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
+ }
+ }
}
+ } else {
+ puts stdout "LEF file has layer section with no pitch information"
}
}
@@ -286,6 +297,8 @@ while {[gets $flef line] >= 0} {
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] {
diff --git a/scripts/synthesize_yosys.sh b/scripts/synthesize_yosys.sh
index 617a09a..898926e 100755
--- a/scripts/synthesize_yosys.sh
+++ b/scripts/synthesize_yosys.sh
@@ -139,11 +139,23 @@ set blif_opts = "${blif_opts} -buf ${bufcell} ${bufpin_in} ${bufpin_out}"
set versionstring = `${bindir}/yosys -V | cut -d' ' -f2`
set major = `echo $versionstring | cut -d. -f1`
set minor = `echo $versionstring | cut -d. -f2`
-set revisionstring = `echo $versionstring | cut -d. -f3`
-if ( ${revisionstring} == "" ) set revisionstring = 0
-set revision = `echo $revisionstring | cut -d+ -f1`
-set subrevision = `echo $revisionstring | cut -d+ -f2`
-if ( ${subrevision} == "" ) set subrevision = 0
+
+# Sigh. . . versioning doesn't follow any fixed standard
+set minortest = `echo $minor | cut -d+ -f2`
+if ( ${minortest} == "" ) then
+
+ set revisionstring = `echo $versionstring | cut -d. -f3`
+ if ( ${revisionstring} == "" ) set revisionstring = 0
+ set revision = `echo $revisionstring | cut -d+ -f1`
+ set subrevision = `echo $revisionstring | cut -d+ -f2`
+ if ( ${subrevision} == "" ) set subrevision = 0
+
+else
+ set revision = 0
+ set minor = `echo $minor | cut -d+ -f1`
+ set subrevision = ${minortest}
+
+endif
cat > ${rootname}.ys << EOF
# Synthesis script for yosys created by qflow
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/qflow.git
More information about the debian-science-commits
mailing list