write_aiger: make more robust
authorEddie Hung <eddie@fpgeh.com>
Mon, 6 Jan 2020 18:18:59 +0000 (10:18 -0800)
committerEddie Hung <eddie@fpgeh.com>
Mon, 6 Jan 2020 18:18:59 +0000 (10:18 -0800)
backends/aiger/aiger.cc

index 44718baaed05bdf130c0483401af342ee8f6f789..a51e3648c16dcf55baf0895ec4f888a799f875e0 100644 (file)
@@ -787,6 +787,14 @@ struct AigerBackend : public Backend {
                if (top_module == nullptr)
                        log_error("Can't find top module in current design!\n");
 
+               if (!design->selected_whole_module(top_module))
+                       log_cmd_error("Can't handle partially selected module %s!\n", log_id(top_module));
+
+               if (!top_module->processes.empty())
+                       log_error("Found unmapped processes in module %s: unmapped processes are not supported in AIGER backend!\n", log_id(top_module));
+               if (!top_module->memories.empty())
+                       log_error("Found unmapped memories in module %s: unmapped memories are not supported in AIGER backend!\n", log_id(top_module));
+
                AigerWriter writer(top_module, zinit_mode, imode, omode, bmode, lmode);
                writer.write_aiger(*f, ascii_mode, miter_mode, symbols_mode);