mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-22 14:07:07 +02:00
Compare commits
14
Commits
1.5.317
...
netgen-1.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb8a6108b9 | ||
|
|
e1528a797c | ||
|
|
5e48c4e876 | ||
|
|
2c94087510 | ||
|
|
0b4a8fe9d6 | ||
|
|
3eadc8b0dc | ||
|
|
b3af7b98b4 | ||
|
|
9630670071 | ||
|
|
f29452e550 | ||
|
|
da3b96ae9e | ||
|
|
8a2bbe0723 | ||
|
|
a0c49a026a | ||
|
|
1520e276bc | ||
|
|
665203bba1 |
+3
-1
@@ -164,8 +164,10 @@ unsigned long hashcase(char *s, int hashsize)
|
||||
unsigned long genhash(char *s, int c, int hashsize)
|
||||
{
|
||||
unsigned long hashval = 2166136261ul;
|
||||
hashval ^= (unsigned long)c;
|
||||
hashval *= 16777619ul;
|
||||
for (; *s != '\0'; s++) {
|
||||
hashval ^= (unsigned long)c;
|
||||
hashval ^= (unsigned char)(*s);
|
||||
hashval *= 16777619ul;
|
||||
}
|
||||
return (hashsize == 0) ? hashval : (hashval % hashsize);
|
||||
|
||||
+56
-2
@@ -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
|
||||
@@ -7896,7 +7896,8 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
if (*(cover + i) == (char)0) {
|
||||
j = 0;
|
||||
for (ob2 = tc2->cell; ob2 != NULL; ob2 = ob2->next) {
|
||||
char *name1, *name2;
|
||||
char *name1, *name2, *aptr1 = NULL, *aptr2 = NULL;
|
||||
char delim1, delim2;
|
||||
|
||||
if (!IsPort(ob2)) break;
|
||||
|
||||
@@ -7914,8 +7915,59 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
if (!strncmp(name1, "proxy", 5) && (ob2->node == -1)) name1 +=5;
|
||||
if (!strncmp(name2, "proxy", 5) && (ob1->node == -1)) name2 +=5;
|
||||
|
||||
/* Recognize an array as matching a non-array of the same */
|
||||
/* name if the array is size 1. There must be a better way */
|
||||
/* to do this; this method makes excessive calls to */
|
||||
/* matchfunc(). */
|
||||
|
||||
if ((tc1->flags & CELL_PLACEHOLDER) || (tc2->flags && CELL_PLACEHOLDER)) {
|
||||
aptr1 = get_array_delimiter(name1, &delim1);
|
||||
aptr2 = get_array_delimiter(name2, &delim2);
|
||||
|
||||
if ((aptr1 != NULL) && (aptr2 == NULL)) {
|
||||
*aptr1 = '\0';
|
||||
if ((*matchfunc)(name1, name2)) {
|
||||
/* Check that name1 does not have another array
|
||||
* component in ob1
|
||||
*/
|
||||
struct objlist *ob3;
|
||||
for (ob3 = tc1->cell; ob3; ob3 = ob3->next) {
|
||||
if (!IsPort(ob3)) break;
|
||||
if (ob3 == ob1) continue;
|
||||
if (!strncmp(ob3->name, name1, strlen(name1)) &&
|
||||
is_delimiter(*(ob3->name + strlen(name1)))) {
|
||||
*aptr1 = delim1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((aptr1 == NULL) && (aptr2 != NULL)) {
|
||||
*aptr2 = '\0';
|
||||
if ((*matchfunc)(name1, name2)) {
|
||||
/* Check that name2 does not have another array
|
||||
* component in ob1
|
||||
*/
|
||||
struct objlist *ob3;
|
||||
for (ob3 = tc2->cell; ob3; ob3 = ob3->next) {
|
||||
if (!IsPort(ob3)) break;
|
||||
if (ob3 == ob2) continue;
|
||||
if (!strncmp(ob3->name, name2, strlen(name2)) &&
|
||||
is_delimiter(*(ob3->name + strlen(name2)))) {
|
||||
*aptr2 = delim2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((*matchfunc)(name1, name2)) {
|
||||
|
||||
if (aptr1) *aptr1 = delim1;
|
||||
if (aptr2) *aptr2 = delim2;
|
||||
|
||||
/* If both sides have unconnected nodes, then pins with */
|
||||
/* matching names are an automatic match. Otherwise, if */
|
||||
/* matching black-box entries, then pins are always */
|
||||
@@ -8069,6 +8121,8 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
}
|
||||
}
|
||||
if (bangptr2) *bangptr2 = '!';
|
||||
if (aptr1) *aptr1 = delim1;
|
||||
if (aptr2) *aptr2 = delim2;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,6 +282,33 @@ int matchfilenocase(char *st1, char *st2, int f1, int f2)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Delimiter matching---Find an opening delimiter in a string. */
|
||||
/* Return the position of the first opening delimeter in the string, */
|
||||
/* like strchr(). Place the actual delimeter character in *delim. */
|
||||
|
||||
char *get_array_delimiter(char *name, char *delim)
|
||||
{
|
||||
char *stest = name;
|
||||
|
||||
while (*stest != '\0')
|
||||
{
|
||||
if (to_lower[*stest] == '<') {
|
||||
*delim = *stest;
|
||||
return stest;
|
||||
}
|
||||
stest++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Delimiter parsing---Check if a character is an opening array delimiter. */
|
||||
/* Return TRUE if the character is an opening delimiter, FALSE if not. */
|
||||
|
||||
int is_delimiter(char testc)
|
||||
{
|
||||
return (to_lower[testc] == '<') ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MALLINFO
|
||||
void PrintMemoryStats(void)
|
||||
{
|
||||
|
||||
@@ -309,6 +309,8 @@ extern int match(char *, char *);
|
||||
extern int matchnocase(char *, char *);
|
||||
extern int matchfile(char *, char *, int, int);
|
||||
extern int matchfilenocase(char *, char *, int, int);
|
||||
extern int is_delimiter(char);
|
||||
extern char *get_array_delimiter(char *, char *);
|
||||
|
||||
extern void GarbageCollect(void);
|
||||
extern void InitGarbageCollection(void);
|
||||
|
||||
+12
-3
@@ -1783,10 +1783,19 @@ skip_ends:
|
||||
if (scan->next != NULL) scan = scan->next;
|
||||
tail->next = NULL;
|
||||
|
||||
/* Check for class defined inside itself (self-referential loop) */
|
||||
|
||||
if (!strcasecmp(model, scan->name)) {
|
||||
Fprintf(stderr, "Fatal: Class \"%s\" is instanced inside of itself!\n",
|
||||
scan->name);
|
||||
InputParseError(stderr);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for ignored class */
|
||||
|
||||
if ((itype = IsIgnored(subcktname, filenum)) == IGNORE_CLASS) {
|
||||
Printf("Class '%s' instanced in input but is being ignored.\n", model);
|
||||
if ((itype = IsIgnored(scan->name, filenum)) == IGNORE_CLASS) {
|
||||
Printf("Class '%s' instanced in input but is being ignored.\n", scan->name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1801,7 +1810,7 @@ skip_ends:
|
||||
break;
|
||||
}
|
||||
if (shorted == (unsigned char)1) {
|
||||
Printf("Instance of '%s' is shorted, ignoring.\n", subcktname);
|
||||
Printf("Instance of '%s' is shorted, ignoring.\n", scan->name);
|
||||
while (head) {
|
||||
p = head->next;
|
||||
FREE(head);
|
||||
|
||||
@@ -1914,6 +1914,38 @@ skip_endmodule:
|
||||
else { /* "assign" */
|
||||
SkipTokComments(VLOG_PIN_CHECK_DELIMITERS);
|
||||
char *aptr = strvchr(nexttok, '[');
|
||||
|
||||
/* This is a repeat of code to handle reading of pins, and
|
||||
* makes sure that all input has been read to the closing
|
||||
* bracket. There needs to be a single routine to do this,
|
||||
* or (better) rewrite the parser with lex instead of trying
|
||||
* to enumerate all the syntax cases separately.
|
||||
*/
|
||||
if ((aptr != NULL) && (strvchr(nexttok, ']') == NULL))
|
||||
{
|
||||
/* If a bus expressions has whitespace, then concatenate
|
||||
* to the closing ']'.
|
||||
*/
|
||||
char *array_expr = (char *)MALLOC(1);
|
||||
char *new_array_expr = NULL;
|
||||
*array_expr = '\0';
|
||||
/* Read to "]" */
|
||||
while (nexttok) {
|
||||
new_array_expr = (char *)MALLOC(strlen(array_expr) +
|
||||
strlen(nexttok) + 1);
|
||||
/* Roundabout way to do realloc() becase there is no REALLOC() */
|
||||
strcpy(new_array_expr, array_expr);
|
||||
strcat(new_array_expr, nexttok);
|
||||
FREE(array_expr);
|
||||
array_expr = new_array_expr;
|
||||
if (strchr(nexttok, ']')) break;
|
||||
SkipTokComments(VLOG_PIN_CHECK_DELIMITERS);
|
||||
}
|
||||
if (!nexttok) {
|
||||
Printf("Unterminated array in assignment %s\n", array_expr);
|
||||
}
|
||||
}
|
||||
|
||||
if (((aptr == NULL) && (GetBusTok(&wb) == 0)) ||
|
||||
((aptr != NULL) && (GetBus(aptr, &wb) == 0))) {
|
||||
if (aptr != NULL) {
|
||||
@@ -2295,7 +2327,18 @@ nextinst:
|
||||
FREE(wire_bundle);
|
||||
wire_bundle = new_wire_bundle;
|
||||
if (!strcmp(nexttok, "}"))
|
||||
{
|
||||
/* If a "bundle" has only one component, then it is
|
||||
* not really a bundle and should be treated as a
|
||||
* single wire.
|
||||
*/
|
||||
if (strchr(wire_bundle, ',') == NULL) {
|
||||
int blen = strlen(wire_bundle + 1) - 1;
|
||||
memmove(wire_bundle, wire_bundle + 1, blen);
|
||||
*(wire_bundle + blen) = '\0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
SkipTokComments(VLOG_PIN_CHECK_DELIMITERS);
|
||||
}
|
||||
if (!nexttok) {
|
||||
|
||||
Reference in New Issue
Block a user