»»»Home «««
»»»TELL «««
»»»Toped «««
»»»Ifaces «««
|
Table of Contents 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.
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 rest of the list members should be trivial. 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.
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 replace an existing 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. A TDT database is created only if it is not already existing.
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. 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.
Convert TDT database to GDSII - The function translates the active layout database or part of it into GDSII format.
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 gds_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. Extracts a cell hierarchy from a GDSII file - The function is capable of creating a new GDSII file from an existing one without a conversion to TDT. It can be used to extract cell sub-hierarchies from a large stream file. The contents of the cells in the new file is direct binary copy of the original. Toped neither changes nor checks the data, nevertheless the input file should be a valid GDSII file so that it can be properly parsed.
A GDSII file should’ve been be parsed by gdsread before using this function. Example 6. gdssplit gdsread("/home/guest_user/layout/new_design.sf"); gdssplit("bgap", "/home/guest_user/layout/new_design_bgap.sf", true); 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.
This function always takes into account the layers used in the entire hierarchy of structures, starting from struct_name. 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.
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 8. getgdslaymap lmap list gdsExportMap = getgdslaymap(false); gdsexport(gdsExportMap, "all_design.gds", false); 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
Example 9. setgdslaymap lmap list gdsDefaultMap = {{2,"2;0"},{4,"4;0"},{60,"60;40"}}; setgdslaymap(gdsDefaultMap); Clean-up the memory from the layer map stored by setgdslaymap. After executing cleargdslaymap, getgdslaymap will return the default layer map.
|