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

Merge pull request #2059 from boqwxp/logger-vector-to-dict

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:
Miodrag Milanović 2020-05-21 15:36:30 +02:00 committed by GitHub
commit 637650597b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);