Skip to content

Commit

Permalink
cciutils: error out if the specified parameter is not found
Browse files Browse the repository at this point in the history
This should help users find out when a specific parameter is present or
not.

Signed-off-by: Matheus Tavares Bernardino <[email protected]>
  • Loading branch information
quic-mathbern committed Dec 3, 2024
1 parent 7604ae3 commit e932973
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions systemc-components/common/include/cciutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class HelpSingleton : public sc_core::sc_module

void print_used_parameter(cci::cci_broker_handle broker, std::string path = "")
{
bool found_match = false;
for (auto v : m_used) {
if (v.rfind(path, 0) == 0) {
cci::cci_value c = cci_get(broker, v);
Expand All @@ -254,8 +255,12 @@ class HelpSingleton : public sc_core::sc_module
std::cout << " (" << h.get_description() << ")";
}
std::cout << std::endl;
found_match = true;
}
}
if (!path.empty() && !found_match) {
SCP_FATAL("cciutils") << "No parameter matching '" << path << "'.";
}
}

void set_unused(const std::string& parname, const cci_originator& originator)
Expand Down

0 comments on commit e932973

Please sign in to comment.