VUnit offers Logging library which provides several logging functions and custom log levels. The library is well documented here: [https://vunit.github.io/logging/user_guide.html]
However there are some pitfalls when using the library which were discovered during update of testcases to use this library...
Pitfall nr.1: Can't use String concatenation.
Consider following report:
report "Simple error message with code: " & integer'image(error_code) severity error;
This is perfectly valid and usable in GHDL. However, if one wants to do the same with
"error" function of GHDL:
error("Simple error message with code: " & integer'image(error_code)");
and error will be thrown out (Don't know why, this must be examined. Error message does not make sense!)
It is possible to split the message into two messages (e.g. info and error):
info("Simple error message with code: ");
This is a the moment prefferred workaround.
Pitfall nr.2: Message can't start with integer.
Consider following report message:
error("8 bit access error");
Will thrown an error (again confusing), however following:
error("Memory access error - 8 bit");
will compile just fine!