Implemented an idea from Staf Verhaegen to have "labels" options

"port" and "noport" in the cifoutput section to distinguish
between layer:purpose pairs for port text vs. other kinds of
text.  This allows a closer correspondence between GDS read and
write.  Note that the port writing is currently only in the GDS
write routine, not in the CIF routine.
This commit is contained in:
Tim Edwards 2018-09-09 15:09:15 -04:00
parent b964f9d33a
commit 9eb406ffba
3 changed files with 37 additions and 7 deletions

View File

@ -892,7 +892,7 @@ calmaOutFunc(def, f, cliprect)
for (lab = def->cd_labels; lab; lab = lab->lab_next)
{
type = CIFCurStyle->cs_labelLayer[lab->lab_type];
if ((lab->lab_flags & PORT_DIR_MASK) == 0)
if ((type >= 0) && (lab->lab_flags & PORT_DIR_MASK) == 0)
{
calmaWriteLabelFunc(lab, type, f);
}
@ -906,8 +906,8 @@ calmaOutFunc(def, f, cliprect)
for (i = 0; i <= maxport; i++)
for (lab = def->cd_labels; lab; lab = lab->lab_next)
{
type = CIFCurStyle->cs_labelLayer[lab->lab_type];
if (((lab->lab_flags & PORT_DIR_MASK) != 0) &&
type = CIFCurStyle->cs_portLayer[lab->lab_type];
if ((type >= 0) && ((lab->lab_flags & PORT_DIR_MASK) != 0) &&
((lab->lab_flags & PORT_NUM_MASK) == i))
{
calmaWriteLabelFunc(lab, type, f);
@ -2470,6 +2470,9 @@ calmaWriteLabelFunc(lab, type, f)
/* and the label rectangle is not degenerate, then output the label */
/* rectangle as a boundary with the label's layer:purpose pair. */
/* Note that the check for whether the CIF_LABEL_NOPORT flag has */
/* been set is done outside of this routine. */
if ((CIFCurStyle->cs_layers[type]->cl_ops == NULL) &&
(lab->lab_rect.r_xtop > lab->lab_rect.r_xbot) &&
(lab->lab_rect.r_ytop > lab->lab_rect.r_ybot))

View File

@ -208,8 +208,8 @@ typedef struct
* only be generated if the cell is a top-level cell.
*/
#define CIF_TEMP 1
#define CIF_BBOX_TOP 2
#define CIF_TEMP 1
#define CIF_BBOX_TOP 2
/* The following data structure describes a complete set of CIF
* layers. The number of CIF layers (MAXCIFLAYERS) must not be
@ -271,6 +271,11 @@ typedef struct cifstyle
* -1 means no known CIF layer for this Magic
* layer.
*/
int cs_portLayer[TT_MAXTYPES];
/* Similar to cs_labelLayer, to distinguish
* between output types used for "normal"
* text and those used specifically for ports.
*/
CIFLayer *cs_layers[MAXCIFLAYERS];
/* Describes how to generate each layer.*/
int cs_flags; /* bitmask of boolean-valued output options */

View File

@ -179,7 +179,10 @@ cifTechStyleInit()
CIFCurStyle->cs_hierLayers = DBZeroTypeBits;
CIFCurStyle->cs_flags = 0;
for (i=0; i<TT_MAXTYPES; i+=1)
{
CIFCurStyle->cs_labelLayer[i] = -1;
CIFCurStyle->cs_portLayer[i] = -1;
}
for (i = 0; i < MAXCIFLAYERS; i++)
CIFCurStyle->cs_layers[i] = NULL;
}
@ -859,6 +862,8 @@ CIFTechLine(sectionName, argc, argv)
if (strcmp(argv[0], "labels") == 0)
{
bool portOnly = FALSE, noPort = FALSE;
if (cifCurLayer == NULL)
{
TechError("Must define layer before giving labels it holds.\n");
@ -866,12 +871,29 @@ CIFTechLine(sectionName, argc, argv)
}
if (cifCurLayer->cl_flags & CIF_TEMP)
TechError("Why are you attaching labels to a temporary layer?\n");
if (argc != 2) goto wrongNumArgs;
if (argc == 3)
{
if (!strncmp(argv[2], "port", 4))
portOnly = TRUE;
else if (!strncmp(argv[2], "noport", 6))
noPort = TRUE;
else
{
TechError("Unknown option %s for labels statement.\n", argv[2]);
goto wrongNumArgs;
}
}
else if (argc != 2) goto wrongNumArgs;
DBTechNoisyNameMask(argv[1], &mask);
for (i=0; i<TT_MAXTYPES; i+=1)
{
if (TTMaskHasType(&mask, i))
CIFCurStyle->cs_labelLayer[i] = CIFCurStyle->cs_nLayers-1;
{
if (noPort == FALSE)
CIFCurStyle->cs_labelLayer[i] = CIFCurStyle->cs_nLayers-1;
if (portOnly == TRUE)
CIFCurStyle->cs_portLayer[i] = CIFCurStyle->cs_nLayers-1;
}
}
cifGotLabels = TRUE;
return TRUE;