Corrected the extraction offset, in which a parameter like "l"
can provide a delta offset such as "l+0.06", indicating that the extraction model has a length larger than the drawn device. Previously the value was assumed to be in microns but did not scale between the .ext file and the SPICE netlist. Corrected so that it scales like the other parameter values, being converted to internal units and tracking the internal grid scale.
This commit is contained in:
parent
610c86a234
commit
7a9445ec30
|
|
@ -736,15 +736,15 @@ efBuildDeviceParams(name, argc, argv)
|
|||
if ((offset = strchr(pptr + 1, '+')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
newparm->parm_offset = atof(offset + 1);
|
||||
newparm->parm_offset = atoi(offset + 1);
|
||||
}
|
||||
else if ((offset = strchr(pptr + 1, '-')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
newparm->parm_offset = -atof(offset + 1);
|
||||
newparm->parm_offset = -atoi(offset + 1);
|
||||
}
|
||||
else
|
||||
newparm->parm_offset = 0.0;
|
||||
newparm->parm_offset = 0;
|
||||
}
|
||||
|
||||
// For parameters defined for cell defs, copy the whole
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ typedef struct parm
|
|||
char parm_type[2];
|
||||
char *parm_name;
|
||||
double parm_scale;
|
||||
double parm_offset;
|
||||
int parm_offset;
|
||||
struct parm *parm_next;
|
||||
} DevParam;
|
||||
|
||||
|
|
|
|||
|
|
@ -1678,7 +1678,7 @@ extOutputParameters(def, transList, outFile)
|
|||
plist->pl_param[0], plist->pl_param[1],
|
||||
plist->pl_name, plist->pl_scale);
|
||||
else if (plist->pl_offset != 0.0)
|
||||
fprintf(outFile, " %c%c=%s%+g",
|
||||
fprintf(outFile, " %c%c=%s%+d",
|
||||
plist->pl_param[0], plist->pl_param[1],
|
||||
plist->pl_name, plist->pl_offset);
|
||||
else
|
||||
|
|
@ -1692,7 +1692,7 @@ extOutputParameters(def, transList, outFile)
|
|||
plist->pl_param[0],
|
||||
plist->pl_name, plist->pl_scale);
|
||||
else if (plist->pl_offset != 0.0)
|
||||
fprintf(outFile, " %c=%s%+g",
|
||||
fprintf(outFile, " %c=%s%+d",
|
||||
plist->pl_param[0],
|
||||
plist->pl_name, plist->pl_offset);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2366,6 +2366,7 @@ ExtTechLine(sectionName, argc, argv)
|
|||
while ((paramName = strchr(argv[argc - 1], '=')) != NULL)
|
||||
{
|
||||
char *mult, *offset;
|
||||
double dval;
|
||||
|
||||
/* Ignore ">=" and "<=", which are handled below */
|
||||
if (paramName > argv[argc - 1])
|
||||
|
|
@ -2379,7 +2380,7 @@ ExtTechLine(sectionName, argc, argv)
|
|||
newParam->pl_param[1] = '\0';
|
||||
newParam->pl_maximum = -1;
|
||||
newParam->pl_minimum = 0;
|
||||
newParam->pl_offset = 0.0;
|
||||
newParam->pl_offset = 0;
|
||||
|
||||
if (paramName - argv[argc - 1] == 3)
|
||||
newParam->pl_param[1] = *(argv[argc - 1] + 1);
|
||||
|
|
@ -2412,16 +2413,18 @@ ExtTechLine(sectionName, argc, argv)
|
|||
{
|
||||
*offset = '\0';
|
||||
offset++;
|
||||
newParam->pl_offset = atof(offset);
|
||||
dval = atof(offset);
|
||||
newParam->pl_offset = (int)(0.5 + (dval * 1000));
|
||||
}
|
||||
else if ((offset = strchr(paramName, '-')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
offset++;
|
||||
newParam->pl_offset = -atof(offset);
|
||||
dval = -atof(offset);
|
||||
newParam->pl_offset = (int)(0.5 + (dval * 1000));
|
||||
}
|
||||
else
|
||||
newParam->pl_offset = 0.0;
|
||||
newParam->pl_offset = 0;
|
||||
}
|
||||
|
||||
newParam->pl_name = StrDup((char **)NULL, paramName);
|
||||
|
|
@ -2483,7 +2486,7 @@ ExtTechLine(sectionName, argc, argv)
|
|||
newParam->pl_minimum = 0;
|
||||
newParam->pl_name = NULL;
|
||||
newParam->pl_scale = 1.0;
|
||||
newParam->pl_offset = 0.0;
|
||||
newParam->pl_offset = 0;
|
||||
|
||||
newParam->pl_next = subcktParams;
|
||||
subcktParams = newParam;
|
||||
|
|
@ -3693,6 +3696,14 @@ zinit:
|
|||
for (chkParam = devptr->exts_deviceParams; chkParam;
|
||||
chkParam = chkParam->pl_next)
|
||||
{
|
||||
if (chkParam->pl_offset != 0)
|
||||
{
|
||||
if (chkParam->pl_param[0] == 'a')
|
||||
chkParam->pl_offset /= dsq;
|
||||
else
|
||||
chkParam->pl_offset /= dscale;
|
||||
}
|
||||
|
||||
if (chkParam->pl_minimum > chkParam->pl_maximum) continue;
|
||||
else if (chkParam->pl_param[0] == 'a')
|
||||
{
|
||||
|
|
@ -3781,6 +3792,8 @@ zinit:
|
|||
for (chkParam = devptr->exts_deviceParams; chkParam;
|
||||
chkParam = chkParam->pl_next)
|
||||
{
|
||||
if (chkParam->pl_offset != 0)
|
||||
chkParam->pl_offset /= 1000;
|
||||
if (chkParam->pl_minimum > chkParam->pl_maximum) continue;
|
||||
chkParam->pl_maximum /= 1000;
|
||||
chkParam->pl_minimum /= 1000;
|
||||
|
|
@ -3835,6 +3848,19 @@ ExtTechScale(scalen, scaled)
|
|||
for (chkParam = devptr->exts_deviceParams; chkParam;
|
||||
chkParam = chkParam->pl_next)
|
||||
{
|
||||
if (chkParam->pl_offset != 0)
|
||||
{
|
||||
if (chkParam->pl_param[0] == 'a')
|
||||
{
|
||||
chkParam->pl_offset *= sqd;
|
||||
chkParam->pl_offset /= sqn;
|
||||
}
|
||||
else
|
||||
{
|
||||
chkParam->pl_offset *= scaled;
|
||||
chkParam->pl_offset /= scalen;
|
||||
}
|
||||
}
|
||||
if (chkParam->pl_minimum > chkParam->pl_maximum) continue;
|
||||
else if (chkParam->pl_param[0] == 'a')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ typedef struct pl
|
|||
char pl_param[2]; /* Default character for parameter */
|
||||
char *pl_name; /* Full name for parameter */
|
||||
double pl_scale; /* Scaling of parameter, if specified */
|
||||
double pl_offset; /* Offset of parameter, if specified */
|
||||
int pl_offset; /* Offset of parameter, if specified */
|
||||
int pl_maximum; /* Maximum value for this device model */
|
||||
int pl_minimum; /* Minimum value for this device model */
|
||||
struct pl *pl_next; /* Next parameter in list */
|
||||
|
|
|
|||
Loading…
Reference in New Issue