»»»Home «««
Framework
Screenshots
FAQ
»»»TELL «««
Types
Operators
Functions
Example
»»»Toped «««
Database
Cells
Add
Select
Edit
View
Interfaces
Miscellaneous

Toped interfaces

This chapter describes interfaces to popular IC layout formats available in Toped. All conversions follow the template described below.

Import
External formats are imported in two stages. First comes the file parsing. After the parsing the user can browse the data base hierarchy and obtain basic information about the database contents. The conversion comes next and the user can select to translate only part of the database. Layer correspondence between the TDT and the external database is normally required at this stage.
[Note]Note

Two-step import process allows also to map cell (structure) names between the TDT and the external data base. This functionality is not yet fully implemented for all intefaces.

Export
The exporting process is a bit simpler and executes in a single step. TDT database can be exported as a whole or partially. Layer maps are normally also required.

GDS II

The stream format is a binary file format representing planar geometric shapes, text labels, and other information about the layout in hierarchical form. It is still an industry standard for transferring the layout data between different tools. The structure of the TDT data base is similar to the structure of the stream format, that's why the conversion to/from GDSII is the most natural of all toped interfaces.

Despite the fact that GDS II has been around for more than 30 years (or maybe just because of this), it appears that most of the tools are maintaining a subset of the format. Toped also doesn't maintain the full GDSII specification at least because some of the data fields are tape specific. A description of the GDS records maintained by Toped converters can be found on the wiki page. GDS records that are not maintained will be ignored and a warning will be issued in the log window during the parsing phase.

GDS Layer Maps
The layer maps are presented in a form of lmap lists. They can be saved in a TELL variable and reused for import/export. The idea is that the user can interface with different technologies without redefining its toped layers. Each member of the GDS layer map is in the format described below. The format allows several GDS layers to be converted to a single TDT layer. The same is valid for GDS data types. The Toped data base doesn't maintain the data type concept of GDSII. Instead it has practically unlimited number of layers. Using the layer map each GDS layer / data_type pair can be mapped to a separate TDT layer and vice versa.
[Tip]{tdt_lay, "gds_layers : gds_data_types"}
int tdt_lay
This is the key field of the lmap structure which contains the TDT layer number. That TDT layer will be the target layer for import operations and source layer during the export.

The value field consists of two parts separated by mandatory colon.

gds_layers
This string contains one or more GDS layers in quick list format.
gds_data_types
This string contains one or more GDS data/text/box types in quick list format.

Example 1. gds layer map

   lmap list gds_layer_definition = {{ 1, " 1; *"   }, { 2, " 2; 0"},
                                     { 3, " 3;20, 0"}, { 4, " 4; 0"},
                                     { 5, " 5; 0"   }, { 6, " 6; 0"},
                                     { 7, " 7; 0"   }, { 8, " 8; 0"},
                                     { 9, " 9; 0"   }, {10, "10; 0"},
                                     {60, "60;20"   }, {62, "60;40"} };

  • the * in the data type field of layer 1 will force all GDSII data types to be imported to a single TDT layer. On export the * will be simply replaced by 0
  • A similar rule is valid for the layer 3. On import both GDSII data types 0 and 20 will be converted to TDT layer 3. On export only the first data type will be taken into account and all data on layer 3 will be converted to GDSII data type 20 in layer 3.

The rest of the list members should be trivial.

gdsread

Parse a GDSII file - this is the first step of the two-step process of GDSII conversion. When executed this function parses the GDSII file into memory checking it for validity, hierarchy structure and used layers. The function returns a list of strings containing the names of the top-level structures in the parsed file. To convert GDSII structure into TDT, use gdsimport. When done, call gdsclose to free the memory occupied by this operation. Only one GDS DB can reside in memory at a time. gdsread will automatically remove the previous GDS database (if any) from the memory.

[Tip]string list gdsread(file_name)
string file_name
A valid file name - platform dependent. OS environmental variables may be used.

Example 2. gdsread

   string list top_s = gdsread("/home/guest_user/layout/new_design.sf");

top

gdsimport

Convert GDSII structure to TDT cell - this is the second step of the GDSII import process. Function requires that a GDSII file has been already parsed into the memory using gdsread. It transfers the data from the stream format to the appropriate TDT types. It is important to note that this function does not create a new TDT database. Instead it simply adds new cells to the TDT. This is supposed to facilitate the work of transferring layout blocks from design to design.

[Warning]Warning

These functions were modified in rev.0.92

[Tip]gdsimport …

void gdsimport (top_structures, layer_map, recursive, overwrite)

void gdsimport (top_structure, layer_map ,recursive, overwrite)

string list top_structures
A list of names of the top GDSII structures to be imported.
string list top_structure
The name of the top GDSII structure to be imported.
lmap list layer_map
The layer map to be used during the conversion.
bool recursive
Defines recursive behavior of the function. If true, the function will convert all the structures referenced directly or indirectly by the top structures. If false only the top structure will be converted.
bool overwrite
Defines the overwrite policy. If true - the cells created by the conversion will overwrite the TDT cell with the same name (if they exists). If false, the existing TDT cells will be preserved - i.e. GDSII cell will not be converted if a TDT cell with this name already exists.

Toped will import only the layers listed in the layer_map. The layers not listed there will be silently omited. The function getgdslaymap can be used to obtain the defualt layer map of the parsed GDS database.

Example 3. gdsimport

   gdsimport("top_structure", {{2,"2;*"},{4,"4;0"}}, true, false);
   gdsimport(gdsread("test_file.sf"), getgdslaymap(true), true, true);

In the first example above, current TDT layout database will be updated with the GDSII hierarchy starting with the cell named top_structure and only layers 2 and 4 with the corresponding data types will be converted. All existing TDT cells will be preserved.

The second example is demonstrating a quick way to get an external GDSII file imported into Toped.

top

gdsclose

Clean-up the memory from the GDSII data parsed with gdsread. After executing gdsclose, gdsimport can not be called until the next gdsread. It is important to use this function, when parsed GDSII database is no longer required.

[Tip]void gdsclose ()
-

Example 4. gdsclose

   gdsclose();

top

gdsexport

Convert TDT database to GDSII - The function translates the active layout database or part of it into GDSII format.

[Warning]Warning

These functions were modified in rev.0.92

[Tip]gdsexport …

void gdsexport (layer_map, filename_name, file_size)

void gdsexport (cell_name, recursive, layer_map, filename_name, file_size)

string cell_name
The name of the top TDT cell to be exported.
bool recursive
Defines recursive behavior of the function. If true, the function will convert all the structures referenced directly or indirectly by the top structure. If false only the top structure will be converted.
lmap list layer_map
The layer map to be used during the conversion.
string file_name
A valid file name - platform dependent. OS environmental variables may be used.
bool file_size
Originally GDSII is a tape format and its size use to be multiply to 2048 bytes. These days this is not a requirement, but some tools still flag an error if the file has an arbitrary size. It should be noted that other tools don't parse properly a GDSII file tagged with zeros at the end. Normally the value of this parameter should be false

Toped will export only the layers listed in the layer_map. The layers not listed there will be silently omited. The function getgdslaymap can be used to obtain the defualt layer map of the TDT data base.

In contrast with gdsimport TDT layer can be exported to exactly one GDS layer/data type pair. If the layer map contains GDS layer lists or GDS data type lists, they will be coerced to a single layer or data type respectively and a warning will be issued in the log window.

Example 5. gdsexport

   gdsexport({{2,"2;0"}, {4,"14;20"}}, "/home/user/layout/seed.sf", false);
   gdsexport("crop" , true, getgdslaymap(false), "seed_part.sf", false);

In the first example above, current TDT layout database will be exported, but only layers 2 and 4. In the second one, cell hierarchy starting with the cell named crop will be converted, including all referenced cells.

top

report_gdslayers

Prints the list of used layers in a GDS structure. The function can be used only if there is a GDS file parsed in the memory.

[Tip]layout report_gdslayers( struct_name )
string struct_name
Target structure name

This function always takes into account the layers used in the entire hierarchy of structures, starting from struct_name.

Example 6. report_gdslayers

   report_gdslayers("some_struct");

top

getgdslaymap

Returns TDT-GDS layer map suitable for use in the interface functions gdsimport and gdsexport. The function checks whether a layer map has been already saved in the memory (see setgdslaymap). It returns the saved map if it exists. If a map doesn't exists in memory - the function generates a default layer map.

[Tip]lmap list getgdslaymap( import )
bool import
Import and export functions might have different requirements for the layer map esspecially when Toped generates the default layer map. This parameter brings the information about the purpose of the generated map. It must be set to true if the generated map is going to be used in gdsimport and false if it will be used in gdsexport

If a default layer map can not be generated the function will issue an error on the log window. Depending on the input parameter this could be because a TDT ot GDS data base doesn't exists in the memory.

Example 7. getgdslaymap

   lmap list gdsExportMap = getgdslaymap(false);
   gdsexport(gdsExportMap, "all_design.gds", false);

top

setgdslaymap

Stores a TDT-GDS layer map as a Toped property. The map can be later retrieved using getgdslaymap and is also used as an initial layer map in the GDS import/export dialogue boxes. The map will be dumped along with other editor properties by propsave

[Tip]void setgdslaymap( layer_map )
lmap list layer_map
The layer map to be saved as a Toped property.

Example 8. setgdslaymap

   lmap list gdsDefaultMap = {{2,"2;0"},{4,"4;0"},{60,"60;40"}};
   setgdslaymap(gdsDefaultMap);

top

CIF

Caltech Intermediate form (CIF) is a low level graphics langage for specifying the geometry of integrated circuits. In contrast with GDS, the CIF is a text format exposed by nature to a different user interpretation and expansion. It appears that even the root format definitions are not quite followed by some of the major EDA vendors. Toped CIF interfaces are written to comply with CIF 2.0 definition as described in "A Guide to LSI implementation, Second Edition" by Robert W. Hon and Carlo H.Sequin. Toped is using also some of the CIF user expansions for which although "widely accepted" an authorithative reference was not found. See the wiki pages for more details on Toped CIF interface implementation.

[Note]Note

CIF interface might be updated in the future releases in case of compatibility problems with the major EDA vendors. Please do report incompatibilities.

CIF Layer Maps
The layer maps are presented in a form of lmap lists. They can be saved in a TELL variable and reused for import/export. The idea is that the user can interface with different technologies without redefining its toped layers. Each member of the CIF layer map is in the format described below. The format allows several CIF layers to merged into a single TDT layer.
[Tip]{tdt_lay, "cif_layer"}
int tdt_lay
This is the key field of the lmap structure which contains the TDT layer number. That TDT layer will be the target layer for import operations and source layer during the export.
string cif_layer
This string contains the CIF layer name according to the CIF 2.0 format description.

cifread

Parse a CIF file - this is the first step of the two-step process of CIF conversion. When executed this function parses the CIF file into memory checking it for validity, hierarchy structure and used layers. The function returns a list of strings containing the names of the top-level structures in the parsed file. To convert a CIF structure into TDT, use cifimport. When done, call cifclose to free the memory occupied by this operation. Only one CIF DB can reside in memory at a time. cifread will automatically remove the previous CIF database (if any) from the memory.

[Tip]string list cifread(file_name)
string file_name
A valid file name - platform dependent. OS environmental variables may be used.

Example 9. cifread

   string list top_s = cifread("/home/guest_user/layout/delivery.cif");

top

cifimport

Convert CIF structure to TDT cell - this is the second step of the CIF import process. Function requires that a CIF file has been already parsed into the memory using cifread. It transfers the data from CIF representation into the corresponding TDT types. It is important to note that this function does not create a new TDT database. Instead it simply adds new cells to the TDT. This is supposed to facilitate the work of transferring layout blocks from design to design.

[Tip]cifimport …

void cifimport (top_structures, layer_map, recursive, overwrite)

void cifimport (top_structure, layer_map ,recursive, overwrite)

string list top_structures
A list of names of the top CIF structures to be imported.
string list top_structure
The name of the top CIF structure to be imported.
lmap list layer_map
The layer map to be used during the conversion.
bool recursive
Defines recursive behavior of the function. If true, the function will convert all the structures referenced directly or indirectly by the top structures. If false only the top structure will be converted.
bool overwrite
Defines the overwrite policy. If true - the cells created by the conversion will overwrite the TDT cell with the same name (if they exists). If false, the existing TDT cells will be preserved - i.e. CIF cell will not be converted if a TDT cell with this name already exists.

Toped will import only the layers listed in the layer_map. The layers not listed there will be silently omited. The function getciflaymap can be used to obtain the defualt layer map of the parsed CIF database.

Example 10. cifimport

   cifimport("top", {{1,"L01"}, {3,"L03"}, {4,"POLY"}}, true, false);
   cifimport(cifread("test_file.cif"), defaultciflaymap(), true, false);

In the example above, current TDT layout database will be updated with the CIF hierarchy starting with the cell named top_structure. All existing TDT cells will be preserved. Only 3 layers form the CIF data base will be imported.

The second example will convert the entire test_file.cif using default CIF layer map

top

cifclose

Clean-up the memory from the CIF data parsed with cifread. After executing cifclose, cifimport can not be called until the next cifread. It is important to use this function, when parsed CIF database is no longer required.

[Tip]void cifclose ()
-

Example 11. cifclose

   cifclose();

top

cifexport

Convert TDT database to CIF - The function translates the active layout or part of it database into CIF format.

[Tip]cifexport …

void cifexport (layer_map, filename_name, verbose_slang)

void cifexport (cell_name, recursive, layer_map, filename_name, verbose_slang)

string cell_name
The name of the top TDT cell to be exported.
bool recursive
Defines recursive behavior of the function. If true, the function will convert all the structures referenced directly or indirectly by the top structure. If false only the top structure will be converted.
lmap list layer_map
The layer map to be used during the conversion.
string file_name
A valid file name - platform dependent. OS environmental variables may be used.
bool cif_slang
By definition CIF syntax is failry free and allows a wide variety of "slangs". Toped maintains two type of CIF output which should be equivalent. The verbose dialect might not accepted by all tools. The default value of this option should be false

Toped will export only the layers listed in the layer_map. The layers not listed there will be silently omited. The function getciflaymap can be used to obtain the defualt layer map of the TDT data base.

Example 12. cifexport

   cifexport({{2,"L2"}, {4,"L4"}}, "/home/user/layout/seed.cif", false);
   cifexport("crop" , true, getciflaymap(false), "seed_part.cif", false);

In the first example above, current TDT layout database will be exported, but only layers 2 and 4. In the second one, cell hierarchy starting with the cell named crop will be converted, including all referenced cells.

top

report_ciflayers

Prints the list of used layers in a CIF structure. The function can be used only if there is a CIF database in the memory.

[Tip]layout report_ciflayers( struct_name )
string struct_name
Target structure name

This function always takes into account the layers used in the entire hierarchy of structures, starting from struct_name.

Example 13. report_ciflayers

   report_ciflayers("some_struct");

top

getciflaymap

Returns TDT-CIF layer map suitable for use in the interface functions cifimport and cifexport. The function checks whether a layer map has been already saved in the memory (see setciflaymap). It returns the saved map if it exists. If a map doesn't exists in memory - the function generates a default layer map.

[Tip]lmap list getciflaymap( import )
bool import
Import and export functions might have different requirements for the layer map esspecially when Toped generates the default layer map. This parameter brings the information about the purpose of the generated map. It must be set to true if the generated map is going to be used in cifimport and false if it will be used in cifexport

If a default layer map can not be generated the function will issue an error on the log window. Depending on the input parameter this could be because a TDT ot CIF data base doesn't exists in the memory.

Example 14. getciflaymap

   lmap list cifExportMap = getciflaymap(false);
   cifexport(cifExportMap, "all_design.cif", false);

top

setciflaymap

Stores a TDT-CIF layer map as a Toped property. The map can be later retrieved using getciflaymap and is also used as an initial layer map in the CIF import/export dialogue boxes. The map will be dumped along with other editor properties by propsave

[Tip]void setciflaymap( layer_map )
lmap list layer_map
The layer map to be saved as a Toped property.

Example 15. setciflaymap

   lmap list cifDefaultMap = {{2,"ACTI"},{4,"POLY"},{60,"TEXT"}};
   setciflaymap(cifDefaultMap);

top