Merge branch 'master' into netgen-1.5

This commit is contained in:
Tim Edwards 2020-03-27 03:00:21 -04:00
commit 1be00bbd99
3 changed files with 25 additions and 4 deletions

View File

@ -1 +1 @@
1.5.144 1.5.145

View File

@ -259,7 +259,7 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
struct nlist *ChildCell; struct nlist *ChildCell;
struct objlist *tmp, *ob2, *ob3; struct objlist *tmp, *ob2, *ob3;
int notdone, rnodenum; int notdone, rnodenum;
char tmpstr[200]; char tmpstr[1024];
int nextnode, oldmax, numflat = 0; int nextnode, oldmax, numflat = 0;
#if !OLDPREFIX #if !OLDPREFIX
int prefixlength; int prefixlength;

View File

@ -1565,19 +1565,40 @@ nextinst:
// Check if net name is a wire bus or portion of a bus // Check if net name is a wire bus or portion of a bus
if (GetBus(scan->net, &wb) == 0) { if (GetBus(scan->net, &wb) == 0) {
int range; int range;
// This takes care of three situations:
// (1) The signal bus length matches the number of instances:
// apply one signal per instance.
// (2) The signal bus length is a multiple of the number of instances:
// apply a signal sub-bus to each instance.
// (3) The number of instances is a multiple of the signal bus length:
// apply the same signal to each instance.
if ((arrayend - arraystart) == (wb.end - wb.start)) { if ((arrayend - arraystart) == (wb.end - wb.start)) {
// Net is a bus, but net is split over arrayed instances // Net is a bus, but net is split over arrayed instances
Port(scan->name); Port(scan->name);
} }
else if (wb.start > wb.end) { else if (wb.start > wb.end) {
range = wb.start - wb.end; if ((arraystart - arrayend) > (wb.start - wb.end))
range = (((arraystart - arrayend) + 1) /
((wb.start - wb.end) + 1)) - 1;
else
range = (((wb.start - wb.end) + 1) /
((arraystart - arrayend) + 1)) - 1;
for (i = range; i >= 0; i--) { for (i = range; i >= 0; i--) {
sprintf(defport, "%s[%d]", scan->name, i); sprintf(defport, "%s[%d]", scan->name, i);
Port(defport); Port(defport);
} }
} }
else { else {
range = wb.end - wb.start; if ((arrayend - arraystart) > (wb.end - wb.start))
range = (((arrayend - arraystart) + 1) /
((wb.end - wb.start) + 1)) - 1;
else
range = (((wb.end - wb.start) + 1) /
((arrayend - arraystart) + 1)) - 1;
for (i = 0; i <= range; i++) { for (i = 0; i <= range; i++) {
sprintf(defport, "%s[%d]", scan->name, i); sprintf(defport, "%s[%d]", scan->name, i);
Port(defport); Port(defport);