Merge branch 'master' into netgen-1.5

This commit is contained in:
Tim Edwards 2019-06-16 03:00:15 -04:00
commit b7187d5899
3 changed files with 18 additions and 44 deletions

View File

@ -59,9 +59,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
// See netfile.c for explanation of delimiters. 'X' // See netfile.c for explanation of delimiters. 'X'
// separates single-character delimiters from two-character delimiters. // separates single-character delimiters from two-character delimiters.
#define VLOG_DELIMITERS "X///**/(**)#(X,;:(){}[]=" #define VLOG_DELIMITERS "X///**/#((**)X,::(){}[]="
#define VLOG_PIN_NAME_DELIMITERS "X///**/(**)X()" #define VLOG_PIN_NAME_DELIMITERS "X///**/(**)X()"
#define VLOG_PIN_CHECK_DELIMITERS "X///**/(**)X(),{}"
// Global storage for verilog parameters // Global storage for verilog parameters
struct hashdict verilogparams; struct hashdict verilogparams;
@ -292,8 +291,6 @@ int GetBusTok(struct bus *wb)
return 1; return 1;
} }
} }
/* Move token forward to bus name */
SkipTokComments(VLOG_DELIMITERS);
} }
else { else {
struct bus *hbus; struct bus *hbus;
@ -315,7 +312,7 @@ int GetBusTok(struct bus *wb)
int GetBus(char *astr, struct bus *wb) int GetBus(char *astr, struct bus *wb)
{ {
char *colonptr, *brackstart, *brackend, *sstr; char *colonptr, *brackstart, *brackend;
int result, start, end; int result, start, end;
if (wb == NULL) return 0; if (wb == NULL) return 0;
@ -323,21 +320,15 @@ int GetBus(char *astr, struct bus *wb)
wb->start = -1; wb->start = -1;
wb->end = -1; wb->end = -1;
} }
sstr = astr; brackstart = strchr(astr, '[');
// Skip to the end of verilog names bounded by '\' and ' '
if (*sstr == '\\')
while (*sstr && *sstr != ' ') sstr++;
brackstart = strchr(sstr, '[');
if (brackstart != NULL) { if (brackstart != NULL) {
brackend = strchr(sstr, ']'); brackend = strchr(astr, ']');
if (brackend == NULL) { if (brackend == NULL) {
Printf("Badly formed array notation \"%s\"\n", astr); Printf("Badly formed array notation \"%s\"\n", astr);
return 1; return 1;
} }
*brackend = '\0'; *brackend = '\0';
colonptr = strchr(sstr, ':'); colonptr = strchr(astr, ':');
if (colonptr) *colonptr = '\0'; if (colonptr) *colonptr = '\0';
result = sscanf(brackstart + 1, "%d", &start); result = sscanf(brackstart + 1, "%d", &start);
if (colonptr) *colonptr = ':'; if (colonptr) *colonptr = ':';
@ -1238,12 +1229,12 @@ skip_endmodule:
arraystart = wb.start; arraystart = wb.start;
arrayend = wb.end; arrayend = wb.end;
} }
SkipTokComments(VLOG_DELIMITERS);
} }
if (match(nexttok, "(")) { if (match(nexttok, "(")) {
char savetok = (char)0; char savetok = (char)0;
struct portelement *new_port; struct portelement *new_port;
char *in_line_net = NULL;
// Read the pin list // Read the pin list
while (nexttok != NULL) { while (nexttok != NULL) {
@ -1270,7 +1261,7 @@ skip_endmodule:
Printf("Badly formed subcircuit pin line at \"%s\"\n", nexttok); Printf("Badly formed subcircuit pin line at \"%s\"\n", nexttok);
SkipNewLine(VLOG_DELIMITERS); SkipNewLine(VLOG_DELIMITERS);
} }
SkipTokComments(VLOG_PIN_CHECK_DELIMITERS); SkipTokComments(VLOG_PIN_NAME_DELIMITERS);
if (match(nexttok, ")")) { if (match(nexttok, ")")) {
char localnet[100]; char localnet[100];
// Empty parens, so create a new local node // Empty parens, so create a new local node
@ -1279,29 +1270,7 @@ skip_endmodule:
new_port->net = strsave(localnet); new_port->net = strsave(localnet);
} }
else { else {
if (!strcmp(nexttok, "{")) { new_port->net = strsave(nexttok);
char *in_line_net = (char *)MALLOC(1);
*in_line_net = '\0';
/* In-line array---Read to "}" */
while (nexttok) {
char *new_in_line_net = (char *)MALLOC(
strlen(in_line_net) +
strlen(nexttok) + 1);
strcpy(new_in_line_net, in_line_net);
strcat(new_in_line_net, nexttok);
FREE(in_line_net);
in_line_net = new_in_line_net;
if (!strcmp(nexttok, "}")) break;
SkipTokComments(VLOG_PIN_CHECK_DELIMITERS);
}
if (!nexttok) {
Printf("Unterminated net in pin %s\n", in_line_net);
}
new_port->net = in_line_net;
}
else
new_port->net = strsave(nexttok);
/* Read array information along with name; will be parsed later */ /* Read array information along with name; will be parsed later */
SkipTokComments(VLOG_DELIMITERS); SkipTokComments(VLOG_DELIMITERS);
if (match(nexttok, "[")) { if (match(nexttok, "[")) {
@ -1310,8 +1279,8 @@ skip_endmodule:
if (!match(nexttok, ")")) { if (!match(nexttok, ")")) {
char *expnet; char *expnet;
expnet = (char *)MALLOC(strlen(new_port->net) expnet = (char *)MALLOC(strlen(new_port->net)
+ strlen(nexttok) + 3); + strlen(nexttok) + 2);
sprintf(expnet, "%s [%s", new_port->net, nexttok); sprintf(expnet, "%s[%s", new_port->net, nexttok);
FREE(new_port->net); FREE(new_port->net);
new_port->net = expnet; new_port->net = expnet;
} }
@ -1513,8 +1482,13 @@ skip_endmodule:
// Otherwise, net is bit-sliced across array of instances. // Otherwise, net is bit-sliced across array of instances.
} }
else if (wb.start > wb.end) { else if (wb.start > wb.end) {
char *bptr;
i = wb.start; i = wb.start;
j = portstart; j = portstart;
// Remove indexed part of scan->net
if ((bptr = strchr(scan->net, '[')) != NULL)
*bptr = '\0';
while (1) { while (1) {
new_port = (struct portelement *)CALLOC(1, new_port = (struct portelement *)CALLOC(1,
sizeof(struct portelement)); sizeof(struct portelement));

2
configure vendored
View File

@ -4,4 +4,4 @@
# all of its config scripts in a different directory than the configure # all of its config scripts in a different directory than the configure
# script itself. # script itself.
( CFLAGS="-g" ; export CFLAGS ; cd scripts ; ./configure $* ) ( CFLAGS="-g" ; export CFLAGS ; cd scripts ; ./configure "$@" )

View File

@ -3811,8 +3811,8 @@ _netcmp_permute(ClientData clientData,
if (PermuteForget(tp->name, fnum, NULL, NULL)) if (PermuteForget(tp->name, fnum, NULL, NULL))
Fprintf(stdout, "No permutations on circuit %s\n", tp->name); Fprintf(stdout, "No permutations on circuit %s\n", tp->name);
else else
Fprintf(stderr, "Unable to reset model %s pin permutation %s, %s.\n", Fprintf(stderr, "Unable to reset model %s pin permutations.\n",
tp->name, pin1, pin2); tp->name);
} }
return TCL_OK; return TCL_OK;
} }