mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-22 14:17:43 +02:00
Corrected a typo in the previous commit that causes parameters to
be output twice for scaled devices (such as diodes in the sky130 process). Above and beyond the typo, though, the implementation of offsets is not very well thought out and needs to be revised. For one, the +/- notation can be confused with signs in the parameter expression; that is also fixed in this commit. But there is currently no way to express both a scale and an offset for a device parameter.
This commit is contained in:
+20
-13
@@ -2391,22 +2391,29 @@ ExtTechLine(sectionName, argc, argv)
|
||||
newParam->pl_scale = atof(mult);
|
||||
}
|
||||
else
|
||||
{
|
||||
newParam->pl_scale = 1.0;
|
||||
|
||||
if ((offset = strchr(paramName, '+')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
offset++;
|
||||
newParam->pl_offset = atof(offset);
|
||||
/* NOTE: If allowing both scale and offset, be sure
|
||||
* to distinguish between +/- used for offsets and
|
||||
* +/- used as sign.
|
||||
*/
|
||||
|
||||
if ((offset = strchr(paramName, '+')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
offset++;
|
||||
newParam->pl_offset = atof(offset);
|
||||
}
|
||||
else if ((offset = strchr(paramName, '-')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
offset++;
|
||||
newParam->pl_offset = -atof(offset);
|
||||
}
|
||||
else
|
||||
newParam->pl_offset = 0.0;
|
||||
}
|
||||
else if ((offset = strchr(paramName, '-')) != NULL)
|
||||
{
|
||||
*offset = '\0';
|
||||
offset++;
|
||||
newParam->pl_offset = -atof(offset);
|
||||
}
|
||||
else
|
||||
newParam->pl_offset = 0.0;
|
||||
|
||||
newParam->pl_name = StrDup((char **)NULL, paramName);
|
||||
newParam->pl_next = subcktParams;
|
||||
|
||||
Reference in New Issue
Block a user