abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
intFrames.c File Reference
#include "intInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Aig_Man_t
Inter_ManFramesInter (Aig_Man_t *pAig, int nFrames, int fAddRegOuts, int fUseTwoFrames)
 DECLARATIONS ///. More...
 

Function Documentation

ABC_NAMESPACE_IMPL_START Aig_Man_t* Inter_ManFramesInter ( Aig_Man_t pAig,
int  nFrames,
int  fAddRegOuts,
int  fUseTwoFrames 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [intFrames.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Sequential AIG unrolling for interpolation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 24, 2008.]

Revision [

Id:
intFrames.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Create timeframes of the manager for interpolation.]

Description [The resulting manager is combinational. The primary inputs corresponding to register outputs are ordered first. The only POs of the manager is the property output of the last timeframe.]

SideEffects []

SeeAlso []

Definition at line 47 of file intFrames.c.

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 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition: saig.h:101
void * pData
Definition: aig.h:87
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
for(p=first;p->value< newval;p=p->next)
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static int Saig_ManConstrNum(Aig_Man_t *p)
Definition: saig.h:78
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:259
Definition: aig.h:69
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
#define assert(ex)
Definition: util_old.h:213
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91