»»»Home «««
»»»TELL «««
»»»Toped «««
»»»Ifaces «««
|
Table of Contents TELL defines several build-in basic data types as listed below.
Lists can be defined from any of the build-in or user types in TELL. They are homogeneous, their length is dynamic and limited only by the available memory. Empty lists are perfectly legal. One can think for TELL lists as of dynamic length arrays. List expansion can have an adverse performance impact when repeated significant number of times. Much faster is to setup the initial list length during the variable declaration. int list iter; // empty list declaration point list polygon [10]; // list of 10 points See list operations Below is the list of the build-in structures. The only non-trivial structure here is bind. It is used for reference and text objects and fully describes the placement of a particular cell instance or text. See also user defined structures
Constants in TELL are fixed values that can’t be changed after initialization. They can be of any build-in or user type and are defined using the keyword const in front of the variable declaration. Constants can be initialized either with the declaration or after, but a value can be assigned to them only once. const int a = 1; // constant declaration & initialization const real b; // constant declaration // ... some code b = 3.7; // constant initialization TELL defines a number of build-in constants listed in the table below
For selection filters - see selectmask For toolbar icon sizes - see toolbarsize A structure is defined using a keyword struct and the type name, followed by the list of structure members enclosed in curly braces. Each structure member is described by its type and name. Structure member declarations are separated by a semicolon. The new type name can be used exactly as any other build-in TELL type to declare variables or function arguments. The struct definition does not create an actual data object, but just describes what constitutes this object. struct circle { point center; real radius }; struct ply_shape { point list vertexes; int layer }; struct layout_text { string text; point bind; int layer; bool flipX; real rotation }; Variables can be declared anywhere in the code, but before they are used. Initialization can be included in the declaration. Variables are visible from the line they are defined until the end of the block. Global variables are those declared outside any function scope. They are visible from the line of definition further. int number_of_contacts = 4; real contact_size = 0.25; point bound_point = {20.5,20}; box source_area = { {0,0} , {2.2,1.6} }; layout list contacts = select(source_area); bool nc_OK = (number_of_contacts == 4); circle c1 = { {12.5, 96} , 10 }; ply_shape p1 = { {{-1,75},{10,75},{10,70},{15,70}, {15,66},{-10,66},{-10,70},{-1,70}}, 6}; Lists and user defined structures are initialized using similar syntax - a comma separated list of initializers enclosed in braces. The same syntax can be used in assignments. For lists, each of the initializer fields should be the same type as the type of the list declaration. For structures, each initializer should match the type of the corresponding structure member. Some examples can be seen above Some of the Toped functions - for example gdsimport are using relatively complex data structures as input parameters. The quick list is a very simple convention which can save some typing and reduce errors. This is not a separate TELL type. It shall be always included in a string variable. Quick list can contain only numbers, spaces and following characters: - comma , - used as a separator - star * - used as a wildcard - dash - indicating a range Example 1. Quick List "1,3-6,8" // is a short for 1,3,4,5,6,8 "*" // means *all*. The parser will treat this depending on the // context it is used. |