Compare commits
9 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
8a2bbe0723 | |
|
|
a0c49a026a | |
|
|
665203bba1 | |
|
|
0192558d4b | |
|
|
21d329b22d | |
|
|
37b1a2a07d | |
|
|
777f7ef095 | |
|
|
9b4185fe62 | |
|
|
ddd95c4fe6 |
|
|
@ -91,7 +91,7 @@ char *ActelName(char *Name)
|
|||
/* strip physical-pin information, if it exists */
|
||||
if ((nm = strrchr(name,PHYSICALPIN[0])) != NULL) *nm = '\0';
|
||||
if (strlen(name) > 13) {
|
||||
ActelIndex = (++ActelIndex) % ACTELNAMESIZE;
|
||||
ActelIndex = (ActelIndex + 1) % ACTELNAMESIZE;
|
||||
/* format the value of the hashed value of the string */
|
||||
sprintf(ActelNames[ActelIndex], "$%lX", ActelNameHash(name));
|
||||
if (Debug)
|
||||
|
|
@ -102,7 +102,7 @@ Printf("ActelNameHash returns %s on name %s\n",ActelNames[ActelIndex], name);
|
|||
NeedsQuoting = 0;
|
||||
if (NULL != strpbrk(name, ".,:; \t\"'\n\r")) NeedsQuoting = 1;
|
||||
|
||||
ActelIndex = (++ActelIndex) % ACTELNAMESIZE;
|
||||
ActelIndex = (ActelIndex + 1) % ACTELNAMESIZE;
|
||||
if (!NeedsQuoting) {
|
||||
strcpy(ActelNames[ActelIndex], name);
|
||||
return(ActelNames[ActelIndex]);
|
||||
|
|
|
|||
|
|
@ -2018,8 +2018,11 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
|
||||
/* Do NOT remove shorting devices that */
|
||||
if (found) {
|
||||
/* Beware remove shorting devices that */
|
||||
/* connect two ports. Otherwise the */
|
||||
/* port lists get screwed up. It is */
|
||||
/* better in that case to force the */
|
||||
|
|
@ -2027,6 +2030,10 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
|||
/* This is ignored for a top-level cell */
|
||||
/* because it will just show up as a */
|
||||
/* port mismatch error as it should. */
|
||||
/* (12/12/2025---disabling this worked; */
|
||||
/* may need to go back to a failing */
|
||||
/* example and determine how pin */
|
||||
/* matching gets scrambled.) */
|
||||
|
||||
if ((not_top == TRUE) &&
|
||||
(ecomp->cell1->class != CLASS_ISOURCE)) {
|
||||
|
|
@ -2039,14 +2046,18 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
|||
else if (ob2->node == node2)
|
||||
found2 = TRUE;
|
||||
if (found1 && found2) {
|
||||
found = FALSE;
|
||||
Fprintf(stdout, "Warning: "
|
||||
"zero-valued device connects "
|
||||
"port %s to another port; pin "
|
||||
"matching may be affected.\n",
|
||||
ob2->name);
|
||||
// found = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found) break;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
Fprintf(stdout, "Removing zero-valued device "
|
||||
"%s from cell %s (%d) makes a better "
|
||||
|
|
|
|||
33
base/hash.c
33
base/hash.c
|
|
@ -137,32 +137,39 @@ static unsigned char uppercase[] = {
|
|||
// horrible things can happen, as, for example, names AOI12 and OAI12
|
||||
// have exactly the same hash result. Lousy for binning and even
|
||||
// lousier for generating class magic numbers.
|
||||
//
|
||||
// Updated again 4/2/2026 to the FNV-1a hash, which is better than
|
||||
// SDBM for this application, according to ChatGPT.
|
||||
|
||||
unsigned long hashnocase(char *s, int hashsize)
|
||||
{
|
||||
unsigned long hashval;
|
||||
|
||||
for (hashval = 0; *s != '\0'; )
|
||||
hashval = uppercase[*s++]
|
||||
+ (hashval << 6) + (hashval << 16) - hashval;
|
||||
unsigned long hashval = 2166136261ul;
|
||||
for (; *s != '\0'; s++) {
|
||||
hashval ^= uppercase[*s];
|
||||
hashval *= 16777619ul;
|
||||
}
|
||||
return (hashsize == 0) ? hashval : (hashval % hashsize);
|
||||
}
|
||||
|
||||
unsigned long hashcase(char *s, int hashsize)
|
||||
{
|
||||
unsigned long hashval;
|
||||
|
||||
for (hashval = 0; *s != '\0'; )
|
||||
hashval = (*s++) + (hashval << 6) + (hashval << 16) - hashval;
|
||||
unsigned long hashval = 2166136261ul;
|
||||
for (; *s != '\0'; s++) {
|
||||
hashval ^= (unsigned char)(*s);
|
||||
hashval *= 16777619ul;
|
||||
}
|
||||
return (hashsize == 0) ? hashval : (hashval % hashsize);
|
||||
}
|
||||
|
||||
unsigned long genhash(char *s, int c, int hashsize)
|
||||
{
|
||||
unsigned long hashval;
|
||||
|
||||
for (hashval = (unsigned long)c; *s != '\0'; )
|
||||
hashval = (*s++) + (hashval << 6) + (hashval << 16) - hashval;
|
||||
unsigned long hashval = 2166136261ul;
|
||||
hashval ^= (unsigned long)c;
|
||||
hashval *= 16777619ul;
|
||||
for (; *s != '\0'; s++) {
|
||||
hashval ^= (unsigned char)(*s);
|
||||
hashval *= 16777619ul;
|
||||
}
|
||||
return (hashsize == 0) ? hashval : (hashval % hashsize);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
|
||||
#ifdef TCL_NETGEN
|
||||
int InterruptPending = 0;
|
||||
void (*oldinthandler)() = SIG_DFL;
|
||||
void (*oldinthandler)(int) = SIG_DFL;
|
||||
extern Tcl_Interp *netgeninterp;
|
||||
extern int check_interrupt();
|
||||
#endif
|
||||
|
|
@ -1622,8 +1622,8 @@ void FormatIllegalElementClasses()
|
|||
char *permcount;
|
||||
int bytesleft;
|
||||
|
||||
permname = CALLOC(right_col_end + 2, sizeof(char));
|
||||
permcount = CALLOC(right_col_end + 2, sizeof(char));
|
||||
permname = CALLOC(right_col_end + 100, sizeof(char));
|
||||
permcount = CALLOC(right_col_end + 100, sizeof(char));
|
||||
ostr = output_string_init();
|
||||
|
||||
found = 0;
|
||||
|
|
|
|||
|
|
@ -685,6 +685,7 @@ void SpiceSkipNewLine(void)
|
|||
ungetc(contline, infile);
|
||||
}
|
||||
|
||||
#if 0 /* Commented with "#if 0" due to comment characters in the comment */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Function similar to strtok() for token parsing. The difference is */
|
||||
/* that it takes two sets of delimiters. The first is whitespace */
|
||||
|
|
@ -705,6 +706,7 @@ void SpiceSkipNewLine(void)
|
|||
/* the first character of the delimiter string in addition to marking */
|
||||
/* the boundary between two-character and one-character delimiters. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
#endif
|
||||
|
||||
char *strdtok0(char *pstring, char *delim1, char *delim2, char isverilog)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -449,6 +449,7 @@ int removeshorted(struct hashlist *p, int file)
|
|||
ob = nob;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Remove shorted instances of class "class" from the database */
|
||||
|
|
@ -539,6 +540,7 @@ int deleteclass(struct hashlist *p, int file)
|
|||
}
|
||||
}
|
||||
FREE(checknodes);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Remove all instances of class "class" from the database */
|
||||
|
|
@ -576,6 +578,7 @@ int renameinstances(struct hashlist *p, int file)
|
|||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void InstanceRename(char *from, char *to, int file)
|
||||
|
|
@ -598,9 +601,10 @@ int freeprop(struct hashlist *p)
|
|||
struct property *prop;
|
||||
|
||||
prop = (struct property *)(p->ptr);
|
||||
if (prop->type == PROP_STRING)
|
||||
if (prop->type == PROP_STRING) {
|
||||
if (prop->pdefault.string != NULL)
|
||||
FREE(prop->pdefault.string);
|
||||
}
|
||||
else if (prop->type == PROP_EXPRESSION) {
|
||||
struct tokstack *stackptr, *nptr;
|
||||
stackptr = prop->pdefault.stack;
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ void Fanout(char *cell, char *node, int filter)
|
|||
while (ob != NULL) {
|
||||
char *obname = ob->name;
|
||||
if (*obname == '/') obname++;
|
||||
if (ob->node == nodenum)
|
||||
if (ob->node == nodenum) {
|
||||
if (filter == ALLOBJECTS) {
|
||||
Printf(" %s (", obname);
|
||||
PrintObjectType(ob->type);
|
||||
|
|
@ -331,6 +331,7 @@ void Fanout(char *cell, char *node, int filter)
|
|||
else if (ob->type == filter) {
|
||||
Printf(" %s\n", obname);
|
||||
}
|
||||
}
|
||||
ob = ob->next;
|
||||
}
|
||||
}
|
||||
|
|
@ -933,7 +934,7 @@ static int PrintLeavesInCellHash(struct hashlist *p)
|
|||
struct nlist *ptr;
|
||||
|
||||
ptr = (struct nlist *)(p->ptr);
|
||||
if ((ptr->class == CLASS_SUBCKT)) PrintLeavesInCell(ptr->name, ptr->file);
|
||||
if (ptr->class == CLASS_SUBCKT) PrintLeavesInCell(ptr->name, ptr->file);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell)
|
|||
if (ob->type == PROPERTY) {
|
||||
struct valuelist *vl;
|
||||
int i;
|
||||
for (i == 0;; i++) {
|
||||
for (i = 0;; i++) {
|
||||
vl = &(ob->instance.props[i]);
|
||||
if (vl->type == PROP_ENDLIST) break;
|
||||
else if (vl->type == PROP_VALUE) {
|
||||
|
|
@ -216,7 +216,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell)
|
|||
if (ob->type == PROPERTY) {
|
||||
struct valuelist *vl;
|
||||
int i;
|
||||
for (i == 0;; i++) {
|
||||
for (i = 0;; i++) {
|
||||
vl = &(ob->instance.props[i]);
|
||||
if (vl->type == PROP_ENDLIST) break;
|
||||
else if (vl->type == PROP_VALUE) {
|
||||
|
|
@ -236,7 +236,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell)
|
|||
if (ob->type == PROPERTY) {
|
||||
struct valuelist *vl;
|
||||
int i;
|
||||
for (i == 0;; i++) {
|
||||
for (i = 0;; i++) {
|
||||
vl = &(ob->instance.props[i]);
|
||||
if (vl->type == PROP_ENDLIST) break;
|
||||
else if (vl->type == PROP_VALUE) {
|
||||
|
|
@ -399,7 +399,7 @@ int renamepins(struct hashlist *p, int file)
|
|||
ptr = (struct nlist *)(p->ptr);
|
||||
|
||||
if (ptr->file != file)
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
for (ob = ptr->cell; ob != NULL; ob = ob->next) {
|
||||
if (ob->type == FIRSTPIN) {
|
||||
|
|
@ -426,6 +426,7 @@ int renamepins(struct hashlist *p, int file)
|
|||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If any pins are marked unconnected, see if there are */
|
||||
|
|
|
|||
|
|
@ -516,6 +516,14 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} {
|
|||
}
|
||||
}
|
||||
close $fsetup
|
||||
if {$command != {}} {
|
||||
# Incomplete command. Evaluate it to get a meaningful error message
|
||||
if {[catch {uplevel 1 [list namespace eval netgen $command]} msg]} {
|
||||
set msg [string trimright $msg "\n"]
|
||||
puts stderr "Error $setupfile:$sline (ignoring), $msg"
|
||||
incr perrors
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puts stdout "Error: Cannot read the setup file $setupfile"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue