3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

log: Use dict instead of std::vector<std::pair> for log_expect_{error, warning, log} to better express the intent that each element is unique.

This commit is contained in:
Alberto Gonzalez 2020-05-14 22:52:07 +00:00
parent 07eecff9cc
commit 8297afe925
No known key found for this signature in database
GPG key ID: 8395A8BA109708B2
3 changed files with 21 additions and 51 deletions

View file

@ -202,19 +202,16 @@ void log_flush();
struct LogExpectedItem
{
LogExpectedItem(std::string pattern, int expected) :
expected_count(expected),
current_count(0),
pattern(pattern)
{
}
LogExpectedItem(const YS_REGEX_TYPE &pat, int expected) :
pattern(pat), expected_count(expected), current_count(0) {}
LogExpectedItem() : expected_count(0), current_count(0) {}
YS_REGEX_TYPE pattern;
int expected_count;
int current_count;
std::string pattern;
};
extern std::vector<std::pair<YS_REGEX_TYPE,LogExpectedItem>> log_expect_log, log_expect_warning, log_expect_error;
extern dict<std::string, LogExpectedItem> log_expect_log, log_expect_warning, log_expect_error;
void log_check_expected();
const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true);