From 66e8986ae7655f56881eb664a5919eac4dfd06a3 Mon Sep 17 00:00:00 2001 From: Andrew Zonenberg Date: Thu, 14 Sep 2017 10:34:45 -0700 Subject: [PATCH] Minor changes to opt_demorgan requested during code review --- passes/opt/Makefile.inc | 4 ++-- passes/opt/opt_demorgan.cc | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/passes/opt/Makefile.inc b/passes/opt/Makefile.inc index 639dc6590..0d01e9d35 100644 --- a/passes/opt/Makefile.inc +++ b/passes/opt/Makefile.inc @@ -6,11 +6,11 @@ OBJS += passes/opt/opt_reduce.o OBJS += passes/opt/opt_rmdff.o OBJS += passes/opt/opt_clean.o OBJS += passes/opt/opt_expr.o -OBJS += passes/opt/opt_demorgan.o -OBJS += passes/opt/rmports.o ifneq ($(SMALL),1) OBJS += passes/opt/share.o OBJS += passes/opt/wreduce.o +OBJS += passes/opt/opt_demorgan.o +OBJS += passes/opt/rmports.o endif diff --git a/passes/opt/opt_demorgan.cc b/passes/opt/opt_demorgan.cc index 62d65dea7..f2af1cb93 100644 --- a/passes/opt/opt_demorgan.cc +++ b/passes/opt/opt_demorgan.cc @@ -39,9 +39,9 @@ void demorgan_worker( return; auto insig = sigmap(cell->getPort("\\A")); - log("Inspecting %s cell %s (%d inputs)\n", log_id(cell->type), log_id(cell->name), insig.size()); + log("Inspecting %s cell %s (%d inputs)\n", log_id(cell->type), log_id(cell->name), GetSize(insig)); int num_inverted = 0; - for(int i=0; i seen_bits; - for(int i=0; i seen_bits; + for(int i=0; iwidth) ) + if(every_bit_once && (GetSize(insig) == srcwire->width) ) { log("Rearranging bits\n"); RTLIL::SigSpec newsig; - for(int i=0; i /*args*/, RTLIL::Design *design) + virtual void execute(std::vector args, RTLIL::Design *design) { log_header(design, "Executing OPT_DEMORGAN pass (push inverters through $reduce_* cells).\n"); - //int argidx = 0; - //extra_args(args, argidx, design); + int argidx = 0; + extra_args(args, argidx, design); unsigned int cells_changed = 0; for (auto module : design->selected_modules()) -- 2.30.2