From 0d3923d0868d0e2be7886854984016bc48451615 Mon Sep 17 00:00:00 2001 From: Lofty Date: Tue, 28 Apr 2026 12:33:21 +0100 Subject: [PATCH] abc_new: use default script if not specified --- passes/techmap/abc_new.cc | 16 ++++++++++++++ tests/techmap/abc_speed_gia_only.script | 28 ------------------------- tests/techmap/xaiger2-5169.ys | 2 +- 3 files changed, 17 insertions(+), 29 deletions(-) delete mode 100644 tests/techmap/abc_speed_gia_only.script diff --git a/passes/techmap/abc_new.cc b/passes/techmap/abc_new.cc index 0afabce11..9850ff609 100644 --- a/passes/techmap/abc_new.cc +++ b/passes/techmap/abc_new.cc @@ -50,6 +50,17 @@ struct AbcNewPass : public ScriptPass { experimental(); } + void on_register() override + { + RTLIL::constpad["abc_new.script.speed"] = "+&st; &dch -r;" \ + "&nf; &st; &syn2; &if -g -K 6; &synch2 -r;" \ + "&nf; &st; &syn2; &if -g -K 6; &synch2 -r;" \ + "&nf; &st; &syn2; &if -g -K 6; &synch2 -r;" \ + "&nf; &st; &syn2; &if -g -K 6; &synch2 -r;" \ + "&nf; &st; &syn2; &if -g -K 6; &synch2 -r;" \ + "&nf"; + } + void help() override { // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| @@ -110,6 +121,11 @@ struct AbcNewPass : public ScriptPass { } extra_args(args, argidx, d); + // If no script provided, use a default. + if (abc_exe_options.find("-script") == std::string::npos) { + d->scratchpad_set_string("abc9.script", RTLIL::constpad["abc_new.script.speed"]); + } + log_header(d, "Executing ABC_NEW pass.\n"); log_push(); run_script(d, run_from, run_to); diff --git a/tests/techmap/abc_speed_gia_only.script b/tests/techmap/abc_speed_gia_only.script deleted file mode 100644 index d3730fdb5..000000000 --- a/tests/techmap/abc_speed_gia_only.script +++ /dev/null @@ -1,28 +0,0 @@ -&st -&dch -r -&nf -&st -&syn2 -&if -g -K 6 -&synch2 -r -&nf -&st -&syn2 -&if -g -K 6 -&synch2 -r -&nf -&st -&syn2 -&if -g -K 6 -&synch2 -r -&nf -&st -&syn2 -&if -g -K 6 -&synch2 -r -&nf -&st -&syn2 -&if -g -K 6 -&synch2 -r -&nf diff --git a/tests/techmap/xaiger2-5169.ys b/tests/techmap/xaiger2-5169.ys index 110f17346..1678d56ac 100644 --- a/tests/techmap/xaiger2-5169.ys +++ b/tests/techmap/xaiger2-5169.ys @@ -57,4 +57,4 @@ endmodule EOF logger -expect error "Malformed design" 1 -abc_new -script abc_speed_gia_only.script -liberty ../../tests/liberty/normal.lib -liberty ../../tests/liberty/dff.lib +abc_new -liberty ../../tests/liberty/normal.lib -liberty ../../tests/liberty/dff.lib