Table of Contents

Name

librds - rds library description

Description

I) DATA STRUCTURES USED
A)
rdsrec_list structure

The rdsrec_list structure is used to describe a rectangle which belongs to a symbolic figure.

The following C structure supports the description of a rectangle :

typedef struct rdsrec_list
{
struct rdsrec_list *NEXT;

long
X;
long
Y;
long
DX;
long
DY;
long
FLAGS;
char
*NAME;
void
*USER; } rdsrec_list;

Description of the structure's fields :

NEXT : Pointer to the next rectangle whitch belongs to the list of rectangles.

X,Y : Coordinates of one of the extremities of the rectangle.

DX,DY :
Width and lenght of the rectangle ; fixes the position of the second extremity of the rectangle.
FLAGS :
32 bits flag; contains informations about the rectangle. 31..........................17.16..............................0 |X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X |-----------------------------|-|-|-----|-------|---------------
reserved for user
^ ^ type object Layer | | figure/instance | one/many window(s)
- first 8 bits (0 to 7)
reserved to code the layer, constants used to code the layer can take the values as follows (defined in rdsnnn.h) : RDS_NWELL, RDS_PWELL, RDS_ACTIV, RDS_NIMP, RDS_PIMP, RDS_NDIF, RDS_PDIF, RDS_NTIE, RDS_PTIE, RDS_POLY, RDS_GATE, RDS_TPOLY, RDS_CONT, RDS_ALU1, RDS_TALU1, RDS_VIA1, RDS_ALU2, RDS_TALU2, RDS_VIA2, RDS_ALU3, RDS_TALU3,
RDS_VIA3,
RDS_ALU4, RDS_VIA4, RDS_CPAS, RDS_PPOL, RDS_REF, RDS_USER0, RDS_USER1, RDS_USER2, RDS_ABOX
- 4 next bits
MBK object which belongs the rectangle, constants used to code the object can take the values as follows (defined in rfmnnn.h) : MBK_CONNECTOR, MBK_SEGMENT, MBK_REFERENCE,
MBK_VIA,
MBK_INSTANCE, MBK_FIGURE
- 3 next bits
complementary information about connectors and references objects, constants used to code these bits can take the values as follows (defined in rfmnnn.h) :

RDS_CON_EXTER, RDS_CON_INTER : external/internal connector ; RDS_REF_REF, RDS_REF_CON : reference type.

- next bit
Determine if the rectangle belongs to a figure or an instance. The constant used to code this bit can take the value as follows (defined in rfmnnn.h) :
RDS_FIG_REC
- next bit
Determine if the rectangle belongs to one or many windows. The constant used to code this bit can take the value as follows (defined in rwinnn.h) :
RDS_ONE_WINDOW
- the 15 bits remaining are free and can be used by the user.

NAME : rectangle's name

USER : not used in RDS library. It's used in RFM library and RWI library.If the user wants to use both libraries, he has to save (in an added structure to the rdsrec_list structure, for example) the USER field after calling the functions of one of the two libraries. In RFM library, the field USER is used to chain rectangles belonging to a same object. In RWI library, the field USER is used know the windows which contains the rectangle.

B)
rdsins_list structure

The rdsins_list structure is used to describe an instance which belongs to a symbolic figure.

The following C structure supports the description of an instance :

typedef struct rdsins_list
{
struct rdsins_list *NEXT;

char
*FIGNAME;
char
*INSNAME;
long
X;
long
Y;
char
TRANSF;
unsigned int
SIZE; struct rdsrec_list *LAYERTAB[ RDS_MAX_LAYER ]; struct rdsrec_list *COURONNE[ RDS_MAX_LAYER ];
void
*USER; } rdsins_list;

Description of the structure's fields :

NEXT : Pointer to the next instance whitch belongs to the list of instances.

FIGNAME :
Model's name of the instance.
INSNAME :
Instance name in the figure of higher hierarchical level.

X,Y : Position of the lower left corner of instance after geometrical transformation.

TRANSF :
Geometrical transformation applied to the instance before placing.

The field TRANSF can take these values :

RDS_NOSYM
no symmetry.
RDS_ROT_P
90 degrees rotation counter clockwise.
RDS_SYMXY
Symmetry with regard to a horizontal and vertical axis.
RDS_ROT_M
90 degrees rotation clockwise.
RDS_SYM_X
Symmetry with regard to a vertical axis.
RDS_SY_RM
Symmetry with regard to a vertical axis and 90 degrees clockwise.
RDS_SYM_Y
Symmetry with regard to a horizontal axis.
RDS_SY_RP
Symmetry with regard to a horizontal axis and 90 degrees rotation counter clockwise.

SIZE : Size of the user structure which can be added to a rdsrec_list structure.

LAYERTAB [RDS_MAX_LAYER] :
Table of layers which contains rectangle's list associated to each layer.
COURONNE [RDS_MAX_LAYER] :
Specific field used by some tools. Table of layers which contains rectangle's list associated to each layer. These rectangles compose the instance's perimeter.
C)
rdsfig_list structure

The rdsfig_list structure is used to describe a hierarchical level of a symbolic figure.

The following C structure supports the description of a figure :

typedef struct rdsfig_list
{

struct rdsfig_list
*NEXT;
char
*NAME;
struct rdsrec_list
*LAYERTAB[ RDS_MAX_LAYER ];
struct rdsins_list
*INSTANCE;
char
MODE;
unsigned int
SIZE;
char
FLAGTAB[ RDS_MAX_LAYER ];
struct rdsrec_list
*BBOXTAB[ RDS_MAX_LAYER ];
void
*USER; } rdsfig_list;

Description of the structure's fields :

NEXT : Pointer to the next figure of figure's list.

NAME : Name of the figure : it identifies the figure so it must be unique and identical to the filename which describes the figure on disk.

LAYERTAB [RDS_MAX_LAYER] :
Table of layers which contains rectangle's list associated to each layer.
INSTANCE :
Pointer to the head of the list of instances of the figure.

MODE : Caracter indicating the status of the figure in memory.

This field can take three values :

`A'
All the cell is loaded in ram (The figure, its rectangles and its instances empty).
`P'
Only information concerning the model interface is present, that means : connectors, the abutment box and through routes of the figure.
`V'
Visualization mode : all is loaded in RAM : The figure, its rectangles, its instances and the rectangles of its instances.

SIZE : Size of the user structure which can be added to a rdsrec_list structure.

FLAGTAB[RDS_MAX_LAYER] :
This is a table of flags associated to each layer. This table is free for the user.
BBOXTAB[RDS_MAX_LAYER] :
This table is used to contain the bounding box of a circuit by layer (It is used by the s2r tool).

USER : Pointer free for the user.

II)
Description of global variables and constants of the library
A)
Constants of the library
RDS_MAX_TRANSF
Maximum number of possible geometrical transformations applied to an instance (defines the size of the table RDS_TRANSF_NAME[]).
RDS_MAX_LAYER
Maximum number of layers defined in RDS library (defines the size of the table RDS_LAYER_NAME).
RDS_ALLOC_BLOCK
Used in rdsalloc function to set a BLOCK allocation.
RDS_ALLOC_HEAP
Used in rdsalloc function to set a HEAP allocation.

Transformation constants
RDS_NOSYM, RDS_ROT_P, RDS_SYMXY, RDS_ROT_M, RDS_SYM_X, RDS_SY_RM, RDS_SYM_Y, RDS_SY_RP :

define the transformation to apply to an instance (see rdsins_list structure).

Layer constants
RDS_NWELL, RDS_PWELL, RDS_NDIF, RDS_PDIF, RDS_NTIE, RDS_PTIE, RDS_POLY, RDS_GATE, RDS_TPOLY, RDS_CONT, RDS_ALU1, RDS_TALU1, RDS_VIA1, RDS_ALU2, RDS_TALU2, RDS_VIA2, RDS_ALU3, RDS_TALU3, RDS_ACTIV, RDS_NIMP, RDS_PIMP, RDS_REF, RDS_USER0, RDS_USER1, RDS_USER2, RDS_ABOX :

MBK_CONNECTOR
Represents object type of the field `FLAGS' of the rdsrec_list structure which is a MBK connector.
MBK_SEGMENT
Represents object type of the field `FLAGS' of the rdsrec_list structure which is a MBK segment.
MBK_REFERENCE
Represents object type of the field `FLAGS' of the rdsrec_list structure which is a MBK reference.
MBK_VIA
Represents object type of the field `FLAGS' of the rdsrec_list structure which is a MBK contact.
MBK_INSTANCE
Represents object type of the field `FLAGS' of the rdsrec_list structure which is a MBK instance.
MBK_FIGURE
Represents object type of the field `FLAGS' of the rdsrec_list structure which is a MBK figure.
MBK_TYPE
Mask of the field `FLAGS' of the rdsrec_list structure which permits to get object type.(see librds).
RDS_FIG_REC
Represents the bit of the field `FLAGS' of the rdsrec_list structure that means if the rectangle belongs to a figure or to an instance.
RDS_CON_EXTER
Represents the type of the MBK connector of the field `FLAGS' of the rdsrec_list structure (external connector).
RDS_CON_INTER
Represents the type of the MBK connector of the field `FLAGS' of the rdsrec_list structure (internal connector).
RDS_REF_REF
Represents the type of the MBK reference of the field `FLAGS' of the rdsrec_list structure (ref_ref reference).
RDS_REF_CON
Represents the type of the MBK reference of the field `FLAGS' of the rdsrec_list structure (ref_con reference).
RDS_EXTRACT_TYPE
Mask of the field `FLAGS' of the rdsrec_list structure which permits to get additionnal object type (for a reference or a connector).

Constants associated to the possible layers.

B)
Global variables

rdsfig_list *HEAD_RDSFIG;

HEAD_RDSFIG is a pointer to the head of the list of figures in memory.

char RDS_LAYER_NAME [ RDS_MAX_LAYER ] [ 12 ] = {
RDS_NWELL ,
RDS_PWELL ,
RDS_ACTIV ,
RDS_NINP ,
RDS_PINP ,
RDS_NDIF ,
RDS_PDIF ,
RDS_NTIE ,
RDS_PTIE ,
RDS_POLY ,
RDS_GATE ,
RDS_TPOLY ,
RDS_CONT ,
RDS_ALU1 ,
RDS_TALU1 ,
RDS_VIA1 ,
RDS_ALU2 ,
RDS_TALU2 ,
RDS_VIA2 ,
RDS_ALU3 ,
RDS_TALU3 ,
RDS_VIA3 ,
RDS_ALU4 ,
RDS_VIA4 ,
RDS_CPAS ,
RDS_PPOL ,

RDS_REF
, RDS_USER0 , RDS_USER1 , RDS_USER2 , RDS_ABOX  };

The RDS_LAYER_NAME table contains names of possible layers of a rectangle. May be used when debugging a programme.

char RDS_TRANSF_NAME [ RDS_MAX_TRANSF ][ 8 ] = {
NOSYM",
ROT_P",
SYMXY",
ROT_M",
SYM_X",
SY_RM",
SYM_Y",
SY_RP"
};

The RDS_TRANSF_NAME table contains names of possible transformations of an instance. May be used when debugging a programme.

III)
Description of the macros
-
char GetRdsLayer( Rectangle ) rdsrec_list *Rectangle;

GetRdsLayer function gets the layer associated to the rectangle by testing the field FLAGS of the rdsrec_list structure.The returned value corresponds to the following layers :

0
-> RDS_NWELL
1
-> RDS_PWELL
2
-> RDS_ACTIV
3
-> RDS_NIMP
4
-> RDS_PIMP
5
-> RDS_NDIF
6
-> RDS_PDIF
7
-> RDS_NTIE
8
-> RDS_PTIE
9
-> RDS_POLY 10 -> RDS_GATE 11 -> RDS_TPOLY 12 -> RDS_CONT 13 -> RDS_ALU1 14 -> RDS_TALU1 15 -> RDS_VIA1 16 -> RDS_ALU2 17 -> RDS_TALU2 18 -> RDS_VIA2 19 -> RDS_ALU3 20 -> RDS_TALU3 21 -> RDS_VIA3 22 -> RDS_ALU4 23 -> RDS_VIA4 24 -> RDS_CPAS 25 -> RDS_PPOL 26 -> RDS_REF 27 -> RDS_USER0 28 -> RDS_USER1 29 -> RDS_USER2 30 -> RDS_ABOX

Where the names RDS_XXXXX are some constants defined in the file rdsnnn.h".

-
void SetRdsLayer( Rectangle, Layer ) rdsrec_list *Rectangle;
char
Layer;

The SetRdsLayer function sets in the FLAGS field of rdsrec_list structure the layer associated to the rectangle.

Macros for testing rectangle type :

-
char IsRdsConnector( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a MBK connector : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsConExter( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is an external MBK connector : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsConInter( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is an internal MBK connector : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsSegment( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a MBK segment : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsReference( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a MBK reference : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsRefRef( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a Ref_Ref MBK reference : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsRefCon( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a Ref_Con MBK reference : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsVia( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a MBK contact : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsInstance( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is an MBK instance :

If true, then value 1 is returned else value 0 is returned.

-
char IsRdsFigure( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle is a MBK figure : If true, then value 1 is returned else value 0 is returned.

-
char IsRdsFigRec( Rectangle ) rdsrec_list *Rectangle;

Tests if the rectangle belongs to a MBK figure : If true, then value 1 is returned else value 0 is returned (it belongs to an instance).

Macros for setting rectangle type :

-
void SetRdsConnector( Rectangle ) rdsrec_list *Rectangle;

Sets rectangle type as a connector.

-
void SetRdsConExter( Rectangle ) rdsrec_list *Rectangle;

Sets connector type as external connector. Uses the RDS_CON_EXTER constant in the field `FLAGS' of rdsrec_list structure.

-
void SetRdsConInter( Rectangle ) rdsrec_list *Rectangle;

Sets connector type as internal connector. Uses the RDS_CON_INTER constant in the field `FLAGS' of rdsrec_list structure.

-
void SetRdsSegment( Rectangle ) rdsrec_list *Rectangle;

Sets rectangle type as a segment.

-
void SetRdsReference( Rectangle ) rdsrec_list *Rectangle;

Sets rectangle type as a reference.

-
void SetRdsRefRef( Rectangle ) rdsrec_list *Rectangle;

Sets reference type as REF_REF reference. Uses the RDS_REF_REF constant in the field `FLAGS' of rdsrec_list structure.

-
void SetRdsRefCon( Rectangle ) rdsrec_list *Rectangle;

Sets reference type as REF_CON reference. Uses the RDS_REF_CON constant in the field `FLAGS' of rdsrec_list structure.

-
void SetRdsVia( Rectangle ) rdsrec_list *Rectangle;

Sets the rectangle type as a contact.

-
SetRdsInstance( Rectangle ) rdsrec_list *Rectangle;

Sets the rectangle type as an instance.

-
SetRdsFigure( Rectangle ) rdsrec_list *Rectangle;

Sets the rectangle type as a figure.

-
SetRdsFigRec( Rectangle ) rdsrec_list *Rectangle;

Sets the rectangle type as belonging to a figure.

-
ClearRdsFigRec( Rectangle ) rdsrec_list *Rectangle;

Sets the rectangle type as not belonging to a figure.It can be used to mean that the rectangle belongs to an instance.

VI)
Functions of LibRds library

rdsalloc
memory allocation

rdsfree
memory freeing

allocrdsfig
allocates memory for a figure

allocrdsins
allocates memory for an instance

allocrdsrec
allocates memory for a rectangle

freerdsfig
frees memory of a figure

freerdsins
frees memory of an instance

freerdsrec
frees memory of a rectangle

addrdsfig
adds a figure to the head of figures's list

addrdsins
adds an instance to the head of instances's list of a figure

addrdsinsrec
adds a rectangle in an instance

addrdsfigrec
adds a rectangle in a figure

delrdsfig
deletes a figure and the objects contained in it

delrdsins
deletes an instance and the objects contained in it

delrdsinsrec
deletes a rectangle in an instance

delrdsfigrec
deletes a rectangle in a figure

viewrdsrec
displays caracteristics of a rectangle

viewrdsins
displays caracteristics of an instance

viewrdsfig
displays caracteristics of a figure

See Also

librfm, librpr, librut, librtl, librwi

Bug Report

This tool is under development at the ASIM/LIP6/UPMC laboratory, cao-vlsi research team.
We need your feedbak to improve documentation and tools. If you find bugs, please fill-in the form at http://asim.lip6.fr/alliance/support/bug-report/ Thanks for doing this.


Table of Contents

 



Alliance Web Site © 1997, 2002 ASIM/LIP6/UPMC, page maintained by Czo [Olivier Sirol] , last updated on 26 May 2000.