3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 11:45:41 +00:00

equiv_opt: support -ignore-unknown-cells

This commit is contained in:
Mohamed Gaber 2026-06-17 21:10:02 +03:00
parent 8267cf87b5
commit 98a1db2756
No known key found for this signature in database
2 changed files with 14 additions and 11 deletions

View file

@ -74,16 +74,16 @@ struct EquivOptPass:public ScriptPass
log("\n");
}
std::string command, techmap_opts, make_opts;
bool assert, undef, multiclock, async2sync, nocheck, post;
std::string command, techmap_opts, make_opts, induct_opts;
bool assert, multiclock, async2sync, nocheck, post;
void clear_flags() override
{
command = "";
techmap_opts = "";
make_opts = "";
induct_opts = "";
assert = false;
undef = false;
multiclock = false;
async2sync = false;
nocheck = false;
@ -118,7 +118,11 @@ struct EquivOptPass:public ScriptPass
continue;
}
if (args[argidx] == "-undef") {
undef = true;
induct_opts += " -undef";
continue;
}
if (args[argidx] == "-ignore-unknown-cells") {
induct_opts += " -ignore-unknown-cells";
continue;
}
if (args[argidx] == "-nocheck") {
@ -213,11 +217,10 @@ struct EquivOptPass:public ScriptPass
opts = make_opts;
run("equiv_make" + opts + " gold gate equiv");
if (help_mode)
run("equiv_induct [-undef] equiv");
else if (undef)
run("equiv_induct -undef equiv");
opts = " [-undef] [-ignore-unknown-cells]";
else
run("equiv_induct equiv");
opts = induct_opts;
run("equiv_induct" + opts + " equiv");
if (help_mode)
run("equiv_status [-assert] equiv");
else if (assert)

View file

@ -315,13 +315,13 @@ module top (
wire intermediate1, intermediate2;
assign intermediate1 = a & b;
assign intermediate2 = intermediate1 | c;
assign w1 = intermediate1;
assign w2 = intermediate1;
assign w3 = intermediate1;
assign w4 = intermediate1;
assign w5 = intermediate1;
assign x1 = intermediate2;
assign x2 = intermediate2;
assign x3 = intermediate2;
@ -376,7 +376,7 @@ EOF
check -assert
# Check equivalence after fanoutbuf - should insert buffers in sub module
equiv_opt -assert fanoutbuf
equiv_opt -assert -ignore-unknown-cells fanoutbuf
design -load postopt
select -assert-count 1 t:$buf
select -assert-none t:$pos