File: readliberty.h

package info (click to toggle)
qflow 1.3.17+dfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,852 kB
  • sloc: ansic: 8,342; csh: 3,873; sh: 2,869; makefile: 417; tcl: 6
file content (99 lines) | stat: -rw-r--r-- 2,688 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*--------------------------------------------------------------*/
/* readliberty.h ---						*/
/*								*/
/* Header file for readliberty.c				*/
/*--------------------------------------------------------------*/

#define LIB_LINE_MAX  65535

#define INIT		0
#define LIBBLOCK	1
#define CELLDEF		2
#define PINDEF		3
#define TIMING		4

// Pin types (a clock is also an input)
#define	PIN_UNKNOWN	-1
#define PIN_INPUT	0
#define PIN_CLOCK	1
#define PIN_OUTPUT	2

// Function translation
#define GROUPBEGIN	1
#define GROUPEND	2
#define SIGNAL		3
#define OPERATOR	4
#define XOPERATOR	5
#define SEPARATOR	6

/*--------------------------------------------------------------*/
/* Database							*/
/*--------------------------------------------------------------*/

typedef struct _lutable *lutableptr;

typedef struct _lutable {
    char *name;
    char invert;	// 0 if times x caps, 1 if caps x times
    char *var1;		// Name of array in index1
    char *var2;		// Name of array in index2
    int  tsize;		// Number of entries in time array
    int  csize;		// Number of entries in cap array
    double *times;	// Time array (units fF)
    double *caps;	// Cap array (units ps)
    lutableptr next;
} LUTable;

/*--------------------------------------------------------------*/

typedef struct _bustype *bustypeptr;

typedef struct _bustype {
    char *name;
    int  from;		// Bus array first index
    int  to;		// Bus array last index
    bustypeptr next;
} BUStype;

/*--------------------------------------------------------------*/

typedef struct _pin *pinptr;

typedef struct _pin {
    char *name;
    int	type;
    double cap;
    double maxtrans;
    double maxcap;
    pinptr next;
} Pin;

/*--------------------------------------------------------------*/

typedef struct _cell *cellptr;

typedef struct _cell {
    char *name;
    char *function;
    Pin	 *pins;
    double area;
    double slope;
    double mintrans;
    LUTable *reftable;
    double *times;	// Local values for time indexes, if given
    double *caps;	// Local values for cap indexes, if given
    double *values;	// Matrix of all values
    cellptr next;
} Cell;

/*--------------------------------------------------------------*/

extern int get_pintype(Cell *curcell, char *pinname);
extern int get_pincap(Cell *curcell, char *pinname, double *retcap);
extern int get_values(Cell *curcell, double *retdelay, double *retcap);
extern Cell *read_liberty(char *libfile, char *pattern);
extern Cell *get_cell_by_name(Cell *cell, char *name);
extern Pin *get_pin_by_name(Cell *curcell, char *pinname);
extern void delete_cell_list(Cell *cell);

/*--------------------------------------------------------------*/