3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-13 04:28:18 +00:00

add log_suppressed and fixed formatting

This commit is contained in:
Miodrag Milanovic 2024-02-08 12:19:42 +01:00
parent 2797d67569
commit a38273c19d

View file

@ -531,33 +531,33 @@ int main(int argc, char **argv)
yosys_banner(); yosys_banner();
#if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE) #if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
std::string state_dir; std::string state_dir;
#if defined(_WIN32) #if defined(_WIN32)
if (getenv("HOMEDRIVE") != NULL && getenv("HOMEPATH") != NULL) { if (getenv("HOMEDRIVE") != NULL && getenv("HOMEPATH") != NULL) {
state_dir = stringf("%s%s/.local/state", getenv("HOMEDRIVE"), getenv("HOMEPATH")); state_dir = stringf("%s%s/.local/state", getenv("HOMEDRIVE"), getenv("HOMEPATH"));
} else { } else {
log_debug("$HOMEDRIVE and/or $HOMEPATH is empty. No history file will be created."); log_debug("$HOMEDRIVE and/or $HOMEPATH is empty. No history file will be created.\n");
} }
#else #else
if (getenv("XDG_STATE_HOME") == NULL || getenv("XDG_STATE_HOME")[0] == '\0') { if (getenv("XDG_STATE_HOME") == NULL || getenv("XDG_STATE_HOME")[0] == '\0') {
if (getenv("HOME") != NULL) { if (getenv("HOME") != NULL) {
state_dir = stringf("%s/.local/state", getenv("HOME")); state_dir = stringf("%s/.local/state", getenv("HOME"));
} else { } else {
log_debug("$HOME is empty. No history file will be created."); log_debug("$HOME is empty. No history file will be created.\n");
} }
} else { } else {
state_dir = stringf("%s", getenv("XDG_STATE_HOME")); state_dir = stringf("%s", getenv("XDG_STATE_HOME"));
} }
#endif #endif
if (!state_dir.empty()) { if (!state_dir.empty()) {
std::string yosys_dir = state_dir + "/yosys"; std::string yosys_dir = state_dir + "/yosys";
create_directory(yosys_dir); create_directory(yosys_dir);
yosys_history_file = yosys_dir + "/history"; yosys_history_file = yosys_dir + "/history";
read_history(yosys_history_file.c_str()); read_history(yosys_history_file.c_str());
yosys_history_offset = where_history(); yosys_history_offset = where_history();
} }
#endif #endif
if (print_stats) if (print_stats)
@ -591,6 +591,8 @@ int main(int argc, char **argv)
for (auto &fn : plugin_filenames) for (auto &fn : plugin_filenames)
load_plugin(fn, {}); load_plugin(fn, {});
log_suppressed();
if (!vlog_defines.empty()) { if (!vlog_defines.empty()) {
std::string vdef_cmd = "read -define"; std::string vdef_cmd = "read -define";
for (auto vdef : vlog_defines) for (auto vdef : vlog_defines)