aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-08-28 19:52:06 +0200
committerClifford Wolf <clifford@clifford.at>2017-08-28 19:52:06 +0200
commit908f34aafc3135c91b257f8cc2e66d49860138d2 (patch)
tree2c63040dd980023a177e22ae22fbcda981907c8b /passes
parent3aad3ed3da2d838e774b68644ff9e51c475d9916 (diff)
downloadyosys-908f34aafc3135c91b257f8cc2e66d49860138d2.tar.gz
yosys-908f34aafc3135c91b257f8cc2e66d49860138d2.tar.bz2
yosys-908f34aafc3135c91b257f8cc2e66d49860138d2.zip
Rename recover_reduce to extract_reduce, fix args handling
Diffstat (limited to 'passes')
-rw-r--r--passes/techmap/Makefile.inc2
-rw-r--r--passes/techmap/extract_reduce.cc (renamed from passes/techmap/recover_reduce.cc)31
2 files changed, 25 insertions, 8 deletions
diff --git a/passes/techmap/Makefile.inc b/passes/techmap/Makefile.inc
index c2b918f00..3f8a6feb5 100644
--- a/passes/techmap/Makefile.inc
+++ b/passes/techmap/Makefile.inc
@@ -17,7 +17,7 @@ OBJS += passes/techmap/iopadmap.o
OBJS += passes/techmap/hilomap.o
OBJS += passes/techmap/extract.o
OBJS += passes/techmap/extract_fa.o
-OBJS += passes/techmap/recover_reduce.o
+OBJS += passes/techmap/extract_reduce.o
OBJS += passes/techmap/alumacc.o
OBJS += passes/techmap/dff2dffe.o
OBJS += passes/techmap/dffinit.o
diff --git a/passes/techmap/recover_reduce.cc b/passes/techmap/extract_reduce.cc
index bcc31e182..114015c23 100644
--- a/passes/techmap/recover_reduce.cc
+++ b/passes/techmap/extract_reduce.cc
@@ -23,19 +23,21 @@
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
-struct RecoverReducePass : public Pass {
+struct ExtractReducePass : public Pass
+{
enum GateType {
And,
Or,
Xor
};
- RecoverReducePass() : Pass("recover_reduce", "converts gate chains into $reduce_* cells") { }
+ ExtractReducePass() : Pass("extract_reduce", "converts gate chains into $reduce_* cells") { }
+
virtual void help()
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
- log(" recover_reduce\n");
+ log(" extract_reduce [selection]\n");
log("\n");
log("converts gate chains into $reduce_* cells\n");
log("\n");
@@ -43,13 +45,26 @@ struct RecoverReducePass : public Pass {
log("with their corresponding $reduce_* cells. Because this command only operates on\n");
log("these cell types, it is recommended to map the design to only these cell types\n");
log("using the `abc -g` command. Note that, in some cases, it may be more effective\n");
- log("to map the design to only $_AND_ cells, run recover_reduce, map the remaining\n");
- log("parts of the design to AND/OR/XOR cells, and run recover_reduce a second time.\n");
+ log("to map the design to only $_AND_ cells, run extract_reduce, map the remaining\n");
+ log("parts of the design to AND/OR/XOR cells, and run extract_reduce a second time.\n");
log("\n");
}
+
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
{
- (void)args;
+ log_header(design, "Executing EXTRACT_REDUCE pass.\n");
+ log_push();
+
+ size_t argidx;
+ for (argidx = 1; argidx < args.size(); argidx++)
+ {
+ // if (args[argidx] == "-v") {
+ // verbose = true;
+ // continue;
+ // }
+ break;
+ }
+ extra_args(args, argidx, design);
for (auto module : design->selected_modules())
{
@@ -216,7 +231,9 @@ struct RecoverReducePass : public Pass {
for (auto cell : consumed_cells)
module->remove(cell);
}
+
+ log_pop();
}
-} RecoverReducePass;
+} ExtractReducePass;
PRIVATE_NAMESPACE_END