Skip to content

Commit

Permalink
deregister network event in circuit_validator (lsils#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
lee30sonia authored Apr 11, 2021
1 parent a49125a commit 261e02a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/mockturtle/algorithms/circuit_validator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class circuit_validator
static_assert( has_foreach_fanout_v<Ntk>, "Ntk does not implement the foreach_fanout method" );
}

event_ptr = ntk._events->on_add.size();
ntk._events->on_add.emplace_back( [&]( const auto& n ) {
(void)n;
literals.resize();
Expand All @@ -136,6 +137,11 @@ class circuit_validator
restart();
}

~circuit_validator()
{
ntk._events->on_add.erase( ntk._events->on_add.begin() + event_ptr );
}

/*! \brief Validate functional equivalence of signals `f` and `d`. */
std::optional<bool> validate( signal const& f, signal const& d )
{
Expand Down Expand Up @@ -698,6 +704,8 @@ class circuit_validator
bool between_push_pop = false;
std::vector<node> tmp;

uint32_t event_ptr;

public:
std::vector<bool> cex;
};
Expand Down

0 comments on commit 261e02a

Please sign in to comment.