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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Gia_Man_t
Gia_ManDupIn2Ff (Gia_Man_t *p)
 DECLARATIONS ///. More...
 
int Gia_ManDupFf2In_rec (Gia_Man_t *pNew, Gia_Obj_t *pObj)
 
Gia_Man_tGia_ManDupFf2In (Gia_Man_t *p, int nFlopsOld)
 
Gia_Man_tAbs_RpmPerformOld (Gia_Man_t *p, int fVerbose)
 

Function Documentation

Gia_Man_t* Abs_RpmPerformOld ( Gia_Man_t p,
int  fVerbose 
)

Function*************************************************************

Synopsis [Reparameterized to get rid of useless primary inputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 141 of file absRpmOld.c.

142 {
143 // extern Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
144  Aig_Man_t * pMan, * pTemp;
145  Gia_Man_t * pNew, * pTmp;
146  int nFlopsOld = Gia_ManRegNum(p);
147  if ( fVerbose )
148  {
149  printf( "Original AIG:\n" );
150  Gia_ManPrintStats( p, NULL );
151  }
152 
153  // perform input trimming
154  pNew = Gia_ManDupTrimmed( p, 1, 0, 0, -1 );
155  if ( fVerbose )
156  {
157  printf( "After PI trimming:\n" );
158  Gia_ManPrintStats( pNew, NULL );
159  }
160  // transform GIA
161  pNew = Gia_ManDupIn2Ff( pTmp = pNew );
162  Gia_ManStop( pTmp );
163  if ( fVerbose )
164  {
165  printf( "After PI-2-FF transformation:\n" );
166  Gia_ManPrintStats( pNew, NULL );
167  }
168 
169  // derive AIG
170  pMan = Gia_ManToAigSimple( pNew );
171  Gia_ManStop( pNew );
172  // perform min-reg retiming
173  pMan = Saig_ManRetimeMinArea( pTemp = pMan, 10, 0, 0, 1, 0 );
174  Aig_ManStop( pTemp );
175  // derive GIA
176  pNew = Gia_ManFromAigSimple( pMan );
177  Aig_ManStop( pMan );
178  if ( fVerbose )
179  {
180  printf( "After min-area retiming:\n" );
181  Gia_ManPrintStats( pNew, NULL );
182  }
183 
184  // transform back
185  pNew = Gia_ManDupFf2In( pTmp = pNew, nFlopsOld );
186  Gia_ManStop( pTmp );
187  if ( fVerbose )
188  {
189  printf( "After FF-2-PI tranformation:\n" );
190  Gia_ManPrintStats( pNew, NULL );
191  }
192  return pNew;
193 }
Gia_Man_t * Gia_ManDupTrimmed(Gia_Man_t *p, int fTrimCis, int fTrimCos, int fDualOut, int OutValue)
Definition: giaDup.c:1638
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition: giaMan.c:389
Aig_Man_t * Saig_ManRetimeMinArea(Aig_Man_t *p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose)
Definition: saigRetMin.c:623
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition: giaAig.c:171
ABC_NAMESPACE_IMPL_START Gia_Man_t * Gia_ManDupIn2Ff(Gia_Man_t *p)
DECLARATIONS ///.
Definition: absRpmOld.c:45
Definition: gia.h:95
Gia_Man_t * Gia_ManDupFf2In(Gia_Man_t *p, int nFlopsOld)
Definition: absRpmOld.c:108
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
Gia_Man_t* Gia_ManDupFf2In ( Gia_Man_t p,
int  nFlopsOld 
)

Function*************************************************************

Synopsis [Reverses the above step.]

Description []

SideEffects []

SeeAlso []

Definition at line 108 of file absRpmOld.c.

109 {
110  Gia_Man_t * pNew;
111  Gia_Obj_t * pObj;
112  int i;
113  pNew = Gia_ManStart( Gia_ManObjNum(p) );
114  pNew->pName = Abc_UtilStrsav( p->pName );
115  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
116  Gia_ManFillValue( p );
117  Gia_ManConst0(p)->Value = 0;
118  Gia_ManForEachRo( p, pObj, i )
119  pObj->Value = Gia_ManAppendCi( pNew );
120  for ( i = Gia_ManPiNum(p) - nFlopsOld; i < Gia_ManPiNum(p); i++ )
121  Gia_ManPi(p, i)->Value = Gia_ManAppendCi( pNew );
122  Gia_ManForEachPo( p, pObj, i )
123  Gia_ManDupFf2In_rec( pNew, Gia_ObjFanin0(pObj) );
124  Gia_ManForEachPo( p, pObj, i )
125  Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
126  Gia_ManSetRegNum( pNew, nFlopsOld );
127  return pNew;
128 }
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
int Gia_ManDupFf2In_rec(Gia_Man_t *pNew, Gia_Obj_t *pObj)
Definition: absRpmOld.c:87
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
for(p=first;p->value< newval;p=p->next)
Definition: gia.h:75
static Gia_Obj_t * Gia_ManPi(Gia_Man_t *p, int v)
Definition: gia.h:405
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
char * pName
Definition: gia.h:97
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
void Gia_ManFillValue(Gia_Man_t *p)
Definition: giaUtil.c:328
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
Definition: gia.h:95
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define Gia_ManForEachRo(p, pObj, i)
Definition: gia.h:1038
unsigned Value
Definition: gia.h:87
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
#define Gia_ManForEachPo(p, pObj, i)
Definition: gia.h:1036
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
int Gia_ManDupFf2In_rec ( Gia_Man_t pNew,
Gia_Obj_t pObj 
)

Function*************************************************************

Synopsis [Reverses the above step.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file absRpmOld.c.

88 {
89  if ( pObj->Value != ~0 )
90  return pObj->Value;
91  assert( Gia_ObjIsAnd(pObj) );
92  Gia_ManDupFf2In_rec( pNew, Gia_ObjFanin0(pObj) );
93  Gia_ManDupFf2In_rec( pNew, Gia_ObjFanin1(pObj) );
94  return pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
95 }
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: gia.h:592
int Gia_ManDupFf2In_rec(Gia_Man_t *pNew, Gia_Obj_t *pObj)
Definition: absRpmOld.c:87
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
ABC_NAMESPACE_IMPL_START Gia_Man_t* Gia_ManDupIn2Ff ( Gia_Man_t p)

DECLARATIONS ///.

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

FileName [absRpmOld.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Old min-cut-based reparametrization.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

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

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

Synopsis [Specialized duplication.]

Description [Replaces registers by PIs/POs and PIs by registers.]

SideEffects []

SeeAlso []

Definition at line 45 of file absRpmOld.c.

46 {
47  Vec_Int_t * vPiOuts;
48  Gia_Man_t * pNew;
49  Gia_Obj_t * pObj;
50  int i;
51  vPiOuts = Vec_IntAlloc( Gia_ManPiNum(p) );
52  pNew = Gia_ManStart( Gia_ManObjNum(p) + 2 * Gia_ManPiNum(p) );
53  pNew->pName = Abc_UtilStrsav( p->pName );
54  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
55  Gia_ManFillValue( p );
56  Gia_ManConst0(p)->Value = 0;
57  Gia_ManForEachPi( p, pObj, i )
58  Vec_IntPush( vPiOuts, Gia_ManAppendCi(pNew) );
59  Gia_ManForEachRo( p, pObj, i )
60  pObj->Value = Gia_ManAppendCi( pNew );
61  Gia_ManForEachPi( p, pObj, i )
62  pObj->Value = Gia_ManAppendCi( pNew );
63  Gia_ManForEachAnd( p, pObj, i )
64  pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
65  Gia_ManForEachPo( p, pObj, i )
66  pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
67  Gia_ManForEachRi( p, pObj, i )
68  pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
69  Gia_ManForEachPi( p, pObj, i )
70  Gia_ManAppendCo( pNew, Vec_IntEntry(vPiOuts, i) );
71  Gia_ManSetRegNum( pNew, Gia_ManPiNum(p) );
72  Vec_IntFree( vPiOuts );
73  return pNew;
74 }
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: gia.h:592
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
Definition: gia.h:75
char * pName
Definition: gia.h:97
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
void Gia_ManFillValue(Gia_Man_t *p)
Definition: giaUtil.c:328
#define Gia_ManForEachPi(p, pObj, i)
Definition: gia.h:1034
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
Definition: gia.h:95
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define Gia_ManForEachRo(p, pObj, i)
Definition: gia.h:1038
unsigned Value
Definition: gia.h:87
#define Gia_ManForEachRi(p, pObj, i)
Definition: gia.h:1040
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
#define Gia_ManForEachPo(p, pObj, i)
Definition: gia.h:1036
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388