[qflow] 05/16: Modified readliberty.c to ignore cells marked "dont_use". Corrected synthesis script to no longer require a "gate.cfg" file to run blifFanout, since this has been deprecated (and is no longer in the set of installed files). Modified blifFanout to use the first buffer found in the liberty file, so details of the buffer cell do not need to be provided in the tech shell script (although they will be used, if passed to the program).

Ruben Undheim rubund-guest at moszumanska.debian.org
Thu Jul 23 08:22:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to tag upstream/1.1.7
in repository qflow.

commit 77eadd02dbffceb3af29bb56f7a365680c00f8a1
Author: Tim Edwards <tim at opencircuitdesign.com>
Date:   Tue Jun 2 10:05:52 2015 -0400

    Modified readliberty.c to ignore cells marked "dont_use".
    Corrected synthesis script to no longer require a "gate.cfg" file
    to run blifFanout, since this has been deprecated (and is no longer
    in the set of installed files).  Modified blifFanout to use the
    first buffer found in the liberty file, so details of the buffer
    cell do not need to be provided in the tech shell script (although
    they will be used, if passed to the program).
---
 scripts/synthesize.sh |  17 +++++++++++++----
 src/blifFanout.c      |  49 +++++++++++++++++++++++++++++++++++++++++++++----
 src/readliberty.c     |  12 ++++++++++--
 src/readliberty.o     | Bin 44168 -> 44368 bytes
 4 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/scripts/synthesize.sh b/scripts/synthesize.sh
index d05dabe..d8a1a53 100755
--- a/scripts/synthesize.sh
+++ b/scripts/synthesize.sh
@@ -405,7 +405,7 @@ endif
 
 echo "Running blifFanout (iterative)" |& tee -a ${synthlog}
 echo "" >> ${synthlog}
-if (-f ${techdir}/gate.cfg && -f ${bindir}/blifFanout ) then
+if (-f ${techdir}/${libertyfile} && -f ${bindir}/blifFanout ) then
    set nchanged=1000
    while ($nchanged > 0)
       mv ${rootname}.blif tmp.blif
@@ -414,9 +414,13 @@ if (-f ${techdir}/gate.cfg && -f ${bindir}/blifFanout ) then
       else
 	 set sepoption="-s ${separator}"
       endif
+      if ("x${bufcell}" == "x") then
+	 set bufoption=""
+      else
+	 set bufoption="-b ${bufcell} -i ${bufpin_in} -o ${bufpin_out}"
+      endif
       ${bindir}/blifFanout ${fanout_options} -f ${rootname}_nofanout \
-		-p ${techdir}/${libertyfile} ${sepoption} \
-		-b ${bufcell} -i ${bufpin_in} -o ${bufpin_out} \
+		-p ${techdir}/${libertyfile} ${sepoption} ${bufoption} \
 		tmp.blif ${rootname}.blif >>& ${synthlog}
       set nchanged=$status
       echo "gates resized: $nchanged" |& tee -a ${synthlog}
@@ -455,7 +459,12 @@ ${bindir}/blif2Verilog -c -p -v ${vddnet} -g ${gndnet} ${rootname}.blif \
 	> ${rootname}.rtlnopwr.v
 
 echo "Running blif2BSpice." |& tee -a ${synthlog}
-${bindir}/blif2BSpice -p ${vddnet} -g ${gndnet} -l ${techdir}/${spicefile} \
+if ("x${spicefile}" == "x") then
+    set spiceopt=""
+else
+    set spiceopt="-l ${techdir}/${spicefile}"
+endif
+${bindir}/blif2BSpice -p ${vddnet} -g ${gndnet} ${spiceopt} \
 	${rootname}.blif > ${rootname}.spc
 
 #---------------------------------------------------------------------
diff --git a/src/blifFanout.c b/src/blifFanout.c
index 96f7f93..c566ac6 100644
--- a/src/blifFanout.c
+++ b/src/blifFanout.c
@@ -334,11 +334,50 @@ int main (int argc, char *argv[])
    if (buf_in_pin == NULL || buf_out_pin == NULL) {
       Pin *curpin;
 
-      if (Buffername == NULL) {
-         fprintf(stderr, "blifFanout:  Need name of buffer cell.\n");
-         return -1;
+      gl = (struct Gatelist *)NULL;
+
+      if (Buffername != NULL) {
+	 gl = (struct Gatelist *)HashLookup(Buffername, Gatehash);
+	 if (gl == NULL) {
+	    fprintf(stderr, "No buffer \"%s\" found in gate list\n", Buffername);
+	    fprintf(stderr, "Searching gate list for suitable buffer.\n");
+	 }
+      }
+
+      if ((gl == NULL) || (Buffername == NULL)) {
+	 // Find a suitable buffer
+	 gl = (struct Gatelist *)HashFirst(Gatehash);
+	 while (gl != NULL) {
+	    Cell *ctest;
+
+	    // Find the first gate with one input, one output,
+	    // and a function string that matches the input pin name.
+
+	    ctest = gl->gatecell;
+	    if (ctest->pins && ctest->pins->next && !ctest->pins->next->next) {
+		if (ctest->pins->type == PIN_INPUT &&
+				ctest->pins->next->type == PIN_OUTPUT) {
+		    if (!strcmp(ctest->function, ctest->pins->name)) {
+			fprintf(stdout, "Using cell \"%s\" for buffers.\n",
+				ctest->name);
+			break;
+		    }
+		}
+		else if (ctest->pins->type == PIN_OUTPUT &&
+				ctest->pins->next->type == PIN_INPUT) {
+		    if (!strcmp(ctest->function, ctest->pins->next->name)) {
+			fprintf(stdout, "Using cell \"%s\" for buffers.\n",
+				ctest->name);
+			break;
+		    }
+		}
+	    }
+	    gl = (struct Gatelist *)HashNext(Gatehash);
+	 }
       }
-      gl = (struct Gatelist *)HashLookup(Buffername, Gatehash);
+      else
+	 gl = (struct Gatelist *)HashLookup(Buffername, Gatehash);
+
       if (gl == NULL) {
          fprintf(stderr, "blifFanout:  Buffer cell %s cannot be found.\n",
 			Buffername);
@@ -628,6 +667,8 @@ int read_gate_file(char *gate_file_name)
    gatecount = 0;
    cells = read_liberty(gate_file_name, NULL);
    for (curcell = cells; curcell != NULL; curcell = curcell->next) {
+	if (curcell->name == NULL) continue;	/* "dont_use" cell */
+
 	gl = GatelistAlloc();
 	gl->gatename = strdup(curcell->name);
 	gl->suffix = find_suffix(gl->gatename);
diff --git a/src/readliberty.c b/src/readliberty.c
index d6fe160..dea9087 100644
--- a/src/readliberty.c
+++ b/src/readliberty.c
@@ -789,6 +789,10 @@ read_liberty(char *libfile, char *pattern)
 		if (!strcmp(token, "}")) {
 		    section = LIBBLOCK;			// End of cell def
 		}
+		else if (!strcasecmp(token, "dont_use")) {
+		    free(newcell->name);
+		    newcell->name == NULL;
+		}
 		else if (!strcasecmp(token, "pin")) {
 		    token = advancetoken(flib, 0);	// Open parens
 		    if (!strcmp(token, "("))
@@ -856,8 +860,12 @@ read_liberty(char *libfile, char *pattern)
 			newcell->function = strdup(rfunc);
 		    }
 		    token = advancetoken(flib, 0);
-		    if (strcmp(token, ";"))
-			fprintf(stderr, "Expected end-of-statement.\n");
+		    if (strcmp(token, ";")) {
+			if (!strcmp(token, "}"))
+			    section = CELLDEF;
+		        else
+			    fprintf(stderr, "Expected end-of-statement.\n");
+		    }
 		}
 		else if (!strcasecmp(token, "direction")) {
 		    token = advancetoken(flib, 0);	// Colon
diff --git a/src/readliberty.o b/src/readliberty.o
index aa882d4..54289a1 100644
Binary files a/src/readliberty.o and b/src/readliberty.o differ

-- 
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