171 log(
"[%2d%%] Analyzing input cone for signal %s:\n", prec,
log_signal(output));
173 std::vector<RTLIL::SigBit> pi;
177 log(
" Found %d input signals and %d cells.\n",
int(pi.size()),
int(
ez_cells.size()));
187 std::set<int> unused_pi_idx;
189 for (
size_t i = 0; i < pi.size(); i++)
190 unused_pi_idx.insert(i);
194 std::vector<int> model_pi_idx;
195 std::vector<int> model_expr;
196 std::vector<bool> model;
198 for (
size_t i = 0; i < pi.size(); i++)
199 if (unused_pi_idx.count(i) != 0) {
200 model_pi_idx.push_back(i);
201 model_expr.push_back(
sat_pi.at(pi[i]));
204 if (!
ez.solve(model_expr, model,
ez.expression(
ezSAT::OpOr, model_expr),
ez.XOR(output_a, output_b),
ez.NOT(output_undef_a),
ez.NOT(output_undef_b)))
208 for (
size_t i = 0; i < model_pi_idx.size(); i++)
211 log(
" Found relevant input: %s\n",
log_signal(pi[model_pi_idx[i]]));
212 unused_pi_idx.erase(model_pi_idx[i]);
218 for (
size_t i = 0; i < pi.size(); i++)
219 if (unused_pi_idx.count(i) == 0)
220 reduced_inputs.push_back(pi[i]);
223 log(
" Reduced input cone contains %d inputs.\n",
int(reduced_inputs.size()));
const char * log_signal(const RTLIL::SigSpec &sig, bool autoint)
std::vector< int > importSigSpec(RTLIL::SigSpec sig, int timestep=-1)
std::vector< int > importUndefSigSpec(RTLIL::SigSpec sig, int timestep=-1)
#define log_assert(_assert_expr_)
void setContext(SigMap *sigmap, std::string prefix=std::string())
void log(const char *format,...)