ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
Ttopt::TruthTableRewrite Class Reference
Inheritance diagram for Ttopt::TruthTableRewrite:
Collaboration diagram for Ttopt::TruthTableRewrite:

Public Member Functions

 TruthTableRewrite (int nInputs, int nOutputs)
 
void SetValue (int index_lev, int lev, word value)
 
void CopyFunc (int index1, int index2, int lev, bool fCompl)
 
void ShiftToMajority (int index, int lev)
 
- Public Member Functions inherited from Ttopt::TruthTable
 TruthTable (int nInputs, int nOutputs)
 
virtual void Save (unsigned i)
 
virtual void Load (unsigned i)
 
virtual void SaveIndices (unsigned i)
 
virtual void LoadIndices (unsigned i)
 
word GetValue (int index_lev, int lev)
 
int IsEq (int index1, int index2, int lev, bool fCompl=false)
 
bool Imply (int index1, int index2, int lev)
 
int BDDNodeCountLevel (int lev)
 
int BDDNodeCount ()
 
int BDDFind (int index, int lev)
 
virtual int BDDBuildOne (int index, int lev)
 
virtual void BDDBuildStartup ()
 
virtual void BDDBuildLevel (int lev)
 
virtual int BDDBuild ()
 
virtual int BDDRebuild (int lev)
 
virtual void Swap (int lev)
 
void SwapIndex (int &index, int d)
 
virtual int BDDSwap (int lev)
 
int SiftReo ()
 
void Reo (std::vector< int > vLevelsNew)
 
int RandomSiftReo (int nRound)
 
int BDDGenerateAigRec (Gia_Man_t *pNew, std::vector< int > const &vInputs, std::vector< std::vector< int > > &vvNodes, int index, int lev)
 
virtual void BDDGenerateAig (Gia_Man_t *pNew, Vec_Int_t *vSupp)
 

Additional Inherited Members

- Public Types inherited from Ttopt::TruthTable
typedef std::bitset< 64 > bsw
 
- Public Attributes inherited from Ttopt::TruthTable
int nInputs
 
int nSize
 
int nTotalSize
 
int nOutputs
 
std::vector< wordt
 
std::vector< std::vector< int > > vvIndices
 
std::vector< std::vector< int > > vvRedundantIndices
 
std::vector< int > vLevels
 
std::vector< std::vector< word > > savedt
 
std::vector< std::vector< std::vector< int > > > vvIndicesSaved
 
std::vector< std::vector< std::vector< int > > > vvRedundantIndicesSaved
 
std::vector< std::vector< int > > vLevelsSaved
 
- Static Public Attributes inherited from Ttopt::TruthTable
static const int ww = 64
 
static const int lww = 6
 
static const word ones []
 
static const word swapmask []
 

Detailed Description

Definition at line 628 of file giaTtopt.cpp.

Constructor & Destructor Documentation

◆ TruthTableRewrite()

Ttopt::TruthTableRewrite::TruthTableRewrite ( int nInputs,
int nOutputs )
inline

Definition at line 630 of file giaTtopt.cpp.

TruthTable(int nInputs, int nOutputs)
Definition giaTtopt.cpp:63
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ CopyFunc()

void Ttopt::TruthTableRewrite::CopyFunc ( int index1,
int index2,
int lev,
bool fCompl )
inline

Definition at line 642 of file giaTtopt.cpp.

642 {
643 assert(index1 >= 0);
644 int logwidth = nInputs - lev;
645 if(logwidth > lww) {
646 int nScopeSize = 1 << (logwidth - lww);
647 if(!fCompl) {
648 if(index2 < 0) {
649 for(int i = 0; i < nScopeSize; i++) {
650 t[nScopeSize * index1 + i] = 0;
651 }
652 } else {
653 for(int i = 0; i < nScopeSize; i++) {
654 t[nScopeSize * index1 + i] = t[nScopeSize * index2 + i];
655 }
656 }
657 } else {
658 if(index2 < 0) {
659 for(int i = 0; i < nScopeSize; i++) {
660 t[nScopeSize * index1 + i] = ones[lww];
661 }
662 } else {
663 for(int i = 0; i < nScopeSize; i++) {
664 t[nScopeSize * index1 + i] = ~t[nScopeSize * index2 + i];
665 }
666 }
667 }
668 } else {
669 word value = 0;
670 if(index2 >= 0) {
671 value = GetValue(index2, lev);
672 }
673 if(fCompl) {
674 value ^= ones[logwidth];
675 }
676 SetValue(index1, lev, value);
677 }
678 }
ABC_NAMESPACE_IMPL_START typedef signed char value
void SetValue(int index_lev, int lev, word value)
Definition giaTtopt.cpp:632
word GetValue(int index_lev, int lev)
Definition giaTtopt.cpp:109
std::vector< word > t
Definition giaTtopt.cpp:49
static const int lww
Definition giaTtopt.cpp:42
static const word ones[]
Definition giaTtopt.cpp:60
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetValue()

void Ttopt::TruthTableRewrite::SetValue ( int index_lev,
int lev,
word value )
inline

Definition at line 632 of file giaTtopt.cpp.

632 {
633 assert(index_lev >= 0);
634 assert(nInputs - lev <= lww);
635 int logwidth = nInputs - lev;
636 int index = index_lev >> (lww - logwidth);
637 int pos = (index_lev % (1 << (lww - logwidth))) << logwidth;
638 t[index] &= ~(ones[logwidth] << pos);
639 t[index] ^= value << pos;
640 }
bool pos
Definition globals.c:30
Here is the caller graph for this function:

◆ ShiftToMajority()

void Ttopt::TruthTableRewrite::ShiftToMajority ( int index,
int lev )
inline

Definition at line 680 of file giaTtopt.cpp.

680 {
681 assert(index >= 0);
682 int logwidth = nInputs - lev;
683 int count = 0;
684 if(logwidth > lww) {
685 int nScopeSize = 1 << (logwidth - lww);
686 for(int i = 0; i < nScopeSize; i++) {
687 count += bsw(t[nScopeSize * index + i]).count();
688 }
689 } else {
690 count = bsw(GetValue(index, lev)).count();
691 }
692 bool majority = count > (1 << (logwidth - 1));
693 CopyFunc(index, -1, lev, majority);
694 }
void CopyFunc(int index1, int index2, int lev, bool fCompl)
Definition giaTtopt.cpp:642
std::bitset< 64 > bsw
Definition giaTtopt.cpp:43
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: