LDMCINTRO(5ICD)

NAME
ldmcintro - introduction to the LDMC library functions

SYNOPSIS

#include <stdldmc.h>

DESCRIPTION
The routines in this library are intended to facilitate the creation of layout generator programs. They do not only output an LDM layout description, but also built and maintain an internal LDMC datastructure. This datastructure remembers for each cell its dimensions, its terminals and its subcells. All this information, describing the whole hierarchy of the generated LDM output, can later be used in the LDMC program to do relative placement of new subcells, etc. To retrieve this information, one must use the getmodel, igetterm, mgetterm and getinst functions, see getmodel(5ICD). These functions each return a pointer to an appropriate node in the datastructure, see below for a description of these nodes.

Moreover, these functions provide run-time error-checking. They all complain about bad arguments, like negative repeat parameters and references to undefined cells, that would produce semantically incorrect LDM text.

The LDMC datastructure is built with so-called MODEL, TERM and INST nodes. The user (LDMC programmer) can assume that they look as presented below in the declarations section. Actually, they have some other fields linking all nodes together. However, this is not the kind of information the user must embed in his program and he need not know it.

DECLARATIONS
#define NAMLEN 14			/* maximum length of a name  */
typedef struct {			/* cell node */
	char	name[NAMLEN+1];		/* name of cell */
	int	xl, xr, yb, yt,		/* bounding box of cell */
		bxl, bxr, byb, byt,	/* box and terminal bounding box */
		mcxl, mcxr, mcyb, mcyt;	/* cell call bounding box  */
	int	status;			/* number of errors in cell  */
} MODEL;
typedef struct {			/* instance node */
	char	name[NAMLEN+1];		/* instance name or cell name */
	int	mir, rot,		/* orientation of subcell */
		tx, ty,			/* location of subcell */
		dx, nx, dy, ny;		/* repetition of subcell */
} INST;
typedef struct {			/* terminal node */
	char	name[NAMLEN+1];		/* terminal name */
	int	xl, xr, yb, yt,		/* terminal coordinates */
		dx, nx, dy, ny,		/* repetition of terminal */
		layer,			/* terminal layer */
		index,			/* index for repeated terminals */
		i_index,		/* repetition of instance */
		side;			/* actual side in instance */
} TERM;
MODEL *this;				/* address of current MODEL node */
int l_xl, l_xr, l_yb, l_yt;		/* coordinates of the most recent
					LDM statement in the current cell */
typedef TERM *TERMVEC;			/* vector of pointers to TERM nodes */

LIST OF FUNCTIONS
The functions listed below are those available from the LDMC library. Function names which are indented below others appear on the same manual page as the one from which they are indented.

abut
    Abut a cell to an instance.
vabut
    Ditto, TERM vector arguments.
array
    Make an array of cells
connect
    Connect terminals.
vconnect
    Ditto, TERM vector arguments.
uconnect
    Connect terminals.
vuconnect
    Ditto, TERM vector arguments.
dbread
    Read an LDM database, argument vector.
dbreadl
    Ditto, argument list.
getmodel
    Get address of a specified MODEL node.
getinst
    Get address of a specified INST node.
mgetterm
    Get addresses of TERM nodes.
igetterm
    Get addresses of instantiated TERM nodes.
ms  Start of cell definition.
box Place a rectangle.
term
    Make a terminal.
mc  Call a subcell.
me  End of cell definition.
comment
    Print a comment line in LDM text.
on_me
    Print header above each cell description.
pitch
    Return the x- or y-pitch of a specified cell.
vpitch
    Ditto, TERM vector arguments.
readldm
    Read an LDM file.
freadldm
    Ditto, FILE * argument.
setout
    Change current output file.
tup Copy terminals of subcell in the current cell.
vtup
    Ditto, TERM vector argument.
atup
    Tup with automatic repetition.
vatup
    Ditto, TERM vector argument.
ll_abut
    LDMC abutment primitive.
ll_connect
    LDMC connection primitive.
ll_error
    LDMC error message handler.
ll_perror
    Print LDMC error message.
ll_exit
    Terminate LDMC program.
ll_getterm
    LDMC getterm primitive.
ll_init
    Initialize the LDMC system.
ll_process
    Ldmc technology information.
ll_quit
    Quit the LDMC system.
ll_river
    LDMC river routing primitive.

AUTHOR
N. van der Meijs

SEE ALSO
N. van der Meijs, "LDMC User's Manual", Delft University of Technology, Dep. of Electrical Engineering, Network Theory Section.
ldmcc(1ICD)

DIAGNOSTICS
A rich variety of messages can be given to help program debugging. Examples are messages about references to undefined cells, negative repetition parameters, etc. Some further complaints are, for example, from abut when abut does not know how to abut, or from pitch when pitch can't determine the pitch.