summaryrefslogtreecommitdiff
path: root/kernel/show.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-27 18:31:42 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-27 18:31:42 +0100
commit92cf7ae2f73278fbcbb0bf443c0e245ce4e868b7 (patch)
treed019d463f5912735d2b882c57dacb548098d7ed5 /kernel/show.cc
parent35a02ee81e360a0f8c7643a38b72305c33da08c6 (diff)
Added check: only one module for "show" unless format is "ps"
Diffstat (limited to 'kernel/show.cc')
-rw-r--r--kernel/show.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/show.cc b/kernel/show.cc
index e95d1317..244a4d08 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)