From: Andrew Zonenberg Date: Thu, 14 Sep 2017 17:34:45 +0000 (-0700) Subject: Minor changes to opt_demorgan requested during code review X-Git-Tag: yosys-0.8~321^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66e8986ae7655f56881eb664a5919eac4dfd06a3;p=yosys.git Minor changes to opt_demorgan requested during code review --- 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())