summaryrefslogtreecommitdiffstats
path: root/src/sat/bmc/bmcUnroll.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-09-05 15:39:18 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-09-05 15:39:18 -0700
commite9d0466494cbf7a707a450a7e058a0ae4c652f8b (patch)
tree4433986c02f58247676c0fb032f98c848278eeab /src/sat/bmc/bmcUnroll.c
parente651e227886452e088fd8c4b87f8cf48d189f7fb (diff)
downloadabc-e9d0466494cbf7a707a450a7e058a0ae4c652f8b.tar.gz
abc-e9d0466494cbf7a707a450a7e058a0ae4c652f8b.tar.bz2
abc-e9d0466494cbf7a707a450a7e058a0ae4c652f8b.zip
Updates for the new BMC engine.
Diffstat (limited to 'src/sat/bmc/bmcUnroll.c')
-rw-r--r--src/sat/bmc/bmcUnroll.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/sat/bmc/bmcUnroll.c b/src/sat/bmc/bmcUnroll.c
index c05eb66b..9cabcd8b 100644
--- a/src/sat/bmc/bmcUnroll.c
+++ b/src/sat/bmc/bmcUnroll.c
@@ -45,7 +45,6 @@ struct Unr_Obj_t_
unsigned Res[1]; // RankMax entries
};
-typedef struct Unr_Man_t_ Unr_Man_t;
struct Unr_Man_t_
{
// input data
@@ -366,14 +365,18 @@ void Unr_ManFree( Unr_Man_t * p )
SeeAlso []
***********************************************************************/
-void Unr_ManUnrollStart( Unr_Man_t * p )
+Unr_Man_t * Unr_ManUnrollStart( Gia_Man_t * pGia, int fVerbose )
{
int i, iHandle;
+ Unr_Man_t * p;
+ p = Unr_ManAlloc( pGia );
+ Unr_ManSetup( p, fVerbose );
for ( i = 0; i < Gia_ManRegNum(p->pGia); i++ )
if ( (iHandle = Vec_IntEntry(p->vCoMap, Gia_ManPoNum(p->pGia) + i)) != -1 )
Unr_ManObjSetValue( Unr_ManObj(p, iHandle), 0 );
+ return p;
}
-void Unr_ManUnrollFrame( Unr_Man_t * p, int f )
+Gia_Man_t * Unr_ManUnrollFrame( Unr_Man_t * p, int f )
{
int i, iLit, iLit0, iLit1, hStart;
for ( i = 0; i < Gia_ManPiNum(p->pGia); i++ )
@@ -405,14 +408,19 @@ void Unr_ManUnrollFrame( Unr_Man_t * p, int f )
hStart += Unr_ObjSize( pUnrObj );
}
assert( p->pObjs + hStart == p->pEnd );
+ return p->pFrames;
}
-Gia_Man_t * Unr_ManUnroll( Unr_Man_t * p, int nFrames )
+Gia_Man_t * Unr_ManUnroll( Gia_Man_t * pGia, int nFrames )
{
+ Unr_Man_t * p;
+ Gia_Man_t * pFrames;
int f;
- Unr_ManUnrollStart( p );
+ p = Unr_ManUnrollStart( pGia, 1 );
for ( f = 0; f < nFrames; f++ )
Unr_ManUnrollFrame( p, f );
- return Gia_ManCleanup( p->pFrames );
+ pFrames = Gia_ManCleanup( p->pFrames );
+ Unr_ManFree( p );
+ return pFrames;
}
/**Function*************************************************************
@@ -472,14 +480,8 @@ void Unr_ManTest( Gia_Man_t * pGia, int nFrames )
{
Gia_Man_t * pFrames0, * pFrames1;
abctime clk = Abc_Clock();
- Unr_Man_t * p;
- p = Unr_ManAlloc( pGia );
- Unr_ManSetup( p, 1 );
- pFrames0 = Unr_ManUnroll( p, nFrames );
+ pFrames0 = Unr_ManUnroll( pGia, nFrames );
Abc_PrintTime( 1, "Unroll ", Abc_Clock() - clk );
-
- Unr_ManFree( p );
-
clk = Abc_Clock();
pFrames1 = Unr_ManUnrollSimple( pGia, nFrames );
Abc_PrintTime( 1, "UnrollS", Abc_Clock() - clk );