From d8631420a1f50ce34e7a980f0d7764a9c2864d33 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Thu, 16 Jan 2025 19:35:22 -0800 Subject: [PATCH] Add -nocells option to equiv_make and equiv_opt to ensure that equivalence is only checked for wires --- passes/equiv/equiv_make.cc | 12 +++++++++++- passes/equiv/equiv_opt.cc | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/passes/equiv/equiv_make.cc b/passes/equiv/equiv_make.cc index e15e510be..9b10817d4 100644 --- a/passes/equiv/equiv_make.cc +++ b/passes/equiv/equiv_make.cc @@ -34,6 +34,7 @@ struct EquivMakeWorker vector blacklists; vector encfiles; bool make_assert; + bool nocells; pool blacklist_names; dict> encdata; @@ -419,7 +420,8 @@ struct EquivMakeWorker copy_to_equiv(); find_undriven_nets(false); find_same_wires(); - find_same_cells(); + if (!nocells) + find_same_cells(); find_undriven_nets(true); } }; @@ -450,6 +452,9 @@ struct EquivMakePass : public Pass { log(" Check equivalence with $assert cells instead of $equiv.\n"); log(" $eqx (===) is used to compare signals."); log("\n"); + log(" -nocells\n"); + log(" Do not check for equivalent cells, just wires.\n"); + log("\n"); log("Note: The circuit created by this command is not a miter (with something like\n"); log("a trigger output), but instead uses $equiv cells to encode the equivalence\n"); log("checking problem. Use 'miter -equiv' if you want to create a miter circuit.\n"); @@ -461,6 +466,7 @@ struct EquivMakePass : public Pass { worker.ct.setup(design); worker.inames = false; worker.make_assert = false; + worker.nocells = false; size_t argidx; for (argidx = 1; argidx < args.size(); argidx++) @@ -481,6 +487,10 @@ struct EquivMakePass : public Pass { worker.make_assert = true; continue; } + if (args[argidx] == "-nocells") { + worker.nocells = true; + continue; + } break; } diff --git a/passes/equiv/equiv_opt.cc b/passes/equiv/equiv_opt.cc index f5eb75730..57b208439 100644 --- a/passes/equiv/equiv_opt.cc +++ b/passes/equiv/equiv_opt.cc @@ -60,6 +60,9 @@ struct EquivOptPass:public ScriptPass log(" -undef\n"); log(" enable modelling of undef states during equiv_induct.\n"); log("\n"); + log(" -nocells\n"); + log(" Do not check for equivalent cells, just wires.\n"); + log("\n"); log(" -nocheck\n"); log(" disable running check before and after the command under test.\n"); log("\n"); @@ -126,6 +129,10 @@ struct EquivOptPass:public ScriptPass async2sync = true; continue; } + if (args[argidx] == "-nocells") { + make_opts += " -nocells"; + continue; + } break; }