diff options
Diffstat (limited to 'src/opt/sim')
-rw-r--r-- | src/opt/sim/sim.h | 3 | ||||
-rw-r--r-- | src/opt/sim/simMan.c | 39 | ||||
-rw-r--r-- | src/opt/sim/simSeq.c | 4 | ||||
-rw-r--r-- | src/opt/sim/simSupp.c | 2 |
4 files changed, 25 insertions, 23 deletions
diff --git a/src/opt/sim/sim.h b/src/opt/sim/sim.h index 74c3c22f..963f0ad6 100644 --- a/src/opt/sim/sim.h +++ b/src/opt/sim/sim.h @@ -98,6 +98,7 @@ struct Sim_Man_t_ Abc_Ntk_t * pNtk; int nInputs; int nOutputs; + int fLightweight; // internal simulation information int nSimBits; // the number of bits in simulation info int nSimWords; // the number of words in simulation info @@ -172,7 +173,7 @@ struct Sim_Pat_t_ extern Sym_Man_t * Sym_ManStart( Abc_Ntk_t * pNtk, int fVerbose ); extern void Sym_ManStop( Sym_Man_t * p ); extern void Sym_ManPrintStats( Sym_Man_t * p ); -extern Sim_Man_t * Sim_ManStart( Abc_Ntk_t * pNtk ); +extern Sim_Man_t * Sim_ManStart( Abc_Ntk_t * pNtk, int fLightweight ); extern void Sim_ManStop( Sim_Man_t * p ); extern void Sim_ManPrintStats( Sim_Man_t * p ); extern Sim_Pat_t * Sim_ManPatAlloc( Sim_Man_t * p ); diff --git a/src/opt/sim/simMan.c b/src/opt/sim/simMan.c index 3df8ac4b..a7d8251c 100644 --- a/src/opt/sim/simMan.c +++ b/src/opt/sim/simMan.c @@ -31,7 +31,7 @@ /**Function************************************************************* - Synopsis [Starts the simulatin manager.] + Synopsis [Starts the simulation manager.] Description [] @@ -83,7 +83,7 @@ Sym_Man_t * Sym_ManStart( Abc_Ntk_t * pNtk, int fVerbose ) /**Function************************************************************* - Synopsis [Stops the simulatin manager.] + Synopsis [Stops the simulation manager.] Description [] @@ -149,11 +149,9 @@ void Sym_ManPrintStats( Sym_Man_t * p ) } - - /**Function************************************************************* - Synopsis [Starts the simulatin manager.] + Synopsis [Starts the simulation manager.] Description [] @@ -162,7 +160,7 @@ void Sym_ManPrintStats( Sym_Man_t * p ) SeeAlso [] ***********************************************************************/ -Sim_Man_t * Sim_ManStart( Abc_Ntk_t * pNtk ) +Sim_Man_t * Sim_ManStart( Abc_Ntk_t * pNtk, int fLightweight ) { Sim_Man_t * p; // start the manager @@ -175,24 +173,27 @@ Sim_Man_t * Sim_ManStart( Abc_Ntk_t * pNtk ) p->nSimBits = 2048; p->nSimWords = SIM_NUM_WORDS(p->nSimBits); p->vSim0 = Sim_UtilInfoAlloc( Abc_NtkObjNumMax(pNtk), p->nSimWords, 0 ); - p->vSim1 = Sim_UtilInfoAlloc( Abc_NtkObjNumMax(pNtk), p->nSimWords, 0 ); - // support information - p->nSuppBits = Abc_NtkCiNum(pNtk); - p->nSuppWords = SIM_NUM_WORDS(p->nSuppBits); - p->vSuppStr = Sim_ComputeStrSupp( pNtk ); - p->vSuppFun = Sim_UtilInfoAlloc( Abc_NtkCoNum(p->pNtk), p->nSuppWords, 1 ); - // other data - p->pMmPat = Extra_MmFixedStart( sizeof(Sim_Pat_t) + p->nSuppWords * sizeof(unsigned) ); - p->vFifo = Vec_PtrAlloc( 100 ); - p->vDiffs = Vec_IntAlloc( 100 ); - // allocate support targets (array of unresolved outputs for each input) - p->vSuppTargs = Vec_VecStart( p->nInputs ); + p->fLightweight = fLightweight; + if (!p->fLightweight) { + p->vSim1 = Sim_UtilInfoAlloc( Abc_NtkObjNumMax(pNtk), p->nSimWords, 0 ); + // support information + p->nSuppBits = Abc_NtkCiNum(pNtk); + p->nSuppWords = SIM_NUM_WORDS(p->nSuppBits); + p->vSuppStr = Sim_ComputeStrSupp( pNtk ); + p->vSuppFun = Sim_UtilInfoAlloc( Abc_NtkCoNum(p->pNtk), p->nSuppWords, 1 ); + // other data + p->pMmPat = Extra_MmFixedStart( sizeof(Sim_Pat_t) + p->nSuppWords * sizeof(unsigned) ); + p->vFifo = Vec_PtrAlloc( 100 ); + p->vDiffs = Vec_IntAlloc( 100 ); + // allocate support targets (array of unresolved outputs for each input) + p->vSuppTargs = Vec_VecStart( p->nInputs ); + } return p; } /**Function************************************************************* - Synopsis [Stops the simulatin manager.] + Synopsis [Stops the simulation manager.] Description [] diff --git a/src/opt/sim/simSeq.c b/src/opt/sim/simSeq.c index f6989bf7..ba6b54d9 100644 --- a/src/opt/sim/simSeq.c +++ b/src/opt/sim/simSeq.c @@ -53,7 +53,7 @@ Vec_Ptr_t * Sim_SimulateSeqRandom( Abc_Ntk_t * pNtk, int nFrames, int nWords ) assert( Abc_NtkIsStrash(pNtk) ); vInfo = Sim_UtilInfoAlloc( Abc_NtkObjNumMax(pNtk), nWords * nFrames, 0 ); // set the constant data - pNode = Abc_AigConst1(pNtk->pManFunc); + pNode = Abc_NtkConst1(pNtk); Sim_UtilSetConst( Sim_SimInfoGet(vInfo,pNode), nWords * nFrames, 1 ); // set the random PI data Abc_NtkForEachPi( pNtk, pNode, i ) @@ -94,7 +94,7 @@ Vec_Ptr_t * Sim_SimulateSeqModel( Abc_Ntk_t * pNtk, int nFrames, int * pModel ) int i, k; vInfo = Sim_UtilInfoAlloc( Abc_NtkObjNumMax(pNtk), nFrames, 0 ); // set the constant data - pNode = Abc_AigConst1(pNtk->pManFunc); + pNode = Abc_NtkConst1(pNtk); Sim_UtilSetConst( Sim_SimInfoGet(vInfo,pNode), nFrames, 1 ); // set the random PI data Abc_NtkForEachPi( pNtk, pNode, i ) diff --git a/src/opt/sim/simSupp.c b/src/opt/sim/simSupp.c index bd2db441..dac0e5cf 100644 --- a/src/opt/sim/simSupp.c +++ b/src/opt/sim/simSupp.c @@ -106,7 +106,7 @@ Vec_Ptr_t * Sim_ComputeFunSupp( Abc_Ntk_t * pNtk, int fVerbose ) srand( 0xABC ); // start the simulation manager - p = Sim_ManStart( pNtk ); + p = Sim_ManStart( pNtk, 0 ); // compute functional support using one round of random simulation Sim_UtilAssignRandom( p ); |