From: Clifford Wolf Date: Wed, 27 Mar 2013 17:31:42 +0000 (+0100) Subject: Added check: only one module for "show" unless format is "ps" X-Git-Tag: yosys-0.2.0~673 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92cf7ae2f73278fbcbb0bf443c0e245ce4e868b7;p=yosys.git Added check: only one module for "show" unless format is "ps" --- diff --git a/kernel/show.cc b/kernel/show.cc index e95d13171..244a4d08e 100644 --- a/kernel/show.cc +++ b/kernel/show.cc @@ -459,6 +459,15 @@ struct ShowPass : public Pass { } extra_args(args, argidx, design); + if (format != "ps") { + int modcount = 0; + for (auto &mod_it : design->modules) + if (design->selected_module(mod_it.first)) + modcount++; + if (modcount > 1) + log_cmd_error("For formats different than 'ps' only one module must be selected.\n"); + } + for (auto filename : libfiles) { FILE *f = fopen(filename.c_str(), "rt"); if (f == NULL)