abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fpga.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [fpga.h]
4 
5  PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]
6 
7  Synopsis [Technology mapping for variable-size-LUT FPGAs.]
8 
9  Author [MVSIS Group]
10 
11  Affiliation [UC Berkeley]
12 
13  Date [Ver. 2.0. Started - August 18, 2004.]
14 
15  Revision [$Id: fpga.h,v 1.7 2004/09/30 21:18:09 satrajit Exp $]
16 
17 ***********************************************************************/
18 
19 #ifndef ABC__map__fpga__fpga_h
20 #define ABC__map__fpga__fpga_h
21 
22 
23 ////////////////////////////////////////////////////////////////////////
24 /// INCLUDES ///
25 ////////////////////////////////////////////////////////////////////////
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// PARAMETERS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 
32 
34 
35 
36 // the maximum size of LUTs used for mapping
37 #define FPGA_MAX_LUTSIZE 32
38 
39 ////////////////////////////////////////////////////////////////////////
40 /// STRUCTURE DEFINITIONS ///
41 ////////////////////////////////////////////////////////////////////////
42 
48 
49 ////////////////////////////////////////////////////////////////////////
50 /// GLOBAL VARIABLES ///
51 ////////////////////////////////////////////////////////////////////////
52 
53 ////////////////////////////////////////////////////////////////////////
54 /// MACRO DEFINITIONS ///
55 ////////////////////////////////////////////////////////////////////////
56 
57 #define Fpga_IsComplement(p) (((int)((ABC_PTRUINT_T) (p) & 01)))
58 #define Fpga_Regular(p) ((Fpga_Node_t *)((ABC_PTRUINT_T)(p) & ~01))
59 #define Fpga_Not(p) ((Fpga_Node_t *)((ABC_PTRUINT_T)(p) ^ 01))
60 #define Fpga_NotCond(p,c) ((Fpga_Node_t *)((ABC_PTRUINT_T)(p) ^ (c)))
61 
62 #define Fpga_Ref(p)
63 #define Fpga_Deref(p)
64 #define Fpga_RecursiveDeref(p,c)
65 
66 ////////////////////////////////////////////////////////////////////////
67 /// FUNCTION DEFINITIONS ///
68 ////////////////////////////////////////////////////////////////////////
69 
70 /*=== fpgaCreate.c =============================================================*/
71 extern Fpga_Man_t * Fpga_ManCreate( int nInputs, int nOutputs, int fVerbose );
73 extern void Fpga_ManFree( Fpga_Man_t * pMan );
74 extern void Fpga_ManPrintTimeStats( Fpga_Man_t * p );
75 
76 extern int Fpga_ManReadInputNum( Fpga_Man_t * p );
77 extern int Fpga_ManReadOutputNum( Fpga_Man_t * p );
81 extern float * Fpga_ManReadInputArrivals( Fpga_Man_t * p );
82 extern int Fpga_ManReadVerbose( Fpga_Man_t * p );
83 extern int Fpga_ManReadVarMax( Fpga_Man_t * p );
84 extern float * Fpga_ManReadLutAreas( Fpga_Man_t * p );
86 extern void Fpga_ManSetOutputNames( Fpga_Man_t * p, char ** ppNames );
87 extern void Fpga_ManSetInputArrivals( Fpga_Man_t * p, float * pArrivals );
88 extern void Fpga_ManSetAreaRecovery( Fpga_Man_t * p, int fAreaRecovery );
89 extern void Fpga_ManSetDelayLimit( Fpga_Man_t * p, float DelayLimit );
90 extern void Fpga_ManSetAreaLimit( Fpga_Man_t * p, float AreaLimit );
91 extern void Fpga_ManSetObeyFanoutLimits( Fpga_Man_t * p, int fObeyFanoutLimits );
92 extern void Fpga_ManSetNumIterations( Fpga_Man_t * p, int nNumIterations );
94 extern void Fpga_ManSetFanoutViolations( Fpga_Man_t * p, int nVio );
95 extern void Fpga_ManSetChoiceNodeNum( Fpga_Man_t * p, int nChoiceNodes );
96 extern void Fpga_ManSetChoiceNum( Fpga_Man_t * p, int nChoices );
97 extern void Fpga_ManSetVerbose( Fpga_Man_t * p, int fVerbose );
98 extern void Fpga_ManSetSwitching( Fpga_Man_t * p, int fSwitching );
99 extern void Fpga_ManSetLatchPaths( Fpga_Man_t * p, int fLatchPaths );
100 extern void Fpga_ManSetLatchNum( Fpga_Man_t * p, int nLatches );
101 extern void Fpga_ManSetDelayTarget( Fpga_Man_t * p, float DelayTarget );
102 extern void Fpga_ManSetName( Fpga_Man_t * p, char * pFileName );
103 
104 extern int Fpga_LibReadLutMax( Fpga_LutLib_t * pLib );
105 
106 extern char * Fpga_NodeReadData0( Fpga_Node_t * p );
108 extern int Fpga_NodeReadRefs( Fpga_Node_t * p );
109 extern int Fpga_NodeReadNum( Fpga_Node_t * p );
110 extern int Fpga_NodeReadLevel( Fpga_Node_t * p );
115 extern void Fpga_NodeSetLevel( Fpga_Node_t * p, Fpga_Node_t * pNode );
116 extern void Fpga_NodeSetData0( Fpga_Node_t * p, char * pData );
117 extern void Fpga_NodeSetData1( Fpga_Node_t * p, Fpga_Node_t * pNode );
118 extern void Fpga_NodeSetArrival( Fpga_Node_t * p, float Time );
119 extern void Fpga_NodeSetNextE( Fpga_Node_t * p, Fpga_Node_t * pNextE );
120 extern void Fpga_NodeSetRepr( Fpga_Node_t * p, Fpga_Node_t * pRepr );
121 extern void Fpga_NodeSetSwitching( Fpga_Node_t * p, float Switching );
122 
123 extern int Fpga_NodeIsConst( Fpga_Node_t * p );
124 extern int Fpga_NodeIsVar( Fpga_Node_t * p );
125 extern int Fpga_NodeIsAnd( Fpga_Node_t * p );
126 extern int Fpga_NodeComparePhase( Fpga_Node_t * p1, Fpga_Node_t * p2 );
127 
128 extern int Fpga_CutReadLeavesNum( Fpga_Cut_t * p );
130 
131 extern Fpga_Node_t * Fpga_NodeAnd( Fpga_Man_t * p, Fpga_Node_t * p1, Fpga_Node_t * p2 );
132 extern Fpga_Node_t * Fpga_NodeOr( Fpga_Man_t * p, Fpga_Node_t * p1, Fpga_Node_t * p2 );
133 extern Fpga_Node_t * Fpga_NodeExor( Fpga_Man_t * p, Fpga_Node_t * p1, Fpga_Node_t * p2 );
134 extern Fpga_Node_t * Fpga_NodeMux( Fpga_Man_t * p, Fpga_Node_t * pNode, Fpga_Node_t * pNodeT, Fpga_Node_t * pNodeE );
135 extern void Fpga_NodeSetChoice( Fpga_Man_t * pMan, Fpga_Node_t * pNodeOld, Fpga_Node_t * pNodeNew );
136 
137 extern void Fpga_ManStats( Fpga_Man_t * p );
138 
139 /*=== fpgaCore.c =============================================================*/
140 extern int Fpga_Mapping( Fpga_Man_t * p );
141 /*=== fpgaCut.c ===============================================================*/
142 extern void Fpga_MappingCreatePiCuts( Fpga_Man_t * p );
143 extern void Fpga_CutsCleanSign( Fpga_Man_t * pMan );
144 extern void Fpga_CutsCleanRoot( Fpga_Man_t * pMan );
145 /*=== fpgaCutUtils.c =============================================================*/
146 extern void Fpga_CutCreateFromNode( Fpga_Man_t * p, int iRoot, int * pLeaves, int nLeaves );
147 extern void Fpga_MappingSetUsedCuts( Fpga_Man_t * p );
148 /*=== fpgaLib.c =============================================================*/
150 extern int Fpga_LutLibReadVarMax( Fpga_LutLib_t * p );
151 extern float * Fpga_LutLibReadLutAreas( Fpga_LutLib_t * p );
152 extern float * Fpga_LutLibReadLutDelays( Fpga_LutLib_t * p );
153 extern float Fpga_LutLibReadLutArea( Fpga_LutLib_t * p, int Size );
154 extern float Fpga_LutLibReadLutDelay( Fpga_LutLib_t * p, int Size );
155 /*=== fpgaTruth.c =============================================================*/
156 extern void * Fpga_TruthsCutBdd( void * dd, Fpga_Cut_t * pCut );
157 extern int Fpga_CutVolume( Fpga_Cut_t * pCut );
158 /*=== fpgaUtil.c =============================================================*/
159 extern int Fpga_ManCheckConsistency( Fpga_Man_t * p );
160 extern void Fpga_ManCleanData0( Fpga_Man_t * pMan );
161 extern Fpga_NodeVec_t * Fpga_CollectNodeTfo( Fpga_Man_t * pMan, Fpga_Node_t * pNode );
162 /*=== fpga.c =============================================================*/
163 extern void Fpga_SetSimpleLutLib( int nLutSize );
164 
165 
166 
168 
169 
170 
171 #endif
172 
173 ////////////////////////////////////////////////////////////////////////
174 /// END OF FILE ///
175 ////////////////////////////////////////////////////////////////////////
void Fpga_ManSetAreaRecovery(Fpga_Man_t *p, int fAreaRecovery)
Definition: fpgaCreate.c:63
int Fpga_ManReadVarMax(Fpga_Man_t *p)
Definition: fpgaCreate.c:58
Fpga_Node_t ** Fpga_ManReadInputs(Fpga_Man_t *p)
Definition: fpgaCreate.c:53
Fpga_Node_t * Fpga_NodeMux(Fpga_Man_t *p, Fpga_Node_t *pNode, Fpga_Node_t *pNodeT, Fpga_Node_t *pNodeE)
Definition: fpgaCreate.c:522
void Fpga_CutsCleanSign(Fpga_Man_t *pMan)
Definition: fpgaCut.c:797
void Fpga_ManSetName(Fpga_Man_t *p, char *pFileName)
Definition: fpgaCreate.c:73
Fpga_Node_t * Fpga_NodeCreate(Fpga_Man_t *p, Fpga_Node_t *p1, Fpga_Node_t *p2)
Definition: fpgaCreate.c:293
void Fpga_NodeSetData0(Fpga_Node_t *p, char *pData)
Definition: fpgaCreate.c:108
int Fpga_CutVolume(Fpga_Cut_t *pCut)
Definition: fpgaTruth.c:140
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Fpga_ManSetLatchNum(Fpga_Man_t *p, int nLatches)
Definition: fpgaCreate.c:71
void Fpga_NodeSetNextE(Fpga_Node_t *p, Fpga_Node_t *pNextE)
Definition: fpgaCreate.c:110
void Fpga_ManSetAreaLimit(Fpga_Man_t *p, float AreaLimit)
Definition: fpgaCreate.c:65
int Fpga_LibReadLutMax(Fpga_LutLib_t *pLib)
Definition: fpgaCreate.c:86
void Fpga_MappingCreatePiCuts(Fpga_Man_t *p)
Definition: fpgaCut.c:181
void Fpga_ManCleanData0(Fpga_Man_t *pMan)
Definition: fpgaUtils.c:657
Fpga_Node_t * Fpga_NodeReadOne(Fpga_Node_t *p)
Definition: fpgaCreate.c:106
int Fpga_NodeReadRefs(Fpga_Node_t *p)
Definition: fpgaCreate.c:101
Fpga_LutLib_t * Fpga_LutLibDup(Fpga_LutLib_t *p)
Definition: fpgaLib.c:165
void Fpga_CutsCleanRoot(Fpga_Man_t *pMan)
Definition: fpgaCut.c:819
int Fpga_NodeComparePhase(Fpga_Node_t *p1, Fpga_Node_t *p2)
Definition: fpgaCreate.c:128
void Fpga_NodeSetData1(Fpga_Node_t *p, Fpga_Node_t *pNode)
Definition: fpgaCreate.c:109
Fpga_Node_t * Fpga_ManReadConst1(Fpga_Man_t *p)
Definition: fpgaCreate.c:55
void Fpga_ManSetNumIterations(Fpga_Man_t *p, int nNumIterations)
Fpga_Node_t * Fpga_NodeReadData1(Fpga_Node_t *p)
Definition: fpgaCreate.c:100
void Fpga_NodeSetSwitching(Fpga_Node_t *p, float Switching)
Definition: fpgaCreate.c:112
void Fpga_ManSetDelayLimit(Fpga_Man_t *p, float DelayLimit)
Definition: fpgaCreate.c:64
int Fpga_ManReadInputNum(Fpga_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: fpgaCreate.c:51
void Fpga_ManSetLatchPaths(Fpga_Man_t *p, int fLatchPaths)
Definition: fpgaCreate.c:70
void Fpga_MappingSetUsedCuts(Fpga_Man_t *p)
Definition: fpgaCutUtils.c:459
void Fpga_ManSetObeyFanoutLimits(Fpga_Man_t *p, int fObeyFanoutLimits)
float * Fpga_ManReadInputArrivals(Fpga_Man_t *p)
Definition: fpgaCreate.c:56
Fpga_Node_t * Fpga_NodeReadTwo(Fpga_Node_t *p)
Definition: fpgaCreate.c:107
float * Fpga_ManReadLutAreas(Fpga_Man_t *p)
Definition: fpgaCreate.c:59
void Fpga_NodeSetRepr(Fpga_Node_t *p, Fpga_Node_t *pRepr)
Definition: fpgaCreate.c:111
float * Fpga_LutLibReadLutAreas(Fpga_LutLib_t *p)
Definition: fpgaLib.c:44
void Fpga_ManSetInputArrivals(Fpga_Man_t *p, float *pArrivals)
Definition: fpgaCreate.c:62
Fpga_Cut_t * Fpga_NodeReadCutBest(Fpga_Node_t *p)
Definition: fpgaCreate.c:105
int Fpga_ManReadVerbose(Fpga_Man_t *p)
Definition: fpgaCreate.c:57
int Fpga_ManReadOutputNum(Fpga_Man_t *p)
Definition: fpgaCreate.c:52
void Fpga_CutCreateFromNode(Fpga_Man_t *p, int iRoot, int *pLeaves, int nLeaves)
int Fpga_ManReadFanoutViolations(Fpga_Man_t *p)
Fpga_NodeVec_t * Fpga_CollectNodeTfo(Fpga_Man_t *pMan, Fpga_Node_t *pNode)
Definition: fpgaUtils.c:675
Fpga_Cut_t * Fpga_NodeReadCuts(Fpga_Node_t *p)
Definition: fpgaCreate.c:104
float * Fpga_LutLibReadLutDelays(Fpga_LutLib_t *p)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
int Fpga_Mapping(Fpga_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: fpgaCore.c:53
Fpga_Node_t ** Fpga_ManReadOutputs(Fpga_Man_t *p)
Definition: fpgaCreate.c:54
int Fpga_NodeIsConst(Fpga_Node_t *p)
Definition: fpgaCreate.c:125
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int Fpga_NodeReadLevel(Fpga_Node_t *p)
Definition: fpgaCreate.c:103
void Fpga_ManSetFanoutViolations(Fpga_Man_t *p, int nVio)
void Fpga_ManFree(Fpga_Man_t *pMan)
Definition: fpgaCreate.c:217
int Fpga_NodeIsAnd(Fpga_Node_t *p)
Definition: fpgaCreate.c:127
Fpga_Node_t * Fpga_NodeAnd(Fpga_Man_t *p, Fpga_Node_t *p1, Fpga_Node_t *p2)
Definition: fpgaCreate.c:470
Fpga_Node_t ** Fpga_CutReadLeaves(Fpga_Cut_t *p)
Definition: fpgaCreate.c:142
char * Fpga_NodeReadData0(Fpga_Node_t *p)
Definition: fpgaCreate.c:99
float Fpga_LutLibReadLutArea(Fpga_LutLib_t *p, int Size)
Definition: fpgaLib.c:45
void Fpga_ManSetDelayTarget(Fpga_Man_t *p, float DelayTarget)
Definition: fpgaCreate.c:72
int Fpga_NodeIsVar(Fpga_Node_t *p)
Definition: fpgaCreate.c:126
void Fpga_ManSetVerbose(Fpga_Man_t *p, int fVerbose)
Definition: fpgaCreate.c:68
STRUCTURE DEFINITIONS ///.
Definition: fpgaInt.h:99
void Fpga_ManSetOutputNames(Fpga_Man_t *p, char **ppNames)
Definition: fpgaCreate.c:61
int Fpga_CutReadLeavesNum(Fpga_Cut_t *p)
Definition: fpgaCreate.c:141
Fpga_Node_t * Fpga_NodeExor(Fpga_Man_t *p, Fpga_Node_t *p1, Fpga_Node_t *p2)
Definition: fpgaCreate.c:506
void Fpga_ManSetChoiceNum(Fpga_Man_t *p, int nChoices)
Definition: fpgaCreate.c:67
Fpga_Man_t * Fpga_ManCreate(int nInputs, int nOutputs, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: fpgaCreate.c:163
void Fpga_SetSimpleLutLib(int nLutSize)
Definition: fpga.c:252
void Fpga_NodeSetChoice(Fpga_Man_t *pMan, Fpga_Node_t *pNodeOld, Fpga_Node_t *pNodeNew)
Definition: fpgaCreate.c:544
void * Fpga_TruthsCutBdd(void *dd, Fpga_Cut_t *pCut)
Definition: fpgaTruth.c:79
Fpga_Node_t * Fpga_NodeOr(Fpga_Man_t *p, Fpga_Node_t *p1, Fpga_Node_t *p2)
Definition: fpgaCreate.c:488
int Fpga_LutLibReadVarMax(Fpga_LutLib_t *p)
DECLARATIONS ///.
Definition: fpgaLib.c:43
void Fpga_ManSetChoiceNodeNum(Fpga_Man_t *p, int nChoiceNodes)
Definition: fpgaCreate.c:66
void Fpga_ManSetSwitching(Fpga_Man_t *p, int fSwitching)
Definition: fpgaCreate.c:69
float Fpga_LutLibReadLutDelay(Fpga_LutLib_t *p, int Size)
void Fpga_NodeSetArrival(Fpga_Node_t *p, float Time)
Fpga_NodeVec_t * Fpga_ManReadMapping(Fpga_Man_t *p)
Definition: fpgaCreate.c:60
void Fpga_ManPrintTimeStats(Fpga_Man_t *p)
Definition: fpgaCreate.c:252
int Fpga_NodeReadNum(Fpga_Node_t *p)
Definition: fpgaCreate.c:102
void Fpga_ManStats(Fpga_Man_t *p)
Definition: fpgaCreate.c:564
void Fpga_NodeSetLevel(Fpga_Node_t *p, Fpga_Node_t *pNode)
int Fpga_ManCheckConsistency(Fpga_Man_t *p)
Definition: fpgaUtils.c:500