#

## flatten

Flatten edit cell into the indicated destination cell.

### Usage:

> flatten [option] cellname

> > where cellname is the name of a cell definition to be created, and into which the flattened geometry will be placed. option may be one of -nolabels, -nosubcircuits, or -noports, -novendor, -dotoplabels, and -dobox.

### Summary:

> The flatten command creates a new cell with the indicated name, then flattens the hierarchy of the current edit cell and copies the result into the new cell.

> The options allow selective flattening, as follows:

> -nolabels
>   Prevents magic from copying labels into the flattened cell. Otherwise, magic flattens labels by prepending the cell hierarchy to each label as it copies it into the flat cell.
> -nosubcircuits
>   Prevents magic from flattening cells declared to be subcircuits (by the presence of ports in the cell). These cells are retained as subcells in the flattened version.
> -noports
>   Removes port information from labels when flattening, so that the flattened view will have only labels and not ports.
> -novendor
>   Prevents magic from flattening cells that are vendor cells, that is, cells that are generated by reading GDS using the gds readonly option, or which have the appropriate property values set.
> -dotoplabels
>   This option tells magic to preserve in the flattened view only the labels that are in the top level cell. Labels in subcells will be ignored.
> -dobox
>   When this option is specified, magic flattens only the area of the circuit that is inside the boundary of the cursor box.
> Note that cellname is a top-level cell but is not displayed or saved subsequent to the flatten command. The usual procedure is to follow the command "flatten cellname" with "load cellname", to view the new flattened layout.

> The target cell cellname must not already exist in the database except when using the -dobox option. With -dobox, using the same target cellname allows a layout to be flattened in pieces.

### Implementation Notes:

> flatten is implemented as a built-in command in magic.

Return to command index

Last updated: June 23, 2021 at 5:48pm