ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
fsimInt.h
Go to the documentation of this file.
1
20
21#ifndef ABC__aig__fsim__fsimInt_h
22#define ABC__aig__fsim__fsimInt_h
23
24
28
29#include "aig/saig/saig.h"
30#include "fsim.h"
31
35
36
37
39
40
44
45// simulation object
46typedef struct Fsim_Obj_t_ Fsim_Obj_t;
48{
49 int iNode; // the node ID
50 int iFan0; // the first fanin
51 int iFan1; // the second fanin
52};
53
54// fast sequential simulation manager
56{
57 // parameters
58 Aig_Man_t * pAig; // the AIG to be used for simulation
59 int nWords; // the number of simulation words
60 // AIG representation
61 int nPis; // the number of primary inputs
62 int nPos; // the number of primary outputs
63 int nCis; // the number of combinational inputs
64 int nCos; // the number of combinational outputs
65 int nNodes; // the number of internal nodes
66 int nObjs; // nCis + nNodes + nCos + 2
67 int * pFans0; // fanin0 for all objects
68 int * pFans1; // fanin1 for all objects
69 int * pRefs; // reference counter for each node
70 int * pRefsCopy; // reference counter for each node
71 Vec_Int_t * vCis2Ids; // mapping of CIs into their PI ids
72 Vec_Int_t * vLos; // register outputs
73 Vec_Int_t * vLis; // register inputs
74 // cross-cut representation
75 int nCrossCut; // temporary cross-cut variable
76 int nCrossCutMax; // maximum cross-cut variable
77 int nFront; // the size of frontier
78 // derived AIG representation
79 int nDataAig; // the length of allocated data
80 unsigned char * pDataAig; // AIG representation
81 unsigned char * pDataCur; // AIG representation (current position)
82 int iNodePrev; // previous extracted value
83 int iNumber; // the number of the last object
84 Fsim_Obj_t Obj; // current object
85 // temporary AIG representation
86 int * pDataAig2; // temporary representation
87 int * pDataCur2; // AIG representation (current position)
88 // simulation information
89 unsigned * pDataSim; // simulation data
90 unsigned * pDataSimCis; // simulation data for CIs
91 unsigned * pDataSimCos; // simulation data for COs
92 // other information
93 int * pData1;
94 int * pData2;
95};
96
97static inline unsigned * Fsim_SimData( Fsim_Man_t * p, int i ) { return p->pDataSim + i * p->nWords; }
98static inline unsigned * Fsim_SimDataCi( Fsim_Man_t * p, int i ) { return p->pDataSimCis + i * p->nWords; }
99static inline unsigned * Fsim_SimDataCo( Fsim_Man_t * p, int i ) { return p->pDataSimCos + i * p->nWords; }
100
104
105static inline int Fsim_Var2Lit( int Var, int fCompl ) { return Var + Var + fCompl; }
106static inline int Fsim_Lit2Var( int Lit ) { return Lit >> 1; }
107static inline int Fsim_LitIsCompl( int Lit ) { return Lit & 1; }
108static inline int Fsim_LitNot( int Lit ) { return Lit ^ 1; }
109static inline int Fsim_LitNotCond( int Lit, int c ) { return Lit ^ (int)(c > 0); }
110static inline int Fsim_LitRegular( int Lit ) { return Lit & ~01; }
111
112#define Fsim_ManForEachObj( p, pObj, i )\
113 for ( i = 2, p->pDataCur = p->pDataAig, p->iNodePrev = 0, pObj = &p->Obj;\
114 i < p->nObjs && Fsim_ManRestoreObj( p, pObj ); i++ )
115
119
120/*=== fsimFront.c ========================================================*/
121extern void Fsim_ManFront( Fsim_Man_t * p, int fCompressAig );
122/*=== fsimMan.c ==========================================================*/
123extern Fsim_Man_t * Fsim_ManCreate( Aig_Man_t * pAig );
124extern void Fsim_ManDelete( Fsim_Man_t * p );
125extern void Fsim_ManTest( Aig_Man_t * pAig );
126
127
128
130
131
132
133#endif
134
138
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
int Var
Definition exorList.c:228
void Fsim_ManFront(Fsim_Man_t *p, int fCompressAig)
FUNCTION DECLARATIONS ///.
Definition fsimFront.c:245
void Fsim_ManDelete(Fsim_Man_t *p)
Definition fsimMan.c:169
typedefABC_NAMESPACE_HEADER_START struct Fsim_Obj_t_ Fsim_Obj_t
INCLUDES ///.
Definition fsimInt.h:46
void Fsim_ManTest(Aig_Man_t *pAig)
Definition fsimMan.c:198
Fsim_Man_t * Fsim_ManCreate(Aig_Man_t *pAig)
Definition fsimMan.c:102
typedefABC_NAMESPACE_HEADER_START struct Fsim_Man_t_ Fsim_Man_t
INCLUDES ///.
Definition fsim.h:42
int nObjs
Definition fsimInt.h:66
int nDataAig
Definition fsimInt.h:79
int * pFans1
Definition fsimInt.h:68
int * pData2
Definition fsimInt.h:94
int * pDataCur2
Definition fsimInt.h:87
Vec_Int_t * vLos
Definition fsimInt.h:72
int iNumber
Definition fsimInt.h:83
unsigned * pDataSimCis
Definition fsimInt.h:90
Vec_Int_t * vCis2Ids
Definition fsimInt.h:71
int nWords
Definition fsimInt.h:59
int * pData1
Definition fsimInt.h:93
int nCrossCutMax
Definition fsimInt.h:76
int * pFans0
Definition fsimInt.h:67
unsigned char * pDataAig
Definition fsimInt.h:80
int nNodes
Definition fsimInt.h:65
int iNodePrev
Definition fsimInt.h:82
Vec_Int_t * vLis
Definition fsimInt.h:73
unsigned char * pDataCur
Definition fsimInt.h:81
int nFront
Definition fsimInt.h:77
int * pRefs
Definition fsimInt.h:69
int nCrossCut
Definition fsimInt.h:75
int * pRefsCopy
Definition fsimInt.h:70
int * pDataAig2
Definition fsimInt.h:86
unsigned * pDataSimCos
Definition fsimInt.h:91
Aig_Man_t * pAig
Definition fsimInt.h:58
Fsim_Obj_t Obj
Definition fsimInt.h:84
unsigned * pDataSim
Definition fsimInt.h:89
int iFan0
Definition fsimInt.h:50
int iNode
Definition fsimInt.h:49
int iFan1
Definition fsimInt.h:51