From: Clifford Wolf Date: Wed, 26 Jun 2019 09:00:44 +0000 (+0200) Subject: Do not clean up buffer cells with "keep" attribute, closes #1128 X-Git-Tag: yosys-0.9~42 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e9ef891febb47f512710de591401539ad521634;p=yosys.git Do not clean up buffer cells with "keep" attribute, closes #1128 Signed-off-by: Clifford Wolf --- diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc index cfb0f788a..5f75288e2 100644 --- a/passes/opt/opt_clean.cc +++ b/passes/opt/opt_clean.cc @@ -480,7 +480,7 @@ void rmunused_module(RTLIL::Module *module, bool purge_mode, bool verbose, bool std::vector delcells; for (auto cell : module->cells()) - if (cell->type.in("$pos", "$_BUF_")) { + if (cell->type.in("$pos", "$_BUF_") && !cell->has_keep_attr()) { bool is_signed = cell->type == "$pos" && cell->getParam("\\A_SIGNED").as_bool(); RTLIL::SigSpec a = cell->getPort("\\A"); RTLIL::SigSpec y = cell->getPort("\\Y");