ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
rrr::BddMspfAnalyzer< Ntk > Class Template Reference

#include <rrrBddMspfAnalyzer.h>

Public Member Functions

 BddMspfAnalyzer ()
 
 BddMspfAnalyzer (Parameter const *pPar)
 
 ~BddMspfAnalyzer ()
 
void AssignNetwork (Ntk *pNtk_, bool fReuse)
 
bool CheckRedundancy (int id, int idx)
 
bool CheckFeasibility (int id, int fi, bool c)
 
void ResetSummary ()
 
summary< int > GetStatsSummary () const
 
summary< double > GetTimesSummary () const
 

Detailed Description

template<typename Ntk>
class rrr::BddMspfAnalyzer< Ntk >

Definition at line 12 of file rrrBddMspfAnalyzer.h.

Constructor & Destructor Documentation

◆ BddMspfAnalyzer() [1/2]

template<typename Ntk>
rrr::BddMspfAnalyzer< Ntk >::BddMspfAnalyzer ( )

Definition at line 683 of file rrrBddMspfAnalyzer.h.

683 :
684 pNtk(NULL),
685 nVerbose(0),
686 fInitialized(false),
687 pBdd(NULL),
688 fUpdate(false) {
689 ResetSummary();
690 }
Here is the call graph for this function:

◆ BddMspfAnalyzer() [2/2]

template<typename Ntk>
rrr::BddMspfAnalyzer< Ntk >::BddMspfAnalyzer ( Parameter const * pPar)

Definition at line 693 of file rrrBddMspfAnalyzer.h.

693 :
694 pNtk(NULL),
695 nVerbose(pPar->nAnalyzerVerbose),
696 fInitialized(false),
697 pBdd(NULL),
698 fUpdate(false) {
699 ResetSummary();
700 }
Here is the call graph for this function:

◆ ~BddMspfAnalyzer()

template<typename Ntk>
rrr::BddMspfAnalyzer< Ntk >::~BddMspfAnalyzer ( )

Definition at line 703 of file rrrBddMspfAnalyzer.h.

703 {
704 Reset();
705 }

Member Function Documentation

◆ AssignNetwork()

template<typename Ntk>
void rrr::BddMspfAnalyzer< Ntk >::AssignNetwork ( Ntk * pNtk_,
bool fReuse )

Definition at line 708 of file rrrBddMspfAnalyzer.h.

708 {
709 Reset(fReuse);
710 pNtk = pNtk_;
712 }

◆ CheckFeasibility()

template<typename Ntk>
bool rrr::BddMspfAnalyzer< Ntk >::CheckFeasibility ( int id,
int fi,
bool c )

Definition at line 754 of file rrrBddMspfAnalyzer.h.

754 {
755 if(!fInitialized) {
756 Initialize();
757 } else if(fUpdate) {
758 Simulate();
759 fUpdate = false;
760 }
761 Mspf(id, false);
763 bool fFeasible = false;
764 switch(pNtk->GetNodeType(id)) {
765 case AND: {
766 lit x = pBdd->Or(pBdd->LitNot(vFs[id]), vGs[id]);
767 IncRef(x);
768 lit y = pBdd->Or(x, pBdd->LitNotCond(vFs[fi], c));
769 DecRef(x);
770 if(pBdd->IsConst1(y)) {
771 fFeasible = true;
772 return true;
773 }
774 break;
775 }
776 default:
777 assert(0);
778 }
779 if(nVerbose) {
780 if(fFeasible) {
781 std::cout << "node " << id << " fanin " << (c? "!": "") << fi << " is feasible" << std::endl;
782 } else {
783 std::cout << "node " << id << " fanin " << (c? "!": "") << fi << " is NOT feasible" << std::endl;
784 }
785 }
786 durationCheck += Duration(timeStart, GetCurrentTime());
787 return fFeasible;
788 }
#define assert(ex)
Definition util_old.h:213

◆ CheckRedundancy()

template<typename Ntk>
bool rrr::BddMspfAnalyzer< Ntk >::CheckRedundancy ( int id,
int idx )

Definition at line 719 of file rrrBddMspfAnalyzer.h.

719 {
720 if(!fInitialized) {
721 Initialize();
722 } else if(fUpdate) {
723 Simulate();
724 fUpdate = false;
725 }
726 Mspf(id);
728 bool fRedundant = false;
729 switch(pNtk->GetNodeType(id)) {
730 case AND: {
731 int fi = pNtk->GetFanin(id, idx);
732 bool c = pNtk->GetCompl(id, idx);
733 lit x = pBdd->Or(pBdd->LitNotCond(vFs[fi], c), vvCs[id][idx]);
734 if(pBdd->IsConst1(x)) {
735 fRedundant = true;
736 }
737 break;
738 }
739 default:
740 assert(0);
741 }
742 if(nVerbose) {
743 if(fRedundant) {
744 std::cout << "node " << id << " fanin " << (pNtk->GetCompl(id, idx)? "!": "") << pNtk->GetFanin(id, idx) << " index " << idx << " is redundant" << std::endl;
745 } else {
746 std::cout << "node " << id << " fanin " << (pNtk->GetCompl(id, idx)? "!": "") << pNtk->GetFanin(id, idx) << " index " << idx << " is NOT redundant" << std::endl;
747 }
748 }
749 durationCheck += Duration(timeStart, GetCurrentTime());
750 return fRedundant;
751 }

◆ GetStatsSummary()

template<typename Ntk>
summary< int > rrr::BddMspfAnalyzer< Ntk >::GetStatsSummary ( ) const

Definition at line 809 of file rrrBddMspfAnalyzer.h.

809 {
811 v.emplace_back("bdd node", pBdd->GetNumTotalCreatedNodes() - nNodesOld + nNodesAccumulated);
812 return v;
813 }

◆ GetTimesSummary()

template<typename Ntk>
summary< double > rrr::BddMspfAnalyzer< Ntk >::GetTimesSummary ( ) const

Definition at line 816 of file rrrBddMspfAnalyzer.h.

816 {
818 v.emplace_back("bdd symbolic simulation", durationSimulation);
819 v.emplace_back("bdd care computation", durationPf);
820 v.emplace_back("bdd check", durationCheck);
821 v.emplace_back("bdd reorder", durationReorder);
822 return v;
823 }

◆ ResetSummary()

template<typename Ntk>
void rrr::BddMspfAnalyzer< Ntk >::ResetSummary ( )

Definition at line 795 of file rrrBddMspfAnalyzer.h.

795 {
796 if(pBdd) {
797 nNodesOld = pBdd->GetNumTotalCreatedNodes();
798 } else {
799 nNodesOld = 0;
800 }
801 nNodesAccumulated = 0;
802 durationSimulation = 0;
803 durationPf = 0;
804 durationCheck = 0;
805 durationReorder = 0;
806 }
Here is the caller graph for this function:

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