@@ -141,7 +141,11 @@ struct AbcNewPass : public ScriptPass {
141141 selected_modules = order_modules (active_design,
142142 active_design->selected_whole_modules_warn ());
143143 active_design->push_empty_selection ();
144- } else {
144+ }
145+
146+ run (" abc9_ops -replace_zbufs" );
147+
148+ if (help_mode) {
145149 selected_modules = {nullptr };
146150 run (" foreach module in selection" );
147151 }
@@ -169,13 +173,10 @@ struct AbcNewPass : public ScriptPass {
169173 }
170174
171175 run (stringf (" abc9_ops -write_box %s/input.box" , tmpdir));
172- run (" abc9_ops -replace_zbufs" );
173176 run (stringf (" write_xaiger2 -mapping_prep -map2 %s/input.map2 %s/input.xaig" , tmpdir, tmpdir));
174177 run (stringf (" abc9_exe %s -cwd %s -box %s/input.box" , exe_options, tmpdir, tmpdir));
175178 run (stringf (" read_xaiger2 -sc_mapping -module_name %s -map2 %s/input.map2 %s/output.aig" ,
176179 modname.c_str (), tmpdir.c_str (), tmpdir.c_str ()));
177- run (" abc9_ops -restore_zbufs" );
178-
179180 if (!help_mode && mod->has_attribute (ID (abc9_script))) {
180181 if (script_save.empty ())
181182 active_design->scratchpad_unset (" abc9.script" );
@@ -196,6 +197,8 @@ struct AbcNewPass : public ScriptPass {
196197 }
197198 }
198199
200+ run (" abc9_ops -restore_zbufs" );
201+
199202 if (!help_mode) {
200203 active_design->pop_selection ();
201204 }
0 commit comments