Merge branch 'master' into magic-8.2

This commit is contained in:
Tim Edwards 2019-10-24 03:00:05 -04:00
commit 6152fb01c6
6 changed files with 83 additions and 34 deletions

View File

@ -621,8 +621,10 @@ CIFReadTechLine(sectionName, argc, argv)
if (argc >= 3)
{
if(!strncmp(argv[argc - 1], "nanom", 5))
if (!strncmp(argv[argc - 1], "nanom", 5))
cifCurReadStyle->crs_multiplier = 10;
else if (!strncmp(argv[argc - 1], "angstr", 6))
cifCurReadStyle->crs_multiplier = 100;
}
if (cifCurReadStyle->crs_scaleFactor <= 0)

View File

@ -318,7 +318,7 @@ CmdLabel(w, cmd)
* Implement the "load" command.
*
* Usage:
* load [name [scaled n [d]]] [-force]
* load [name [scaled n [d]]] [-force] [-nowindow]
*
* If name is supplied, then the window containing the point tool is
* remapped so as to edit the cell with the given name.
@ -364,15 +364,16 @@ CmdLoad(w, cmd)
locargc--;
ignoreTech = TRUE;
}
if (locargc >= 4 && !strncmp(cmd->tx_argv[2], "scale", 5) &&
if ((locargc >= 4) && !strncmp(cmd->tx_argv[2], "scale", 5) &&
StrIsInt(cmd->tx_argv[3]))
{
n = atoi(cmd->tx_argv[3]);
if (cmd->tx_argc == 5 && StrIsInt(cmd->tx_argv[4]))
if ((locargc == 5) && StrIsInt(cmd->tx_argv[4]))
d = atoi(cmd->tx_argv[4]);
else if (locargc != 4)
{
TxError("Usage: %s name scaled n [d]\n", cmd->tx_argv[0]);
TxError("Usage: %s name scaled n [d] [-force] [-nowindow]\n",
cmd->tx_argv[0]);
return;
}
DBLambda[0] *= d;
@ -381,7 +382,8 @@ CmdLoad(w, cmd)
}
else if (!ignoreTech && !noWindow)
{
TxError("Usage: %s [name [scaled n [d]]]\n", cmd->tx_argv[0]);
TxError("Usage: %s name [scaled n [d]] [-force] [-nowindow]\n",
cmd->tx_argv[0]);
return;
}
}

View File

@ -1656,7 +1656,7 @@ esMakePorts(hc, cdata)
// In particular, this keeps parasitics out of the netlist for
// LVS purposes if "cthresh" is set to "infinite".
if (fabs((double)conn->conn_cap) < EFCapThreshold) continue;
if (fabs((double)conn->conn_cap / 1000) < EFCapThreshold) continue;
portname = name;
updef = def;
@ -1883,6 +1883,9 @@ esHierVisit(hc, cdata)
EFHierVisitNodes(hcf, spcnodeHierVisit, (ClientData) NULL);
freeMagic(resstr);
}
/* Reset device merge index for next cell */
if (esMergeDevsA || esMergeDevsC) esFMIndex = 0;
}
if ((def != topdef) || (def->def_flags & DEF_SUBCIRCUIT) || (locDoSubckt == TRUE))

View File

@ -264,7 +264,8 @@ CmdExtToSpice(w, cmd)
"extresist [on|off] incorporate information from extresist",
"resistor tee [on|off] model resistor capacitance as a T-network",
"scale [on|off] use .option card for scaling",
"subcircuits [on|off] standard cells become subcircuit calls",
"subcircuits [top|descend] [on|off|auto]\n"
" standard cells become subcircuit calls",
"hierarchy [on|off] output hierarchical spice for LVS",
"blackbox [on|off] output abstract views as black-box entries",
"renumber [on|off] on = number instances X1, X2, etc.\n"
@ -2095,6 +2096,56 @@ esOutputResistor(dev, hierName, scale, term1, term2, has_model, l, w, dscale)
}
}
/* Report if device at index n has been deleted due to merging */
bool
devIsKilled(n)
int n;
{
return (esFMult[(n)] <= (float)0.0) ? TRUE : FALSE;
}
/* Add a dev's multiplier to the table and grow it if necessary */
void
addDevMult(f)
float f;
{
int i;
float *op;
if (esFMult == NULL) {
esFMult = (float *) mallocMagic((unsigned) (esFMSize*sizeof(float)));
}
else if (esFMIndex >= esFMSize)
{
op = esFMult;
esFMSize *= 2;
esFMult = (float *)mallocMagic((unsigned)(esFMSize * sizeof(float)));
for (i = 0; i < esFMSize / 2; i++) esFMult[i] = op[i];
if (op) freeMagic(op);
}
esFMult[esFMIndex++] = f;
}
/* Set the multiplier value f of device at index i */
void
setDevMult(i, f)
int i;
float f;
{
esFMult[i] = f;
}
/* Get the multiplier value of the device at the current index esFMIndex */
float
getCurDevMult()
{
return (esFMult && (esFMIndex > 0)) ? esFMult[esFMIndex-1] : (float)1.0;
}
/*
* ----------------------------------------------------------------------------
*

View File

@ -36,6 +36,11 @@ extern char *nodeSpiceHierName();
extern devMerge *mkDevMerge();
extern bool extHierSDAttr();
extern bool devIsKilled();
extern float getCurDevMult();
extern void addDevMult();
extern void setDevMult();
/* Options specific to ext2spice */
extern bool esDoExtResis;
extern bool esDoPorts;
@ -166,7 +171,7 @@ typedef struct {
/*
*---------------------------------------------------------
* Variables & macros used for merging parallel devs
* Variables used for merging parallel devs
* The merging of devs is based on the fact that spcdevVisit
* visits the devs in the same order all the time so the
* value of esFMult[i] keeps the multiplier for the ith dev
@ -174,31 +179,8 @@ typedef struct {
*/
#define DEV_KILLED ((float) -1.0)
#define FMULT_SIZE (1<<10)
#define devIsKilled(n) ( esFMult[(n)] <=(float)0.0 )
#define DEV_KILLED ((float) -1.0)
/* macro to add a dev's multiplier to the table and grow it if necessary */
#define addDevMult(f) \
{ \
if ( esFMult == NULL ) { \
esFMult = (float *) mallocMagic((unsigned) (esFMSize*sizeof(float))); \
} else if ( esFMIndex >= esFMSize ) { \
int i; \
float *op = esFMult ; \
esFMult = (float *) mallocMagic((unsigned) ((esFMSize = esFMSize*2)*sizeof(float))); \
for ( i = 0 ; i < esFMSize/2 ; i++ ) esFMult[i] = op[i]; \
if (op) freeMagic(op); \
} \
esFMult[esFMIndex++] = (float)(f); \
}
#define setDevMult(i,f) { esFMult[(i)] = (float)(f); }
#define getCurDevMult() ((esFMult && (esFMIndex > 0)) ? esFMult[esFMIndex-1] : (float)1.0)
#ifdef MAGIC_WRAPPER
#define atoCap(s) ((EFCapValue)atof(s))
#endif

View File

@ -1018,14 +1018,23 @@ efFlatSingleCap(hc, name1, name2, conn)
EFNode *n1, *n2;
HashEntry *he;
EFCoupleKey ck;
static char msg0[] = "cap(1)";
static char msg1[] = "cap(2)";
char *msg;
/* Connections that are below threshold (ext2spice hierarchy only) */
/* will be missing. Do not generate errors for these. */
if ((he = EFHNLook(hc->hc_hierName, name1, "cap(1)")) == NULL)
msg = (fabs((double)conn->conn_cap / 1000) < EFCapThreshold) ? NULL : msg0;
if ((he = EFHNLook(hc->hc_hierName, name1, msg)) == NULL)
return 0;
n1 = ((EFNodeName *) HashGetValue(he))->efnn_node;
if (n1->efnode_flags & EF_KILLED)
return 0;
if ((he = EFHNLook(hc->hc_hierName, name2, "cap(2)")) == NULL)
if (msg) msg = msg1;
if ((he = EFHNLook(hc->hc_hierName, name2, msg)) == NULL)
return 0;
n2 = ((EFNodeName *) HashGetValue(he))->efnn_node;
if (n2->efnode_flags & EF_KILLED)