From 9e893369c9d00c130a018a1a023647a2d9f9d22f Mon Sep 17 00:00:00 2001 From: Cassie Jones Date: Sat, 7 Mar 2020 00:10:53 +0100 Subject: [PATCH] Add -retime and -pre-flatten args These are the synthesis options that I wanted to be able to run when I added the -nosynth option, so I'm including them here. --- nangate.cc | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/nangate.cc b/nangate.cc index de0111a..70df222 100644 --- a/nangate.cc +++ b/nangate.cc @@ -213,19 +213,25 @@ struct SynthNaN : public Pass { log(""); log("This command synthesizes a design into NaN gates."); log(""); + log(" -nosynth "); + log(" skip the pre-run synthesis step. Requires that the circuit"); + log(" has already been synthesized down to NAND and NOT gates."); + log(""); + log(" -pre-flatten"); + log(" flatten duing the initial coarse synthesis"); + log(""); + log(" -retime"); + log(" do retiming in ABC"); + log(""); log(" -top "); log(" use the specified module as top module (default='top')"); log(""); log(" -width "); log(" synthesize with a given floating-point with (default=3)"); log(""); - log(" -nosynth "); - log(" skip the pre-run synthesis step. Requires that the circuit"); - log(" has already been synthesized down to NAND and NOT gates."); - log(""); log("Runs the equivalent of the following script:\n\n"); - log(" synth [-top ] (unless -nosynth)\n"); - log(" abc -g NAND (unless -nosynth)\n"); + log(" synth [-flatten] [-top ] (unless -nosynth)\n"); + log(" abc -g NAND [-dff -D 1] (unless -nosynth)\n"); log(" nand_to_nan [-width ]\n"); log(" share_nan\n"); log(" dff_nan [-width ]\n"); @@ -234,6 +240,7 @@ struct SynthNaN : public Pass { log(" techmap_nan\n"); } void execute(vector args, Design *design) override { + string abc_args; string synth_args; string width_args; log_header(design, "Executing SYNTH_NaN pass (synthesizing to tom7 logic).\n"); @@ -242,6 +249,18 @@ struct SynthNaN : public Pass { size_t argidx = 1; bool synth = true; for (; argidx < args.size(); ++argidx) { + if (args[argidx] == "-nosynth") { + synth = false; + continue; + } + if (args[argidx] == "-pre-flatten") { + synth_args += " -flatten"; + continue; + } + if (args[argidx] == "-retime") { + abc_args += " -dff -D 1"; + continue; + } if (args[argidx] == "-top" and argidx + 1 < args.size()) { synth_args += " -top "; synth_args += args[++argidx]; @@ -252,17 +271,13 @@ struct SynthNaN : public Pass { width_args += args[++argidx]; continue; } - if (args[argidx] == "-nosynth") { - synth = false; - continue; - } break; } extra_args(args, argidx, design, false); if (synth) { Pass::call(design, "synth" + synth_args); - Pass::call(design, "abc -g NAND"); + Pass::call(design, "abc -g NAND" + abc_args); } Pass::call(design, "nand_to_nan" + width_args); Pass::call(design, "share_nan"); -- 2.43.2