From fce46d2a53d886ba1d72e232ce755bb44e16920c Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Sat, 15 Jun 2024 14:18:33 -0700 Subject: [PATCH] Add better Yosys/Verific name aliasing and reenable dffe opt --- frontends/verific/verific.cc | 4 +++- kernel/yosys.cc | 1 + kernel/yosys_common.h | 1 + passes/opt/opt_dff.cc | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index b4a83518c..e45d4de67 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -207,7 +207,9 @@ bool is_blackbox(Netlist *nl) RTLIL::IdString VerificImporter::new_verific_id(Verific::DesignObj *obj) { - std::string s = stringf("$%s$%d", obj->Name(), autoidx++); + std::string s = stringf("$%s", obj->Name()); + if (seen_ids.count(s)) s += stringf("$%d", autoidx++); + seen_ids.insert(s); return s; } diff --git a/kernel/yosys.cc b/kernel/yosys.cc index b8e06f2db..aab0b191c 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -79,6 +79,7 @@ YOSYS_NAMESPACE_BEGIN int autoidx = 1; int yosys_xtrace = 0; +std::set seen_ids; RTLIL::Design *yosys_design = NULL; CellTypes yosys_celltypes; diff --git a/kernel/yosys_common.h b/kernel/yosys_common.h index 9f1bc2f58..22aeafafa 100644 --- a/kernel/yosys_common.h +++ b/kernel/yosys_common.h @@ -348,6 +348,7 @@ inline int GetSize(RTLIL::Wire *wire); extern int autoidx; extern int yosys_xtrace; +extern std::set seen_ids; RTLIL::IdString new_id(std::string file, int line, std::string func); RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std::string suffix); diff --git a/passes/opt/opt_dff.cc b/passes/opt/opt_dff.cc index f0a22fd61..b77be4515 100644 --- a/passes/opt/opt_dff.cc +++ b/passes/opt/opt_dff.cc @@ -884,7 +884,7 @@ struct OptDffPass : public Pass { { log_header(design, "Executing OPT_DFF pass (perform DFF optimizations).\n"); OptDffOptions opt; - opt.nodffe = true; // SILIMATE: DISABLE DFFE PASS BECAUSE IT BREAKS THE DESIGN + opt.nodffe = false; opt.nosdff = false; opt.simple_dffe = false; opt.keepdc = false;