Search
»»»Home «««
Framework
Screenshots
FAQ
»»»TELL «««
Types
Operators
Functions
Example
»»»Toped «««
Database
Cells
Add
Select
Edit
Properties
Rendering
GUI
Miscellaneous
»»»Ifaces «««
GDSII
OASIS
CIF
DRC

Layout database and libraries

The layout database is the place where all graphical data is stored. Toped uses its own database format called TDT. It deals purely with graphical data.There is no electrical or setup information stored there. A TDT file can be loaded as a target database or as a library. TELL defines several internal functions to deal with TDT databases.

Toped libraries

The library in this context means layout blocks or IPs external to the current project which are supposed to be used "as is" and are not subject to change by any means. A typical example is a digital cell library delivered from the fab or other characterized standard cells used across multiply designs. Toped implements a concept of dynamically linked libraries.

  • Libraries are loaded always in read only mode.
  • Libraries can be loaded or unloaded "at will".
  • Toped handles multiple libraries simultaneously, but only one target database.
  • Library cells can be referenced from the target database as well as from other libraries.
  • Cell references and cell definitions are linked by name only. Toped searches the current database first for a cell definition. If the cell is not found, Toped searches the following libraries in order of loading.
  • The above principle is followed for both - target DB, and the libraries.
  • If two libraries contain a cell definition with the same name, only one of them will be linked. The one defined in the library loaded first.
  • If cell is not found, Toped indicates the cell reference as "undefined".
  • Undefined references can be treated in the same way as defined ones. They can be moved, deleted and even copied.
  • Every time a new library is loaded Toped relinks automatically the target database as well as all libraries that are already loaded.
  • The above is true also when a library is unloaded.

newdesign

Create a new empty design. This function defines the design name and more importantly the design data base units. By default the database is created with DBU = 1e-9 and UU = 1e-3. The above are the default GDSII units - (1 micron = 1000 DBU). Note that the value of the DBU defines indirectly the coordinate limits.

[Tip]newdesign …

void newdesign (design_name)

void newdesign (design_name, time_created)

void newdesign (design_name, DBU, UU)

void newdesign (design_name, DBU, UU, time_created)

string design_name
The name of the design to be created.
string time_created
The creation time stamp of the new database
real DBU
Data Base Unit - the size of one database unit in meters. Must be a positive number. The default value is 1 nm.
real UU
User Unit - a positive real number (typically less than one) which specifies the global precision of the database. All user input is in user units. The size of the UU in meters can be calculated as DBU/UU

The second and fourth overloaded functions are defined for recovery purposes - Toped always uses those forms in the log file. time_created parameter is used later when the database is saved.

[Warning]Warning

Use non-default DBU/UU settings with care esspecially when such a database is a source or target of any conversion to/from external formats.

Example 1. newdesign

   newdesign("toped_design");
   newdesign("scaled", 1e-10, 1e-4);

top

tdtread

Load a TDT file and create TDT database (design) into memory. Toped handles only one target database at a time, so current design will be closed if the operation is successful. The loaded design becomes current.

[Tip]tdtread …

void tdtread (file_name)

void tdtread (file_name, time_created, time_updated)

string file_name
A valid file name - platform dependent. OS environmental variables may be used. Compressed files are accepted as well - zip and gz formats.
string time_created
The creation time stamp of the database
string time_updated
Shows when the file was updated for the last time

The second overloaded function is used in the log files for recovery mode. It reads the database only if the time_created time stamp matches the corresponding time stamp in the TDT file. time_updated is important for a proper functionality of the recovery mode.

Example 2. tdtread

   tdtread("/$TPD_LOCAL/tdt/toped_design.tdt");
   tdtread("/home/guest_user/tpd_des.tdt",
      "20-01-2006 01:09:53","21-05-2006 22:22:54");

top

loadlib

Load a TDT file as a library, relink and update the database into memory. Toped handles multiple libraries, so already loaded libraries will not be unloaded.

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

Example 3. loadlib

   loadlib("$TPD_LOCAL/tdt/digital_lib.tdt");

top

unloadlib

Unload a library, relink and update the database into memory. The cells linked to this library will be relinked. If a cell definition doesn’t exists in the remaining libraries, the reference will be marked as "undefined"

[Tip]void unloadlib (lib_name)
string lib_name
A valid name of a library loded in the memory.

Example 4. unloadlib

   unloadlib("digital_lib");

top

tdtsave

Save the current design to the disk in TDT format overwriting (updating) already existing file. The current design in memory is not changed or altered.

[Tip]tdtsave …

void tdtsave()

void tdtsave(time_created, time_updated)

string time_created
The creation time stamp of the database
string time_updated
Shows when the file was updated for the last time

The second overloaded function is used in the log files for recovery mode. It implements conditional save. The command is executed only if the time_created time stamp matches the corresponding time stamp of the database (or the existing TDT file) and time_updated is newer than the corresponding one in the TDT file.

Example 5. tdtsave

   tdtsave();
   tdtsave("20-01-2006 01:09:53","22-05-2006 20:51:01");

top

tdtsaveas

Save the design under a new name to the disk in TDT format. File with this name should not exist. The current design in memory is not changed or altered.

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

Example 6. tdtsaveas

   tdtsaveas("/home/guest_user/layout/new_design.tdt");

top

psexport

Convert TDT database to PostScript - The function translates the active layout database or part of it into PS format that can be used for printing.

[Tip]void psexport (cell_name, file_name)
string cell_name
The name of the top TDT cell to be exported.
string file_name
A valid file name -platform dependent. OS environmental variables may be used

Example 7. psexport

   psexport("top", "/home/guest_user/layout/new_design.ps");

top

Substandard layout objects

The objects which failed the validation checks, but are considered recoverable are stored away from the layout database in the GRC DB (Graphical rules check database). The GRC objects can’t be edited by any means. They can’t be even selected together with the validated objects. The sole purpose of the GRC DB is to store those objects temporary until an equivalent but valid object is created in the layout database.

The group of functions described below work with GRC DB.

grcgetcells

Returns the list of cells of the active layout database which contain invalid layout objects.

[Tip]string list grcgetcells ()

-

See the example in grcgetdata.

top

grcgetlayers

Returns the list of layers in the current active cell which contain invalid layout objects.

[Tip]int list grcgetlayers()

-

See the example in grcgetdata.

top

grcgetdata

Returns the list of all GRC objects on a certain layer of the current active cell.

[Tip]auxdata list grcgetdata (layer)
int layer
The layer number to retrieve GRC objects from.

Example 8. grcgetdata

  foreach(string name; grcgetcells())
  {
    echo(name);
    opencell(name);
    foreach(int layer; grcgetlayers())
    {
      echo(layer);
      foreach(auxdata grcobject; grcgetdata(layer))
      {
        echo(grcobject);
      }
      grcrecoverdata(layer);
      // alternatively ...
      // grccleanlayer(layer);
    }
  }

top

grcrecoverdata

This function generates valid objects which are one to one layout equivalent of the GRC objects on certain layer of the current cell. The new objects are added to the corresponding layer of the active cell in the layout DB. As a side effect, the function also clears the recovered GRC objects.

[Tip]void grcrecoverdata (layer)
int layer
All GRC objects on this layer will be recovered and then removed.

See the example in grcgetdata.

top

grccleanlayer

Removes all GRC objects from a certain layer in the current active cell.

[Tip]void grccleanlayer (layer)
int layer
The layer number to remove all GRC objects from.

See the example in grcgetdata.

top