mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
tee: Allow logging command output to a given scratchpad value
This commit is contained in:
parent
a64ed824ed
commit
ed02d52f30
3 changed files with 20 additions and 0 deletions
|
@ -40,6 +40,7 @@ YOSYS_NAMESPACE_BEGIN
|
|||
|
||||
std::vector<FILE*> log_files;
|
||||
std::vector<std::ostream*> log_streams;
|
||||
std::vector<std::string> log_scratchpads;
|
||||
std::map<std::string, std::set<std::string>> log_hdump;
|
||||
std::vector<YS_REGEX_TYPE> log_warn_regexes, log_nowarn_regexes, log_werror_regexes;
|
||||
dict<std::string, LogExpectedItem> log_expect_log, log_expect_warning, log_expect_error;
|
||||
|
@ -158,6 +159,11 @@ void logv(const char *format, va_list ap)
|
|||
for (auto f : log_streams)
|
||||
*f << str;
|
||||
|
||||
RTLIL::Design *design = yosys_get_design();
|
||||
if (design != nullptr)
|
||||
for (auto &scratchpad : log_scratchpads)
|
||||
design->scratchpad[scratchpad].append(str);
|
||||
|
||||
static std::string linebuffer;
|
||||
static bool log_warn_regex_recusion_guard = false;
|
||||
|
||||
|
|
|
@ -133,6 +133,7 @@ struct log_cmd_error_exception { };
|
|||
|
||||
extern std::vector<FILE*> log_files;
|
||||
extern std::vector<std::ostream*> log_streams;
|
||||
extern std::vector<std::string> log_scratchpads;
|
||||
extern std::map<std::string, std::set<std::string>> log_hdump;
|
||||
extern std::vector<YS_REGEX_TYPE> log_warn_regexes, log_nowarn_regexes, log_werror_regexes;
|
||||
extern std::set<std::string> log_warnings, log_experimentals, log_experimentals_ignored;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue