• No results found

INTERFACE DATA STRUCTURES

In document WRL 90 7 pdf (Page 77-82)

In those cases where tiles must be placed using absolute, (half-lambda) coordinates, it is useful to know that RECTANGLEs and POINTs are defined as:

typedef struct {

int x_left, x_right, y_top, y_bot; } RECTANGLE;

typedef struct { int x, y; } POINT;

The variable origin_point is predefined to be (0, 0). origin_rect is defined to be a zero-sized rectangle located at the origin.

OPTIONS ACCEPTED BY TPinitialize()

Typical command line: program_name [-t template] [-s style] [-o output_file] input_file

-a produce Magic format (this is the default)

-c produce CIF format

-v be verbose (sequentially label the tiles in the output for debugging purposes; also print out infor- mation about the number of rectangles processed by mpack)

-s style generate output using the template for this style (see TPinitialize for details)

-o The next argument is taken to be the base name of the output file. The default is the input file name with any extensions removed. If there is not input file specified and no -o option specified, the output will go to stdout.

MPACK ( 3 ) CAD Tool User’s Manual MPACK ( 3 )

-p (pipe mode) Send the output to stdout.

-t The next argument specifies the template base name to use. This overrides the default supplied by the program. A .mag extension is automatically added. (see TPinitialize)

-l name Set the cif output style to name. name is the name of a cif output style as defined in Magic’s tech-

nology file. If this option is not specified then the first output style in the technology file is used. (Note: In the old tpack system this option set the size of lambda.)

input_file

The name of the file that the program should read from (such as a truth table file). If this filename is omitted then the input is taken from the standard input (such as a pipe).

-M num This option is accepted by mpack, but ignored. It is a leftover from the tpack system. -D num1 num2

The Demo or Debug option. This option will cause mpack to place only the first num1 tiles, and the last num2 of those will be outlined with rectangular labels. In addition, if a tile called "blotch" is defined then a copy of it will be placed in the output tile upon each call to the align function during the placing of the last num2 tiles. The blotch tile will be centered on the first point passed to align, and usually consists of a small blotch of brightly colored paint. This has the effect of marking the alignment points of tiles. The last tile painted into is assumed to be the output tile.

EXAMPLE

It is highly recommended that the example in∼∼cad/src/mquilt be examined. Look at both the template

and the ‘C’ code. A more complex example is in∼∼cad/src/mpla.

FILES

∼cad/lib/mpack.h (definition of the mpack interface)

∼cad/lib/mpack.lib (linkable mpack library)

∼cad/lib/mpack.ln (lint-library for lint)

∼cad/src/mquilt/* (an example of an mpack program)

∼cad/lib/magic/sys/*.tech*(technology description files)

ALSO SEE

magic(CAD), mquilt(CAD), mpla(CAD)

Robert N. Mayo Pictures with Parentheses: Combining Graphics and Procedures in a VLSI Layout Tool,

Proceedings of the 20th Design Automation Conference, June, 1983. `C’ Manual

HISTORY

This is a port of the tpack(1) system which generated Caesar files.

AUTHOR

Robert N. Mayo

BUGS

When a tile contains part of a subcell, or touches a subcell, then the whole subcell is considered to be part of the tile. The same goes for arrays of subcells.

PATH ( 3 ) CAD Tool User’s Manual PATH ( 3 )

NAME

path−procedures for managing search paths in libmagicutils.a

SYNOPSIS

#include <stdio.h> #include utils.h

int PaConvertTilde(psource, pdest, size) char **psource, **pdest;

int size;

FILE *PaOpen(file, mode, ext, path, libpath, prealname) char *file, *mode, *ext;

char *path, *libpath; char **prealname;

char *PaSubsWD(path, newWD) char *path, *newWD;

int PaEnum(path, file, func, cdata) char *path, *file;

int (*func)(name, cdata); ClientData cdata;

DESCRIPTION

These procedures implement a path mechanism, whereby several places may be searched for files.

PaConvertTilde is used to convert csh (1)-style tilde notation for users’ home directories (e.g., ‘‘∼wss’’, ‘‘∼/mydir/file.o’’) to standard directory names as understood by open (2), etc. If **psource is a tilde (‘‘∼∼’’), then the name following the tilde up to the first slash or end of string is converted to a home direc- tory and stored in the string pointed to by *pdest. Then remaining characters in the file name at *psource are copied to *pdest (the file name is terminated by white space, a NULL character, or a colon) and

*psource is updated. Upon return, *psource points to the terminating character in the source file name, and *pdest points to the null character terminating the expanded name. If a tilde cannot be converted because

the user name cannot be found, *psource is still advanced past the current entry, but nothing is stored at the destination. At most size characters (including the terminating null character) will be stored at *pdest. The name consisting of a single tilde, i.e, ‘‘∼∼’’ with no user name, expands to the current user’s home directory.

PaConvertTilde returns the number of bytes of space left in the destination area if successful, or -1 if the

user name couldn’t be found in the password file.

PaOpen opens a file, looking it up in the current path and supplying a default extension. It either returns a

pointer to a FILE, as does fopen (3s), or NULL if no file could be opened. The mode of the file opened is determined by mode, also as in fopen. If ext is specified, then it is tacked onto the end of name to construct the name of the file PaOpen will attempt to find. (Ext must begin with a dot if that is the extension separa- tor; none is inserted automatically.) If the first character of name is a tilde or slash, PaOpen tries to look up the file with the original name (and extension), doing tilde expansion if necessary and returning the result. Otherwise, it goes through the search path path (a colon-separated list of directories much as in csh (1)) one entry at a time, trying to look up the file once for each path entry by prepending the path entry to the origi- nal file name. This concatenated name is stored in a static string and made available to the caller by setting

*prealName to point to it if prealName is non-NULL and if the open succeeds. If the entire path is tried,

and still nothing works, then we try each entry in the library path libpath next. The static string will be trashed on the next call to this routine. Also, no individual file name is allowed to be more than 200 char- acters long; excess characters are lost.

PATH ( 3 ) CAD Tool User’s Manual PATH ( 3 )

PaSubsWD replaces all uses of the working directory in a path by some fixed directory. It returns a pointer

to a path that is just like path, except that every implicit or explicit use of the working directory (‘‘.’’) is replaced by the newWD argument. The result is a static array, which will be trashed on the next call to this procedure.

PaEnum is used to call a client procedure with each directory in path prepended to the string file. The

client procedure is of the form (*func)(name, cdata), where name is a directory in the path prepended to

file, and cdata is the same as cdata passed to PaEnum. This client procedure should return 0 normally, or 1

to abort the path enumeration. If a directory in the search path refers to a non-existent user name (using the ‘‘∼user’’ syntax), we skip that component. PaEnum returns 0 if all clients returned 0, or 1 if some client returned 1. If some client returns 1, the enumeration is aborted.

SEE ALSO

magicutils (3)

RUNSTATS ( 3 ) CAD Tool User’s Manual RUNSTATS ( 3 )

NAME

runstats−keep track of process time and memory utilization (in libmagicutils.a)

SYNOPSIS

#include <sys/types.h> #include <sys/times.h> #include <sys/time.h> #include runstats.h

char *RunStats(flags, lastt, deltat) int flags;

struct tms *lastt, *deltat; char *RunStatsRealTime()

DESCRIPTION

RunStats collects information about a process’s utilization of memory and CPU time. Depending on the

flags provided, the following information is returned:

RS_TCUM

cumulative user and system time

RS_TINCR

the difference between the current cumulative user and system time and the values stored in the

tms struct pointed to by lastt. This struct is usually the one last passed to RunStats when it was

last called with RS_TINCR as a flag.

RS_MEM

the number of bytes by which the data segment has grown past its initial size.

RunStats returns a pointer to a statically allocated character string of the form ‘‘[... stuff ...]’’, where stuff

contains the information specified by the flags. Times are of the form mins:secsu mins:secss, where the first time is the amount of user CPU time this process has used, and the second time is the amount of sys- tem time used. Memory is specified by a string of the form Nk, where N is the number of kilobytes by which the data segment has grown past its initial size.

If RS_TINCR is specified, the parameters lastt and deltat are set if they are non-NULL. Both point to tms structs; the one pointed to by deltat is set to the difference between the current user/system time and the time given in the tms struct pointed to by lastt; the one pointed to by lastt is then set to the current user/system time.

RunStatsRealTime reports the real time, both since the first invocation and incremental since the last invo-

cation. It returns a statically allocated string of the form x:xx.x x:xx.x, where the first number is the amount of elapsed real time since the first call to RunStatsRealTime, and the second is the amount of elapsed real time since the latest call.

BUGS

The interfaces to RunStats and RunStatsRealTime should really be consistent.

SEE ALSO

magicutils (3)

SET ( 3 ) CAD Tool User’s Manual SET ( 3 )

NAME

set−procedures for setting parameters (from strings) and for printing their values.

SYNOPSIS

In document WRL 90 7 pdf (Page 77-82)