mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-22 14:07:07 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf9c61e412 | ||
|
|
9a2902abbb | ||
|
|
8d34bd372d | ||
|
|
229c2931a8 | ||
|
|
840f997133 | ||
|
|
b8da97deb1 | ||
|
|
b7187d5899 | ||
|
|
cb3cf592e8 | ||
|
|
b1d40e6d12 | ||
|
|
edbefbd1c4 | ||
|
|
d27d441c58 | ||
|
|
48c9e6b292 | ||
|
|
527cdb3dab | ||
|
|
ced5846da3 | ||
|
|
b99d33064f | ||
|
|
ee66c00121 | ||
|
|
f40a50d3b8 | ||
|
|
399472e940 | ||
|
|
8e0371e09b | ||
|
|
395f857a82 | ||
|
|
9e59048731 | ||
|
|
7889e2ae73 | ||
|
|
8c7d2ae239 | ||
|
|
e361640947 | ||
|
|
56b4174646 | ||
|
|
ccf2dc23c9 | ||
|
|
f8ea27d8e8 | ||
|
|
ef914e8d46 | ||
|
|
f9cc4d3db6 | ||
|
|
d8eefdad9a | ||
|
|
2cdf3c450f | ||
|
|
079e0ab5d3 | ||
|
|
f0cf6b52d3 | ||
|
|
9432bfc182 | ||
|
|
4fb892a64f | ||
|
|
faadb78870 | ||
|
|
7fc668c2d4 | ||
|
|
13c45c6d0c | ||
|
|
5efe2151ed | ||
|
|
642de57418 | ||
|
|
397444acd3 | ||
|
|
5e5720e7be | ||
|
|
65c0f6b840 | ||
|
|
09b2bb3316 | ||
|
|
41665036e9 | ||
|
|
b4c189a114 | ||
|
|
85af816ab8 | ||
|
|
4ba5425b6a | ||
|
|
83b2084a10 | ||
|
|
0de1c232e4 |
@@ -9,4 +9,3 @@ config.status
|
||||
*~
|
||||
*.log
|
||||
UPDATE_ME
|
||||
VERSION
|
||||
|
||||
@@ -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}
|
||||
|
||||
+8
-6
@@ -1391,7 +1391,7 @@ SurveyCell(struct nlist *tc, struct hashdict *compdict, int file1, int file2, in
|
||||
/* */
|
||||
/* If there is a mismatch between instances of low- */
|
||||
/* level devices, determine if the mismatches can be */
|
||||
/* resolved by parallel/serial combining, according to */
|
||||
/* resolved by parallel/series combining, according to */
|
||||
/* combination rules. */
|
||||
/* */
|
||||
/* Return the number of modifications made. */
|
||||
@@ -1659,7 +1659,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||
ecomp = (ECompare *)HashFirst(&compdict);
|
||||
while (ecomp != NULL) {
|
||||
if ((ecomp->num1 != ecomp->num2) && (ecomp->cell1 != NULL) &&
|
||||
(ecomp->cell1->class == CLASS_RES)) {
|
||||
((ecomp->cell1->class == CLASS_RES) ||
|
||||
(ecomp->cell1->class == CLASS_VSOURCE))) {
|
||||
int node1 = -1, node2 = -1;
|
||||
lob = NULL;
|
||||
for (ob1 = tc1->cell; ob1; ) {
|
||||
@@ -1703,7 +1704,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||
if (found) break;
|
||||
}
|
||||
if (found) {
|
||||
Fprintf(stdout, "Removing zero-valued device"
|
||||
Fprintf(stdout, "Removing zero-valued device "
|
||||
"%s from cell %s makes a better match\n",
|
||||
tsub1->name,
|
||||
tc1->name);
|
||||
@@ -1763,7 +1764,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||
// Repeat the last section for the other circuit
|
||||
|
||||
if ((ecomp->num1 != ecomp->num2) && (ecomp->cell2 != NULL) &&
|
||||
(ecomp->cell2->class == CLASS_RES)) {
|
||||
((ecomp->cell2->class == CLASS_RES) ||
|
||||
(ecomp->cell2->class == CLASS_VSOURCE))) {
|
||||
int node1 = -1, node2 = -1;
|
||||
lob = NULL;
|
||||
for (ob2 = tc2->cell; ob2; ) {
|
||||
@@ -1807,7 +1809,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||
if (found) break;
|
||||
}
|
||||
if (found) {
|
||||
Fprintf(stdout, "Removing zero-valued device"
|
||||
Fprintf(stdout, "Removing zero-valued device "
|
||||
"%s from cell %s makes a better match\n",
|
||||
tsub2->name,
|
||||
tc2->name);
|
||||
@@ -1917,7 +1919,7 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||
char *dstr = NULL;
|
||||
tc2 = LookupCellFile(ob2->model.class, ecomp0X->cell2->file);
|
||||
if (tc2->flags & CELL_DUPLICATE) {
|
||||
dstr = strstr(ob1->model.class, "[[");
|
||||
dstr = strstr(ob2->model.class, "[[");
|
||||
if (dstr) *dstr = '\0';
|
||||
}
|
||||
ncomp = (ECompare *)HashInt2Lookup(ob2->model.class,
|
||||
|
||||
+403
-293
File diff suppressed because it is too large
Load Diff
+5
-1
@@ -36,7 +36,8 @@ extern int EquivalenceNodes(char *name1, int file1, char *name2, int file2);
|
||||
extern int EquivalenceClasses(char *name1, int file1, char *name2, int file2);
|
||||
extern int IgnoreClass(char *name, int file, unsigned char type);
|
||||
extern int MatchPins(struct nlist *tp1, struct nlist *tp2, int dolist);
|
||||
extern int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run, int serial);
|
||||
extern int PropertyOptimize(struct objlist *ob, struct nlist *tp, int run,
|
||||
int series, int comb);
|
||||
|
||||
extern int CreateCompareQueue(char *, int, char *, int);
|
||||
extern int GetCompareQueueTop(char **, int *, char **, int *);
|
||||
@@ -47,6 +48,9 @@ extern void PrintIllegalClasses();
|
||||
extern void PrintIllegalNodeClasses();
|
||||
extern void PrintIllegalElementClasses();
|
||||
|
||||
extern void DumpNetwork(struct objlist *ob, int cidx);
|
||||
extern void DumpNetworkAll(char *name, int file);
|
||||
|
||||
#ifdef TCL_NETGEN
|
||||
extern int EquivalentNode();
|
||||
extern int EquivalentElement();
|
||||
|
||||
+25
-5
@@ -437,7 +437,10 @@ void SpiceSkipNewLine(void)
|
||||
/* 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/**///#(". */
|
||||
/* "X/**///#(X,;()". Two-character delimiters should go first so that */
|
||||
/* they have precedence over one-character delimiters. 'X' should be */
|
||||
/* the first character of the delimiter string in addition to marking */
|
||||
/* the boundary between two-character and one-character delimiters. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
char *strdtok(char *pstring, char *delim1, char *delim2)
|
||||
@@ -468,6 +471,23 @@ char *strdtok(char *pstring, char *delim1, char *delim2)
|
||||
|
||||
/* "stoken" is now set. Now find the end of the current token */
|
||||
|
||||
s = stoken;
|
||||
|
||||
/* Special verilog rule: If a name begins with '\', then all characters */
|
||||
/* are a valid part of the name until a space character is reached. The */
|
||||
/* space character becomes part of the verilog name. The remainder of the */
|
||||
/* name is parsed according to the rules of "delim2". */
|
||||
|
||||
if (*s == '\\') {
|
||||
while (*s != '\0') {
|
||||
if (*s == ' ') {
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
@@ -476,11 +496,11 @@ char *strdtok(char *pstring, char *delim1, char *delim2)
|
||||
/* 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++) {
|
||||
for (; *s; s++) {
|
||||
twofer = (delim2 && (*delim2 == 'X')) ? TRUE : FALSE;
|
||||
for (s2 = ((twofer == TRUE) ? delim2 + 1 : delim2); s2 && *s2; s2++) {
|
||||
if (*s2 == 'X') {
|
||||
twofer = TRUE;
|
||||
twofer = FALSE;
|
||||
continue;
|
||||
}
|
||||
if (twofer) {
|
||||
|
||||
+145
-39
@@ -897,6 +897,32 @@ void SetParallelCombine(int value)
|
||||
RecurseCellHashTable2(SetParallelCombineFlag, (void *)(&value));
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Same as above, for series (here for symmetry, although "property */
|
||||
/* series all" would be an odd command to issue, and "property series */
|
||||
/* none" is the default, so not needed). */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
struct nlist *SetSeriesCombineFlag(struct hashlist *p, void *clientdata)
|
||||
{
|
||||
struct nlist *ptr;
|
||||
int *value = (int *)clientdata;
|
||||
|
||||
ptr = (struct nlist *)(p->ptr);
|
||||
if (*value == TRUE)
|
||||
ptr->flags &= (~COMB_SERIES);
|
||||
else
|
||||
ptr->flags |= COMB_SERIES;
|
||||
|
||||
return NULL; /* NULL keeps search alive */
|
||||
}
|
||||
|
||||
void SetSeriesCombine(int value)
|
||||
{
|
||||
ClearDumpedList();
|
||||
RecurseCellHashTable2(SetSeriesCombineFlag, (void *)(&value));
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Delete a property from the master cell record. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -992,15 +1018,15 @@ PropertyTolerance(char *name, int fnum, char *key, int ival, double dval)
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
PropertyMerge(char *name, int fnum, char *key, int merge_type)
|
||||
PropertyMerge(char *name, int fnum, char *key, int merge_type, int merge_mask)
|
||||
{
|
||||
struct property *kl = NULL;
|
||||
struct nlist *tc;
|
||||
int result;
|
||||
|
||||
if ((fnum == -1) && (Circuit1 != NULL) && (Circuit2 != NULL)) {
|
||||
result = PropertyMerge(name, Circuit1->file, key, merge_type);
|
||||
result = PropertyMerge(name, Circuit2->file, key, merge_type);
|
||||
result = PropertyMerge(name, Circuit1->file, key, merge_type, merge_mask);
|
||||
result = PropertyMerge(name, Circuit2->file, key, merge_type, merge_mask);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1016,7 +1042,8 @@ PropertyMerge(char *name, int fnum, char *key, int merge_type)
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
kl->merge = merge_type;
|
||||
kl->merge &= ~merge_mask;
|
||||
kl->merge |= merge_type;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -2462,8 +2489,7 @@ int ConvertStringToInteger(char *string, int *ival)
|
||||
*ival = (int)lval;
|
||||
return 1;
|
||||
}
|
||||
else if (eptr == string)
|
||||
return 0; /* No conversion */
|
||||
else return 0; /* No conversion */
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
@@ -2868,50 +2894,50 @@ void ConnectAllNodes(char *model, int file)
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Serial and Parallel combination: */
|
||||
/* All devices of the same type that exist in serial and parallel */
|
||||
/* Series and Parallel combination: */
|
||||
/* All devices of the same type that exist in series and parallel */
|
||||
/* combinations will be treated as a single device in a network. */
|
||||
/* Serial connections are only allowed for resistors and inductors. */
|
||||
/* Any device may be connected in parallel. For combinations of serial */
|
||||
/* Series connections are only allowed for resistors and inductors. */
|
||||
/* Any device may be connected in parallel. For combinations of series */
|
||||
/* and parallel, as in a resistor network, there is a set of rules: */
|
||||
/* */
|
||||
/* Running parallel and serial checks: */
|
||||
/* Running parallel and series checks: */
|
||||
/* 1. Run parallel once. If a repeat run and no devices are merged, */
|
||||
/* then go to 4. */
|
||||
/* 2. Run serial until no devices are merged. */
|
||||
/* 3. If serial ran more than once, then go to 1. */
|
||||
/* 2. Run series until no devices are merged. */
|
||||
/* 3. If series ran more than once, then go to 1. */
|
||||
/* 4. End merge */
|
||||
/* */
|
||||
/* Each merge procedure, when it finds two devices that can be merged, */
|
||||
/* removes the second device from the netlist and adds its properties */
|
||||
/* to the first device. If a serial merge, then the nodes are adjusted */
|
||||
/* to the first device. If a series merge, then the nodes are adjusted */
|
||||
/* appropriately. Where A is the property list of the first device and */
|
||||
/* B is the property list of the second device, the first and last */
|
||||
/* properties of A and the first property of B may require a marker to */
|
||||
/* indicate the topology of the network, as follows (in order): */
|
||||
/* */
|
||||
/* For a parallel merge: */
|
||||
/* 1) If A has serial components then tag first property of A with */
|
||||
/* 1) If A has series components then tag first property of A with */
|
||||
/* "open" and tag first property of B with "close". */
|
||||
/* 2) If B has serial components then tag first property of B with */
|
||||
/* 2) If B has series components then tag first property of B with */
|
||||
/* "open". */
|
||||
/* */
|
||||
/* For a serial merge: */
|
||||
/* For a series merge: */
|
||||
/* 1) If A has unbalanced "opens", then add "close" to first */
|
||||
/* property of B to balance the "opens". */
|
||||
/* 2) Always tag B with "serial". */
|
||||
/* 2) Always tag B with "series". */
|
||||
/* */
|
||||
/* Tags are indicated by a property named "_tag" which has a string */
|
||||
/* value of ordered characters, "+" for serial, "(" for open, and ")" */
|
||||
/* value of ordered characters, "+" for series, "(" for open, and ")" */
|
||||
/* for close. A device with only one property record has no "_tag" */
|
||||
/* record. A device which is in parallel with the device(s) in front */
|
||||
/* of it is implicitly parallel by not having an "+" tag, and may not */
|
||||
/* have a tag at all. */
|
||||
/* */
|
||||
/* The property check routine is responsible for comparing device */
|
||||
/* serial/parallel networks against each other. Otherwise, each */
|
||||
/* serial/parallel network is considered topologically as a single */
|
||||
/* device, and any differences in the serial/parallel networks between */
|
||||
/* series/parallel networks against each other. Otherwise, each */
|
||||
/* series/parallel network is considered topologically as a single */
|
||||
/* device, and any differences in the series/parallel networks between */
|
||||
/* two circuits being matched will be treated as a property error. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -2927,7 +2953,8 @@ int add_prop_tag(struct objlist *obr, char tagc)
|
||||
char *tmpstr;
|
||||
|
||||
hastag = FALSE;
|
||||
for (nob = obr; nob->next && nob->next->type == PROPERTY; nob = nob->next) {
|
||||
for (nob = obr; nob; nob = nob->next) {
|
||||
if (nob->type != PROPERTY) break;
|
||||
for (i = 0; ; i++) {
|
||||
kv = &(nob->instance.props[i]);
|
||||
if (kv->type == PROP_ENDLIST) break;
|
||||
@@ -3018,6 +3045,75 @@ void add_balancing_close(struct objlist *ob1, struct objlist *ob2)
|
||||
while (opentags-- > 0) add_prop_tag(nob, ')');
|
||||
}
|
||||
|
||||
/* Remove unneeded group tags, when device merging has removed all but */
|
||||
/* one, or all but parallel devices inside a group. For simplicity, */
|
||||
/* handle only one group at a time. Return 1 if a group was removed */
|
||||
/* and 0 if not. The caller should run repeatedly until the routine */
|
||||
/* returns 0. */
|
||||
|
||||
int remove_group_tags(struct objlist *ob)
|
||||
{
|
||||
struct objlist *nob, *sob;
|
||||
int i, si, stags;
|
||||
struct valuelist *kv;
|
||||
char *tag;
|
||||
|
||||
/* Find the first property record in ob. */
|
||||
for (nob = ob->next; nob && nob->type != FIRSTPIN; nob = nob->next)
|
||||
if (nob->type == PROPERTY)
|
||||
break;
|
||||
if (nob->type != PROPERTY) return 0; // shouldn't happen
|
||||
|
||||
for (sob = NULL; nob && nob->type == PROPERTY; nob = nob->next) {
|
||||
for (i = 0; ; i++) {
|
||||
kv = &(nob->instance.props[i]);
|
||||
if (kv->type == PROP_ENDLIST) break;
|
||||
if (kv->type == PROP_STRING) {
|
||||
if (!strcmp(kv->key, "_tag")) {
|
||||
for (tag = kv->value.string; *tag != '\0'; tag++) {
|
||||
if (*tag == '(') {
|
||||
sob = nob; /* Save position of open group */
|
||||
si = i; /* Save index of open group */
|
||||
stags = 0; /* Check for series tags */
|
||||
}
|
||||
else if (*tag == '+')
|
||||
stags++;
|
||||
else if (*tag == ')') {
|
||||
if (stags == 0) {
|
||||
/* Remove close tag */
|
||||
for (++i; ; i++) {
|
||||
nob->instance.props[i - 1] = nob->instance.props[i];
|
||||
if (nob->instance.props[i].type == PROP_ENDLIST) break;
|
||||
}
|
||||
/* Remove open tag */
|
||||
for (i = si + 1; ; i++) {
|
||||
sob->instance.props[i - 1] = sob->instance.props[i];
|
||||
if (sob->instance.props[i].type == PROP_ENDLIST) break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
sob = NULL;
|
||||
stags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sob != NULL) {
|
||||
/* Implicit close tag at end */
|
||||
if (stags == 0) {
|
||||
/* Remove open tag */
|
||||
for (i = si + 1; ; i++) {
|
||||
sob->instance.props[i - 1] = sob->instance.props[i];
|
||||
if (sob->instance.props[i].type == PROP_ENDLIST) break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Find all devices that are of the same class and check for parallel */
|
||||
/* combinations, and combine them where found, adjusting property "M" */
|
||||
@@ -3229,7 +3325,7 @@ int CombineParallel(char *model, int file)
|
||||
|
||||
if (propfirst != NULL) {
|
||||
|
||||
// Serial/Parallel logic:
|
||||
// Series/Parallel logic:
|
||||
// If propfirst has _tag in properties,
|
||||
// then add an "open" tag at propfirst
|
||||
add_prop_tag(propfirst, '(');
|
||||
@@ -3272,9 +3368,9 @@ int CombineParallel(char *model, int file)
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* For the purposes of serial connection checking, find if all pins */
|
||||
/* For the purposes of series connection checking, find if all pins */
|
||||
/* of two instances after the first two pins are connected to the name */
|
||||
/* nodes. This depends on the definition of a serial device as having */
|
||||
/* nodes. This depends on the definition of a series device as having */
|
||||
/* two ports, but any additional ports (such as a substrate connection) */
|
||||
/* must be the same for all devices in series. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -3284,7 +3380,7 @@ int check_pin_nodes(struct objlist *ob1, struct objlist *ob2)
|
||||
struct objlist *nob, *pob;
|
||||
|
||||
/* A dummy device may have both terminals connected to the same */
|
||||
/* point, triggering a false check for a serial device. */
|
||||
/* point, triggering a false check for a series device. */
|
||||
if (ob1 == ob2) return FALSE;
|
||||
|
||||
for (nob = ob1->next; nob && nob->type != FIRSTPIN; nob = nob->next)
|
||||
@@ -3313,12 +3409,12 @@ int check_pin_nodes(struct objlist *ob1, struct objlist *ob2)
|
||||
/* one. */
|
||||
/* */
|
||||
/* This routine depends on CombineParallel() being run first so that no */
|
||||
/* parallel devices are reported as serial. */
|
||||
/* parallel devices are reported as series. */
|
||||
/* */
|
||||
/* Return the number of devices merged. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
int CombineSerial(char *model, int file)
|
||||
int CombineSeries(char *model, int file)
|
||||
{
|
||||
struct nlist *tp, *tp2;
|
||||
struct objlist ***instlist;
|
||||
@@ -3331,7 +3427,7 @@ int CombineSerial(char *model, int file)
|
||||
return -1;
|
||||
}
|
||||
/* Diagnostic */
|
||||
/* Printf("CombineSerial start model = %s file = %d\n", model, file); */
|
||||
/* Printf("CombineSeries start model = %s file = %d\n", model, file); */
|
||||
|
||||
instlist = (struct objlist ***)CALLOC((tp->nodename_cache_maxnodenum + 1),
|
||||
sizeof(struct objlist **));
|
||||
@@ -3346,26 +3442,36 @@ int CombineSerial(char *model, int file)
|
||||
instlist[ob->node] = (struct objlist **)CALLOC(2,
|
||||
sizeof(struct objlist *));
|
||||
|
||||
/* Device must be marked as able to be combined in serial. */
|
||||
/* Device must be marked as able to be combined in series. */
|
||||
/* Note that devices with more than two pins are expected */
|
||||
/* to serial connect along the first two pins, and the */
|
||||
/* to series connect along the first two pins, and the */
|
||||
/* remaining pins must all connect to the same nodes. By */
|
||||
/* default, CLASS_RES, CLASS_RES3, and CLASS_INDUCTOR are */
|
||||
/* all allowed to combine in serial. All other devices */
|
||||
/* must have serial combination explicitly enabled. */
|
||||
/* all allowed to combine in series. All other devices */
|
||||
/* must have series combination explicitly enabled. */
|
||||
/* NOTE: Arbitrarily, the first two pins of a device are */
|
||||
/* assumed to be the ones that make serial connections. */
|
||||
/* assumed to be the ones that make series connections. */
|
||||
/* Additional pins, if any, do not. */
|
||||
|
||||
tp2 = LookupCellFile(ob->model.class, file);
|
||||
if ((tp2->flags & COMB_SERIAL) && (ob->type <= 2))
|
||||
if ((tp2->flags & COMB_SERIES) && (ob->type <= 2)) {
|
||||
instlist[ob->node][0] = obp;
|
||||
|
||||
/* Node may not be a port of the subcircuit */
|
||||
for (obn = tp->cell; obn && obn->type == PORT; obn = obn->next) {
|
||||
if (obn->node == ob->node) {
|
||||
/* invalidate node */
|
||||
instlist[ob->node][0] = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
/* invalidate node */
|
||||
instlist[ob->node][0] = NULL;
|
||||
}
|
||||
else if (instlist[ob->node][0] == NULL) {
|
||||
/* Node is not valid for serial connection */
|
||||
/* Node is not valid for series connection */
|
||||
}
|
||||
else if (instlist[ob->node][1] == NULL) {
|
||||
/* Check if first instance is the same type */
|
||||
@@ -3393,7 +3499,7 @@ int CombineSerial(char *model, int file)
|
||||
struct valuelist *kv2;
|
||||
|
||||
/* Diagnostic */
|
||||
/* Fprintf(stdout, "Found serial instances %s and %s\n",
|
||||
/* Fprintf(stdout, "Found series instances %s and %s\n",
|
||||
instlist[i][0]->instance.name,
|
||||
instlist[i][1]->instance.name); */
|
||||
scnt++;
|
||||
@@ -3504,7 +3610,7 @@ int CombineSerial(char *model, int file)
|
||||
obs = obn;
|
||||
}
|
||||
|
||||
/* If 2nd device appears anywhere else in the serial device */
|
||||
/* If 2nd device appears anywhere else in the series device */
|
||||
/* list, replace it with the 1st device. */
|
||||
for (j = i + 1; j <= tp->nodename_cache_maxnodenum; j++) {
|
||||
if (instlist[j] == NULL) continue;
|
||||
|
||||
+8
-4
@@ -36,9 +36,11 @@ extern struct property *PropertyString(char *name, int fnum, char *key,
|
||||
double slop, char *pdefault);
|
||||
extern int PropertyDelete(char *name, int fnum, char *key);
|
||||
extern void SetParallelCombine(int value);
|
||||
extern void SetSeriesCombine(int value);
|
||||
extern int PropertyTolerance(char *name, int fnum, char *key, int ival,
|
||||
double dval);
|
||||
extern int PropertyMerge(char *name, int fnum, char *key, int merge_type);
|
||||
extern int PropertyMerge(char *name, int fnum, char *key, int merge_type,
|
||||
int merge_mask);
|
||||
extern void ResolveProperties(char *name1, int file1, char *name2, int file2);
|
||||
extern void CopyProperties(struct objlist *obj_to, struct objlist *obj_from);
|
||||
extern int PromoteProperty(struct property *, struct valuelist *);
|
||||
@@ -85,8 +87,10 @@ extern int PrematchLists(char *, int, char *, int);
|
||||
#define CLASS_DIODE 16 /* standard SPICE diode */
|
||||
#define CLASS_INDUCTOR 17 /* standard SPICE inductor */
|
||||
#define CLASS_XLINE 18 /* transmission line model */
|
||||
#define CLASS_MODULE 19 /* sim "x"; black-box subcircuit */
|
||||
#define CLASS_UNDEF 20 /* not defined; error */
|
||||
#define CLASS_VSOURCE 19 /* independent voltage source */
|
||||
#define CLASS_ISOURCE 20 /* independent current source */
|
||||
#define CLASS_MODULE 21 /* sim "x"; black-box subcircuit */
|
||||
#define CLASS_UNDEF 22 /* not defined; error */
|
||||
|
||||
extern char *P(char *fname, char *inststr, char *drain, char *gate, char *source);
|
||||
extern char *P4(char *fname, char *inststr, char *drain, char *gate, char *source,
|
||||
@@ -120,7 +124,7 @@ extern void ConvertGlobals(char *name, int fnum);
|
||||
extern int CleanupPins(char *name, int fnum);
|
||||
extern void ConnectAllNodes(char *model, int fnum);
|
||||
extern int CombineParallel(char *model, int fnum);
|
||||
extern int CombineSerial(char *model, int fnum);
|
||||
extern int CombineSeries(char *model, int fnum);
|
||||
extern int NoDisconnectedNodes;
|
||||
extern int PropertyKeyMatch(char *, char *);
|
||||
extern int PropertyValueMatch(char *, char *);
|
||||
|
||||
+20
-8
@@ -103,18 +103,30 @@ struct valuelist {
|
||||
|
||||
/* Part 3: Keys & Defaults (kept in the cell record as a hash table) */
|
||||
|
||||
#define MERGE_NONE 0 /* Property does not change when devices merge */
|
||||
#define MERGE_ADD 1 /* Properties sum with device parallel merge */
|
||||
#define MERGE_ADD_CRIT 2 /* Properties sum with device parallel merge */
|
||||
#define MERGE_PAR 3 /* Properties add in parallel with device merge */
|
||||
#define MERGE_PAR_CRIT 4 /* Properties add in parallel with device merge */
|
||||
#define MERGE_SER 5 /* Properties sum with device parallel merge */
|
||||
#define MERGE_SER_CRIT 6 /* Properties sum with device parallel merge */
|
||||
#define MERGE_NONE 0x00 /* Property does not change when devices merge */
|
||||
|
||||
#define MERGE_P_ADD 0x01 /* Properties sum with device parallel merge */
|
||||
#define MERGE_P_PAR 0x02 /* Properties add in parallel with parallel merge */
|
||||
#define MERGE_P_CRIT 0x04 /* This property enables parallel merging */
|
||||
#define MERGE_P_XCRIT 0x08 /* Old "critical" behavior (deprecated) */
|
||||
|
||||
#define MERGE_S_ADD 0x10 /* Properties sum with device series merge */
|
||||
#define MERGE_S_PAR 0x20 /* Properties add in parallel with series merge */
|
||||
#define MERGE_S_CRIT 0x40 /* This property enables series merging */
|
||||
#define MERGE_S_XCRIT 0x80 /* Old "critical" behavior (deprecated) */
|
||||
|
||||
#define MERGE_P_MASK (MERGE_P_ADD | MERGE_P_PAR | MERGE_P_CRIT | MERGE_P_XCRIT)
|
||||
#define MERGE_S_MASK (MERGE_S_ADD | MERGE_S_PAR | MERGE_S_CRIT | MERGE_S_XCRIT)
|
||||
#define MERGE_ALL_MASK (MERGE_P_MASK | MERGE_S_MASK)
|
||||
|
||||
/* Although the above are flags, "ADD" and "PAR" are mutually exclusive. */
|
||||
|
||||
/* Note: A "critical" merge means that the property causes the number of */
|
||||
/* devices to change. e.g., transistor width is critical; transistor drain */
|
||||
/* area sums when devices are merged, but does not change the number of devices.*/
|
||||
/* More than one property can be critical. e.g., width and number of fingers. */
|
||||
/* Also it is possible for a property (e.g., "value") to be critical for both */
|
||||
/* series and parallel merging. */
|
||||
|
||||
struct property {
|
||||
char *key; /* name of the property */
|
||||
@@ -217,7 +229,7 @@ struct nlist {
|
||||
|
||||
/* Flags for combination allowances and prohibitions */
|
||||
|
||||
#define COMB_SERIAL 0x40
|
||||
#define COMB_SERIES 0x40
|
||||
#define COMB_NO_PARALLEL 0x80
|
||||
|
||||
extern struct nlist *CurrentCell;
|
||||
|
||||
+32
-3
@@ -117,6 +117,12 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell)
|
||||
case CLASS_NPN: case CLASS_PNP: case CLASS_BJT:
|
||||
spice_class = 'Q';
|
||||
break;
|
||||
case CLASS_VSOURCE:
|
||||
spice_class = 'V';
|
||||
break;
|
||||
case CLASS_ISOURCE:
|
||||
spice_class = 'I';
|
||||
break;
|
||||
case CLASS_RES: case CLASS_RES3:
|
||||
spice_class = 'R';
|
||||
break;
|
||||
@@ -172,7 +178,7 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell)
|
||||
break;
|
||||
}
|
||||
|
||||
/* caps and resistors, print out device value */
|
||||
/* caps, resistors, voltage and current sources, print out device value */
|
||||
|
||||
/* print out device type (model/subcircuit name) */
|
||||
|
||||
@@ -217,6 +223,23 @@ void SpiceSubCell(struct nlist *tp, int IsSubCell)
|
||||
FlushString(" %s", model); /* semiconductor resistor */
|
||||
break;
|
||||
|
||||
case CLASS_VSOURCE:
|
||||
case CLASS_ISOURCE:
|
||||
ob = ob->next;
|
||||
if (ob->type == PROPERTY) {
|
||||
struct valuelist *vl;
|
||||
int i;
|
||||
for (i == 0;; i++) {
|
||||
vl = &(ob->instance.props[i]);
|
||||
if (vl->type == PROP_ENDLIST) break;
|
||||
else if (vl->type == PROP_VALUE) {
|
||||
FlushString(" %g", vl->value.dval);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
FlushString(" %s", model); /* everything else */
|
||||
}
|
||||
@@ -711,6 +734,12 @@ skip_ends:
|
||||
else if (!strcasecmp(nexttok, "R")) {
|
||||
class = CLASS_RES;
|
||||
}
|
||||
else if (!strcasecmp(nexttok, "V")) {
|
||||
class = CLASS_VSOURCE;
|
||||
}
|
||||
else if (!strcasecmp(nexttok, "I")) {
|
||||
class = CLASS_ISOURCE;
|
||||
}
|
||||
else if (!strcasecmp(nexttok, "C")) {
|
||||
class = CLASS_CAP;
|
||||
}
|
||||
@@ -1436,7 +1465,7 @@ skip_ends:
|
||||
Port("pos");
|
||||
Port("neg");
|
||||
PropertyInteger(model, filenum, "M", 0, 1);
|
||||
SetClass(CLASS_MODULE);
|
||||
SetClass(CLASS_VSOURCE);
|
||||
EndCell();
|
||||
ReopenCellDef((*CellStackPtr)->cellname, filenum); /* Reopen */
|
||||
}
|
||||
@@ -1490,7 +1519,7 @@ skip_ends:
|
||||
Port("pos");
|
||||
Port("neg");
|
||||
PropertyInteger(model, filenum, "M", 0, 1);
|
||||
SetClass(CLASS_MODULE);
|
||||
SetClass(CLASS_ISOURCE);
|
||||
EndCell();
|
||||
ReopenCellDef((*CellStackPtr)->cellname, filenum); /* Reopen */
|
||||
}
|
||||
|
||||
+284
-50
@@ -59,8 +59,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
// 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///**/"
|
||||
#define VLOG_DELIMITERS "X///**/#((**)X,;:(){}[]="
|
||||
#define VLOG_PIN_NAME_DELIMITERS "X///**/(**)X()"
|
||||
|
||||
// Global storage for verilog parameters
|
||||
struct hashdict verilogparams;
|
||||
@@ -127,11 +127,28 @@ int GetBusTok(struct bus *wb)
|
||||
Printf("Unknown definition %s found in array notation.\n", nexttok);
|
||||
}
|
||||
else {
|
||||
/* Note: all verilog definitions have been saved as PROP_STRING */
|
||||
result = sscanf(kl->pdefault.string, "%d", &start);
|
||||
if (result != 1) {
|
||||
Printf("Cannot parse first digit from parameter %s value %s\n",
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -147,11 +164,29 @@ int GetBusTok(struct bus *wb)
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
result = sscanf(kl->pdefault.string, "%d", &start);
|
||||
if (result != 1) {
|
||||
Printf("Parameter %s has value %s that cannot be parsed"
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,12 +210,29 @@ int GetBusTok(struct bus *wb)
|
||||
Printf("Unknown definition %s found in array notation.\n", nexttok);
|
||||
}
|
||||
else {
|
||||
/* Note: all verilog definitions have been saved as 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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,12 +247,30 @@ int GetBusTok(struct bus *wb)
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
result = sscanf(kl->pdefault.string, "%d", &end);
|
||||
if (result != 1) {
|
||||
Printf("Parameter %s has value %s that cannot be parsed"
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,8 +580,9 @@ 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;
|
||||
double dval;
|
||||
char devtype, in_module, in_param;
|
||||
char *eqptr, *matchptr;
|
||||
struct keyvalue *kvlist = NULL;
|
||||
@@ -660,7 +731,6 @@ void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
|
||||
}
|
||||
}
|
||||
else if (match(nexttok, "=")) {
|
||||
double dval;
|
||||
|
||||
// The parameter value is the next token.
|
||||
SkipTokComments(VLOG_DELIMITERS); /* get the next token */
|
||||
@@ -755,10 +825,47 @@ skip_endmodule:
|
||||
}
|
||||
else if (match(nexttok, "input") || match(nexttok, "output")
|
||||
|| match(nexttok, "inout")) {
|
||||
struct bus wb;
|
||||
|
||||
// To be completed: Duplicate parsing of ports, except as statements
|
||||
// and not in the module pin list.
|
||||
SkipNewLine(VLOG_DELIMITERS);
|
||||
// Parsing of ports as statements not in the module pin list.
|
||||
wb.start = wb.end = -1;
|
||||
while (1) {
|
||||
SkipTokComments(VLOG_DELIMITERS);
|
||||
if (EndParseFile()) break;
|
||||
|
||||
if (match(nexttok, ";")) {
|
||||
// End of statement
|
||||
break;
|
||||
}
|
||||
else if (match(nexttok, "[")) {
|
||||
if (GetBusTok(&wb) != 0) {
|
||||
// Didn't parse as a bus, so wing it
|
||||
wb.start = wb.end = -1;
|
||||
Port(nexttok);
|
||||
}
|
||||
}
|
||||
else if (!match(nexttok, ",")) {
|
||||
if (wb.start != -1) {
|
||||
if (wb.start > wb.end) {
|
||||
for (i = wb.start; i >= wb.end; i--) {
|
||||
sprintf(portname, "%s[%d]", nexttok, i);
|
||||
Port(portname);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = wb.start; i <= wb.end; i++) {
|
||||
sprintf(portname, "%s[%d]", nexttok, i);
|
||||
Port(portname);
|
||||
}
|
||||
}
|
||||
wb.start = wb.end = -1;
|
||||
}
|
||||
else {
|
||||
Port(nexttok);
|
||||
}
|
||||
}
|
||||
hasports = 1;
|
||||
}
|
||||
}
|
||||
else if (match(nexttok, "endmodule")) {
|
||||
|
||||
@@ -855,15 +962,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")) {
|
||||
@@ -882,9 +1007,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);
|
||||
}
|
||||
}
|
||||
@@ -923,14 +1062,25 @@ skip_endmodule:
|
||||
}
|
||||
}
|
||||
|
||||
else if (match(nexttok, "wire")) { /* wire = node */
|
||||
else if (match(nexttok, "wire") || match(nexttok, "assign")) { /* wire = node */
|
||||
struct bus wb, *nb;
|
||||
char nodename[128];
|
||||
int is_assignment = FALSE;
|
||||
struct objlist *lhs, *rhs;
|
||||
|
||||
// Several allowed uses of "assign":
|
||||
// "assign a = b" joins two nets.
|
||||
// "assign a = {b, c, ...}" creates a bus from components.
|
||||
// "assign" using any boolean arithmetic is not structural verilog.
|
||||
|
||||
SkipTokNoNewline(VLOG_DELIMITERS);
|
||||
if (match(nexttok, "real")) SkipTokNoNewline(VLOG_DELIMITERS);
|
||||
while (nexttok != NULL) {
|
||||
/* Handle bus notation */
|
||||
if (GetBusTok(&wb) == 0) {
|
||||
if (match(nexttok, "=")) {
|
||||
is_assignment = TRUE;
|
||||
}
|
||||
else if (GetBusTok(&wb) == 0) {
|
||||
/* Handle bus notation */
|
||||
SkipTokNoNewline(VLOG_DELIMITERS);
|
||||
if (wb.start > wb.end) {
|
||||
for (i = wb.end; i <= wb.start; i++) {
|
||||
@@ -952,10 +1102,28 @@ skip_endmodule:
|
||||
HashPtrInstall(nexttok, nb, &buses);
|
||||
}
|
||||
else {
|
||||
if (LookupObject(nexttok, CurrentCell) == NULL)
|
||||
if (is_assignment) {
|
||||
/* Handle assignment statements */
|
||||
/* To be done: Handle where both are bus names, and */
|
||||
/* where lhs is a bus name and rhs is a list of nets */
|
||||
if ((rhs = LookupObject(nexttok, CurrentCell)) != NULL) {
|
||||
join(lhs->name, rhs->name);
|
||||
}
|
||||
else {
|
||||
Printf("Module '%s' is not structural verilog, "
|
||||
"making black-box.\n", model);
|
||||
SetClass(CLASS_MODULE);
|
||||
goto skip_endmodule;
|
||||
}
|
||||
is_assignment = FALSE;
|
||||
}
|
||||
else if (LookupObject(nexttok, CurrentCell) == NULL)
|
||||
Node(nexttok);
|
||||
lhs = LookupObject(nexttok, CurrentCell);
|
||||
}
|
||||
SkipTokNoNewline(VLOG_DELIMITERS);
|
||||
do {
|
||||
SkipTokNoNewline(VLOG_DELIMITERS);
|
||||
} while (nexttok && match(nexttok, ";"));
|
||||
}
|
||||
}
|
||||
else if (match(nexttok, "endmodule")) {
|
||||
@@ -967,8 +1135,7 @@ skip_endmodule:
|
||||
// Ignore any other directive starting with a backtick
|
||||
SkipNewLine(VLOG_DELIMITERS);
|
||||
}
|
||||
else if (match(nexttok, "reg") || match(nexttok, "assign")
|
||||
|| match(nexttok, "always")) {
|
||||
else if (match(nexttok, "reg") || match(nexttok, "always")) {
|
||||
Printf("Module '%s' is not structural verilog, making black-box.\n", model);
|
||||
// To be done: Remove any contents (but may not be necessary)
|
||||
// Recast as module
|
||||
@@ -1106,6 +1273,19 @@ skip_endmodule:
|
||||
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);
|
||||
@@ -1237,9 +1417,61 @@ skip_endmodule:
|
||||
struct bus wb;
|
||||
struct portelement *new_port;
|
||||
char vname[256];
|
||||
int j;
|
||||
int j, result;
|
||||
struct objlist *bobj;
|
||||
char *bptr;
|
||||
int minnet, maxnet, testidx;
|
||||
|
||||
if (GetBus(scan->net, &wb) == 0) {
|
||||
result = GetBus(scan->net, &wb);
|
||||
if (result == -1) {
|
||||
/* CHECK: THIS CODE SHOULD BE DELETED, IT IS NOT THE ISSUE */
|
||||
/* Not bus notation, but check if signal was defined as a bus */
|
||||
wb.start = wb.end = -1;
|
||||
minnet = maxnet = -1;
|
||||
|
||||
/* Pins should be in index order start->end. Other nodes */
|
||||
/* should be in order start->end by node number. */
|
||||
|
||||
for (bobj = CurrentCell->cell; bobj; bobj = bobj->next) {
|
||||
if (bobj->type == PORT) {
|
||||
if ((bptr = strchr(bobj->name, '[')) != NULL) {
|
||||
*bptr = '\0';
|
||||
if (!strcmp(bobj->name, scan->net)) {
|
||||
*bptr = '[';
|
||||
if (wb.start == -1)
|
||||
sscanf(bptr + 1, "%d", &wb.start);
|
||||
else
|
||||
sscanf(bptr + 1, "%d", &wb.end);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bobj->type == NODE) {
|
||||
if ((bptr = strchr(bobj->name, '[')) != NULL) {
|
||||
*bptr = '\0';
|
||||
if (!strcmp(bobj->name, scan->net)) {
|
||||
if (sscanf(bptr + 1, "%d", &testidx) == 1) {
|
||||
if (minnet == -1) {
|
||||
minnet = maxnet = bobj->node;
|
||||
wb.start = wb.end = testidx;
|
||||
}
|
||||
else if (bobj->node < minnet) {
|
||||
minnet = bobj->node;
|
||||
wb.start = testidx;
|
||||
}
|
||||
else if (bobj->node > maxnet) {
|
||||
maxnet = bobj->node;
|
||||
wb.end = testidx;
|
||||
}
|
||||
}
|
||||
}
|
||||
*bptr = '[';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wb.start != -1) result = 0;
|
||||
}
|
||||
|
||||
if (result == 0) {
|
||||
if (((wb.start - wb.end) != (portstart - portend)) &&
|
||||
((wb.start - wb.end) != (portend - portstart))) {
|
||||
if (((wb.start - wb.end) != (arraystart - arrayend)) &&
|
||||
@@ -1250,8 +1482,13 @@ skip_endmodule:
|
||||
// Otherwise, net is bit-sliced across array of instances.
|
||||
}
|
||||
else if (wb.start > wb.end) {
|
||||
char *bptr;
|
||||
i = wb.start;
|
||||
j = portstart;
|
||||
// Remove indexed part of scan->net
|
||||
if ((bptr = strchr(scan->net, '[')) != NULL)
|
||||
*bptr = '\0';
|
||||
|
||||
while (1) {
|
||||
new_port = (struct portelement *)CALLOC(1,
|
||||
sizeof(struct portelement));
|
||||
@@ -1468,17 +1705,14 @@ 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, */
|
||||
/* but we won't depend upon it. Any comment line */
|
||||
/* will be handled by the main Verilog file processing. */
|
||||
|
||||
ReadVerilogFile(fname, filenum, &CellStack, blackbox);
|
||||
CloseParseFile();
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
# all of its config scripts in a different directory than the configure
|
||||
# script itself.
|
||||
|
||||
( CFLAGS="-g" ; export CFLAGS ; cd scripts ; ./configure $* )
|
||||
( CFLAGS="-g" ; export CFLAGS ; cd scripts ; ./configure "$@" )
|
||||
|
||||
@@ -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=\"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
|
||||
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=\"117\" -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=\"117\" -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
@@ -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
@@ -125,7 +125,7 @@ configure: failed program was:
|
||||
| #define PACKAGE_BUGREPORT "[email protected]"
|
||||
| #define PACKAGE_URL ""
|
||||
| #define NETGEN_VERSION "1.5"
|
||||
| #define NETGEN_REVISION "102"
|
||||
| #define NETGEN_REVISION "117"
|
||||
| /* 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 "102"
|
||||
| #define NETGEN_REVISION "117"
|
||||
| /* 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 "102"
|
||||
| #define NETGEN_REVISION "117"
|
||||
| #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 "102"
|
||||
| #define NETGEN_REVISION "117"
|
||||
| #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 "102"
|
||||
| #define NETGEN_REVISION "117"
|
||||
| #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 "102"
|
||||
| #define NETGEN_REVISION "117"
|
||||
| #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=\"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'
|
||||
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=\"117\" -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 "102"
|
||||
#define NETGEN_REVISION "117"
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
@@ -427,7 +427,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
This config.status script is free software; the Free Software Foundation
|
||||
gives unlimited permission to copy, distribute and modify it."
|
||||
|
||||
ac_pwd='/home/tim/gitsrc/netgen-1.5/scripts'
|
||||
ac_pwd='/home/tim/gitsrc/netgen/scripts'
|
||||
srcdir='..'
|
||||
INSTALL='/bin/install -c'
|
||||
test -n "$AWK" || AWK=awk
|
||||
@@ -660,7 +660,7 @@ 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=\\\"102\\\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 "\
|
||||
"circuitdesign.com\\\" -DPACKAGE_URL=\\\"\\\" -DNETGEN_VERSION=\\\"1.5\\\" -DNETGEN_REVISION=\\\"117\\\" -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"
|
||||
|
||||
Vendored
+3
-3
@@ -7779,7 +7779,9 @@ else
|
||||
fi
|
||||
|
||||
${ECHO_N} "Python3: "
|
||||
if test "x${HAVE_PYTHON3}" == "x"; then
|
||||
if test "${HAVE_PYTHON3}" == "yes"; then
|
||||
echo "yes"
|
||||
else
|
||||
echo "no"
|
||||
echo
|
||||
echo " Without Python3, you cannot run the GUI interface to netgen."
|
||||
@@ -7788,8 +7790,6 @@ if test "x${HAVE_PYTHON3}" == "x"; then
|
||||
echo " python3 support, make sure that you have installed python3"
|
||||
echo " on your system."
|
||||
echo
|
||||
else
|
||||
echo "yes"
|
||||
fi
|
||||
|
||||
echo "-----------------------------------------------------------"
|
||||
|
||||
@@ -1319,7 +1319,9 @@ else
|
||||
fi
|
||||
|
||||
${ECHO_N} "Python3: "
|
||||
if test "x${HAVE_PYTHON3}" == "x"; then
|
||||
if test "${HAVE_PYTHON3}" == "yes"; then
|
||||
echo "yes"
|
||||
else
|
||||
echo "no"
|
||||
echo
|
||||
echo " Without Python3, you cannot run the GUI interface to netgen."
|
||||
@@ -1328,8 +1330,6 @@ if test "x${HAVE_PYTHON3}" == "x"; then
|
||||
echo " python3 support, make sure that you have installed python3"
|
||||
echo " on your system."
|
||||
echo
|
||||
else
|
||||
echo "yes"
|
||||
fi
|
||||
|
||||
echo "-----------------------------------------------------------"
|
||||
|
||||
+2
-2
@@ -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=\"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
|
||||
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=\"117\" -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=\"117\" -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
|
||||
|
||||
-187
@@ -1,187 +0,0 @@
|
||||
#!/bin/csh -f
|
||||
#
|
||||
# makes the "database.h" (1st argument, $1) file from "database.h.in"
|
||||
# (2nd argument, $2), setting various mask operation definitions
|
||||
# according to the number of words implied by the value of TT_MAXTYPES
|
||||
|
||||
# The following mess grabs the value of TT_MAXTYPES from database.h.in
|
||||
#
|
||||
set maxtypes=`sed -n -e '/^#define[[:space:]]*TT_MAXTYPES/s/#define[[:space:]]*TT_MAXTYPES[[:space:]]*//p' < $1 | sed -e 's/\/\*[[:print:]]*\*\/[[:space:]]*//g' `
|
||||
#
|
||||
# Alternative method works with outdated versions of sed/ed.
|
||||
#
|
||||
if ($maxtypes == "") then
|
||||
set maxtypes=`sed -n -e '/^#define[ ]*TT_MAXTYPES/s/#define[ ]*TT_MAXTYPES[ ]*//p' < $1 | sed -e 's/\/\*.*\*\/[ ]*//g' `
|
||||
endif
|
||||
#
|
||||
# If we can't generate database.h correctly, nothing is going to compile.
|
||||
#
|
||||
if ($maxtypes == "") then
|
||||
echo "Bad sed script in scripts/makedbh: Cannot generate database/database.h!"
|
||||
exit
|
||||
endif
|
||||
|
||||
# Find derived values from bits per word
|
||||
# Note that bits-per-word should be determined from the compiler, but
|
||||
# 32 bits per word has always been hardwired into magic.
|
||||
#
|
||||
set bpw = 32
|
||||
|
||||
# @ wordmask=$bpw - 1
|
||||
# set wordshift=`echo "c=l($bpw); d=l(2); scale=0; c/d" | bc -l`
|
||||
# @ maskwords=$maxtypes + $bpw - 1
|
||||
# @ maskwords/=$bpw
|
||||
|
||||
@ maskwords=$maxtypes + $bpw - 1
|
||||
@ maskwords/=$bpw
|
||||
|
||||
|
||||
# Generate the main part of the database.h file from database.h.in
|
||||
cat $1 > $2
|
||||
|
||||
# Generate a list of integers from 0 to the value of "maskwords" - 1
|
||||
set count=""
|
||||
@ maskwords--
|
||||
while (${maskwords} >= 0)
|
||||
set count=`echo ${count} ${maskwords}`
|
||||
@ maskwords--
|
||||
end
|
||||
|
||||
# Definitions
|
||||
|
||||
echo "#define TTMaskZero(m) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " (m)->tt_words[$i] = 0" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskIsZero(m) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " (m)->tt_words[$i] == 0" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo " && \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskEqual(m, n) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " (m)->tt_words[$i] == (n)->tt_words[$i]" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo " && \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskIntersect(m, n) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] & (n)->tt_words[$i])" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo " || \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskCom(m) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] = ~(m)->tt_words[$i])" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskCom2(m, n) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] = ~(n)->tt_words[$i])" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskSetMask(m, n) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] |= (n)->tt_words[$i])" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskSetMask3(m, n, o) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] |= (n)->tt_words[$i] | (o)->tt_words[$i])" \
|
||||
>> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskAndMask(m, n) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] &= (n)->tt_words[$i])" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskAndMask3(m, n, o) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] = (n)->tt_words[$i] & (o)->tt_words[$i])" \
|
||||
>> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskClearMask(m, n) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] &= ~(n)->tt_words[$i])" >> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
echo "" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "#define TTMaskClearMask3(m, n, o) ( \" >> $2
|
||||
foreach i (${count})
|
||||
echo -n " ((m)->tt_words[$i] = (n)->tt_words[$i] & ~(o)->tt_words[$i])" \
|
||||
>> $2
|
||||
if ($i == 0) then
|
||||
echo ")" >> $2
|
||||
else
|
||||
echo ", \" >> $2
|
||||
endif
|
||||
end
|
||||
|
||||
echo "" >> $2
|
||||
echo "#endif /* _DATABASE_H */" >> $2
|
||||
+2
-2
@@ -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]
|
||||
|
||||
+170
-50
@@ -3157,19 +3157,25 @@ _netcmp_equate(ClientData clientData,
|
||||
/* add --- add new property */
|
||||
/* remove --- delete existing property */
|
||||
/* tolerance --- set property tolerance */
|
||||
/* merge --- set property merge behavior */
|
||||
/* merge --- (deprecated) */
|
||||
/* or */
|
||||
/* netgen::property default */
|
||||
/* or */
|
||||
/* netgen::property <device>|<model> <option> */
|
||||
/* yes|no */
|
||||
/* Where <option> is one of: */
|
||||
/* serial --- allow/prohibit serial combination */
|
||||
/* series --- allow/prohibit series combination */
|
||||
/* parallel --- allow/prohibit parallel combination */
|
||||
/* or */
|
||||
/* netgen::property parallel none */
|
||||
/* --- prohibit parallel combinations by */
|
||||
/* default. */
|
||||
/* default (for all devices). */
|
||||
/* */
|
||||
/* series|parallel options are: */
|
||||
/* enable|disable|none|{<key> <combine_option>} */
|
||||
/* */
|
||||
/* combine options are: */
|
||||
/* par|add|par_critical|add_critical */
|
||||
/* */
|
||||
/* Formerly: (none) */
|
||||
/* Results: */
|
||||
@@ -3189,11 +3195,11 @@ _netcmp_property(ClientData clientData,
|
||||
|
||||
char *options[] = {
|
||||
"add", "create", "remove", "delete", "tolerance", "merge", "serial",
|
||||
"parallel", NULL
|
||||
"series", "parallel", NULL
|
||||
};
|
||||
enum OptionIdx {
|
||||
ADD_IDX, CREATE_IDX, REMOVE_IDX, DELETE_IDX, TOLERANCE_IDX, MERGE_IDX,
|
||||
SERIAL_IDX, PARALLEL_IDX
|
||||
SERIAL_IDX, SERIES_IDX, PARALLEL_IDX
|
||||
};
|
||||
int result, index, idx2;
|
||||
|
||||
@@ -3204,16 +3210,30 @@ _netcmp_property(ClientData clientData,
|
||||
INTEGER_IDX, DOUBLE_IDX, VALUE_IDX, STRING_IDX
|
||||
};
|
||||
|
||||
/* Note: "merge" has been deprecated, but kept for backwards compatibility. */
|
||||
/* It has been replaced by "combineoptions" below, used with "series" and */
|
||||
/* "parallel". */
|
||||
|
||||
char *mergeoptions[] = {
|
||||
"none", "add", "add_critical", "par", "par_critical",
|
||||
"parallel", "parallel_critical", "ser_critical", "ser",
|
||||
"serial_critical", "serial", NULL
|
||||
"serial_critical", "series_critical", "serial", "series", NULL
|
||||
};
|
||||
|
||||
enum MergeOptionIdx {
|
||||
NONE_IDX, ADD_ONLY_IDX, ADD_CRIT_IDX,
|
||||
PAR_ONLY_IDX, PAR_CRIT_IDX, PAR2_ONLY_IDX, PAR2_CRIT_IDX,
|
||||
SER_CRIT_IDX, SER_IDX, SER2_CRIT_IDX, SER2_IDX
|
||||
SER_CRIT_IDX, SER_IDX, SER2_CRIT_IDX, SER3_CRIT_IDX, SER2_IDX, SER3_IDX
|
||||
};
|
||||
|
||||
char *combineoptions[] = {
|
||||
"none", "par", "add", "critical", NULL
|
||||
};
|
||||
|
||||
enum CombineOptionIdx {
|
||||
COMB_NONE_IDX, COMB_PAR_IDX, COMB_ADD_IDX, COMB_CRITICAL_IDX
|
||||
};
|
||||
|
||||
char *yesno[] = {
|
||||
"on", "yes", "true", "enable", "allow",
|
||||
"off", "no", "false", "disable", "prohibit", NULL
|
||||
@@ -3238,25 +3258,34 @@ _netcmp_property(ClientData clientData,
|
||||
case CLASS_NMOS: case CLASS_PMOS: case CLASS_FET3:
|
||||
case CLASS_NMOS4: case CLASS_PMOS4: case CLASS_FET4:
|
||||
case CLASS_FET:
|
||||
PropertyMerge(tp->name, tp->file, "w", MERGE_ADD_CRIT);
|
||||
PropertyMerge(tp->name, tp->file, "w", MERGE_P_ADD | MERGE_P_CRIT,
|
||||
MERGE_ALL_MASK);
|
||||
PropertyDelete(tp->name, tp->file, "as");
|
||||
PropertyDelete(tp->name, tp->file, "ad");
|
||||
PropertyDelete(tp->name, tp->file, "ps");
|
||||
PropertyDelete(tp->name, tp->file, "pd");
|
||||
break;
|
||||
case CLASS_RES: case CLASS_RES3:
|
||||
PropertyMerge(tp->name, tp->file, "w", MERGE_ADD_CRIT);
|
||||
PropertyMerge(tp->name, tp->file, "l", MERGE_SER_CRIT);
|
||||
tp->flags |= COMB_SERIAL;
|
||||
PropertyMerge(tp->name, tp->file, "w",
|
||||
MERGE_P_PAR | MERGE_S_CRIT, MERGE_ALL_MASK);
|
||||
PropertyMerge(tp->name, tp->file, "l",
|
||||
MERGE_S_ADD | MERGE_P_CRIT, MERGE_ALL_MASK);
|
||||
PropertyMerge(tp->name, tp->file, "value",
|
||||
MERGE_S_ADD | MERGE_P_PAR, MERGE_ALL_MASK);
|
||||
tp->flags |= COMB_SERIES;
|
||||
break;
|
||||
case CLASS_CAP: case CLASS_ECAP: case CLASS_CAP3:
|
||||
// NOTE: No attempt to combine area, width, or length;
|
||||
// only value.
|
||||
PropertyMerge(tp->name, tp->file, "value", MERGE_ADD_CRIT);
|
||||
/* NOTE: No attempt to modify perimeter, length, or width */
|
||||
PropertyMerge(tp->name, tp->file, "area",
|
||||
MERGE_P_ADD | MERGE_S_PAR, MERGE_ALL_MASK);
|
||||
PropertyMerge(tp->name, tp->file, "value",
|
||||
MERGE_P_ADD | MERGE_S_PAR, MERGE_ALL_MASK);
|
||||
tp->flags |= COMB_SERIES;
|
||||
break;
|
||||
case CLASS_INDUCTOR:
|
||||
PropertyMerge(tp->name, tp->file, "value", MERGE_PAR_CRIT);
|
||||
tp->flags |= COMB_SERIAL;
|
||||
PropertyMerge(tp->name, tp->file, "value",
|
||||
MERGE_S_ADD | MERGE_P_PAR, MERGE_ALL_MASK);
|
||||
tp->flags |= COMB_SERIES;
|
||||
break;
|
||||
}
|
||||
tp = NextCell();
|
||||
@@ -3274,7 +3303,22 @@ _netcmp_property(ClientData clientData,
|
||||
}
|
||||
else {
|
||||
Tcl_SetResult(interp, "Bad option, should be property parallel none|all",
|
||||
NONE);
|
||||
NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
else if ((objc == 3) && ((!strcmp(Tcl_GetString(objv[1]), "series")) ||
|
||||
(!strcmp(Tcl_GetString(objv[1]), "serial")))) {
|
||||
if (!strcmp(Tcl_GetString(objv[2]), "none")) {
|
||||
SetSeriesCombine(FALSE);
|
||||
}
|
||||
else if (!strcmp(Tcl_GetString(objv[2]), "all")) {
|
||||
SetSeriesCombine(TRUE);
|
||||
}
|
||||
else {
|
||||
Tcl_SetResult(interp, "Bad option, should be property series none|all",
|
||||
NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_OK;
|
||||
@@ -3329,10 +3373,11 @@ _netcmp_property(ClientData clientData,
|
||||
|
||||
switch (index) {
|
||||
case SERIAL_IDX:
|
||||
case SERIES_IDX:
|
||||
case PARALLEL_IDX:
|
||||
if (objc == 3) {
|
||||
if (index == SERIAL_IDX) {
|
||||
tobj1 = Tcl_NewBooleanObj((tp->flags & COMB_SERIAL) ? 1 : 0);
|
||||
if (index == SERIAL_IDX || index == SERIES_IDX) {
|
||||
tobj1 = Tcl_NewBooleanObj((tp->flags & COMB_SERIES) ? 1 : 0);
|
||||
Tcl_SetObjResult(interp, tobj1);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -3342,30 +3387,97 @@ _netcmp_property(ClientData clientData,
|
||||
return TCL_OK;
|
||||
}
|
||||
}
|
||||
else if (objc == 4) {
|
||||
if (Tcl_GetIndexFromObj(interp, objv[3],
|
||||
(CONST84 char **)yesno,
|
||||
"combine", 0, &idx2) != TCL_OK) {
|
||||
Tcl_WrongNumArgs(interp, 3, objv, "enable|disable");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (idx2 <= 4) { /* true, enable, etc. */
|
||||
if (index == SERIAL_IDX)
|
||||
tp->flags |= COMB_SERIAL;
|
||||
else
|
||||
tp->flags &= ~COMB_NO_PARALLEL;
|
||||
}
|
||||
else { /* false, disable, etc. */
|
||||
if (index == SERIAL_IDX)
|
||||
tp->flags &= ~COMB_SERIAL;
|
||||
else
|
||||
tp->flags |= COMB_NO_PARALLEL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "serial|parallel enable|disable");
|
||||
else if (objc < 4) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "series|parallel enable|disable");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
for (i = 3; i < objc; i++) {
|
||||
// Each value must be a list of two, or a yes/no answer.
|
||||
|
||||
if (Tcl_GetIndexFromObj(interp, objv[i],
|
||||
(CONST84 char **)yesno,
|
||||
"combine", 0, &idx2) == TCL_OK) {
|
||||
if (idx2 <= 4) { /* true, enable, etc. */
|
||||
if (index == SERIAL_IDX || index == SERIES_IDX)
|
||||
tp->flags |= COMB_SERIES;
|
||||
else
|
||||
tp->flags &= ~COMB_NO_PARALLEL;
|
||||
}
|
||||
else { /* false, disable, etc. */
|
||||
if (index == SERIAL_IDX || index == SERIES_IDX)
|
||||
tp->flags &= ~COMB_SERIES;
|
||||
else
|
||||
tp->flags |= COMB_NO_PARALLEL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
result = Tcl_ListObjLength(interp, objv[i], &llen);
|
||||
if ((result != TCL_OK) || (llen != 2)) {
|
||||
Tcl_SetResult(interp, "Not a {key merge_type} pair list.",
|
||||
NULL);
|
||||
}
|
||||
else {
|
||||
int mergeval = MERGE_NONE;
|
||||
int mergemask = MERGE_NONE;
|
||||
|
||||
result = Tcl_ListObjIndex(interp, objv[i], 0, &tobj1);
|
||||
if (result != TCL_OK) return result;
|
||||
result = Tcl_ListObjIndex(interp, objv[i], 1, &tobj2);
|
||||
if (result != TCL_OK) return result;
|
||||
|
||||
result = Tcl_GetIndexFromObj(interp, tobj2,
|
||||
(CONST84 char **)combineoptions,
|
||||
"combine_type", 0, &idx2);
|
||||
if (result != TCL_OK) return result;
|
||||
|
||||
if (index == SERIAL_IDX || index == SERIES_IDX) {
|
||||
mergemask = MERGE_S_MASK;
|
||||
switch (idx2) {
|
||||
case COMB_NONE_IDX:
|
||||
mergeval &= ~(MERGE_S_MASK);
|
||||
tp->flags &= ~COMB_SERIES;
|
||||
break;
|
||||
case COMB_PAR_IDX:
|
||||
mergeval = MERGE_S_PAR;
|
||||
tp->flags |= COMB_SERIES;
|
||||
break;
|
||||
case COMB_ADD_IDX:
|
||||
mergeval |= MERGE_S_ADD;
|
||||
tp->flags |= COMB_SERIES;
|
||||
break;
|
||||
case COMB_CRITICAL_IDX:
|
||||
mergeval |= MERGE_S_CRIT;
|
||||
tp->flags |= COMB_SERIES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else { /* index == PARALLEL_IDX */
|
||||
mergemask = MERGE_P_MASK;
|
||||
switch (idx2) {
|
||||
case COMB_NONE_IDX:
|
||||
mergeval &= ~(MERGE_P_MASK);
|
||||
tp->flags |= COMB_NO_PARALLEL;
|
||||
break;
|
||||
case COMB_PAR_IDX:
|
||||
mergeval |= MERGE_P_PAR;
|
||||
tp->flags &= ~COMB_NO_PARALLEL;
|
||||
break;
|
||||
case COMB_ADD_IDX:
|
||||
mergeval |= MERGE_P_ADD;
|
||||
tp->flags &= ~COMB_NO_PARALLEL;
|
||||
break;
|
||||
case COMB_CRITICAL_IDX:
|
||||
mergeval |= MERGE_P_CRIT;
|
||||
tp->flags &= ~COMB_NO_PARALLEL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
PropertyMerge(tp->name, fnum, Tcl_GetString(tobj1), mergeval,
|
||||
mergemask);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ADD_IDX:
|
||||
@@ -3535,6 +3647,11 @@ _netcmp_property(ClientData clientData,
|
||||
break;
|
||||
|
||||
case MERGE_IDX:
|
||||
// NOTE: This command option is deprecated, kept for backwards
|
||||
// compatibility, with updated flag values. This command format
|
||||
// is unable to specify a property as being a critical property
|
||||
// for merging both in series and in parallel.
|
||||
|
||||
if (objc == 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "{property_key merge_type} ...");
|
||||
return TCL_ERROR;
|
||||
@@ -3564,29 +3681,32 @@ _netcmp_property(ClientData clientData,
|
||||
mergeval = MERGE_NONE;
|
||||
break;
|
||||
case ADD_ONLY_IDX:
|
||||
mergeval = MERGE_ADD;
|
||||
mergeval = MERGE_P_ADD;
|
||||
break;
|
||||
case ADD_CRIT_IDX:
|
||||
mergeval = MERGE_ADD_CRIT;
|
||||
mergeval = MERGE_P_ADD | MERGE_P_XCRIT;
|
||||
break;
|
||||
case PAR_ONLY_IDX:
|
||||
case PAR2_ONLY_IDX:
|
||||
mergeval = MERGE_PAR;
|
||||
mergeval = MERGE_P_PAR;
|
||||
break;
|
||||
case PAR_CRIT_IDX:
|
||||
case PAR2_CRIT_IDX:
|
||||
mergeval = MERGE_PAR_CRIT;
|
||||
mergeval = MERGE_P_PAR | MERGE_P_XCRIT;
|
||||
break;
|
||||
case SER_CRIT_IDX:
|
||||
case SER2_CRIT_IDX:
|
||||
mergeval = MERGE_SER_CRIT;
|
||||
case SER3_CRIT_IDX:
|
||||
mergeval = MERGE_S_ADD | MERGE_S_XCRIT;
|
||||
break;
|
||||
case SER_IDX:
|
||||
case SER2_IDX:
|
||||
mergeval = MERGE_SER;
|
||||
case SER3_IDX:
|
||||
mergeval = MERGE_S_ADD;
|
||||
break;
|
||||
}
|
||||
PropertyMerge(tp->name, fnum, Tcl_GetString(tobj1), mergeval);
|
||||
PropertyMerge(tp->name, fnum, Tcl_GetString(tobj1), mergeval,
|
||||
MERGE_ALL_MASK);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3691,8 +3811,8 @@ _netcmp_permute(ClientData clientData,
|
||||
if (PermuteForget(tp->name, fnum, NULL, NULL))
|
||||
Fprintf(stdout, "No permutations on circuit %s\n", tp->name);
|
||||
else
|
||||
Fprintf(stderr, "Unable to reset model %s pin permutation %s, %s.\n",
|
||||
tp->name, pin1, pin2);
|
||||
Fprintf(stderr, "Unable to reset model %s pin permutations.\n",
|
||||
tp->name);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
+4405
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user