Added code to avoid mishandling negative layer numbers when a
label in a DEF file is on a layer that has not been properly mapped to a magic layer. This would apply a negative index to a TileType bitmask and crash the program. Also: Changed the style and colormap slightly to make the via2 and via4 styles more visible.
This commit is contained in:
parent
4348c11f10
commit
5693729ad5
|
|
@ -686,7 +686,7 @@ DefReadPins(f, rootDef, sname, oscale, total)
|
||||||
{
|
{
|
||||||
char *token;
|
char *token;
|
||||||
char pinname[LEF_LINE_MAX];
|
char pinname[LEF_LINE_MAX];
|
||||||
int keyword, subkey, values;
|
int keyword, subkey, values, flags;
|
||||||
int processed = 0;
|
int processed = 0;
|
||||||
int pinDir = PORT_CLASS_DEFAULT;
|
int pinDir = PORT_CLASS_DEFAULT;
|
||||||
int pinNum = 0;
|
int pinNum = 0;
|
||||||
|
|
@ -805,10 +805,18 @@ DefReadPins(f, rootDef, sname, oscale, total)
|
||||||
currect = LefReadRect(f, curlayer, oscale);
|
currect = LefReadRect(f, curlayer, oscale);
|
||||||
if (pending)
|
if (pending)
|
||||||
{
|
{
|
||||||
|
flags = PORT_DIR_MASK;
|
||||||
|
/* If layer was unknown, set to space and force */
|
||||||
|
/* non-sticky. */
|
||||||
|
if (curlayer < 0)
|
||||||
|
curlayer = TT_SPACE;
|
||||||
|
else
|
||||||
|
flags |= LABEL_STICKY;
|
||||||
|
|
||||||
GeoTransRect(&t, currect, &topRect);
|
GeoTransRect(&t, currect, &topRect);
|
||||||
DBPaint(rootDef, &topRect, curlayer);
|
DBPaint(rootDef, &topRect, curlayer);
|
||||||
DBPutLabel(rootDef, &topRect, -1, pinname, curlayer,
|
DBPutLabel(rootDef, &topRect, -1, pinname, curlayer,
|
||||||
pinNum | pinDir | PORT_DIR_MASK | LABEL_STICKY);
|
pinNum | pinDir | flags);
|
||||||
pending = FALSE;
|
pending = FALSE;
|
||||||
pinNum++;
|
pinNum++;
|
||||||
}
|
}
|
||||||
|
|
@ -820,10 +828,18 @@ DefReadPins(f, rootDef, sname, oscale, total)
|
||||||
pending = TRUE;
|
pending = TRUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
flags = PORT_DIR_MASK;
|
||||||
|
/* If layer was unknown, set to space and force */
|
||||||
|
/* non-sticky. */
|
||||||
|
if (curlayer < 0)
|
||||||
|
curlayer = TT_SPACE;
|
||||||
|
else
|
||||||
|
flags |= LABEL_STICKY;
|
||||||
|
|
||||||
GeoTransRect(&t, currect, &topRect);
|
GeoTransRect(&t, currect, &topRect);
|
||||||
DBPaint(rootDef, &topRect, curlayer);
|
DBPaint(rootDef, &topRect, curlayer);
|
||||||
DBPutLabel(rootDef, &topRect, -1, pinname, curlayer,
|
DBPutLabel(rootDef, &topRect, -1, pinname, curlayer,
|
||||||
pinNum | pinDir | PORT_DIR_MASK | LABEL_STICKY);
|
pinNum | pinDir | flags);
|
||||||
pinNum++;
|
pinNum++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1748,6 +1748,7 @@ enum lef_layer_keys {LEF_LAYER_TYPE=0, LEF_LAYER_WIDTH,
|
||||||
LEF_LAYER_WIREEXT,
|
LEF_LAYER_WIREEXT,
|
||||||
LEF_LAYER_RES, LEF_LAYER_CAP, LEF_LAYER_EDGECAP,
|
LEF_LAYER_RES, LEF_LAYER_CAP, LEF_LAYER_EDGECAP,
|
||||||
LEF_LAYER_THICKNESS, LEF_LAYER_HEIGHT,
|
LEF_LAYER_THICKNESS, LEF_LAYER_HEIGHT,
|
||||||
|
LEF_LAYER_PROPERTY, LEF_LAYER_ACDENSITY, LEF_LAYER_DCDENSITY,
|
||||||
LEF_LAYER_MINDENSITY, LEF_LAYER_ANTENNADIFF,
|
LEF_LAYER_MINDENSITY, LEF_LAYER_ANTENNADIFF,
|
||||||
LEF_LAYER_ANTENNAAREA, LEF_LAYER_ANTENNASIDE,
|
LEF_LAYER_ANTENNAAREA, LEF_LAYER_ANTENNASIDE,
|
||||||
LEF_VIA_DEFAULT, LEF_VIA_LAYER, LEF_VIA_RECT,
|
LEF_VIA_DEFAULT, LEF_VIA_LAYER, LEF_VIA_RECT,
|
||||||
|
|
@ -1794,6 +1795,9 @@ LefReadLayerSection(f, lname, mode, lefl)
|
||||||
"EDGECAPACITANCE",
|
"EDGECAPACITANCE",
|
||||||
"THICKNESS",
|
"THICKNESS",
|
||||||
"HEIGHT",
|
"HEIGHT",
|
||||||
|
"PROPERTY",
|
||||||
|
"ACCURRENTDENSITY",
|
||||||
|
"DCCURRENTDENSITY",
|
||||||
"MINIMUMDENSITY",
|
"MINIMUMDENSITY",
|
||||||
"ANTENNAAREARATIO",
|
"ANTENNAAREARATIO",
|
||||||
"ANTENNADIFFAREARATIO",
|
"ANTENNADIFFAREARATIO",
|
||||||
|
|
@ -1872,6 +1876,30 @@ LefReadLayerSection(f, lname, mode, lefl)
|
||||||
lefl->info.route.spacing = (int)roundf(fvalue / oscale);
|
lefl->info.route.spacing = (int)roundf(fvalue / oscale);
|
||||||
LefEndStatement(f);
|
LefEndStatement(f);
|
||||||
break;
|
break;
|
||||||
|
case LEF_LAYER_PROPERTY:
|
||||||
|
/* Ignoring property statements */
|
||||||
|
LefEndStatement(f);
|
||||||
|
break;
|
||||||
|
case LEF_LAYER_ACDENSITY:
|
||||||
|
/* Stupid syntax */
|
||||||
|
token = LefNextToken(f, TRUE); /* value type */
|
||||||
|
token = LefNextToken(f, TRUE); /* value, FREQUENCY */
|
||||||
|
if (!strcmp(token, "FREQUENCY")) {
|
||||||
|
LefEndStatement(f);
|
||||||
|
token = LefNextToken(f, TRUE);
|
||||||
|
if (!strcmp(token, "WIDTH")) /* Optional width */
|
||||||
|
LefEndStatement(f); /* Additional TABLEENTRIES */
|
||||||
|
}
|
||||||
|
LefEndStatement(f);
|
||||||
|
break;
|
||||||
|
case LEF_LAYER_DCDENSITY:
|
||||||
|
/* Stupid syntax */
|
||||||
|
token = LefNextToken(f, TRUE); /* value type */
|
||||||
|
token = LefNextToken(f, TRUE); /* value, WIDTH */
|
||||||
|
if (!strcmp(token, "WIDTH"))
|
||||||
|
LefEndStatement(f); /* Additional TABLEENTRIES */
|
||||||
|
LefEndStatement(f);
|
||||||
|
break;
|
||||||
case LEF_LAYER_SPACINGTABLE:
|
case LEF_LAYER_SPACINGTABLE:
|
||||||
/* To do: Handle spacing tables */
|
/* To do: Handle spacing tables */
|
||||||
LefEndStatement(f);
|
LefEndStatement(f);
|
||||||
|
|
|
||||||
|
|
@ -186,8 +186,8 @@ layout_styles
|
||||||
51 92 53 0x00 stipple 8 - metal3tight
|
51 92 53 0x00 stipple 8 - metal3tight
|
||||||
91 63 53 0x00 stipple 1 - obsmetal3
|
91 63 53 0x00 stipple 1 - obsmetal3
|
||||||
37 92 46 0xff stipple 19 - via2
|
37 92 46 0xff stipple 19 - via2
|
||||||
56 120 53 0xff stipple 36 - via2arrow
|
56 120 46 0xff stipple 36 - via2arrow
|
||||||
82 120 53 0xff stipple 2 - via2alt
|
82 120 46 0xff stipple 2 - via2alt
|
||||||
23 80 33 0x00 solid 0 - metal4
|
23 80 33 0x00 solid 0 - metal4
|
||||||
92 63 33 0x00 stipple 1 - obsmetal4
|
92 63 33 0x00 stipple 1 - obsmetal4
|
||||||
38 92 38 0xff stipple 24 - via3
|
38 92 38 0xff stipple 24 - via3
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
210 0 155 38 dark_red
|
210 0 155 38 dark_red
|
||||||
165 216 175 39 pale_green
|
165 216 175 39 pale_green
|
||||||
124 191 148 40 medium_green
|
124 191 148 40 medium_green
|
||||||
0 181 0 41 dark_green
|
0 141 0 41 dark_green
|
||||||
170 202 242 42 light_blue
|
170 202 242 42 light_blue
|
||||||
100 150 250 43 bright_blue
|
100 150 250 43 bright_blue
|
||||||
40 169 166 44 teal_blue
|
40 169 166 44 teal_blue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue