aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-02-11 11:39:50 +0100
committerClifford Wolf <clifford@clifford.at>2017-02-11 11:39:50 +0100
commit0b7aac645c482e9f8e80fb74b61b5c9c6c378857 (patch)
tree53eeaf55ae87944de449b2ad23e5977e40abdf0d /frontends
parenteb7b18e897ac908e960bee6c976f744043590881 (diff)
downloadyosys-0b7aac645c482e9f8e80fb74b61b5c9c6c378857.tar.gz
yosys-0b7aac645c482e9f8e80fb74b61b5c9c6c378857.tar.bz2
yosys-0b7aac645c482e9f8e80fb74b61b5c9c6c378857.zip
Improve handling of Verific warnings and error messages
Diffstat (limited to 'frontends')
-rw-r--r--frontends/verific/verific.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc
index 306bc5d82..36e44fe01 100644
--- a/frontends/verific/verific.cc
+++ b/frontends/verific/verific.cc
@@ -57,7 +57,7 @@ PRIVATE_NAMESPACE_BEGIN
void msg_func(msg_type_t msg_type, const char *message_id, linefile_type linefile, const char *msg, va_list args)
{
- log("VERIFIC-%s [%s] ",
+ string message = stringf("VERIFIC-%s [%s] ",
msg_type == VERIFIC_NONE ? "NONE" :
msg_type == VERIFIC_ERROR ? "ERROR" :
msg_type == VERIFIC_WARNING ? "WARNING" :
@@ -65,10 +65,16 @@ void msg_func(msg_type_t msg_type, const char *message_id, linefile_type linefil
msg_type == VERIFIC_INFO ? "INFO" :
msg_type == VERIFIC_COMMENT ? "COMMENT" :
msg_type == VERIFIC_PROGRAM_ERROR ? "PROGRAM_ERROR" : "UNKNOWN", message_id);
+
if (linefile)
- log("%s:%d: ", LineFile::GetFileName(linefile), LineFile::GetLineNo(linefile));
- logv(msg, args);
- log("\n");
+ message += stringf("%s:%d: ", LineFile::GetFileName(linefile), LineFile::GetLineNo(linefile));
+
+ message += vstringf(msg, args);
+
+ if (msg_type == VERIFIC_ERROR || msg_type == VERIFIC_WARNING || msg_type == VERIFIC_PROGRAM_ERROR)
+ log_warning("%s\n", message.c_str());
+ else
+ log("%s\n", message.c_str());
}
struct VerificImporter