Compare commits

...
27 Commits
Author SHA1 Message Date
Tim Edwards 5efe2151ed Merge branch 'master' into work 2018-10-31 14:05:11 -04:00
Tim Edwards 642de57418 Update at Wed Oct 31 14:05:09 EDT 2018 by tim 2018-10-31 14:05:09 -04:00
Tim Edwards 397444acd3 Modified the JSON generation script to backslash-escape backslashes
in verilog net names, which are apparently legal in verilog but not
in python strings (if not escaped).  This is somewhat critical for
running the LVS GUI as yosys can generate backslashes in generated
net names in the synthesized netlist.
2018-10-31 14:03:15 -04:00
Tim Edwards 5e5720e7be Merge branch 'master' into work 2018-10-29 15:19:57 -04:00
Tim Edwards 65c0f6b840 Update at Mon Oct 29 15:19:54 EDT 2018 by tim 2018-10-29 15:19:54 -04:00
Tim Edwards 09b2bb3316 Extended the verilog parser to account for the fact that there can
be whitespace between a wire/register name and its array delimiter.
2018-10-29 15:19:13 -04:00
Tim Edwards 41665036e9 Merge branch 'master' into work 2018-10-02 14:41:40 -04:00
Tim Edwards b4c189a114 Update at Tue Oct 2 14:41:38 EDT 2018 by tim 2018-10-02 14:41:38 -04:00
Tim Edwards 85af816ab8 Removed references to /usr/local/man/man1 and netgen.1, as the netgen.1
man page does not exist.  Running mkdirs on the empty directory causes
problems with "git rm".
2018-10-02 14:40:17 -04:00
Tim Edwards 4ba5425b6a Merge branch 'master' into work 2018-09-26 10:49:06 -04:00
Tim Edwards 83b2084a10 Update at Wed Sep 26 10:49:04 EDT 2018 by tim 2018-09-26 10:49:04 -04:00
Tim Edwards 0de1c232e4 Corrected property matching so that properties are promoted to
type double before sorting (previously, property promotion was
being done after parallel sorting).  Also, modified the verilog
file reading so that parameters and definitions that are numeric
are stored as numeric (not string) properties.
2018-09-26 10:46:55 -04:00
Tim Edwards b8e6f6c030 Merge branch 'master' into work 2018-09-24 15:13:32 -04:00
Tim Edwards a6742bca2e Update at Mon Sep 24 15:13:30 EDT 2018 by tim 2018-09-24 15:13:30 -04:00
Tim Edwards 3a03e769af Substantially improved verilog parsing (although almost certainly not
perfect).  Given the complexities of the verilog language, the simple
strtok() tokenizer used by the SPICE parser is not sufficient.  Wrote
a better tokenizer that can distinguish between whitespace and
functional tokens like parentheses, semicolons, etc., which are tokens
themselves but also token separators.
2018-09-24 15:09:29 -04:00
Tim Edwards 445f732f8b Merge branch 'master' into work 2018-08-08 11:28:45 -04:00
Tim Edwards b911aa7b2e Update at Wed Aug 8 11:28:43 EDT 2018 by tim 2018-08-08 11:28:43 -04:00
Tim Edwards b979d0ad97 Changed the netgen shell script from "sh" to "bash" due to the
presence of one or more bash-isms in the code.  Thanks to Sean
Cross for the patch.
2018-08-08 11:28:04 -04:00
Tim Edwards 86ab771964 Merge branch 'master' into work 2018-08-01 15:44:34 -04:00
Tim Edwards 2d74b3d94b Update at Wed Aug 1 15:44:32 EDT 2018 by tim 2018-08-01 15:44:32 -04:00
Tim Edwards 036e1f0947 Modified the verilog reading code so that it will automatically
determine if a parameter is a floating-point number, integer, or
string, and set the parameter accordingly.  Found an error in the
parameter comparison if the subcircuit definitions don't agree
on the type of parameter. Now all values are promoted to a single
type based on preference order (double, integer, string).  Tested
on a verilog file with a primitive device type defined as a module
with its properties encoded as parameters.  This successfully
matched against the SPICE primitive device.
2018-08-01 15:40:23 -04:00
Tim Edwards 5223011330 Merge branch 'master' into work 2018-06-25 21:26:47 -04:00
Tim Edwards 7bde5125fd Update at Mon Jun 25 21:26:47 EDT 2018 by tim 2018-06-25 21:26:47 -04:00
Tim Edwards dd6145463e Modified the SPICE parser to at least sanely deal with (possibly
CDL syntax) parameters that have values which are multi-word and
space separated (who the hell comes up with these things?).  One
can presumably safely assume that additional pin names are not
intermixed with parameters, so now if a multi-token parameter
value is encountered, the first word is taken as the value and
the remaining words are ignored, generating a warning message.
Since I have no idea what these values are used for, I cannot say
with certainty whether or not this would break LVS, but in the
test case given to me, the parameter had no impact on LVS, but
was apparently an annotation for the layout editor.
2018-06-25 21:21:45 -04:00
Tim Edwards f4ff74783c Merge branch 'master' into work 2018-06-17 15:06:17 -04:00
Tim Edwards f3d850e68e Update at Sun Jun 17 15:06:17 EDT 2018 by tim 2018-06-17 15:06:17 -04:00
Tim Edwards 1c08e5a48d Corrected missing tcl.h includes, which are needed in files that
call FREE(), since the Tcl/Tk version makes that a macro for the
subroutine Tcl_Free().  Thanks to Laurent Charrier for the bug
fix.
2018-06-17 15:05:15 -04:00
18 changed files with 5052 additions and 185 deletions
+2 -2
View File
@@ -60,11 +60,11 @@ install-real: install-dirs
(cd $$dir && ${MAKE} install); done
install-tcl-dirs:
${NETGENDIR}/scripts/mkdirs $(DESTDIR)${BINDIR} $(DESTDIR)${MANDIR} \
${NETGENDIR}/scripts/mkdirs $(DESTDIR)${BINDIR} \
$(DESTDIR)${TCLDIR} $(DESTDIR)${PYDIR}
install-dirs:
${NETGENDIR}/scripts/mkdirs $(DESTDIR)${BINDIR} $(DESTDIR)${MANDIR}
${NETGENDIR}/scripts/mkdirs $(DESTDIR)${BINDIR}
install-tcl: install-dirs
@echo --- installing executable to $(DESTDIR)${BINDIR}
+1 -1
View File
@@ -1 +1 @@
1.5.102
1.5.111
+4
View File
@@ -31,6 +31,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdlib.h>
#endif
#ifdef TCL_NETGEN
#include <tcl.h>
#endif
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
+4
View File
@@ -25,6 +25,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <alloc.h>
#endif
#ifdef TCL_NETGEN
#include <tcl.h>
#endif
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
+82 -9
View File
@@ -3865,7 +3865,8 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
propsort *proplist;
struct property *kl;
struct valuelist *vl;
int i, p, sval;
int i, p, sval, has_crit = FALSE;
char *subs_crit = NULL;
double cval;
obn = ob1->next;
@@ -3875,6 +3876,14 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
// value and index. Then sort that list, then use the sorted
// indexes to sort the actual property linked list.
// If there is no critical property listed, then it is still better
// to sort on any random property than on no properties. Note that
// this can (and should!) be made better by sorting on *all*
// properties, not just the first. Otherwise, circuit 1 can have, e.g.,
// parallel transistors with W=1, L=1 and W=1, L=2 while circuit two
// has W=1, L=2 and W=1, L=1 and property matching will fail because
// sorting was done on W only.
proplist = (propsort *)MALLOC(run * sizeof(propsort));
obp = obn;
@@ -3889,17 +3898,62 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
sval = vl->value.ival;
kl = (struct property *)HashLookup(vl->key, &(tp1->propdict));
if (kl == NULL) continue; /* Ignored property */
if (kl->merge == MERGE_ADD_CRIT)
if (kl->merge == MERGE_ADD_CRIT) {
has_crit = TRUE;
if ((vl->type == PROP_STRING || vl->type == PROP_EXPRESSION) &&
(kl->type != vl->type))
PromoteProperty(kl, vl);
if (vl->type == PROP_INTEGER)
cval = (double)vl->value.ival;
else if (vl->type == PROP_STRING)
/* This is unlikely---no method to merge string properties! */
cval = (double)vl->value.string[0]
+ (double)vl->value.string[1] / 10.0;
else
cval = vl->value.dval;
}
}
proplist[i].value = (double)sval * cval;
proplist[i].idx = i;
proplist[i].ob = obp;
obp = obp->next;
}
if (has_crit == FALSE) {
/* If no critical property was specified, then choose the first one found */
/* and recalculate all the proplist values. */
sval = 1;
obp = obn;
for (i = 0; i < run; i++) {
for (p = 0;; p++) {
vl = &(obp->instance.props[p]);
if (vl->type == PROP_ENDLIST) break;
if (vl->key == NULL) continue;
if (!strcmp(vl->key, "S"))
sval = vl->value.ival;
kl = (struct property *)HashLookup(vl->key, &(tp1->propdict));
if (kl == NULL) continue; /* Ignored property */
if (subs_crit == NULL)
subs_crit = vl->key;
if ((subs_crit != NULL) && !strcmp(vl->key, subs_crit)) {
if ((vl->type == PROP_STRING || vl->type == PROP_EXPRESSION) &&
(kl->type != vl->type))
PromoteProperty(kl, vl);
if (vl->type == PROP_INTEGER)
cval = (double)vl->value.ival;
else if (vl->type == PROP_STRING)
/* In case property is non-numeric, sort by dictionary order */
cval = (double)vl->value.string[0]
+ (double)vl->value.string[1] / 10.0;
else
cval = vl->value.dval;
}
}
proplist[i].value = (double)sval * cval;
obp = obp->next;
}
}
obn = obp; /* Link from last property */
qsort(&proplist[0], run, sizeof(propsort), compsort);
@@ -4625,7 +4679,7 @@ PropertyCheckMismatch(struct objlist *tp1, struct nlist *tc1,
{
int mismatches = 0;
int len2, *check2;
struct property *kl1, *kl2;
struct property *kl1, *kl2, *klt;
struct valuelist *vl1, *vl2;
int i, j;
int islop;
@@ -4797,8 +4851,27 @@ PropertyCheckMismatch(struct objlist *tp1, struct nlist *tc1,
/* Promote properties as necessary to make sure they all match */
if (kl1->type != vl1->type) PromoteProperty(kl1, vl1);
if (kl2->type != vl2->type) PromoteProperty(kl2, vl2);
if (kl1->type != vl2->type) PromoteProperty(kl1, vl2);
if (vl1->type != kl2->type) PromoteProperty(kl2, vl1);
/* If kl1 and kl2 types differ, choose one type to target. Prefer */
/* double if either type is double, otherwise string. */
if (kl1->type == PROP_DOUBLE)
klt = kl1;
else if (kl2->type == PROP_DOUBLE)
klt = kl2;
else if (kl1->type == PROP_INTEGER)
klt = kl1;
else if (kl2->type == PROP_INTEGER)
klt = kl2;
else if (kl1->type == PROP_STRING)
klt = kl1;
else if (kl2->type == PROP_STRING)
klt = kl2;
else
klt = kl1;
if (vl2->type != klt->type) PromoteProperty(klt, vl2);
if (vl1->type != klt->type) PromoteProperty(klt, vl1);
if (vl1->type != vl2->type) {
if (do_print && (vl1->type != vl2->type)) {
@@ -4849,13 +4922,13 @@ PropertyCheckMismatch(struct objlist *tp1, struct nlist *tc1,
if (rval != NULL) mismatches++;
}
else switch (kl1->type) {
else switch (klt->type) {
case PROP_DOUBLE:
case PROP_VALUE:
dval1 = vl1->value.dval;
dval2 = vl2->value.dval;
dslop = MAX(kl1->slop.dval, kl2->slop.dval);
dslop = klt->slop.dval;
pd = 2 * fabs(dval1 - dval2) / (dval1 + dval2);
if (pd > dslop) {
if (do_print) {
@@ -4883,7 +4956,7 @@ PropertyCheckMismatch(struct objlist *tp1, struct nlist *tc1,
ival1 = vl1->value.ival;
ival2 = vl2->value.ival;
islop = MAX(kl1->slop.ival, kl2->slop.ival);
islop = klt->slop.ival;
if (abs(ival1 - ival2) > islop) {
if (do_print) {
if (mismatches == 0)
@@ -4913,7 +4986,7 @@ PropertyCheckMismatch(struct objlist *tp1, struct nlist *tc1,
}
break;
case PROP_STRING:
islop = (int)(MAX(kl1->slop.dval, kl2->slop.dval) + 0.5);
islop = (int)(klt->slop.dval + 0.5);
if (islop == 0) {
if (!(*matchfunc)(vl1->value.string, vl2->value.string)) {
if (do_print) {
+138 -12
View File
@@ -175,7 +175,7 @@ void CloseFile(char *filename)
/* STUFF TO READ INPUT FILES */
static char *line = NULL; /* actual line read in */
static char *linetok; /* line copied to this, then munged by strtok */
static char *linetok; /* line copied to this, then munged by strdtok */
static int linesize = 0; /* amount of memory allocated for line */
static int linenum;
char *nexttok;
@@ -191,7 +191,7 @@ struct filestack {
static struct filestack *OpenFiles = NULL;
#define TOKEN_DELIMITER " \t\n\r"
#define WHITESPACE_DELIMITER " \t\n\r"
/*----------------------------------------------------------------------*/
/* TrimQuoted() --- */
@@ -296,7 +296,7 @@ int GetNextLineNoNewline(char *delimiter)
strcpy(linetok, line);
TrimQuoted(linetok);
nexttok = strtok(linetok, delimiter);
nexttok = strdtok(linetok, WHITESPACE_DELIMITER, delimiter);
return 0;
}
@@ -319,10 +319,9 @@ void GetNextLine(char *delimiter)
void SkipTok(char *delimiter)
{
if (nexttok != NULL &&
(nexttok = strtok(NULL, (delimiter) ? delimiter : TOKEN_DELIMITER))
!= NULL)
(nexttok = strdtok(NULL, WHITESPACE_DELIMITER, delimiter)))
return;
GetNextLine((delimiter) ? delimiter : TOKEN_DELIMITER);
GetNextLine(delimiter);
}
/*----------------------------------------------------------------------*/
@@ -332,7 +331,7 @@ void SkipTok(char *delimiter)
void SkipTokNoNewline(char *delimiter)
{
nexttok = strtok(NULL, (delimiter) ? delimiter : TOKEN_DELIMITER);
nexttok = strdtok(NULL, WHITESPACE_DELIMITER, delimiter);
}
/*----------------------------------------------------------------------*/
@@ -354,12 +353,12 @@ void SpiceTokNoNewline(void)
{
int contline;
if ((nexttok = strtok(NULL, TOKEN_DELIMITER)) != NULL) return;
if ((nexttok = strdtok(NULL, WHITESPACE_DELIMITER, NULL)) != NULL) return;
while (nexttok == NULL) {
contline = getc(infile);
if (contline == '*') {
GetNextLine(TOKEN_DELIMITER);
GetNextLine(WHITESPACE_DELIMITER);
SkipNewLine(NULL);
continue;
}
@@ -367,7 +366,28 @@ void SpiceTokNoNewline(void)
ungetc(contline, infile);
return;
}
if (GetNextLineNoNewline(TOKEN_DELIMITER) == -1) break;
if (GetNextLineNoNewline(WHITESPACE_DELIMITER) == -1) break;
}
}
/*----------------------------------------------------------------------*/
/* Skip to the next token, ignoring any C-style comments. */
/*----------------------------------------------------------------------*/
void SkipTokComments(char *delimiter)
{
SkipTok(delimiter);
while (nexttok) {
if (match(nexttok, "//")) {
SkipNewLine(delimiter);
SkipTok(delimiter);
}
else if (match(nexttok, "/*")) {
while (nexttok && !match(nexttok, "*/"))
SkipTok(delimiter);
if (nexttok) SkipTok(delimiter);
}
else break;
}
}
@@ -378,7 +398,7 @@ void SpiceTokNoNewline(void)
void SkipNewLine(char *delimiter)
{
while (nexttok != NULL)
nexttok = strtok(NULL, (delimiter) ? delimiter : TOKEN_DELIMITER);
nexttok = strdtok(NULL, WHITESPACE_DELIMITER, delimiter);
}
/*----------------------------------------------------------------------*/
@@ -395,13 +415,119 @@ void SpiceSkipNewLine(void)
while (contline == '+') {
ungetc(contline, infile);
GetNextLine(TOKEN_DELIMITER);
GetNextLine(WHITESPACE_DELIMITER);
SkipNewLine(NULL);
contline = getc(infile);
}
ungetc(contline, infile);
}
/*----------------------------------------------------------------------*/
/* Function similar to strtok() for token parsing. The difference is */
/* that it takes two sets of delimiters. The first is whitespace */
/* delimiters, which separate tokens. The second is functional */
/* delimiters, which separate tokens and have additional meaning, such */
/* as parentheses, commas, semicolons, etc. The parser needs to know */
/* when such tokens occur in the string, so they are returned as */
/* individual tokens. */
/* */
/* Definition of delim2: String of single delimiter characters. The */
/* special character "X" (which is never a delimiter in practice) is */
/* used to separate single-character delimiters from two-character */
/* delimiters (this presumably could be further extended as needed). */
/* so ",;()" would be a valid delimiter set, but to include C-style */
/* comments and verilog-style parameter lists, one would need */
/* ",;()X/**///#(". */
/*----------------------------------------------------------------------*/
char *strdtok(char *pstring, char *delim1, char *delim2)
{
static char *stoken = NULL;
static char *sstring = NULL;
char *s, *s2;
char first = FALSE;
int twofer;
if (pstring != NULL) {
/* Allocate enough memory to hold the string; tokens will be put here */
if (sstring != NULL) FREE(sstring);
sstring = (char *)MALLOC(strlen(pstring) + 1);
stoken = pstring;
first = TRUE;
}
/* Skip over "delim1" delimiters at the string beginning */
for (; *stoken; stoken++) {
for (s2 = delim1; *s2; s2++)
if (*stoken == *s2)
break;
if (*s2 == '\0') break;
}
if (*stoken == '\0') return NULL; /* Finished parsing */
/* "stoken" is now set. Now find the end of the current token */
/* Check string from position stoken. If a character in "delim2" is found, */
/* save the character in "lastdelim", null the byte at that position, and */
/* return the token. If a character in "delim1" is found, do the same but */
/* continue checking characters as long as there are contiguous "delim1" */
/* characters. If the series ends in a character from "delim2", then treat */
/* as for "delim2" above. If not, then set "lastdelim" to a null byte and */
/* return the token. */
for (s = stoken; *s; s++) {
twofer = FALSE;
for (s2 = delim2; s2 && *s2; s2++) {
if (*s2 == 'X') {
twofer = TRUE;
continue;
}
if (twofer) {
if ((*s == *s2) && (*(s + 1) == *(s2 + 1))) {
if (s == stoken) {
strncpy(sstring, stoken, 2);
*(sstring + 2) = '\0';
stoken = s + 2;
}
else {
strncpy(sstring, stoken, (int)(s - stoken));
*(sstring + (s - stoken)) = '\0';
stoken = s;
}
return sstring;
}
s2++;
if (*s2 == '\0') break;
}
else if (*s == *s2) {
if (s == stoken) {
strncpy(sstring, stoken, 1);
*(sstring + 1) = '\0';
stoken = s + 1;
}
else {
strncpy(sstring, stoken, (int)(s - stoken));
*(sstring + (s - stoken)) = '\0';
stoken = s;
}
return sstring;
}
}
for (s2 = delim1; *s2; s2++) {
if (*s == *s2) {
strncpy(sstring, stoken, (int)(s - stoken));
*(sstring + (s - stoken)) = '\0';
stoken = s;
return sstring;
}
}
}
strcpy(sstring, stoken); /* Just copy to the end */
stoken = s;
return sstring;
}
/*----------------------------------------------------------------------*/
void InputParseError(FILE *f)
+1
View File
@@ -29,6 +29,7 @@ extern int File;
extern char *nexttok;
#define SKIPTO(a) do {SkipTok(NULL);} while (!match(nexttok,a))
extern char *strdtok(char *pstring, char *delim1, char *delim2);
extern void SkipTok(char *delimiter);
extern void SkipTokNoNewline(char *delimiter);
extern void SkipNewLine(char *delimiter);
+4
View File
@@ -27,6 +27,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <stdarg.h>
#ifdef TCL_NETGEN
#include <tcl.h>
#endif
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
+9 -2
View File
@@ -1573,7 +1573,7 @@ skip_ends:
else if (toupper(nexttok[0]) == 'X') { /* subcircuit instances */
char instancename[100], subcktname[100];
int itype;
int itype, in_props;
instancename[99] = '\0';
subcktname[99] = '\0';
@@ -1596,6 +1596,7 @@ skip_ends:
head = NULL;
tail = NULL;
SpiceTokNoNewline();
in_props = FALSE;
while (nexttok != NULL) {
/* must still be a node or a parameter */
struct portelement *new_port;
@@ -1622,10 +1623,11 @@ skip_ends:
if (((eqptr = strchr(nexttok, '=')) != NULL) &&
((tp = LookupCellFile(nexttok, filenum)) == NULL))
{
in_props = TRUE;
*eqptr = '\0';
AddProperty(&kvlist, nexttok, eqptr + 1);
}
else
else if (in_props == FALSE)
{
new_port = (struct portelement *)CALLOC(1, sizeof(struct portelement));
new_port->name = strsave(nexttok);
@@ -1634,6 +1636,11 @@ skip_ends:
new_port->next = NULL;
tail = new_port;
}
else
{
Fprintf(stderr, "Token \"%s\" is not a parameter!\n", nexttok);
InputParseError(stderr);
}
SpiceTokNoNewline();
}
+381 -138
View File
@@ -57,8 +57,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "netfile.h"
#include "print.h"
#define VLOG_DELIMITERS " \t\r\n,;"
#define VLOG_DELIMITERS2 " \t\r\n,()"
// See netfile.c for explanation of delimiters. 'X'
// separates single-character delimiters from two-character delimiters.
#define VLOG_DELIMITERS ",;:(){}[]=X///**/#("
#define VLOG_PIN_NAME_DELIMITERS "()X///**/"
// Global storage for verilog parameters
struct hashdict verilogparams;
@@ -95,21 +97,229 @@ struct bus *NewBus()
return (wb);
}
//-------------------------------------------------------------------------
// Get bus indexes from the notation name[a:b]. If there is only "name"
// then look up the name in the bus hash list and return the index bounds.
// Return 0 on success, 1 on syntax error, and -1 if signal is not a bus.
//
// Note that this routine relies on the delimiter characters including
// "[", ":", and "]" when calling NextTok.
//-------------------------------------------------------------------------
int GetBusTok(struct bus *wb)
{
int result, start, end;
struct property *kl = NULL;
if (wb == NULL) return 0;
else {
wb->start = -1;
wb->end = -1;
}
if (match(nexttok, "[")) {
SkipTokComments(VLOG_DELIMITERS);
// Check for parameter names and substitute values if found.
if (nexttok[0] == '`') {
kl = (struct property *)HashLookup(nexttok + 1, &verilogdefs);
if (kl == NULL) {
Printf("Unknown definition %s found in array notation.\n", nexttok);
}
else {
if (kl->type == PROP_STRING) {
result = sscanf(kl->pdefault.string, "%d", &start);
if (result != 1) {
Printf("Cannot parse first digit from parameter %s value %s\n",
nexttok, kl->pdefault.string);
return 1;
}
}
else if (kl->type == PROP_INTEGER) {
start = kl->pdefault.ival;
}
else if (kl->type == PROP_DOUBLE) {
start = (int)kl->pdefault.dval;
if ((double)start != kl->pdefault.dval) {
Printf("Cannot parse first digit from parameter %s value %g\n",
nexttok, kl->pdefault.dval);
return 1;
}
}
else {
Printf("Parameter %s has unknown type; don't know how to parse.\n",
nexttok);
return 1;
}
}
}
else {
result = sscanf(nexttok, "%d", &start);
if (result != 1) {
// Is name in the parameter list?
kl = (struct property *)HashLookup(nexttok, &verilogparams);
if (kl == NULL) {
Printf("Array value %s is not a number or a parameter.\n",
nexttok);
return 1;
}
else {
if (kl->type == PROP_STRING) {
result = sscanf(kl->pdefault.string, "%d", &start);
if (result != 1) {
Printf("Parameter %s has value %s that cannot be parsed"
" as an integer.\n", nexttok, kl->pdefault.string);
return 1;
}
}
else if (kl->type == PROP_INTEGER) {
start = kl->pdefault.ival;
}
else if (kl->type == PROP_DOUBLE) {
start = (int)kl->pdefault.dval;
if ((double)start != kl->pdefault.dval) {
Printf("Parameter %s has value %g that cannot be parsed"
" as an integer.\n", nexttok, kl->pdefault.dval);
return 1;
}
}
else {
Printf("Parameter %s has unknown type; don't know how"
" to parse.\n", nexttok);
return 1;
}
}
}
}
SkipTokComments(VLOG_DELIMITERS);
if (match(nexttok, "]")) {
result = 1;
end = start; // Single bit
}
else if (!match(nexttok, ":")) {
Printf("Badly formed array notation: Expected colon, found %s\n", nexttok);
return 1;
}
else {
SkipTokComments(VLOG_DELIMITERS);
// Check for parameter names and substitute values if found.
if (nexttok[0] == '`') {
kl = (struct property *)HashLookup(nexttok + 1, &verilogdefs);
if (kl == NULL) {
Printf("Unknown definition %s found in array notation.\n", nexttok);
}
else {
if (kl->type == PROP_STRING) {
result = sscanf(kl->pdefault.string, "%d", &end);
if (result != 1) {
Printf("Cannot parse second digit from parameter "
"%s value %s\n", nexttok, kl->pdefault.string);
return 1;
}
}
else if (kl->type == PROP_INTEGER) {
end = kl->pdefault.ival;
}
else if (kl->type == PROP_DOUBLE) {
end = (int)kl->pdefault.dval;
if ((double)end != kl->pdefault.dval) {
Printf("Cannot parse second digit from parameter "
"%s value %g\n", nexttok, kl->pdefault.dval);
return 1;
}
}
else {
Printf("Parameter %s has unknown type; don't know how"
" to parse.\n", nexttok);
return 1;
}
}
}
else {
result = sscanf(nexttok, "%d", &end);
if (result != 1) {
// Is name in the parameter list?
kl = (struct property *)HashLookup(nexttok, &verilogparams);
if (kl == NULL) {
Printf("Array value %s is not a number or a parameter.\n",
nexttok);
return 1;
}
else {
if (kl->type == PROP_STRING) {
result = sscanf(kl->pdefault.string, "%d", &end);
if (result != 1) {
Printf("Parameter %s has value %s that cannot be parsed"
" as an integer.\n", nexttok,
kl->pdefault.string);
return 1;
}
}
else if (kl->type == PROP_INTEGER) {
end = kl->pdefault.ival;
}
else if (kl->type == PROP_DOUBLE) {
end = (int)kl->pdefault.dval;
if ((double)end != kl->pdefault.dval) {
Printf("Cannot parse second digit from parameter "
"%s value %g\n", nexttok, kl->pdefault.dval);
return 1;
}
}
else {
Printf("Parameter %s has unknown type; don't know how"
" to parse.\n", nexttok);
return 1;
}
}
}
}
}
wb->start = start;
wb->end = end;
while (!match(nexttok, "]")) {
SkipTokComments(VLOG_DELIMITERS);
if (nexttok == NULL) {
Printf("End of file reached while reading array bounds.\n");
return 1;
}
else if (match(nexttok, ";")) {
// Better than reading to end-of-file, give up on end-of-statement
Printf("End of statement reached while reading array bounds.\n");
return 1;
}
}
}
else {
struct bus *hbus;
hbus = (struct bus *)HashLookup(nexttok, &buses);
if (hbus != NULL) {
wb->start = hbus->start;
wb->end = hbus->end;
}
else
return -1;
}
return 0;
}
//--------------------------------------------------------------------
// GetBus() is similar to GetBusTok() (see above), but it parses from
// a string instead of the input tokenizer.
//--------------------------------------------------------------------
int GetBus(char *astr, struct bus *wb)
{
char *colonptr, *brackstart, *brackend;
int result, start, end;
if (wb == NULL) return;
if (wb == NULL) return 0;
else {
wb->start = -1;
wb->end = -1;
}
brackstart = strchr(astr, '[');
if (brackstart != NULL) {
brackend = strchr(astr, ']');
@@ -129,10 +339,10 @@ int GetBus(char *astr, struct bus *wb)
}
if (colonptr)
result = sscanf(colonptr + 1, "%d", &end);
else {
else {
result = 1;
end = start; // Single bit
}
end = start; // Single bit
}
*brackend = ']';
if (result != 1) {
Printf("Badly formed array notation \"%s\"\n", astr);
@@ -370,12 +580,13 @@ extern void PopStack(struct cellstack **top);
void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
int blackbox)
{
int cdnum = 1, rdnum = 1, i;
int cdnum = 1, rdnum = 1, i, ival;
int warnings = 0, hasports, inlined_decls = 0, localcount = 1;
char devtype, in_module, in_comment, in_param;
char *eqptr, *parptr, *matchptr;
double dval;
char devtype, in_module, in_param;
char *eqptr, *matchptr;
struct keyvalue *kvlist = NULL;
char inst[256], model[256], instname[256], portname[256];
char inst[256], model[256], instname[256], portname[256], pkey[256];
struct nlist *tp;
struct objlist *parent, *sobj, *nobj, *lobj, *pobj;
@@ -383,33 +594,24 @@ void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
model[255] = '\0';
instname[255] = '\0';
in_module = (char)0;
in_comment = (char)0;
in_param = (char)0;
while (!EndParseFile()) {
SkipTok(VLOG_DELIMITERS); /* get the next token */
SkipTokComments(VLOG_DELIMITERS); /* get the next token */
if ((EndParseFile()) && (nexttok == NULL)) break;
else if (nexttok == NULL)
break;
/* Handle comment blocks */
if (nexttok[0] == '/' && nexttok[1] == '*') {
in_comment = (char)1;
}
else if (nexttok[0] == '*' && nexttok[1] == '/') {
in_comment = (char)0;
continue;
}
if (in_comment == (char)1) continue;
/* Handle comment lines */
if (match(nexttok, "//"))
SkipNewLine(VLOG_DELIMITERS);
/* Ignore end-of-statement markers */
else if (match(nexttok, ";"))
continue;
/* Ignore primitive definitions */
else if (match(nexttok, "primitive")) {
while (1) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
if (EndParseFile()) break;
if (match(nexttok, "endprimitive")) {
in_module = 0;
@@ -505,47 +707,48 @@ void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
/* definition, and those which declare everything */
/* inside the pin list. */
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
// Check for parameters within #( ... )
if (match(nexttok, "#(")) {
SkipTok(VLOG_DELIMITERS);
while (match(nexttok, "//")) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS);
}
SkipTokComments(VLOG_DELIMITERS);
in_param = (char)1;
}
else if (nexttok[0] == '(') {
if (match(nexttok, "("))
SkipTok(VLOG_DELIMITERS);
else
nexttok++;
while (match(nexttok, "//")) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS);
}
else if (match(nexttok, "(")) {
SkipTokComments(VLOG_DELIMITERS);
}
wb.start = wb.end = -1;
while ((nexttok != NULL) && (nexttok[0] != ';')) {
while ((nexttok != NULL) && !match(nexttok, ";")) {
if (in_param) {
if (!strcmp(nexttok, ")")) {
if (match(nexttok, ")")) {
in_param = (char)0;
SkipTok(VLOG_DELIMITERS);
if (strcmp(nexttok, "(")) {
SkipTokComments(VLOG_DELIMITERS);
if (!match(nexttok, "(")) {
Fprintf(stderr, "Badly formed module block parameter list.\n");
goto skip_endmodule;
}
}
else if ((eqptr = strchr(nexttok, '=')) != NULL) {
*eqptr = '\0';
// Only String properties allowed
PropertyString(tp->name, filenum, nexttok, 0, eqptr + 1);
else if (match(nexttok, "=")) {
// The parameter value is the next token.
SkipTokComments(VLOG_DELIMITERS); /* get the next token */
eqptr = nexttok;
// Try first as a double, otherwise it's a string
// Double value's slop defaults to 1%.
if (ConvertStringToFloat(eqptr, &dval) == 1)
PropertyDouble(tp->name, filenum, pkey, 0.01, dval);
else
PropertyString(tp->name, filenum, pkey, 0, eqptr);
}
else {
/* Assume this is a keyword and save it */
strcpy(pkey, nexttok);
}
}
else {
else if (!match(nexttok, ",")) {
if (match(nexttok, ")")) break;
// Ignore input, output, and inout keywords, and handle buses.
@@ -558,8 +761,8 @@ void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
if (!match(nexttok, "input") && !match(nexttok, "output") &&
!match(nexttok, "inout") && !match(nexttok, "real") &&
!match(nexttok, "logic") && !match(nexttok, "integer")) {
if (nexttok[0] == '[') {
if (GetBus(nexttok, &wb) != 0) {
if (match(nexttok, "[")) {
if (GetBusTok(&wb) != 0) {
// Didn't parse as a bus, so wing it
wb.start = wb.end = -1;
Port(nexttok);
@@ -582,21 +785,15 @@ void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
wb.start = wb.end = -1;
}
else {
char *pptr;
if ((pptr = strrchr(nexttok, ')')) != NULL)
*pptr = '\0';
Port(nexttok);
if (pptr != NULL) break;
}
}
hasports = 1;
}
}
}
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
if (nexttok == NULL) break;
while (match(nexttok, "//")) { SkipNewLine(VLOG_DELIMITERS); SkipTok(VLOG_DELIMITERS); }
}
SetClass((blackbox) ? CLASS_MODULE : CLASS_SUBCKT);
@@ -617,7 +814,7 @@ skip_endmodule:
while (1) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
if (EndParseFile()) break;
if (match(nexttok, "endmodule")) {
in_module = 0;
@@ -728,15 +925,33 @@ skip_endmodule:
kl = NewProperty();
kl->key = strsave(nexttok);
kl->idx = 0;
kl->type = PROP_STRING;
kl->slop.dval = 0.0;
kl->merge = MERGE_NONE;
SkipTokNoNewline(VLOG_DELIMITERS);
if ((nexttok == NULL) || (nexttok[0] == '\0'))
// Let "`define X" be equivalent to "`define X 1"
kl->pdefault.string = strsave("1");
else
if ((nexttok == NULL) || (nexttok[0] == '\0')) {
// Let "`define X" be equivalent to "`define X 1". Use integer value.
kl->type = PROP_INTEGER;
kl->pdefault.ival = 1;
kl->slop.ival = 0;
}
else if (ConvertStringToInteger(nexttok, &ival) == 1) {
/* Parameter parses as an integer */
kl->type = PROP_INTEGER;
kl->pdefault.ival = ival;
kl->slop.ival = 0; // Exact match default
}
else if (ConvertStringToFloat(nexttok, &dval) == 1) {
/* Parameter parses as a floating-point number */
kl->type = PROP_DOUBLE;
kl->pdefault.dval = dval;
kl->slop.dval = 0.01; // One percent default
}
else {
/* Treat the parameter as a string */
kl->type = PROP_STRING;
kl->pdefault.string = strsave(nexttok);
kl->slop.dval = 0.0;
}
HashPtrInstall(kl->key, kl, &verilogdefs);
}
else if (match(nexttok, "localparam")) {
@@ -755,9 +970,23 @@ skip_endmodule:
kl = NewProperty();
kl->key = strsave(nexttok);
kl->idx = 0;
kl->type = PROP_STRING;
kl->slop.dval = 0.0;
kl->pdefault.string = strsave(eqptr + 1);
kl->merge = MERGE_NONE;
if (ConvertStringToInteger(eqptr + 1, &ival) == 1) {
kl->type = PROP_INTEGER;
kl->slop.ival = 0;
kl->pdefault.ival = ival;
}
else if (ConvertStringToFloat(eqptr + 1, &dval) == 1) {
kl->type = PROP_DOUBLE;
kl->slop.dval = 0.01;
kl->pdefault.dval = dval;
}
else {
kl->type = PROP_STRING;
kl->slop.dval = 0.0;
kl->pdefault.string = strsave(eqptr + 1);
}
HashPtrInstall(nexttok, kl, &verilogparams);
}
}
@@ -781,11 +1010,9 @@ skip_endmodule:
/* Skip to matching `endif */
while (1) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
if (EndParseFile()) break;
if (match(nexttok, "//"))
continue;
else if (match(nexttok, "`ifdef") || match(nexttok, "`ifndef")) {
if (match(nexttok, "`ifdef") || match(nexttok, "`ifndef")) {
nested++;
}
else if (match(nexttok, "`endif")) {
@@ -805,7 +1032,7 @@ skip_endmodule:
if (match(nexttok, "real")) SkipTokNoNewline(VLOG_DELIMITERS);
while (nexttok != NULL) {
/* Handle bus notation */
if (GetBus(nexttok, &wb) == 0) {
if (GetBusTok(&wb) == 0) {
SkipTokNoNewline(VLOG_DELIMITERS);
if (wb.start > wb.end) {
for (i = wb.end; i <= wb.start; i++) {
@@ -874,115 +1101,131 @@ skip_endmodule:
head = NULL;
tail = NULL;
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
// Next token must be '#(' (parameters) or '(' (pin list)
// Next token must be '#(' (parameters) or an instance name
if (!strcmp(nexttok, "#(")) {
if (match(nexttok, "#(")) {
// Read the parameter list
SkipTokComments(VLOG_DELIMITERS);
while (nexttok != NULL) {
char *paramname;
SkipTok(VLOG_DELIMITERS2);
while (match(nexttok, "//")) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS2);
}
if (!strcasecmp(nexttok, ";")) {
SkipTok(VLOG_DELIMITERS);
if (match(nexttok, ")")) {
SkipTokComments(VLOG_DELIMITERS);
break;
}
else if (match(nexttok, ",")) {
SkipTokComments(VLOG_DELIMITERS);
continue;
}
// We need to look for parameters of the type ".name(value)"
if (nexttok[0] != '.') break;
else {
else if (nexttok[0] == '.') {
paramname = strsave(nexttok + 1);
SkipTok(VLOG_DELIMITERS2);
while (match(nexttok, "//")) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS2);
SkipTokComments(VLOG_DELIMITERS);
if (!match(nexttok, "(")) {
Printf("Error: Expecting parameter value, got %s.\n", nexttok);
}
SkipTokComments(VLOG_DELIMITERS);
if (match(nexttok, ")")) {
Printf("Error: Parameter with no value found.\n");
}
else {
AddProperty(&kvlist, paramname, nexttok);
SkipTokComments(VLOG_DELIMITERS);
if (!match(nexttok, ")")) {
Printf("Error: Expecting end of parameter value, "
"got %s.\n", nexttok);
}
}
AddProperty(&kvlist, paramname, nexttok);
FREE(paramname);
}
SkipTokComments(VLOG_DELIMITERS);
}
if (!nexttok) {
Printf("Error: Still reading module, but got end-of-file.\n");
goto skip_endmodule;
}
}
// Catch instance name followed by open parenthesis with no space
if ((parptr = strchr(nexttok, '(')) != NULL) *parptr = '\0';
// Then comes the instance name
strncpy(instancename, nexttok, 99);
if (!parptr)
SkipTok(VLOG_DELIMITERS);
else {
*parptr = '(';
nexttok = parptr;
}
/* Printf("Diagnostic: new instance is %s\n", instancename); */
while (match(nexttok, "//")) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS);
}
SkipTokComments(VLOG_DELIMITERS);
arraystart = arrayend = -1;
if (nexttok[0] == '[') {
if (match(nexttok, "[")) {
// Handle instance array notation.
struct bus wb;
if (GetBus(nexttok, &wb) == 0) {
if (GetBusTok(&wb) == 0) {
arraystart = wb.start;
arrayend = wb.end;
}
SkipTok(VLOG_DELIMITERS);
SkipTokComments(VLOG_DELIMITERS);
}
if (nexttok[0] == '(') {
if (match(nexttok, "(")) {
char savetok = (char)0;
struct portelement *new_port;
// Note that the open parens does not necessarily have to be
// followed by space.
if (nexttok[1] != '\0') {
nexttok++;
savetok = (char)1;
}
// Read the pin list
while (nexttok != NULL) {
if (savetok == (char)0) SkipTok(VLOG_DELIMITERS2);
savetok = (char)0;
SkipTokComments(VLOG_DELIMITERS);
// NOTE: Deal with `ifdef et al. properly. Ignoring for now.
while (match(nexttok, "//") || (nexttok[0] == '`')) {
while (nexttok[0] == '`') {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS2);
SkipTokComments(VLOG_DELIMITERS);
}
if (!strcasecmp(nexttok, ";")) break;
if (match(nexttok, ")")) break;
else if (match(nexttok, ",")) continue;
// We need to look for pins of the type ".name(value)"
if (nexttok[0] != '.') {
Printf("Badly formed subcircuit pin line at \"%s\"\n", nexttok);
SkipNewLine(VLOG_DELIMITERS);
}
else {
new_port = (struct portelement *)CALLOC(1, sizeof(struct portelement));
new_port->name = strsave(nexttok + 1);
SkipTok(VLOG_DELIMITERS2);
while (match(nexttok, "//")) {
SkipNewLine(VLOG_DELIMITERS);
SkipTok(VLOG_DELIMITERS2);
SkipTokComments(VLOG_DELIMITERS);
if (!match(nexttok, "(")) {
Printf("Badly formed subcircuit pin line at \"%s\"\n", nexttok);
SkipNewLine(VLOG_DELIMITERS);
}
if (match(nexttok, ";") || (nexttok[0] == '.')) {
SkipTokComments(VLOG_PIN_NAME_DELIMITERS);
if (match(nexttok, ")")) {
char localnet[100];
// Empty parens, so create a new local node
savetok = (char)1;
sprintf(localnet, "_noconnect_%d_", localcount++);
new_port->net = strsave(localnet);
}
else
else {
new_port->net = strsave(nexttok);
/* Read array information along with name; will be parsed later */
SkipTokComments(VLOG_DELIMITERS);
if (match(nexttok, "[")) {
/* Check for space between name and array identifier */
SkipTokComments(VLOG_PIN_NAME_DELIMITERS);
if (!match(nexttok, ")")) {
char *expnet;
expnet = (char *)MALLOC(strlen(new_port->net)
+ strlen(nexttok) + 2);
sprintf(expnet, "%s[%s", new_port->net, nexttok);
FREE(new_port->net);
new_port->net = expnet;
}
SkipTokComments(VLOG_DELIMITERS);
}
if (!match(nexttok, ")")) {
Printf("Badly formed subcircuit pin line at \"%s\"\n", nexttok);
SkipNewLine(VLOG_DELIMITERS);
}
}
if (head == NULL) head = new_port;
else tail->next = new_port;
@@ -992,13 +1235,12 @@ skip_endmodule:
}
}
else {
// There are too many statements in too many variants of verilog
// to track them all, let alone dealing with macro substitutions
// and such. If it doesn't look like a circuit instance and isn't
// otherwise handled above, treat as a non-structural statement
// and recast the device class as a black-box module.
SetClass(CLASS_MODULE);
goto skip_endmodule;
Printf("Expected to find instance pin block but got \"%s\"\n", nexttok);
}
/* Instance should end with a semicolon */
SkipTokComments(VLOG_DELIMITERS);
if (!match(nexttok, ";")) {
Printf("Expected to find end of instance but got \"%s\"\n", nexttok);
}
/* Check for ignored class */
@@ -1341,11 +1583,12 @@ char *ReadVerilogTop(char *fname, int *fnum, int blackbox)
/* Add the pre-defined key "LVS" to verilogdefs */
kl = NewProperty();
kl->merge = MERGE_NONE;
kl->key = strsave("LVS");
kl->idx = 0;
kl->type = PROP_STRING;
kl->slop.dval = 0.0;
kl->pdefault.string = strsave("1");
kl->type = PROP_INTEGER;
kl->slop.ival = 0;
kl->pdefault.ival = 1;
HashPtrInstall(kl->key, kl, &verilogdefs);
/* All verilog files should start with a comment line, */
+2 -2
View File
@@ -67,8 +67,8 @@ CPP = gcc -E -x c
CXX = @CXX@
CPPFLAGS = -I. -I${NETGENDIR}
DFLAGS = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DUSE_TCL_STUBS -DUSE_TK_STUBS -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"98\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
DFLAGS_NOSTUB = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"98\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
DFLAGS = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DUSE_TCL_STUBS -DUSE_TK_STUBS -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"102\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
DFLAGS_NOSTUB = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"102\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
CFLAGS = -g -m64 -fPIC -fPIC
DEPEND_FILE = Depend
+2 -2
View File
@@ -8,9 +8,9 @@ DOCDIRS = $(DESTDIR)${DOCDIR}
MANFILES =
DOCFILES = $(DESTDIR)${DOCDIR}/netgen.doc
install-tcl: ${MANDIRS} ${MANFILES} ${DOCDIRS} ${DOCFILES}
install-tcl: ${DOCDIRS} ${DOCFILES}
install: ${MANDIRS} ${MANFILES} ${DOCDIRS} ${DOCFILES}
install: ${DOCDIRS} ${DOCFILES}
${MANDIRS}: make-man-dirs
+8 -8
View File
@@ -125,7 +125,7 @@ configure: failed program was:
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define NETGEN_VERSION "1.5"
| #define NETGEN_REVISION "98"
| #define NETGEN_REVISION "102"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3385: result: gcc -E
@@ -146,7 +146,7 @@ configure: failed program was:
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define NETGEN_VERSION "1.5"
| #define NETGEN_REVISION "98"
| #define NETGEN_REVISION "102"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3448: checking for library containing strerror
@@ -261,7 +261,7 @@ configure: failed program was:
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define NETGEN_VERSION "1.5"
| #define NETGEN_REVISION "98"
| #define NETGEN_REVISION "102"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
@@ -302,7 +302,7 @@ configure: failed program was:
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define NETGEN_VERSION "1.5"
| #define NETGEN_REVISION "98"
| #define NETGEN_REVISION "102"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
@@ -382,7 +382,7 @@ configure: failed program was:
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define NETGEN_VERSION "1.5"
| #define NETGEN_REVISION "98"
| #define NETGEN_REVISION "102"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
@@ -454,7 +454,7 @@ configure: failed program was:
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define NETGEN_VERSION "1.5"
| #define NETGEN_REVISION "98"
| #define NETGEN_REVISION "102"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
@@ -625,7 +625,7 @@ CC='gcc'
CFLAGS='-g -m64 -fPIC'
CPP='gcc -E -x c'
CPPFLAGS=''
DEFS='-DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"98\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1'
DEFS='-DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"102\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1'
DEPEND_FLAG='-MM'
ECHO_C=''
ECHO_N='printf'
@@ -741,7 +741,7 @@ unused=''
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL ""
#define NETGEN_VERSION "1.5"
#define NETGEN_REVISION "98"
#define NETGEN_REVISION "102"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
+4 -4
View File
@@ -660,10 +660,10 @@ S["ECHO_T"]=""
S["ECHO_N"]="-n"
S["ECHO_C"]=""
S["DEFS"]="-DPACKAGE_NAME=\\\"netgen\\\" -DPACKAGE_TARNAME=\\\"netgen\\\" -DPACKAGE_VERSION=\\\"1.3\\\" -DPACKAGE_STRING=\\\"netgen\\ 1.3\\\" -DPACKAGE_BUGREPORT=\\\"eda-dev@open"\
"circuitdesign.com\\\" -DPACKAGE_URL=\\\"\\\" -DNETGEN_VERSION=\\\"1.5\\\" -DNETGEN_REVISION=\\\"98\\\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -"\
"DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -D"\
"SIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHA"\
"VE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1"
"circuitdesign.com\\\" -DPACKAGE_URL=\\\"\\\" -DNETGEN_VERSION=\\\"1.5\\\" -DNETGEN_REVISION=\\\"102\\\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 "\
"-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -"\
"DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DH"\
"AVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1"
S["mandir"]="${datarootdir}/man"
S["localedir"]="${datarootdir}/locale"
S["libdir"]="${exec_prefix}/lib"
+2 -2
View File
@@ -67,8 +67,8 @@ CPP = gcc -E -x c
CXX = @CXX@
CPPFLAGS = -I. -I${NETGENDIR}
DFLAGS = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DUSE_TCL_STUBS -DUSE_TK_STUBS -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"98\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
DFLAGS_NOSTUB = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"98\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
DFLAGS = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DUSE_TCL_STUBS -DUSE_TK_STUBS -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"102\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
DFLAGS_NOSTUB = -DCAD_DIR=\"${LIBDIR}\" -DTCL_DIR=\"${TCLDIR}\" -DPACKAGE_NAME=\"netgen\" -DPACKAGE_TARNAME=\"netgen\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"netgen\ 1.3\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DNETGEN_VERSION=\"1.5\" -DNETGEN_REVISION=\"102\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DDBUG_OFF=1 -DTCL_NETGEN=1 -Dlinux=1 -DSYSV=1 -DISC=1 -DSHDLIB_EXT=\".so\" -DNDEBUG
CFLAGS = -g -m64 -fPIC -fPIC
DEPEND_FILE = Depend
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# For installation, put this file (netgen.sh) in a standard executable path.
# Put startup script "netgen.tcl" and shared library "tclnetgen.so"
+2 -2
View File
@@ -138,7 +138,7 @@ proc netgen::convert_to_json {filename lvs_final} {
foreach net $cktval {
incr nidx
puts $fjson " \["
set netname [lindex $net 0]
set netname [string map {"\\" ""} [lindex $net 0]]
puts $fjson " \"$netname\","
puts $fjson " \["
set netconn [lindex $net 1]
@@ -169,7 +169,7 @@ proc netgen::convert_to_json {filename lvs_final} {
foreach net $cktval {
incr nidx
puts $fjson " \["
set netname [lindex $net 0]
set netname [string map {"\\" ""} [lindex $net 0]]
puts $fjson " \"$netname\","
puts $fjson " \["
set netconn [lindex $net 1]
+4405
View File
File diff suppressed because it is too large Load Diff