diff --git a/doc/html/property.html b/doc/html/property.html index 19ffd4bb..b496be23 100644 --- a/doc/html/property.html +++ b/doc/html/property.html @@ -35,10 +35,10 @@ Attach a "property" (string key and value pair) to the edit cell
The property command implements a general-purpose method of attaching information to a cell definition. Except for a - few properties known to the lef and gds commands - (q.v.), properties have no inherent meaning to magic but may be - used with other programs or scripts to add additional information - about a cell definition.++ few properties known to the lef, extract, and + gds commands (q.v.), properties have no inherent meaning + to magic but may be used with other programs or scripts to add + additional information about a cell definition.
With no arguments, all properties of the current edit cell are listed. With only the key argument, the value associated @@ -48,6 +48,87 @@ Attach a "property" (string key and value pair) to the edit cell its original value will be overwritten.
+ Property names reserved by and used by magic: +++
+- GDS_FILE +
- The value is the name of a GDS file which contains the mask + data for the cell. The cell is then effectively an abstract + view, because its contents are in the GDS file and do not + necessarily match what is displayed (although they might). +
- GDS_START +
- If a GDS_FILE is defined, then this value indicates the + byte position of the start of mask data for this cell definition + in the file. If set to value 0, then the file will be + searched for the data bounds. +
- GDS_END +
- If a GDS_FILE is defined, then this value indicates the + byte position of the end of mask data for this cell definition + in the file. If GDS_START is set to 0, then this + property may be omitted. +
- LEFview +
- If set to TRUE, this cell is an abstract view such as that + obtained from a LEF macro, and should not be used for extraction + or for writing mask data (unless GDS_FILE is defined). +
- LEFproperties +
- If the file was read from a LEF macro, then this property corresponds + to the LEF PROPERTY block values. All values from the block + are contatenated into the single property string. +
- LEFsymmetry +
- If the file was read from a LEF macro, then this property corresponds + to the macro's SYMMETRY value. +
- LEFclass +
- If the file was read from a LEF macro, then this property corresponds + to the macro's CLASS value. +
- LEFsite +
- If the file was read from a LEF macro, then this property corresponds + to the macro's SITE value. +
- FIXED_BBOX +
- This property value is a space-separated list of four integer values + corresponding to the abutment box of the cell, in magic's internal + units. The abutment box is automatically read from LEF files, but + may be defined for any file and can be used for placement alignment. +
- device +
- This property declares that the cell is a device or contains a + single device that is not a known extractable device defined in + the technology file. In the first case, the device to be extracted + is a subcircuit and the name of the device is the same as the name + of the cell. In this case, the property value should begin with + "primitive". This may be followed by any parameters + associated with the device that need to be output in the netlist; + e.g., "primitive nf=4. When the cell is recast as a + primitive device, it is necessary for the port order in the cell + to match the port order of the device as it must appear in the + output netlist. In the second case, the device to be extracted + is either a low-level component type (not a subcircuit), or is a + subcircuit with a different name than the cell. In that case, the + value string should be the text of the line as it should appear + in a "device" line in the output .ext file when the + cell is extracted. That includes the names of all ports and any + parameters to be output. As the output device is defined inside + the subcircuit of the cell in which it is defined, the ports may + be reordered between the subcircuit and the instantiation of the + device. The use of either form of the device property + precludes the generation of parasitics associated with the cell. + All parasitics are assumed to be included in the device model. +
- parameter +
- If, when an instance of the cell's subcircuit is generated in the + output netlist, the instance should be passed one or more + parameters, then those parameter key=value + pairs (as a single, space-separated string) should be defined as + the value to the parameter property. +
- MASKHINTS_type +
- The value is a string of consecutive sets of four integer values, + each set representing the bounding box of a rectangle defining + the area of CIF type type, in magic's internal units. + This indicates that magic will + always generate mask layer type in the specified rectangle + area when writing GDS or CIF output. type may be a templayer, + such that type could be defined as the absence of a mask layer, + for example. +
property is implemented as a built-in command in magic. diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index 5bfae6f9..863d95cf 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -445,7 +445,8 @@ subcktHierVisit(use, hierName, is_top) /* Same considerations as at line 1831 for determining if the cell */ /* has been folded into the parent and should not be output. */ - isStub = ((def->def_flags & DEF_ABSTRACT) && esDoBlackBox) ? TRUE : FALSE; + isStub = ((def->def_flags & (DEF_ABSTRACT | DEF_PRIMITIVE)) && esDoBlackBox) ? + TRUE : FALSE; if ((!is_top) && (def->def_flags & DEF_NODEVICES) && (!isStub)) return 0; @@ -1922,6 +1923,9 @@ esHierVisit(hc, cdata) topdef = dfd->def; flags = dfd->flags; + /* Cells which are marked as "primitive" get no output at all */ + if (def->def_flags & DEF_PRIMITIVE) return 0; + /* Cells without any contents (devices or subcircuits) will */ /* be absorbed into their parents. Use this opportunity to */ /* remove all ports. */ diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index c65663f5..6ca1b9c6 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -1779,6 +1779,9 @@ topVisit(def, doStub) char **sorted_ports; linkedNodeName *lnn = NULL; + /* Primitive devices are not output at all */ + if (def->def_flags & DEF_PRIMITIVE) return; + HashInit(&portNameTable, 32, HT_STRINGKEYS); /* SPICE subcircuit names must begin with A-Z. This will also be */ diff --git a/extflat/EFflat.c b/extflat/EFflat.c index 763c1aaf..1f2f82d5 100644 --- a/extflat/EFflat.c +++ b/extflat/EFflat.c @@ -407,11 +407,11 @@ efFlatNodesDeviceless(hc, cdata) /* If this definition has no devices but has ports, then it is treated */ /* as a black-box device, so don't decrement the use count of the */ - /* parent. Alternately, devices flagged "abstract" are automatically */ - /* treated as black-box devices. */ + /* parent. Alternately, devices flagged "abstract" or "primitive" are */ + /* automatically treated as black-box devices. */ if (!(hc->hc_use->use_def->def_flags & DEF_SUBCIRCUIT)) - if (!(hc->hc_use->use_def->def_flags & DEF_ABSTRACT)) + if (!(hc->hc_use->use_def->def_flags & (DEF_ABSTRACT | DEF_PRIMITIVE))) (*usecount)--; } return (0); diff --git a/extflat/EFint.h b/extflat/EFint.h index 0ce71180..506818cb 100644 --- a/extflat/EFint.h +++ b/extflat/EFint.h @@ -179,6 +179,7 @@ typedef struct def #define DEF_NODEVICES 0x08 /* This def contains no devices */ #define DEF_SUBSNODES 0x10 /* This def contains implicit substrate nodes */ #define DEF_ABSTRACT 0x20 /* This def is an abstract view (e.g., LEF) */ +#define DEF_PRIMITIVE 0x40 /* This def is a primitive device */ /* * Every Def has a NULL-terminated list of uses that correspond diff --git a/extflat/EFread.c b/extflat/EFread.c index 7349c1bb..212a21ef 100644 --- a/extflat/EFread.c +++ b/extflat/EFread.c @@ -55,8 +55,8 @@ char *extDevTable[] = {"fet", "mosfet", "asymmetric", "bjt", "devres", typedef enum { ABSTRACT, ADJUST, ATTR, CAP, DEVICE, DIST, EQUIV, FET, KILLNODE, MERGE, - NODE, PARAMETERS, PORT, RESISTOR, RESISTCLASS, RNODE, SCALE, SUBCAP, - SUBSTRATE, TECH, TIMESTAMP, USE, VERSION, EXT_STYLE + NODE, PARAMETERS, PORT, PRIMITIVE, RESISTOR, RESISTCLASS, RNODE, SCALE, + SUBCAP, SUBSTRATE, TECH, TIMESTAMP, USE, VERSION, EXT_STYLE } Key; static struct @@ -80,6 +80,7 @@ keyTable[] = "node", NODE, 7, "parameters", PARAMETERS, 3, "port", PORT, 8, + "primitive", PRIMITIVE, 0, /* defines a primitive device */ "resist", RESISTOR, 4, "resistclasses", RESISTCLASS, 1, "rnode", RNODE, 5, @@ -595,6 +596,11 @@ resistChanged: def->def_flags |= DEF_ABSTRACT; break; + /* primitive (no arguments) */ + case PRIMITIVE: + def->def_flags |= DEF_PRIMITIVE; + break; + /* To-do: compare timestamp against the cell */ case TIMESTAMP: break; diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index 5d3f00f5..532d6e6a 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -303,10 +303,6 @@ extBasic(def, outFile) extRelocateSubstrateCoupling(&extCoupleHash, glob_subsnode); } - /* Output device parameters for any subcircuit devices */ - if (!SigInterruptPending) - extOutputParameters(def, transList, outFile); - /* Check for "device", as it modifies handling of parasitics */ propptr = (char *)DBPropGet(def, "device", &propfound); if (propfound) @@ -318,6 +314,19 @@ extBasic(def, outFile) tnode->nreg_cap = (CapValue)0.0; tnode->nreg_resist = (ResValue)0; } + + /* If the device name is "primitive", then parameters */ + /* are output here. */ + + if (!strncmp(propptr, "primitive ", 10)) + fprintf(outFile, "parameters :%s %s\n", def->cd_name, propptr + 10); + } + + else + { + /* Output device parameters for any subcircuit devices */ + if (!SigInterruptPending) + extOutputParameters(def, transList, outFile); } if (isabstract) fprintf(outFile, "abstract\n"); @@ -342,12 +351,21 @@ extBasic(def, outFile) subsnode = NULL; propvalue = NULL; - if (propfound) + /* Special case of device "primitive": The subcircuit has the */ + /* name of a primitive device model and should be extracted as */ + /* the same. The property string may contain parameters to */ + /* pass to the subcircuit. */ + + if (propfound && (!strncmp(propptr, "primitive", 9))) + fprintf(outFile, "primitive\n"); + + else if (propfound) { /* Sanity checking on syntax of property line, plus */ /* conversion of values to internal units. */ propvalue = StrDup((char **)NULL, propptr); token = strtok(propvalue, " "); + devidx = Lookup(token, extDevTable); if (devidx < 0) {