forked from JackHack96/logic-synthesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjedi.h
81 lines (71 loc) · 2.39 KB
/
jedi.h
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
/*
* Symbolic encoding program for compiling a symbolic
* description into a binary representation. Target
* is multi-level logic synthesis
*
* History:
*
* Bill Lin
* University of California, Berkeley
* Comments to [email protected]
*
* Copyright (c) 1989 Bill Lin, UC Berkeley CAD Group
* Permission is granted to do anything with this
* code except sell it or remove this message.
*/
#include "copyright.h"
#include "port.h"
#include "utility.h"
#include "util.h"
#include "jedi_int.h"
/*
* type declarations
*/
typedef struct Enumtype {
char *name; /* name of the enumerated type */
int ns; /* number of symbols */
int nb; /* number of bits for encoding */
int nc; /* number of possible codes */
Boolean input_flag; /* indicate input weights computed */
Boolean output_flag; /* indicate output weights computed */
char *dont_care; /* don't care bit-vector */
struct Symbol *symbols; /* array of admissible values */
struct Code *codes; /* array of possible codes */
struct Link **links; /* connectivity matrix */
int **distances; /* code distance matrix */
} Enumtype;
typedef struct Symbol {
char *token; /* mnemonic string */
int code_ptr; /* pointer to current assigned code */
} Symbol;
typedef struct Code {
Boolean assigned; /* assigned flag */
char *bit_vector; /* binary bit vector equivalent of decimal */
int symbol_ptr; /* pointer to current assigned symbol */
} Code;
typedef struct Link {
int weight; /* weight of this link */
} Link;
typedef struct Variable {
char *name; /* name of the variable */
Boolean boolean_flag; /* indicates a boolean type */
int enumtype_ptr; /* pointer to enumtype type */
struct Entry *entries; /* array of table entries */
} Variable;
typedef struct Entry {
char *token; /* mnemonic string */
int enumtype_ptr; /* pointer to enumtype type */
int symbol_ptr; /* pointer to symbol in enumtype */
} Entry;
/*
* global variables
*/
int ni; /* number of inputs */
int no; /* number of outputs */
int np; /* number of symbolic product terms */
int ne; /* number of enumtype types */
int tni; /* total number of binary inputs */
int tno; /* total number of binary outputs */
struct Enumtype *enumtypes; /* array of enumtypes */
struct Variable *inputs; /* array of inputs */
struct Variable *outputs; /* array of outputs */