Corrected errors preventing extresist from working properly with

hierarchical cells (namely a scaling issue with .sim file units).
More can be done to make the extresist command more user friendly,
but at least port connections as drivers appears to work.
This commit is contained in:
Tim Edwards 2019-10-14 17:17:08 -04:00
parent 58c4c8a32e
commit 57a5ff6094
5 changed files with 18 additions and 11 deletions

View File

@ -15,7 +15,7 @@ ResMakeRes.o: ResMakeRes.c ../utils/magic.h ../utils/geometry.h \
../database/database.h ../utils/malloc.h ../textio/textio.h \
../extract/extract.h ../extract/extractInt.h ../extract/extDebugInt.h \
../windows/windows.h ../dbwind/dbwind.h ../utils/tech.h \
../textio/txcommands.h ../resis/resis.h
../textio/txcommands.h ../resis/resis.h ../cif/CIFint.h
ResSimple.o: ResSimple.c ../utils/magic.h ../utils/geometry.h \
../utils/geofast.h ../tiles/tile.h ../utils/hash.h ../utils/heap.h \
../database/database.h ../utils/malloc.h ../textio/textio.h \

View File

@ -450,8 +450,8 @@ DBTreeCopyConnectDCS(scx, mask, xMask, connect, area, destUse)
for (tran = TT_TECHDEPBASE; tran < TT_MAXTYPES; tran++)
{
devptr = ExtCurStyle->exts_device[tran];
tran_name = devptr->exts_deviceName;
if ((tran_name != NULL) && (strcmp(tran_name, "None")))
if ((devptr != NULL) && ((tran_name = devptr->exts_deviceName) != NULL)
&& (strcmp(tran_name, "None")))
{
TTMaskSetMask(&DiffTypeBitMask,
&(devptr->exts_deviceSDTypes[0]));

View File

@ -72,8 +72,8 @@ ResInitializeConn()
for (tran = TT_TECHDEPBASE; tran < TT_MAXTYPES; tran++)
{
devptr = ExtCurStyle->exts_device[tran];
tran_name = devptr->exts_deviceName;
if ((tran_name != NULL) && (strcmp(tran_name, "None")))
if ((devptr != NULL) && ((tran_name = devptr->exts_deviceName) != NULL)
&& (strcmp(tran_name, "None")))
{
for (diff = TT_TECHDEPBASE; diff < TT_MAXTYPES; diff++)
{

View File

@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include "utils/tech.h"
#include "textio/txcommands.h"
#include "resis/resis.h"
#include "cif/CIFint.h"
/* Forward declarations */
bool ResCalcNearTransistor();
@ -783,13 +784,14 @@ ResDoContacts(contact, nodes, resList)
resNode *resptr;
cElement *ccell;
int tilenum, squaresx, squaresy, viawidth;
int minside, spacing, border;
int minside, spacing, border, cscale;
float squaresf;
resResistor *resistor;
resElement *element;
static int too_small = 1;
minside = CIFGetContactSize(contact->cp_type, &viawidth, &spacing, &border);
cscale = CIFCurStyle->cs_scaleFactor;
if ((ExtCurStyle->exts_viaResist[contact->cp_type] == 0) || (viawidth == 0))
{
@ -818,7 +820,8 @@ ResDoContacts(contact, nodes, resList)
}
else
{
if ((contact->cp_width < minside) || (contact->cp_height < minside))
if (((contact->cp_width * cscale) < minside) ||
((contact->cp_height * cscale) < minside))
{
if (too_small)
{
@ -832,13 +835,13 @@ ResDoContacts(contact, nodes, resList)
else
{
viawidth += spacing;
squaresf = (float)(contact->cp_width - minside) / (float)viawidth;
squaresf = (float)((contact->cp_width * cscale) - minside) / (float)viawidth;
squaresf *= ExtCurStyle->exts_unitsPerLambda;
squaresf /= (float)viawidth;
squaresx = (int)squaresf;
squaresx++;
squaresf = (float)(contact->cp_height - minside) / (float)viawidth;
squaresf = (float)((contact->cp_height * cscale) - minside) / (float)viawidth;
squaresf *= ExtCurStyle->exts_unitsPerLambda;
squaresf /= (float)viawidth;
squaresy = (int)squaresf;

View File

@ -146,8 +146,12 @@ ResReadSim(simfile,fetproc,capproc,resproc,attrproc,mergeproc)
case '|':
if (strcmp(line[NODEUNITS],"units:") == 0)
{
lambda = (float)atof(line[NODELAMBDA]);
if (lambda == 0.0) lambda = 1.0;
lambda = (float)atof(line[NODELAMBDA]);
if (lambda == 0.0) lambda = 1.0;
/* NOTE: units is derived from EFScale */
/* which needs a factor of 100 conversion */
/* to database units. */
lambda *= 100.0;
}
result=0;
break;