Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style drc: add print keyword to ouput drc why as lambda or microns #284

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions drc/DRCmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ drcSubstitute (cptr)
DRCCookie * cptr; /* Design rule violated */
{
static char *why_out = NULL;
char *whyptr, *sptr, *wptr;
char *whyptr, *sptr, *wptr, *unit;
int subscnt = 0, whylen;
float oscale, value;
float oscale, dscale, value;
extern float CIFGetOutputScale();

whyptr = DRCCurStyle->DRCWhyList[cptr->drcc_tag];
Expand All @@ -203,10 +203,22 @@ drcSubstitute (cptr)
why_out = (char *)mallocMagic(whylen * sizeof(char));
strcpy(why_out, whyptr);

if (cptr->drcc_flags & DRC_CIFRULE)
oscale = CIFGetScale(100); /* 100 = microns to centimicrons */
if (DRCPrintConvert)
{
unit = "um";
if (cptr->drcc_flags & DRC_CIFRULE)
oscale = CIFGetScale(100); /* 100 = microns to centimicrons */
else
oscale = CIFGetOutputScale(1000); /* 1000 for conversion to um */
dscale = 1;
}
else
oscale = CIFGetOutputScale(1000); /* 1000 for conversion to um */
{
unit = "lambda";
oscale = 1;
dscale = CIFGetOutputScale(1);
}

wptr = why_out;

while ((sptr = strchr(whyptr, '%')) != NULL)
Expand All @@ -218,21 +230,21 @@ drcSubstitute (cptr)
switch (*(sptr + 1))
{
case 'd':
/* Replace with "dist" value in microns */
value = (float)cptr->drcc_dist * oscale;
snprintf(wptr, 20, "%01.3gum", value);
/* Replace with "dist" value in microns or lambda */
value = (float)cptr->drcc_dist * oscale / dscale;
snprintf(wptr, 20, "%01.3g%s", value, unit);
wptr += strlen(wptr);
break;
case 'c':
/* Replace with "cdist" value in microns */
value = (float)cptr->drcc_cdist * oscale;
snprintf(wptr, 20, "%01.3gum", value);
/* Replace with "cdist" value in microns or lambda */
value = (float)cptr->drcc_cdist * oscale / dscale;
snprintf(wptr, 20, "%01.3g%s", value, unit);
wptr += strlen(wptr);
break;
case 'a':
/* Replace with "cdist" value in microns squared */
value = (float)cptr->drcc_cdist * oscale * oscale;
snprintf(wptr, 20, "%01.4gum^2", value);
/* Replace with "cdist" value in microns or lambda squared */
value = (float)cptr->drcc_cdist * oscale * oscale / (dscale * dscale);
snprintf(wptr, 20, "%01.4g%s^2", value, unit);
wptr += strlen(wptr);
break;
default:
Expand Down
19 changes: 19 additions & 0 deletions drc/DRCtech.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ global int DRCStepSize;

global int DRCRuleOptimization = TRUE;

/* Whether we are converting units printed from lambda to microns */
global bool DRCPrintConvert;

/* The following variables count how many rules were specified by
* the technology file and how many edge rules were optimized away.
*/
Expand Down Expand Up @@ -554,6 +557,9 @@ DRCTechStyleInit()
drcRulesOptimized = 0;
drcRulesSpecified = 0;

/* default to printing in microns */
DRCPrintConvert = TRUE;

if (DRCCurStyle == NULL)
{
DRCCurStyle = (DRCStyle *) mallocMagic(sizeof(DRCStyle));
Expand Down Expand Up @@ -848,6 +854,19 @@ DRCTechLine(sectionName, argc, argv)
(DRCCurStyle->ds_status != TECH_SUSPENDED))
return TRUE;

/* Process "print" line next (if any) */

if (strcmp(argv[0], "print") == 0)
{
if (!strcmp(argv[1], "microns"))
DRCPrintConvert = TRUE;
else if (!strcmp(argv[1], "um"))
DRCPrintConvert = TRUE;
else if (strcmp(argv[1], "lambda"))
TechError("print must be microns or lambda. Using the "
"default value (microns).\n");
}

/* Process "scalefactor" line next (if any) */

if (strcmp(argv[0], "scalefactor") == 0)
Expand Down
1 change: 1 addition & 0 deletions drc/drc.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ extern int DRCstatVRulesHisto[DRC_MAXRULESHISTO];

extern int DRCTechHalo; /* Current halo being used */
extern int DRCStepSize; /* Current step size being used */
extern bool DRCPrintConvert; /* print as lambda or microns */
extern DRCPendingCookie * DRCPendingRoot;

extern unsigned char DRCBackGround; /* global flag to enable/disable
Expand Down