abc-master
|
Go to the source code of this file.
Data Structures | |
struct | Sym_Man_t_ |
struct | Sim_Man_t_ |
struct | Sim_Pat_t_ |
Macros | |
#define | SIM_NUM_WORDS(n) (((n)>>5) + (((n)&31) > 0)) |
MACRO DEFINITIONS ///. More... | |
#define | SIM_LAST_BITS(n) ((((n)&31) > 0)? (n)&31 : 32) |
#define | SIM_MASK_FULL (0xFFFFFFFF) |
#define | SIM_MASK_BEG(n) (SIM_MASK_FULL >> (32-n)) |
#define | SIM_MASK_END(n) (SIM_MASK_FULL << (n)) |
#define | SIM_SET_0_FROM(m, n) ((m) & ~SIM_MASK_BEG(n)) |
#define | SIM_SET_1_FROM(m, n) ((m) | SIM_MASK_END(n)) |
#define | SIM_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) |
#define | Sim_SetBit(p, i) ((p)[(i)>>5] |= (1<<((i) & 31))) |
#define | Sim_XorBit(p, i) ((p)[(i)>>5] ^= (1<<((i) & 31))) |
#define | Sim_HasBit(p, i) (((p)[(i)>>5] & (1<<((i) & 31))) > 0) |
#define | Sim_SuppStrSetVar(vSupps, pNode, v) Sim_SetBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define | Sim_SuppStrHasVar(vSupps, pNode, v) Sim_HasBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define | Sim_SuppFunSetVar(vSupps, Output, v) Sim_SetBit((unsigned*)(vSupps)->pArray[Output],(v)) |
#define | Sim_SuppFunHasVar(vSupps, Output, v) Sim_HasBit((unsigned*)(vSupps)->pArray[Output],(v)) |
#define | Sim_SimInfoSetVar(vSupps, pNode, v) Sim_SetBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define | Sim_SimInfoHasVar(vSupps, pNode, v) Sim_HasBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define | Sim_SimInfoGet(vInfo, pNode) ((unsigned *)((vInfo)->pArray[(pNode)->Id])) |
Typedefs | |
typedef typedefABC_NAMESPACE_HEADER_START struct Sym_Man_t_ | Sym_Man_t |
INCLUDES ///. More... | |
typedef struct Sim_Man_t_ | Sim_Man_t |
typedef struct Sim_Pat_t_ | Sim_Pat_t |
Functions | |
Sym_Man_t * | Sym_ManStart (Abc_Ntk_t *pNtk, int fVerbose) |
FUNCTION DECLARATIONS ///. More... | |
void | Sym_ManStop (Sym_Man_t *p) |
void | Sym_ManPrintStats (Sym_Man_t *p) |
Sim_Man_t * | Sim_ManStart (Abc_Ntk_t *pNtk, int fLightweight) |
void | Sim_ManStop (Sim_Man_t *p) |
void | Sim_ManPrintStats (Sim_Man_t *p) |
Sim_Pat_t * | Sim_ManPatAlloc (Sim_Man_t *p) |
void | Sim_ManPatFree (Sim_Man_t *p, Sim_Pat_t *pPat) |
Vec_Ptr_t * | Sim_SimulateSeqRandom (Abc_Ntk_t *pNtk, int nFrames, int nWords) |
FUNCTION DEFINITIONS ///. More... | |
Vec_Ptr_t * | Sim_SimulateSeqModel (Abc_Ntk_t *pNtk, int nFrames, int *pModel) |
Vec_Ptr_t * | Sim_ComputeStrSupp (Abc_Ntk_t *pNtk) |
FUNCTION DEFINITIONS ///. More... | |
Vec_Ptr_t * | Sim_ComputeFunSupp (Abc_Ntk_t *pNtk, int fVerbose) |
int | Sim_ComputeTwoVarSymms (Abc_Ntk_t *pNtk, int fVerbose) |
DECLARATIONS ///. More... | |
int | Sim_SymmsGetPatternUsingSat (Sym_Man_t *p, unsigned *pPattern) |
FUNCTION DEFINITIONS ///. More... | |
void | Sim_SymmsStructCompute (Abc_Ntk_t *pNtk, Vec_Ptr_t *vMatrs, Vec_Ptr_t *vSuppFun) |
FUNCTION DEFINITIONS ///. More... | |
void | Sim_SymmsSimulate (Sym_Man_t *p, unsigned *pPatRand, Vec_Ptr_t *vMatrsNonSym) |
FUNCTION DEFINITIONS ///. More... | |
Vec_Ptr_t * | Sim_UtilInfoAlloc (int nSize, int nWords, int fClean) |
FUNCTION DEFINITIONS ///. More... | |
void | Sim_UtilInfoFree (Vec_Ptr_t *p) |
void | Sim_UtilInfoAdd (unsigned *pInfo1, unsigned *pInfo2, int nWords) |
void | Sim_UtilInfoDetectDiffs (unsigned *pInfo1, unsigned *pInfo2, int nWords, Vec_Int_t *vDiffs) |
void | Sim_UtilInfoDetectNews (unsigned *pInfo1, unsigned *pInfo2, int nWords, Vec_Int_t *vDiffs) |
void | Sim_UtilInfoFlip (Sim_Man_t *p, Abc_Obj_t *pNode) |
int | Sim_UtilInfoCompare (Sim_Man_t *p, Abc_Obj_t *pNode) |
void | Sim_UtilSimulate (Sim_Man_t *p, int fFirst) |
void | Sim_UtilSimulateNode (Sim_Man_t *p, Abc_Obj_t *pNode, int fType, int fType1, int fType2) |
void | Sim_UtilSimulateNodeOne (Abc_Obj_t *pNode, Vec_Ptr_t *vSimInfo, int nSimWords, int nOffset) |
void | Sim_UtilTransferNodeOne (Abc_Obj_t *pNode, Vec_Ptr_t *vSimInfo, int nSimWords, int nOffset, int fShift) |
int | Sim_UtilCountSuppSizes (Sim_Man_t *p, int fStruct) |
int | Sim_UtilCountOnes (unsigned *pSimInfo, int nSimWords) |
Vec_Int_t * | Sim_UtilCountOnesArray (Vec_Ptr_t *vInfo, int nSimWords) |
void | Sim_UtilSetRandom (unsigned *pPatRand, int nSimWords) |
void | Sim_UtilSetCompl (unsigned *pPatRand, int nSimWords) |
void | Sim_UtilSetConst (unsigned *pPatRand, int nSimWords, int fConst1) |
int | Sim_UtilInfoIsEqual (unsigned *pPats1, unsigned *pPats2, int nSimWords) |
int | Sim_UtilInfoIsImp (unsigned *pPats1, unsigned *pPats2, int nSimWords) |
int | Sim_UtilInfoIsClause (unsigned *pPats1, unsigned *pPats2, int nSimWords) |
int | Sim_UtilCountAllPairs (Vec_Ptr_t *vSuppFun, int nSimWords, Vec_Int_t *vCounters) |
void | Sim_UtilCountPairsAll (Sym_Man_t *p) |
int | Sim_UtilMatrsAreDisjoint (Sym_Man_t *p) |
#define SIM_MASK_BEG | ( | n | ) | (SIM_MASK_FULL >> (32-n)) |
#define SIM_MASK_END | ( | n | ) | (SIM_MASK_FULL << (n)) |
#define SIM_NUM_WORDS | ( | n | ) | (((n)>>5) + (((n)&31) > 0)) |
#define SIM_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) |
#define SIM_SET_0_FROM | ( | m, | |
n | |||
) | ((m) & ~SIM_MASK_BEG(n)) |
#define SIM_SET_1_FROM | ( | m, | |
n | |||
) | ((m) | SIM_MASK_END(n)) |
#define Sim_SimInfoGet | ( | vInfo, | |
pNode | |||
) | ((unsigned *)((vInfo)->pArray[(pNode)->Id])) |
#define Sim_SimInfoHasVar | ( | vSupps, | |
pNode, | |||
v | |||
) | Sim_HasBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define Sim_SimInfoSetVar | ( | vSupps, | |
pNode, | |||
v | |||
) | Sim_SetBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define Sim_SuppFunHasVar | ( | vSupps, | |
Output, | |||
v | |||
) | Sim_HasBit((unsigned*)(vSupps)->pArray[Output],(v)) |
#define Sim_SuppFunSetVar | ( | vSupps, | |
Output, | |||
v | |||
) | Sim_SetBit((unsigned*)(vSupps)->pArray[Output],(v)) |
#define Sim_SuppStrHasVar | ( | vSupps, | |
pNode, | |||
v | |||
) | Sim_HasBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
#define Sim_SuppStrSetVar | ( | vSupps, | |
pNode, | |||
v | |||
) | Sim_SetBit((unsigned*)(vSupps)->pArray[(pNode)->Id],(v)) |
typedef struct Sim_Man_t_ Sim_Man_t |
typedef struct Sim_Pat_t_ Sim_Pat_t |
typedef typedefABC_NAMESPACE_HEADER_START struct Sym_Man_t_ Sym_Man_t |
INCLUDES ///.
CFile****************************************************************
FileName [sim.h]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Simulation package.]
Synopsis [External declarations.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
]PARAMETERS ///BASIC TYPES ///
Function*************************************************************
Synopsis [Compute functional supports.]
Description [Supports are returned as an array of bit strings, one for each CO.]
SideEffects []
SeeAlso []
Definition at line 103 of file simSupp.c.
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Computes structural supports.]
Description [Supports are returned as an array of bit strings, one for each CO.]
SideEffects []
SeeAlso []
Definition at line 57 of file simSupp.c.
int Sim_ComputeTwoVarSymms | ( | Abc_Ntk_t * | pNtk, |
int | fVerbose | ||
) |
DECLARATIONS ///.
CFile****************************************************************
FileName [simSym.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Simulation to determine two-variable symmetries.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
]FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Computes two variable symmetries.]
Description []
SideEffects []
SeeAlso []
Definition at line 46 of file simSym.c.
Function*************************************************************
Synopsis [Returns one simulation pattern.]
Description []
SideEffects []
SeeAlso []
Definition at line 261 of file simMan.c.
Function*************************************************************
Synopsis [Returns one simulation pattern.]
Description []
SideEffects []
SeeAlso []
Definition at line 282 of file simMan.c.
void Sim_ManPrintStats | ( | Sim_Man_t * | p | ) |
Function*************************************************************
Synopsis [Prints the manager statisticis.]
Description []
SideEffects []
SeeAlso []
Definition at line 233 of file simMan.c.
Function*************************************************************
Synopsis [Starts the simulation manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 166 of file simMan.c.
void Sim_ManStop | ( | Sim_Man_t * | p | ) |
Function*************************************************************
Synopsis [Simulates sequential circuit.]
Description [Takes sequential circuit (pNtk). Simulates the given number (nFrames) of the circuit with the given model. The model is assumed to contain values of PIs for each frame. The latches are initialized to the initial state. One word of data is simulated.]
SideEffects []
SeeAlso []
Definition at line 92 of file simSeq.c.
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Simulates sequential circuit.]
Description [Takes sequential circuit (pNtk). Simulates the given number (nFrames) of the circuit with the given number of machine words (nWords) of random simulation data, starting from the initial state. If the initial state of some latches is a don't-care, uses random input for that latch.]
SideEffects []
SeeAlso []
Definition at line 51 of file simSeq.c.
int Sim_SymmsGetPatternUsingSat | ( | Sym_Man_t * | p, |
unsigned * | pPattern | ||
) |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Tries to prove the remaining pairs using SAT.]
Description [Continues to prove as long as it encounters symmetric pairs. Returns 1 if a non-symmetric pair is found (which gives a counter-example). Returns 0 if it finishes considering all pairs for all outputs.]
SideEffects []
SeeAlso []
Definition at line 51 of file simSymSat.c.
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Detects non-symmetric pairs using one pattern.]
Description []
SideEffects []
SeeAlso []
Definition at line 49 of file simSymSim.c.
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Computes symmetries for a single output function.]
Description []
SideEffects []
SeeAlso []
Definition at line 61 of file simSymStr.c.
Function*************************************************************
Synopsis [Counts the total number of pairs.]
Description []
SideEffects []
SeeAlso []
Definition at line 563 of file simUtils.c.
int Sim_UtilCountOnes | ( | unsigned * | pSimInfo, |
int | nSimWords | ||
) |
Function*************************************************************
Synopsis [Counts the number of 1's in the bitstring.]
Description []
SideEffects []
SeeAlso []
Definition at line 402 of file simUtils.c.
Function*************************************************************
Synopsis [Counts the number of 1's in the bitstring.]
Description []
SideEffects []
SeeAlso []
Definition at line 425 of file simUtils.c.
void Sim_UtilCountPairsAll | ( | Sym_Man_t * | p | ) |
Function*************************************************************
Synopsis [Counts the number of entries in the array of matrices.]
Description []
SideEffects []
SeeAlso []
Definition at line 659 of file simUtils.c.
int Sim_UtilCountSuppSizes | ( | Sim_Man_t * | p, |
int | fStruct | ||
) |
Function*************************************************************
Synopsis [Returns 1 if the simulation infos are equal.]
Description []
SideEffects []
SeeAlso []
Definition at line 371 of file simUtils.c.
void Sim_UtilInfoAdd | ( | unsigned * | pInfo1, |
unsigned * | pInfo2, | ||
int | nWords | ||
) |
Function*************************************************************
Synopsis [Adds the second supp-info the first.]
Description []
SideEffects []
SeeAlso []
Definition at line 100 of file simUtils.c.
Vec_Ptr_t* Sim_UtilInfoAlloc | ( | int | nSize, |
int | nWords, | ||
int | fClean | ||
) |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Allocates simulation information for all nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 57 of file simUtils.c.
Function*************************************************************
Synopsis [Returns 1 if the simulation infos are equal.]
Description []
SideEffects []
SeeAlso []
Definition at line 185 of file simUtils.c.
void Sim_UtilInfoDetectDiffs | ( | unsigned * | pInfo1, |
unsigned * | pInfo2, | ||
int | nWords, | ||
Vec_Int_t * | vDiffs | ||
) |
Function*************************************************************
Synopsis [Returns the positions where pInfo2 is 1 while pInfo1 is 0.]
Description []
SideEffects []
SeeAlso []
Definition at line 118 of file simUtils.c.
void Sim_UtilInfoDetectNews | ( | unsigned * | pInfo1, |
unsigned * | pInfo2, | ||
int | nWords, | ||
Vec_Int_t * | vDiffs | ||
) |
Function*************************************************************
Synopsis [Returns the positions where pInfo2 is 1 while pInfo1 is 0.]
Description []
SideEffects []
SeeAlso []
Definition at line 141 of file simUtils.c.
Function*************************************************************
Synopsis [Flips the simulation info of the node.]
Description []
SideEffects []
SeeAlso []
Definition at line 164 of file simUtils.c.
void Sim_UtilInfoFree | ( | Vec_Ptr_t * | p | ) |
Function*************************************************************
Synopsis [Allocates simulation information for all nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 83 of file simUtils.c.
int Sim_UtilInfoIsClause | ( | unsigned * | pPats1, |
unsigned * | pPats2, | ||
int | nSimWords | ||
) |
Function*************************************************************
Synopsis [Returns 1 if Node1 v Node2 is always true.]
Description []
SideEffects []
SeeAlso []
Definition at line 543 of file simUtils.c.
int Sim_UtilInfoIsEqual | ( | unsigned * | pPats1, |
unsigned * | pPats2, | ||
int | nSimWords | ||
) |
Function*************************************************************
Synopsis [Returns 1 if equal.]
Description []
SideEffects []
SeeAlso []
Definition at line 503 of file simUtils.c.
int Sim_UtilInfoIsImp | ( | unsigned * | pPats1, |
unsigned * | pPats2, | ||
int | nSimWords | ||
) |
Function*************************************************************
Synopsis [Returns 1 if Node1 implies Node2.]
Description []
SideEffects []
SeeAlso []
Definition at line 523 of file simUtils.c.
int Sim_UtilMatrsAreDisjoint | ( | Sym_Man_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 703 of file simUtils.c.
void Sim_UtilSetCompl | ( | unsigned * | pPatRand, |
int | nSimWords | ||
) |
Function*************************************************************
Synopsis [Returns complemented patterns.]
Description []
SideEffects []
SeeAlso []
Definition at line 465 of file simUtils.c.
void Sim_UtilSetConst | ( | unsigned * | pPatRand, |
int | nSimWords, | ||
int | fConst1 | ||
) |
Function*************************************************************
Synopsis [Returns constant patterns.]
Description []
SideEffects []
SeeAlso []
Definition at line 483 of file simUtils.c.
void Sim_UtilSetRandom | ( | unsigned * | pPatRand, |
int | nSimWords | ||
) |
Function*************************************************************
Synopsis [Returns random patterns.]
Description []
SideEffects []
SeeAlso []
Definition at line 447 of file simUtils.c.
void Sim_UtilSimulate | ( | Sim_Man_t * | p, |
int | fType | ||
) |
Function*************************************************************
Synopsis [Simulates the internal nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 208 of file simUtils.c.
Function*************************************************************
Synopsis [Simulates one node.]
Description []
SideEffects []
SeeAlso []
Definition at line 231 of file simUtils.c.
void Sim_UtilSimulateNodeOne | ( | Abc_Obj_t * | pNode, |
Vec_Ptr_t * | vSimInfo, | ||
int | nSimWords, | ||
int | nOffset | ||
) |
Function*************************************************************
Synopsis [Simulates one node.]
Description []
SideEffects []
SeeAlso []
Definition at line 302 of file simUtils.c.
void Sim_UtilTransferNodeOne | ( | Abc_Obj_t * | pNode, |
Vec_Ptr_t * | vSimInfo, | ||
int | nSimWords, | ||
int | nOffset, | ||
int | fShift | ||
) |
Function*************************************************************
Synopsis [Simulates one node.]
Description []
SideEffects []
SeeAlso []
Definition at line 341 of file simUtils.c.
void Sym_ManPrintStats | ( | Sym_Man_t * | p | ) |
FUNCTION DECLARATIONS ///.
FUNCTION DECLARATIONS ///.
CFile****************************************************************
FileName [simMan.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Simulation manager.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
]FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Starts the simulation manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 46 of file simMan.c.
void Sym_ManStop | ( | Sym_Man_t * | p | ) |
Function*************************************************************
Synopsis [Stops the simulation manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 98 of file simMan.c.