diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-02-04 23:31:06 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-02-04 23:31:06 +0100 |
commit | 1fb8ba73bd09a7328e3523193a4f03a8ff87b5c9 (patch) | |
tree | 5fce2be61a7b8e6a28e6a5393d3bde72906c36a4 /passes/cmds | |
parent | b1bf55dd63936cecab0320196236e50673f951f1 (diff) | |
download | yosys-1fb8ba73bd09a7328e3523193a4f03a8ff87b5c9.tar.gz yosys-1fb8ba73bd09a7328e3523193a4f03a8ff87b5c9.tar.bz2 yosys-1fb8ba73bd09a7328e3523193a4f03a8ff87b5c9.zip |
Throw errors if non-existing selection variables are used
Diffstat (limited to 'passes/cmds')
-rw-r--r-- | passes/cmds/select.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc index 253d8d68f..2561e8f64 100644 --- a/passes/cmds/select.cc +++ b/passes/cmds/select.cc @@ -384,7 +384,8 @@ static void select_op_expand(RTLIL::Design *design, std::string arg, char mode) for (auto i1 : design->selection_vars.at(str).selected_members) for (auto i2 : i1.second) limits.insert(i2); - } + } else + log_cmd_error("Selection %s is not defined!\n", RTLIL::id2cstr(str)); } else limits.insert(RTLIL::escape_id(str)); } @@ -521,7 +522,7 @@ static void select_stmt(RTLIL::Design *design, std::string arg) if (design->selection_vars.count(set_name) > 0) work_stack.push_back(design->selection_vars[set_name]); else - work_stack.push_back(RTLIL::Selection(false)); + log_cmd_error("Selection @%s is not defined!\n", RTLIL::id2cstr(set_name)); select_filter_active_mod(design, work_stack.back()); return; } @@ -1016,7 +1017,7 @@ struct SelectPass : public Pass { if (!set_name.empty()) { if (work_stack.size() == 0) - design->selection_vars.erase(set_name); + design->selection_vars[set_name] = RTLIL::Selection(false); else design->selection_vars[set_name] = work_stack.back(); return; |