ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
fsimMan.c File Reference
#include "fsimInt.h"
Include dependency graph for fsimMan.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Fsim_ManCreate_rec (Fsim_Man_t *p, Aig_Obj_t *pObj)
 DECLARATIONS ///.
 
Fsim_Man_tFsim_ManCreate (Aig_Man_t *pAig)
 
void Fsim_ManDelete (Fsim_Man_t *p)
 
void Fsim_ManTest (Aig_Man_t *pAig)
 

Function Documentation

◆ Fsim_ManCreate()

Fsim_Man_t * Fsim_ManCreate ( Aig_Man_t * pAig)

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

Synopsis [Creates fast simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 102 of file fsimMan.c.

103{
104 Fsim_Man_t * p;
105 Aig_Obj_t * pObj;
106 int i, nObjs;
107 Aig_ManCleanData( pAig );
108 p = (Fsim_Man_t *)ABC_ALLOC( Fsim_Man_t, 1 );
109 memset( p, 0, sizeof(Fsim_Man_t) );
110 p->pAig = pAig;
111 p->nPis = Saig_ManPiNum(pAig);
112 p->nPos = Saig_ManPoNum(pAig);
113 p->nCis = Aig_ManPiNum(pAig);
114 p->nCos = Aig_ManPoNum(pAig);
115 p->nNodes = Aig_ManNodeNum(pAig);
116 nObjs = p->nCis + p->nCos + p->nNodes + 2;
117 p->pFans0 = ABC_ALLOC( int, nObjs );
118 p->pFans1 = ABC_ALLOC( int, nObjs );
119 p->pRefs = ABC_ALLOC( int, nObjs );
120 p->vCis2Ids = Vec_IntAlloc( Aig_ManPiNum(pAig) );
121 // add objects (0=unused; 1=const1)
122 p->pFans0[0] = p->pFans1[0] = 0;
123 p->pFans0[1] = p->pFans1[1] = 0;
124 p->pRefs[0] = 0;
125 p->nObjs = 2;
126 pObj = Aig_ManConst1( pAig );
127 pObj->iData = 1;
128 p->pRefs[1] = Aig_ObjRefs(pObj);
129 if ( p->pRefs[1] )
130 p->nCrossCut = 1;
131 Aig_ManForEachPi( pAig, pObj, i )
132 if ( Aig_ObjRefs(pObj) == 0 )
133 Fsim_ManCreate_rec( p, pObj );
134 Aig_ManForEachPo( pAig, pObj, i )
135 Fsim_ManCreate_rec( p, pObj );
136 assert( Vec_IntSize(p->vCis2Ids) == Aig_ManPiNum(pAig) );
137 assert( p->nObjs == nObjs );
138 // check references
139 assert( p->nCrossCut == 0 );
140 Aig_ManForEachObj( pAig, pObj, i )
141 {
142 assert( p->pRefs[pObj->iData] == 0 );
143 p->pRefs[pObj->iData] = Aig_ObjRefs(pObj);
144 }
145 // collect flop outputs
146 p->vLos = Vec_IntAlloc( Aig_ManRegNum(pAig) );
147 Saig_ManForEachLo( pAig, pObj, i )
148 Vec_IntPush( p->vLos, pObj->iData );
149 // collect flop inputs
150 p->vLis = Vec_IntAlloc( Aig_ManRegNum(pAig) );
151 Saig_ManForEachLi( pAig, pObj, i )
152 Vec_IntPush( p->vLis, pObj->iData );
153 // determine the frontier size
154 p->nFront = 1 + (int)(1.1 * p->nCrossCutMax);
155 return p;
156}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
void Aig_ManCleanData(Aig_Man_t *p)
Definition aigUtil.c:205
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START int Fsim_ManCreate_rec(Fsim_Man_t *p, Aig_Obj_t *pObj)
DECLARATIONS ///.
Definition fsimMan.c:45
typedefABC_NAMESPACE_HEADER_START struct Fsim_Man_t_ Fsim_Man_t
INCLUDES ///.
Definition fsim.h:42
#define Saig_ManForEachLi(p, pObj, i)
Definition saig.h:98
#define Saig_ManForEachLo(p, pObj, i)
Definition saig.h:96
int iData
Definition aig.h:88
#define assert(ex)
Definition util_old.h:213
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fsim_ManCreate_rec()

ABC_NAMESPACE_IMPL_START int Fsim_ManCreate_rec ( Fsim_Man_t * p,
Aig_Obj_t * pObj )

DECLARATIONS ///.

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

FileName [fsimMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Fast sequential AIG simulator.]

Synopsis [Simulation manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Creates fast simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file fsimMan.c.

46{
47 int iFan0, iFan1, iTemp;
48 assert( !Aig_IsComplement(pObj) );
49 if ( pObj->iData )
50 return pObj->iData;
51 assert( !Aig_ObjIsConst1(pObj) );
52 if ( Aig_ObjIsNode(pObj) )
53 {
54 iFan0 = Fsim_ManCreate_rec( p, Aig_ObjFanin0(pObj) );
55 iFan1 = Fsim_ManCreate_rec( p, Aig_ObjFanin1(pObj) );
56 assert( iFan0 != iFan1 );
57 if ( --p->pRefs[iFan0] == 0 )
58 p->nCrossCut--;
59 iFan0 = Fsim_Var2Lit( iFan0, Aig_ObjFaninC0(pObj) );
60 if ( --p->pRefs[iFan1] == 0 )
61 p->nCrossCut--;
62 iFan1 = Fsim_Var2Lit( iFan1, Aig_ObjFaninC1(pObj) );
63 if ( p->pAig->pEquivs )
64 Fsim_ManCreate_rec( p, Aig_ObjEquiv(p->pAig, pObj) );
65 }
66 else if ( Aig_ObjIsPo(pObj) )
67 {
68 assert( Aig_ObjRefs(pObj) == 0 );
69 iFan0 = Fsim_ManCreate_rec( p, Aig_ObjFanin0(pObj) );
70 if ( --p->pRefs[iFan0] == 0 )
71 p->nCrossCut--;
72 iFan0 = Fsim_Var2Lit( iFan0, Aig_ObjFaninC0(pObj) );
73 iFan1 = 0;
74 }
75 else
76 {
77 iFan0 = iFan1 = 0;
78 Vec_IntPush( p->vCis2Ids, Aig_ObjPioNum(pObj) );
79 }
80 if ( iFan0 < iFan1 )
81 iTemp = iFan0, iFan0 = iFan1, iFan1 = iTemp;
82 p->pFans0[p->nObjs] = iFan0;
83 p->pFans1[p->nObjs] = iFan1;
84 p->pRefs[p->nObjs] = Aig_ObjRefs(pObj);
85 if ( p->pRefs[p->nObjs] )
86 if ( p->nCrossCutMax < ++p->nCrossCut )
87 p->nCrossCutMax = p->nCrossCut;
88 return pObj->iData = p->nObjs++;
89}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fsim_ManDelete()

void Fsim_ManDelete ( Fsim_Man_t * p)

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

Synopsis [Deletes fast simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 169 of file fsimMan.c.

170{
171 Vec_IntFree( p->vCis2Ids );
172 Vec_IntFree( p->vLos );
173 Vec_IntFree( p->vLis );
174 ABC_FREE( p->pDataAig2 );
175 ABC_FREE( p->pDataAig );
176 ABC_FREE( p->pFans0 );
177 ABC_FREE( p->pFans1 );
178 ABC_FREE( p->pRefs );
179 ABC_FREE( p->pDataSim );
180 ABC_FREE( p->pDataSimCis );
181 ABC_FREE( p->pDataSimCos );
182 ABC_FREE( p->pData1 );
183 ABC_FREE( p->pData2 );
184 ABC_FREE( p );
185}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Fsim_ManTest()

void Fsim_ManTest ( Aig_Man_t * pAig)

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

Synopsis [Testing procedure.]

Description []

SideEffects []

SeeAlso []

Definition at line 198 of file fsimMan.c.

199{
200 Fsim_Man_t * p;
201 p = Fsim_ManCreate( pAig );
202 Fsim_ManFront( p, 0 );
203 Fsim_ManDelete( p );
204}
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
Fsim_Man_t * Fsim_ManCreate(Aig_Man_t *pAig)
Definition fsimMan.c:102
Here is the call graph for this function: