Merge branch 'master' into magic-8.2
This commit is contained in:
commit
140fd5cf5a
|
|
@ -84,10 +84,11 @@ char *defGetType(); /* Forward declaration */
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
defWriteHeader(def, f, oscale)
|
defWriteHeader(def, f, oscale, units)
|
||||||
CellDef *def; /* Def for which to generate DEF output */
|
CellDef *def; /* Def for which to generate DEF output */
|
||||||
FILE *f; /* Output to this file */
|
FILE *f; /* Output to this file */
|
||||||
float oscale;
|
float oscale;
|
||||||
|
int units; /* Units for UNITS; could be derived from oscale */
|
||||||
{
|
{
|
||||||
TileType type;
|
TileType type;
|
||||||
|
|
||||||
|
|
@ -113,10 +114,10 @@ defWriteHeader(def, f, oscale)
|
||||||
/* technology). */
|
/* technology). */
|
||||||
fprintf(f, " TECHNOLOGY %s ;\n", DBTechName);
|
fprintf(f, " TECHNOLOGY %s ;\n", DBTechName);
|
||||||
|
|
||||||
/* As I understand it, this refers to the scalefactor of the GDS */
|
/* The DEF scalefactor (conversion to microns) is always 1000 */
|
||||||
/* file output. Magic does all GDS in nanometers, so the LEF */
|
/* (nanometers) unless overridden on the command line. */
|
||||||
/* scalefactor (conversion to microns) is always 1000. */
|
|
||||||
fprintf(f, " UNITS DISTANCE MICRONS 1000 ;\n");
|
fprintf(f, " UNITS DISTANCE MICRONS %d ;\n", units);
|
||||||
|
|
||||||
/* Die area, taken from the cell def bounding box. */
|
/* Die area, taken from the cell def bounding box. */
|
||||||
fprintf(f, " DIEAREA ( %.10g %.10g ) ( %.10g %.10g ) ;\n",
|
fprintf(f, " DIEAREA ( %.10g %.10g ) ( %.10g %.10g ) ;\n",
|
||||||
|
|
@ -1864,10 +1865,10 @@ defMakeInverseLayerMap()
|
||||||
TileType i;
|
TileType i;
|
||||||
char *lefname;
|
char *lefname;
|
||||||
|
|
||||||
lefMagicToLefLayer = (LefMapping *)mallocMagic(DBNumUserLayers
|
lefMagicToLefLayer = (LefMapping *)mallocMagic(DBNumTypes
|
||||||
* sizeof(LefMapping));
|
* sizeof(LefMapping));
|
||||||
memset(lefMagicToLefLayer, 0, sizeof(LefMapping) * TT_TECHDEPBASE);
|
memset(lefMagicToLefLayer, 0, sizeof(LefMapping) * TT_TECHDEPBASE);
|
||||||
for (i = TT_TECHDEPBASE; i < DBNumUserLayers; i++)
|
for (i = TT_TECHDEPBASE; i < DBNumTypes; i++)
|
||||||
{
|
{
|
||||||
lefname = defGetType(i, &lefl);
|
lefname = defGetType(i, &lefl);
|
||||||
lefMagicToLefLayer[i].lefName = lefname;
|
lefMagicToLefLayer[i].lefName = lefname;
|
||||||
|
|
@ -1916,23 +1917,28 @@ defMakeInverseLayerMap()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
DefWriteCell(def, outName, allSpecial)
|
DefWriteCell(def, outName, allSpecial, units)
|
||||||
CellDef *def; /* Cell being written */
|
CellDef *def; /* Cell being written */
|
||||||
char *outName; /* Name of output file, or NULL. */
|
char *outName; /* Name of output file, or NULL. */
|
||||||
bool allSpecial; /* Treat all nets as SPECIALNETS? */
|
bool allSpecial; /* Treat all nets as SPECIALNETS? */
|
||||||
|
int units; /* Force units to this value (default 1000) */
|
||||||
{
|
{
|
||||||
char *filename;
|
char *filename;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
NetCount nets;
|
NetCount nets;
|
||||||
int total;
|
int total;
|
||||||
float scale = CIFGetOutputScale(1); /* Note that "1" here corresponds
|
float scale;
|
||||||
* to "1000" in the header UNITS line
|
|
||||||
*/
|
|
||||||
LefMapping *lefMagicToLefLayer;
|
LefMapping *lefMagicToLefLayer;
|
||||||
int i;
|
int i;
|
||||||
lefLayer *lefl;
|
lefLayer *lefl;
|
||||||
HashEntry *he;
|
HashEntry *he;
|
||||||
|
|
||||||
|
/* Note that "1" corresponds to "1000" in the header UNITS line, */
|
||||||
|
/* or units of nanometers. 10 = centimicrons, 1000 = microns. */
|
||||||
|
|
||||||
|
scale = CIFGetOutputScale(1000 / units);
|
||||||
|
|
||||||
f = lefFileOpen(def, outName, ".def", "w", &filename);
|
f = lefFileOpen(def, outName, ".def", "w", &filename);
|
||||||
|
|
||||||
TxPrintf("Generating DEF output %s for cell %s:\n", filename, def->cd_name);
|
TxPrintf("Generating DEF output %s for cell %s:\n", filename, def->cd_name);
|
||||||
|
|
@ -1949,7 +1955,7 @@ DefWriteCell(def, outName, allSpecial)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
defWriteHeader(def, f, scale);
|
defWriteHeader(def, f, scale, units);
|
||||||
|
|
||||||
lefMagicToLefLayer = defMakeInverseLayerMap();
|
lefMagicToLefLayer = defMakeInverseLayerMap();
|
||||||
|
|
||||||
|
|
|
||||||
23
lef/lefCmd.c
23
lef/lefCmd.c
|
|
@ -61,7 +61,7 @@ CmdLef(w, cmd)
|
||||||
MagWindow *w;
|
MagWindow *w;
|
||||||
TxCommand *cmd;
|
TxCommand *cmd;
|
||||||
{
|
{
|
||||||
int option, i, cargs;
|
int option, i, cargs, units = 1000; /* Default nanometers */
|
||||||
char **msg, *namep;
|
char **msg, *namep;
|
||||||
CellUse *selectedUse;
|
CellUse *selectedUse;
|
||||||
CellDef *selectedDef;
|
CellDef *selectedDef;
|
||||||
|
|
@ -219,6 +219,25 @@ CmdLef(w, cmd)
|
||||||
else
|
else
|
||||||
TxPrintf("The \"-hide\" option is only for lef write\n");
|
TxPrintf("The \"-hide\" option is only for lef write\n");
|
||||||
}
|
}
|
||||||
|
else if (!strncmp(cmd->tx_argv[i], "-units", 5))
|
||||||
|
{
|
||||||
|
if (is_lef)
|
||||||
|
TxPrintf("The \"-units\" option is only for def write\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
cargs--;
|
||||||
|
if ((cmd->tx_argc < i) || (!StrIsInt(cmd->tx_argv[i])))
|
||||||
|
{
|
||||||
|
TxPrintf("The \"-units\" option requires an argument.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
units = atoi(cmd->tx_argv[i]);
|
||||||
|
// To do: Check range of units
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else goto wrongNumArgs;
|
else goto wrongNumArgs;
|
||||||
cargs--;
|
cargs--;
|
||||||
}
|
}
|
||||||
|
|
@ -236,7 +255,7 @@ CmdLef(w, cmd)
|
||||||
else
|
else
|
||||||
namep = cmd->tx_argv[2];
|
namep = cmd->tx_argv[2];
|
||||||
if (!is_lef)
|
if (!is_lef)
|
||||||
DefWriteCell(selectedUse->cu_def, namep, allSpecial);
|
DefWriteCell(selectedUse->cu_def, namep, allSpecial, units);
|
||||||
else
|
else
|
||||||
LefWriteCell(selectedUse->cu_def, namep, selectedUse->cu_def
|
LefWriteCell(selectedUse->cu_def, namep, selectedUse->cu_def
|
||||||
== EditRootDef, lefTech, lefHide);
|
== EditRootDef, lefTech, lefHide);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue