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

Adding new shapes

The functions described in this chapter are used to create new objects (shapes) in the database. For some shape types TELL defines more that one function and the reason is simply convenience and flexibility.

This is probably the proper place to clarify the difference between Toped object and TELL variable. In the example below

      box tell_box_variable = {{10,10},{20,20}};
      layout rectangle1 = addbox(tell_box_variable,7);

first line is a TELL construct defining and initializing a TELL variable of a type box. Next line creates a rectangular layout object in the current cell and adds it to layer 7. The function on the second line returns a reference to the new Toped object that is assigned to TELL variable rectangle1. It must be clear that variables tell_box_variable and rectangle1 has nothing in common. A lot of addbox functions can be executed with tell_box_variable as input parameter and all of them will produce unique layout object. Any subsequent operations over rectangle1 will not modify by any means tell_box_variable. The opposite is also truth - i.e. any subsequent changes over tell_box_variable will not modify already created layout objects. As an additional example, the code fragment below will create a vertical line of box shapes each with a size 0.25x0.25, with a 0.3 space between them, starting at coordinate (10,10).

      point contBL = {10,10};
      box contactL = {{0,0},{0.25,0.25}};
      usinglayer(7);
      real numconts = 5;
      while (numconts > 0) {
         addbox(contactL+contBL);
         contBL = contBL + {0, + 0.55};
         numconts = numconts - 1;
      };

top

addbox

Add a box in the active cell. Box shape can be added to the database using any of the overloaded functions listed below. There are three main forms of this function and their difference is just the TELL types used to define the desired box. The user can quote the target layer, but if it is omitted the current layer is used. The function returns a reference to the resulting shape. From the input parameters Toped internally creates two points to define the bottom left and top right corners of the shape. Rotated rectangles can not be created using this command. This can be done using addpoly function only.

[Tip]layout addbox …

layout addbox(tell_box, target_layer)

layout addbox(tell_point1, width, height, target_layer)

layout addbox(tell_point1, tell_point2, target_layer)

layout addbox(tell_box)

layout addbox(tell_point1, width, height)

layout addbox(tell_point1, tell_point1)

layout addbox()

layout addbox(target_layer)

box tell_box
Box defining the desired rectangle.
point tell_point1
First corner of the rectangle
point tell_point2
Second corner of the rectangle
real width
the size in X direction of the rectangle
real height
the size in Y direction of the rectangle
int target_layer
the layer where the resulting rectangle will be assigned to.

The last two overloaded functions are interactive and targeted for editor purposes. When executed, Toped expects two points to be selected using the mouse (or keyboard). After first point is selected Toped draws a temporary rubber band rectangle between that point and the cursor position. When second point is selected, the temporary rectangle disappears and the resulting box is added to the database. Virtually the same result can be achieved using the construct

addbox(getpoint(),getpoint());

but there will not be a temporary box shown.

Example 1. addbox

// all examples are using the default layer
addbox({{10,11},{20,21}}); // box input
addbox({10,11},{20,21});   // point input
addbox({10,11},10,10);     // size input

top

addpoly

Add a polygon in the active cell. Poly shape can be added to the database using one of the overloaded functions listed below. TELL apply validation checks over the input points. Last point does not need to coincide with the first one, Toped will close the polygon automatically. The user can quote the target layer, but if it is omitted the current layer is used. The function returns a reference to the resulting polygon.

[Tip]layout addpoly …

layout addpoly( poly_vertexes, target_layer)

layout addpoly( poly_vertexes )

layout addpoly( target_layer )

layout addpoly()

point list polyvertexes
A list of points describing the vertexes of the desired polygon. The list must be valid.
int layer_number
the layer where the resulting polygon will be assigned to.

The last two overloaded functions are interactive and targeted for editor purposes. When executed, Toped expects list of points to be selected using the mouse or typed on the keyboard. After first point is selected Toped draws a temporary rubber band closed polygon using already selected points. When the last point is selected, the temporary draw disappears and the resulting polygon is added to the database. Virtually the same result can be achieved using the construct

addpoly(getpointlist());

but there will not be a temporary polygon shown.

Example 2. addpoly

   addpoly({{-1,75},{10,75},{10,70},{15,70},{15,66},{-10,66},{-10,70},{-1,70}},6);

top

addwire

Add a wire in the active cell. A wire shape can be added to the database using one of the overloaded functions listed below. The points in the input list are taken as a center points of the wire vertex. TELL apply validation checks over the input points. The user can quote the target layer, but if it is omitted the current layer is used. The function returns a reference to the resulting wire.

[Tip]layout addwire …

layout addwire( wire_vertexes, width, target_layer)

layout addwire( wire_vertexes, width)

layout addwire( width, target_layer)

layout addwire( width)

point list wire_vertexes
A list of points describing the vertexes of the desired wire. The list must be valid.
real width
The width of the wire
int layer_number
the layer where the resulting polygon will be assigned to.

The last two overloaded functions are interactive and targeted for editor purposes. When executed, Toped expects list of points to be selected using the mouse or typed from the keyboard. After first point is selected Toped draws a temporary rubber band wire using already selected points. When the last point is selected, temporary draw disappears and the resulting wire is added to the database. Virtually the same result can be achieved using the construct

addwire(getpointlist());

but there will not be a temporary polygon shown.

Example 3. addwire

   addwire({{-1,75},{10,75},{10,70},{15,70},{15,66},{-10,66},{-10,70},{-1,70}},6);

top

addtext

Add a text object in the active cell. A text object can be added to the database using one of the functions below. Texts are not true layout objects, they are used to improve the readability of the layout. The attributes of the text objects are very similar to the attributes of the cell references. Toped uses an Glf library to visualize the layout text objects. The fonts are included in the installation package and text appearance should not be dependent on the platform. Only standard characters (ASCII from 32-127) are rendered. If other characters appear in the input string, they are replaced permanently with ? char. The function returns a reference to the resulting object

[Tip]layout addtext …

.layout addtext(text, target_layer, origin, rotation, flipX, magnification)

.layout addtext(text, magnification)

string text
The string to be added.
int target_layer
The layer where the text will be placed.
point point
The origin (bounding position) of the text object.
real rotation
The angle of rotation of the text object.
bool flipX
Whether or not the object will be flipped towards the vertical axis with a coordinate point.X.
real magnification
the magnification factor - effectively the size of the font in user units.

The second overloaded function is interactive and targeted for editor purposes. When executed, Toped expects a bind record, which can be entered using the mouse or the keyboard. Toped draws a temporary image of the text which follows the marker position taking into account current rotation flip and scale of the text. Right mouse click allows to change the flip and rotation. When a point is selected, temporary image disappears and the resulting text object is added to the database.

Example 4. addtext

   addtext("This is a comment line",6,{10,20},90,false,2.000);
   addtext("another comment",2.5);

top

cellref

Add a reference to Toped cell in the active cell. Cell references are a powerful way for layout generation. Toped maintains "traditional" (Calma style) cell references and this command is a part of their implementation. Referenced cell must exist already. Recursive or circular references are not allowed. The function returns a reference to the resulting object.

[Tip]layout cellref …

layout cellref(cell_name, origin, rotation, flipX, magnification)

layout cellref(cell_name)

layout cell_name
The cell name to be added.
point origin
The origin (bounding position) of the cell reference.
real rotation
The angle of rotation of the text object.
bool flipX
Whether or not the object will be flipped towards the vertical axis with a coordinate point.X.
real magnification
the magnification factor or scale. For cell references very often it’s 1.

The second overloaded function is interactive and targeted for editor purposes. When executed, Toped expects a bind record, which can be entered using the mouse or the keyboard. Toped draws a temporary image of the cell which follows the marker position taking into account current rotation flip and scale of the reference. Right mouse click allows to change the flip and rotation. When a point is selected, temporary image disappears and the resulting reference object is added to the database.

Example 5. cellref

   cellref("cell_A",{10,20},90,true,1);
   cellref("cell_B");

top

cellaref

Add an array of cell references in the active cell. Further to the "traditional" cell reference functionality this function creates an array of cell references. Referenced cell must exist already. Recursive or circular references are not allowed. The function returns a reference to the resulting object.

[Tip]layout cellaref …

layout cellaref(cell_name, origin, rotation, flipX, magnification, column, row, stepX, stepY)

layout cellaref(cell_name, origin, rotation, flipX, magnification, column, row, stepP1, stepP2)

layout cellaref(cell_name, column, row, stepX, stepY)

layout cell_name
The cell name to be added.
point origin
The origin (bounding position) of the cell reference.
real rotation
The angle of rotation of the text object.
bool flipX
Whether or not the object will be flipped towards the vertical axis with a coordinate point.X.
real magnification
the magnification factor or scale. For cell references very often 1.
int column
The number of columns in the array.
int row
The number of rows in the array.
real stepX
The distance (step) between cells in horizontal direction.
real stepY
The distance (step) between cells in vertical direction.
point stepP1
The first point used to calculate the the distance (step) between the cells if the grid is not orthogonal
point stepP2
The second point used to calculate the the distance (step) between the cells if the grid is not orthogonal

Third form of the function is interactive form of the first one - see the description in cellref

Non-orthogonal i.e. uniform and (potentially) diagonal cell grids are allowed and can be introduced using the second form of the function.

Example 6. cellaref

   cellaref("cell_A",{10,20},0,false,1,4,3,20.000,50.000);

top