Commit 267f6116 by Alan Mishchenko

Changes to enable smarter simulation.

parent ee261ef3
......@@ -3779,6 +3779,10 @@ SOURCE=.\src\aig\ssw\sswPart.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\ssw\sswRarity.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\ssw\sswSat.c
# End Source File
# Begin Source File
......
......@@ -11,6 +11,7 @@ SRC += src/aig/ssw/sswAig.c \
src/aig/ssw/sswMan.c \
src/aig/ssw/sswPart.c \
src/aig/ssw/sswPairs.c \
src/aig/ssw/sswRarity.c \
src/aig/ssw/sswSat.c \
src/aig/ssw/sswSemi.c \
src/aig/ssw/sswSim.c \
......
......@@ -124,6 +124,9 @@ extern int Ssw_SmlNumFrames( Ssw_Sml_t * p );
extern int Ssw_SmlNumWordsTotal( Ssw_Sml_t * p );
extern unsigned * Ssw_SmlSimInfo( Ssw_Sml_t * p, Aig_Obj_t * pObj );
extern int Ssw_SmlObjsAreEqualWord( Ssw_Sml_t * p, Aig_Obj_t * pObj0, Aig_Obj_t * pObj1 );
extern void Ssw_SmlInitializeSpecial( Ssw_Sml_t * p, Vec_Int_t * vInit );
extern Vec_Ptr_t * Ssw_SmlSimDataPointers( Ssw_Sml_t * p );
ABC_NAMESPACE_HEADER_END
......
......@@ -579,6 +579,27 @@ void Ssw_SmlObjAssignConst( Ssw_Sml_t * p, Aig_Obj_t * pObj, int fConst1, int iF
SeeAlso []
***********************************************************************/
void Ssw_SmlObjAssignConstWord( Ssw_Sml_t * p, Aig_Obj_t * pObj, int fConst1, int iFrame, int iWord )
{
unsigned * pSims;
assert( iFrame < p->nFrames );
assert( iWord < p->nWordsFrame );
assert( Aig_ObjIsPi(pObj) );
pSims = Ssw_ObjSim( p, pObj->Id ) + p->nWordsFrame * iFrame;
pSims[iWord] = fConst1? ~(unsigned)0 : 0;
}
/**Function*************************************************************
Synopsis [Assigns constant patterns to the PI node.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_SmlObjSetWord( Ssw_Sml_t * p, Aig_Obj_t * pObj, unsigned Word, int iWord, int iFrame )
{
unsigned * pSims;
......@@ -904,6 +925,33 @@ void Ssw_SmlInitialize( Ssw_Sml_t * p, int fInit )
SeeAlso []
***********************************************************************/
void Ssw_SmlInitializeSpecial( Ssw_Sml_t * p, Vec_Int_t * vInit )
{
Aig_Obj_t * pObj;
int Entry, i, k, nRegs;
nRegs = Aig_ManRegNum(p->pAig);
assert( nRegs > 0 );
assert( nRegs <= Aig_ManPiNum(p->pAig) );
assert( Vec_IntSize(vInit) == nRegs * p->nFrames );
// assign random info for primary inputs
Saig_ManForEachPi( p->pAig, pObj, i )
Ssw_SmlAssignRandom( p, pObj );
// assign the initial state for the latches
Vec_IntForEachEntry( vInit, Entry, i )
Ssw_SmlObjAssignConstWord( p, Saig_ManLo(p->pAig, i % nRegs), Entry, 0, i / nRegs );
}
/**Function*************************************************************
Synopsis [Assings random simulation info for the PIs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_SmlReinitialize( Ssw_Sml_t * p )
{
Aig_Obj_t * pObj, * pObjLi, * pObjLo;
......@@ -1123,6 +1171,28 @@ void Ssw_SmlClean( Ssw_Sml_t * p )
/**Function*************************************************************
Synopsis [Get simulation data.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Ptr_t * Ssw_SmlSimDataPointers( Ssw_Sml_t * p )
{
Vec_Ptr_t * vSimInfo;
Aig_Obj_t * pObj;
int i;
vSimInfo = Vec_PtrStart( Aig_ManObjNumMax(p->pAig) );
Aig_ManForEachObj( p->pAig, pObj, i )
Vec_PtrWriteEntry( vSimInfo, i, Ssw_ObjSim(p, i) );
return vSimInfo;
}
/**Function*************************************************************
Synopsis [Deallocates simulation manager.]
Description []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment