diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-21 12:42:09 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-05-14 10:33:56 -0700 |
commit | d5a8aaba8c6160fe51214677f7452492e950b702 (patch) | |
tree | 15f92149c909e4e99f1816ae90d3eb932c3b0c30 | |
parent | e2044fd9c7de4534428ee4f3e8cf1448c493a7fc (diff) | |
download | yosys-d5a8aaba8c6160fe51214677f7452492e950b702.tar.gz yosys-d5a8aaba8c6160fe51214677f7452492e950b702.tar.bz2 yosys-d5a8aaba8c6160fe51214677f7452492e950b702.zip |
abc9_ops: tidy up, suppress error if no boxes/holes
-rw-r--r-- | passes/techmap/abc9.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc index 3355cd7aa..8fa1f60c5 100644 --- a/passes/techmap/abc9.cc +++ b/passes/techmap/abc9.cc @@ -296,25 +296,25 @@ struct Abc9Pass : public ScriptPass run("wbflip"); run("techmap"); run("opt"); - if (dff_mode) { + if (dff_mode || help_mode) { if (!help_mode) active_design->scratchpad_unset("abc9_ops.prep_dff_submod.did_something"); - run("abc9_ops -prep_dff_submod", "(only if -dff)"); // rewrite specify + run("abc9_ops -prep_dff_submod", " (only if -dff)"); // rewrite specify bool did_something = help_mode || active_design->scratchpad_get_bool("abc9_ops.prep_dff_submod.did_something"); if (did_something) { // select all $_DFF_[NP]_ // then select all its fanins // then select all fanouts of all that // lastly remove $_DFF_[NP]_ cells - run("setattr -set submod \"$abc9_flop\" t:$_DFF_?_ %ci* %co* t:$_DFF_?_ %d"); - run("submod"); - run("setattr -mod -set whitebox 1 -set abc9_flop 1 -set abc9_box 1 *_$abc9_flop"); - run("abc9_ops -prep_dff_unmap"); - run("design -copy-to $abc9 *_$abc9_flop"); // copy submod out - run("delete *_$abc9_flop"); + run("setattr -set submod \"$abc9_flop\" t:$_DFF_?_ %ci* %co* t:$_DFF_?_ %d", " (only if -dff)"); + run("submod", " (only if -dff)"); + run("setattr -mod -set whitebox 1 -set abc9_flop 1 -set abc9_box 1 *_$abc9_flop", "(only if -dff)"); + run("abc9_ops -prep_dff_unmap", " (only if -dff)"); + run("design -copy-to $abc9 *_$abc9_flop", " (only if -dff)"); // copy submod out + run("delete *_$abc9_flop", " (only if -dff)"); if (help_mode) { run("foreach module in design"); - run(" rename <module-name>_$abc9_flop _TECHMAP_REPLACE_"); + run(" rename <module-name>_$abc9_flop _TECHMAP_REPLACE_", " (only if -dff)"); } else { // Rename all submod-s to _TECHMAP_REPLACE_ to inherit name + attrs @@ -346,17 +346,17 @@ struct Abc9Pass : public ScriptPass run(stringf("abc9_ops -prep_lut %d", maxlut)); if (help_mode) run("abc9_ops -prep_box", "(skip if -box)"); - else if (box_file.empty()) { + else if (box_file.empty()) run("abc9_ops -prep_box"); + if (saved_designs.count("$abc9_holes") || help_mode) { + run("design -stash $abc9"); + run("design -load $abc9_holes"); + run("techmap -wb -map %$abc9 -map +/techmap.v"); + run("opt -purge"); + run("design -stash $abc9_holes"); + run("design -load $abc9"); + run("design -delete $abc9"); } - run("design -stash $abc9"); - run("design -load $abc9_holes"); - run("techmap -wb -map %$abc9 -map +/techmap.v"); - run("opt -purge"); - run("aigmap"); - run("design -stash $abc9_holes"); - run("design -load $abc9"); - run("design -delete $abc9"); } if (check_label("exe")) { |