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

#include <rrrAnalyzer.h>

Public Member Functions

 Analyzer (Parameter const *pPar)
 
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, typename Sim, typename Sol>
class rrr::Analyzer< Ntk, Sim, Sol >

Definition at line 11 of file rrrAnalyzer.h.

Constructor & Destructor Documentation

◆ Analyzer()

template<typename Ntk, typename Sim, typename Sol>
rrr::Analyzer< Ntk, Sim, Sol >::Analyzer ( Parameter const * pPar)

Definition at line 41 of file rrrAnalyzer.h.

41 :
42 pNtk(NULL),
43 nVerbose(pPar->nAnalyzerVerbose),
44 sim(pPar),
45 sol(pPar) {
46 }

Member Function Documentation

◆ AssignNetwork()

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

Definition at line 49 of file rrrAnalyzer.h.

49 {
50 pNtk = pNtk_;
51 sim.AssignNetwork(pNtk, fReuse);
52 sol.AssignNetwork(pNtk, fReuse);
53 }
void AssignNetwork(Ntk *pNtk_, bool fReuse)
Definition rrrAnalyzer.h:49

◆ CheckFeasibility()

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

Definition at line 87 of file rrrAnalyzer.h.

87 {
88 if(sim.CheckFeasibility(id, fi, c)) {
89 if(nVerbose) {
90 std::cout << "node " << id << " fanin " << (c? "!": "") << fi << " seems feasible" << std::endl;
91 }
92 SatResult r = sol.CheckFeasibility(id, fi, c);
93 if(r == UNSAT) {
94 if(nVerbose) {
95 std::cout << "node " << id << " fanin " << (c? "!": "") << fi << " is feasible" << std::endl;
96 }
97 return true;
98 }
99 if(r == SAT) {
100 if(nVerbose) {
101 std::cout << "node " << id << " fanin " << (c? "!": "") << fi << " is NOT feasible" << std::endl;
102 }
103 sim.AddCex(sol.GetCex());
104 }
105 } else {
106 // if(nVerbose) {
107 // std::cout << "node " << id << " fanin " << (c? "!": "") << fi << " is not feasible" << std::endl;
108 // }
109 }
110 return false;
111 }
bool CheckFeasibility(int id, int fi, bool c)
Definition rrrAnalyzer.h:87

◆ CheckRedundancy()

template<typename Ntk, typename Sim, typename Sol>
bool rrr::Analyzer< Ntk, Sim, Sol >::CheckRedundancy ( int id,
int idx )

Definition at line 60 of file rrrAnalyzer.h.

60 {
61 if(sim.CheckRedundancy(id, idx)) {
62 if(nVerbose) {
63 std::cout << "node " << id << " fanin " << (pNtk->GetCompl(id, idx)? "!": "") << pNtk->GetFanin(id, idx) << " index " << idx << " seems redundant" << std::endl;
64 }
65 SatResult r = sol.CheckRedundancy(id, idx);
66 if(r == UNSAT) {
67 if(nVerbose) {
68 std::cout << "node " << id << " fanin " << (pNtk->GetCompl(id, idx)? "!": "") << pNtk->GetFanin(id, idx) << " index " << idx << " is redundant" << std::endl;
69 }
70 return true;
71 }
72 if(r == SAT) {
73 if(nVerbose) {
74 std::cout << "node " << id << " fanin " << (pNtk->GetCompl(id, idx)? "!": "") << pNtk->GetFanin(id, idx) << " index " << idx << " is NOT redundant" << std::endl;
75 }
76 sim.AddCex(sol.GetCex());
77 }
78 } else {
79 // if(nVerbose) {
80 // std::cout << "node " << id << " fanin " << (pNtk->GetCompl(id, idx)? "!": "") << pNtk->GetFanin(id, idx) << " index " << idx << " is not redundant" << std::endl;
81 // }
82 }
83 return false;
84 }
bool CheckRedundancy(int id, int idx)
Definition rrrAnalyzer.h:60

◆ GetStatsSummary()

template<typename Ntk, typename Sim, typename Sol>
summary< int > rrr::Analyzer< Ntk, Sim, Sol >::GetStatsSummary ( ) const

Definition at line 124 of file rrrAnalyzer.h.

124 {
127 v.insert(v.end(), v2.begin(), v2.end());
128 return v;
129 }
summary< int > GetStatsSummary() const

◆ GetTimesSummary()

template<typename Ntk, typename Sim, typename Sol>
summary< double > rrr::Analyzer< Ntk, Sim, Sol >::GetTimesSummary ( ) const

Definition at line 132 of file rrrAnalyzer.h.

132 {
135 v.insert(v.end(), v2.begin(), v2.end());
136 return v;
137 }
summary< double > GetTimesSummary() const

◆ ResetSummary()

template<typename Ntk, typename Sim, typename Sol>
void rrr::Analyzer< Ntk, Sim, Sol >::ResetSummary ( )

Definition at line 118 of file rrrAnalyzer.h.

118 {
119 sim.ResetSummary();
120 sol.ResetSummary();
121 }

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