ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
intFrames.c
Go to the documentation of this file.
1
20
21#include "intInt.h"
22
24
25
29
33
47Aig_Man_t * Inter_ManFramesInter( Aig_Man_t * pAig, int nFrames, int fAddRegOuts, int fUseTwoFrames )
48{
49 Aig_Man_t * pFrames;
50 Aig_Obj_t * pObj, * pObjLi, * pObjLo;
51 Aig_Obj_t * pLastPo = NULL;
52 int i, f;
53 assert( Saig_ManRegNum(pAig) > 0 );
54 assert( Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) == 1 );
55 pFrames = Aig_ManStart( Aig_ManNodeNum(pAig) * nFrames );
56 // map the constant node
57 Aig_ManConst1(pAig)->pData = Aig_ManConst1( pFrames );
58 // create variables for register outputs
59 if ( fAddRegOuts )
60 {
61 Saig_ManForEachLo( pAig, pObj, i )
62 pObj->pData = Aig_ManConst0( pFrames );
63 }
64 else
65 {
66 Saig_ManForEachLo( pAig, pObj, i )
67 pObj->pData = Aig_ObjCreateCi( pFrames );
68 }
69 // add timeframes
70 for ( f = 0; f < nFrames; f++ )
71 {
72 // create PI nodes for this frame
73 Saig_ManForEachPi( pAig, pObj, i )
74 pObj->pData = Aig_ObjCreateCi( pFrames );
75 // add internal nodes of this frame
76 Aig_ManForEachNode( pAig, pObj, i )
77 pObj->pData = Aig_And( pFrames, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
78 // add outputs for constraints
79 Saig_ManForEachPo( pAig, pObj, i )
80 {
81 if ( i < Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) )
82 continue;
83 Aig_ObjCreateCo( pFrames, Aig_Not( Aig_ObjChild0Copy(pObj) ) );
84 }
85 if ( f == nFrames - 1 )
86 break;
87 // remember the last PO
88 pObj = Aig_ManCo( pAig, 0 );
89 pLastPo = Aig_ObjChild0Copy(pObj);
90 // save register inputs
91 Saig_ManForEachLi( pAig, pObj, i )
92 pObj->pData = Aig_ObjChild0Copy(pObj);
93 // transfer to register outputs
94 Saig_ManForEachLiLo( pAig, pObjLi, pObjLo, i )
95 pObjLo->pData = pObjLi->pData;
96 }
97 // create POs for each register output
98 if ( fAddRegOuts )
99 {
100 Saig_ManForEachLi( pAig, pObj, i )
101 Aig_ObjCreateCo( pFrames, Aig_ObjChild0Copy(pObj) );
102 }
103 // create the only PO of the manager
104 else
105 {
106 pObj = Aig_ManCo( pAig, 0 );
107 // add the last PO
108 if ( pLastPo == NULL || !fUseTwoFrames )
109 pLastPo = Aig_ObjChild0Copy(pObj);
110 else
111 pLastPo = Aig_Or( pFrames, pLastPo, Aig_ObjChild0Copy(pObj) );
112 Aig_ObjCreateCo( pFrames, pLastPo );
113 }
114 Aig_ManCleanup( pFrames );
115 return pFrames;
116}
117
121
122
124
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:104
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition aigObj.c:66
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition aigMan.c:47
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
int Aig_ManCleanup(Aig_Man_t *p)
Definition aigMan.c:265
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigObj.c:45
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:259
ABC_NAMESPACE_IMPL_START Aig_Man_t * Inter_ManFramesInter(Aig_Man_t *pAig, int nFrames, int fAddRegOuts, int fUseTwoFrames)
DECLARATIONS ///.
Definition intFrames.c:47
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition saig.h:101
#define Saig_ManForEachLi(p, pObj, i)
Definition saig.h:98
#define Saig_ManForEachPo(p, pObj, i)
Definition saig.h:93
#define Saig_ManForEachLo(p, pObj, i)
Definition saig.h:96
#define Saig_ManForEachPi(p, pObj, i)
Definition saig.h:91
void * pData
Definition aig.h:87
#define assert(ex)
Definition util_old.h:213