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

Public Member Functions

 TruthTableReo (int nInputs, int nOutputs)
 
void Save (unsigned i)
 
void Load (unsigned i)
 
void SaveIndices (unsigned i)
 
void LoadIndices (unsigned i)
 
void BDDBuildStartup ()
 
void BDDBuildLevel (int lev)
 
int BDDBuild ()
 
int BDDRebuildOne (int index, int cof0, int cof1, int lev, Hash_IntMan_t *unique, std::vector< int > &vChildrenLow)
 
int BDDRebuild (int lev)
 
void Swap (int lev)
 
int BDDSwap (int lev)
 
virtual void BDDGenerateAig (Gia_Man_t *pNew, Vec_Int_t *vSupp)
 
- Public Member Functions inherited from Ttopt::TruthTable
 TruthTable (int nInputs, int nOutputs)
 
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)
 
void SwapIndex (int &index, int d)
 
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)
 

Public Attributes

bool fBuilt
 
std::vector< std::vector< int > > vvChildren
 
std::vector< std::vector< std::vector< int > > > vvChildrenSaved
 
- 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
 

Additional Inherited Members

- Public Types inherited from Ttopt::TruthTable
typedef std::bitset< 64 > bsw
 
- 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 479 of file giaTtopt.cpp.

Constructor & Destructor Documentation

◆ TruthTableReo()

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

Definition at line 485 of file giaTtopt.cpp.

486 fBuilt = false;
487 }
TruthTable(int nInputs, int nOutputs)
Definition giaTtopt.cpp:63
Here is the call graph for this function:

Member Function Documentation

◆ BDDBuild()

int Ttopt::TruthTableReo::BDDBuild ( )
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 533 of file giaTtopt.cpp.

533 {
534 if(fBuilt) {
535 return BDDNodeCount();
536 }
537 fBuilt = true;
539 for(int i = 1; i < nInputs + 1; i++) {
540 BDDBuildLevel(i);
541 }
542 return BDDNodeCount();
543 }
void BDDBuildLevel(int lev)
Definition giaTtopt.cpp:520
Here is the call graph for this function:

◆ BDDBuildLevel()

void Ttopt::TruthTableReo::BDDBuildLevel ( int lev)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 520 of file giaTtopt.cpp.

520 {
521 for(unsigned i = 0; i < vvIndices[lev-1].size(); i++) {
522 int index = vvIndices[lev-1][i];
523 int cof0 = BDDBuildOne(index << 1, lev);
524 int cof1 = BDDBuildOne((index << 1) ^ 1, lev);
525 vvChildren[lev-1].push_back(cof0);
526 vvChildren[lev-1].push_back(cof1);
527 if(cof0 == cof1) {
528 vvRedundantIndices[lev-1].push_back(index);
529 }
530 }
531 }
std::vector< std::vector< int > > vvChildren
Definition giaTtopt.cpp:482
std::vector< std::vector< int > > vvRedundantIndices
Definition giaTtopt.cpp:52
virtual int BDDBuildOne(int index, int lev)
Definition giaTtopt.cpp:213
std::vector< std::vector< int > > vvIndices
Definition giaTtopt.cpp:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BDDBuildStartup()

void Ttopt::TruthTableReo::BDDBuildStartup ( )
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 514 of file giaTtopt.cpp.

514 {
515 vvChildren.clear();
516 vvChildren.resize(nInputs);
518 }
virtual void BDDBuildStartup()
Definition giaTtopt.cpp:222
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BDDGenerateAig()

virtual void Ttopt::TruthTableReo::BDDGenerateAig ( Gia_Man_t * pNew,
Vec_Int_t * vSupp )
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 623 of file giaTtopt.cpp.

623 {
624 abort();
625 }
VOID_HACK abort()
Here is the call graph for this function:

◆ BDDRebuild()

int Ttopt::TruthTableReo::BDDRebuild ( int lev)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 568 of file giaTtopt.cpp.

568 {
569 vvRedundantIndices[lev].clear();
570 vvRedundantIndices[lev+1].clear();
571 std::vector<int> vChildrenHigh;
572 std::vector<int> vChildrenLow;
573 Hash_IntMan_t *unique = Hash_IntManStart(2 * vvIndices[lev+1].size());
574 vvIndices[lev+1].clear();
575 for(unsigned i = 0; i < vvIndices[lev].size(); i++) {
576 int index = vvIndices[lev][i];
577 int cof0index = vvChildren[lev][i+i] >> 1;
578 int cof1index = vvChildren[lev][i+i+1] >> 1;
579 bool cof0c = vvChildren[lev][i+i] & 1;
580 bool cof1c = vvChildren[lev][i+i+1] & 1;
581 int cof00, cof01, cof10, cof11;
582 if(cof0index < 0) {
583 cof00 = -2 ^ (int)cof0c;
584 cof01 = -2 ^ (int)cof0c;
585 } else {
586 cof00 = vvChildren[lev+1][cof0index+cof0index] ^ (int)cof0c;
587 cof01 = vvChildren[lev+1][cof0index+cof0index+1] ^ (int)cof0c;
588 }
589 if(cof1index < 0) {
590 cof10 = -2 ^ (int)cof1c;
591 cof11 = -2 ^ (int)cof1c;
592 } else {
593 cof10 = vvChildren[lev+1][cof1index+cof1index] ^ (int)cof1c;
594 cof11 = vvChildren[lev+1][cof1index+cof1index+1] ^ (int)cof1c;
595 }
596 int newcof0 = BDDRebuildOne(index << 1, cof00, cof10, lev + 1, unique, vChildrenLow);
597 int newcof1 = BDDRebuildOne((index << 1) ^ 1, cof01, cof11, lev + 1, unique, vChildrenLow);
598 vChildrenHigh.push_back(newcof0);
599 vChildrenHigh.push_back(newcof1);
600 if(newcof0 == newcof1) {
601 vvRedundantIndices[lev].push_back(index);
602 }
603 }
604 Hash_IntManStop(unique);
605 vvChildren[lev] = vChildrenHigh;
606 vvChildren[lev+1] = vChildrenLow;
607 return BDDNodeCount();
608 }
int BDDRebuildOne(int index, int cof0, int cof1, int lev, Hash_IntMan_t *unique, std::vector< int > &vChildrenLow)
Definition giaTtopt.cpp:545
unsigned long long size
Definition giaNewBdd.h:39
struct Hash_IntMan_t_ Hash_IntMan_t
Definition vecHash.h:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BDDRebuildOne()

int Ttopt::TruthTableReo::BDDRebuildOne ( int index,
int cof0,
int cof1,
int lev,
Hash_IntMan_t * unique,
std::vector< int > & vChildrenLow )
inline

Definition at line 545 of file giaTtopt.cpp.

545 {
546 if(cof0 < 0 && cof0 == cof1) {
547 return cof0;
548 }
549 bool fCompl = cof0 & 1;
550 if(fCompl) {
551 cof0 ^= 1;
552 cof1 ^= 1;
553 }
554 int *place = Hash_Int2ManLookup(unique, cof0, cof1);
555 if(*place) {
556 return (Hash_IntObjData2(unique, *place) << 1) ^ (int)fCompl;
557 }
558 vvIndices[lev].push_back(index);
559 Hash_Int2ManInsert(unique, cof0, cof1, vvIndices[lev].size() - 1);
560 vChildrenLow.push_back(cof0);
561 vChildrenLow.push_back(cof1);
562 if(cof0 == cof1) {
563 vvRedundantIndices[lev].push_back(index);
564 }
565 return ((vvIndices[lev].size() - 1) << 1) ^ (int)fCompl;
566 }
Here is the caller graph for this function:

◆ BDDSwap()

int Ttopt::TruthTableReo::BDDSwap ( int lev)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 618 of file giaTtopt.cpp.

618 {
619 Swap(lev);
620 return BDDNodeCount();
621 }
void Swap(int lev)
Definition giaTtopt.cpp:610
Here is the call graph for this function:

◆ Load()

void Ttopt::TruthTableReo::Load ( unsigned i)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 496 of file giaTtopt.cpp.

496 {
497 assert(i < vLevelsSaved.size());
499 }
std::vector< int > vLevels
Definition giaTtopt.cpp:53
std::vector< std::vector< int > > vLevelsSaved
Definition giaTtopt.cpp:58
#define assert(ex)
Definition util_old.h:213

◆ LoadIndices()

void Ttopt::TruthTableReo::LoadIndices ( unsigned i)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 509 of file giaTtopt.cpp.

509 {
512 }
std::vector< std::vector< std::vector< int > > > vvChildrenSaved
Definition giaTtopt.cpp:483
virtual void LoadIndices(unsigned i)
Definition giaTtopt.cpp:104
Here is the call graph for this function:

◆ Save()

void Ttopt::TruthTableReo::Save ( unsigned i)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 489 of file giaTtopt.cpp.

489 {
490 if(vLevelsSaved.size() < i + 1) {
491 vLevelsSaved.resize(i + 1);
492 }
494 }

◆ SaveIndices()

void Ttopt::TruthTableReo::SaveIndices ( unsigned i)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 501 of file giaTtopt.cpp.

501 {
503 if(vvChildrenSaved.size() < i + 1) {
504 vvChildrenSaved.resize(i + 1);
505 }
507 }
virtual void SaveIndices(unsigned i)
Definition giaTtopt.cpp:95
Here is the call graph for this function:

◆ Swap()

void Ttopt::TruthTableReo::Swap ( int lev)
inlinevirtual

Reimplemented from Ttopt::TruthTable.

Definition at line 610 of file giaTtopt.cpp.

610 {
611 assert(lev < nInputs - 1);
612 std::vector<int>::iterator it0 = std::find(vLevels.begin(), vLevels.end(), lev);
613 std::vector<int>::iterator it1 = std::find(vLevels.begin(), vLevels.end(), lev + 1);
614 std::swap(*it0, *it1);
615 BDDRebuild(lev);
616 }
int BDDRebuild(int lev)
Definition giaTtopt.cpp:568
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fBuilt

bool Ttopt::TruthTableReo::fBuilt

Definition at line 481 of file giaTtopt.cpp.

◆ vvChildren

std::vector<std::vector<int> > Ttopt::TruthTableReo::vvChildren

Definition at line 482 of file giaTtopt.cpp.

◆ vvChildrenSaved

std::vector<std::vector<std::vector<int> > > Ttopt::TruthTableReo::vvChildrenSaved

Definition at line 483 of file giaTtopt.cpp.


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