mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-30 21:19:30 +00:00
log: Print static message as fatal error for YOSYS_ABORT
This commit is contained in:
parent
86a46b9e5c
commit
2dce50516b
2 changed files with 11 additions and 1 deletions
|
@ -407,6 +407,11 @@ void log_abort_internal(const char *file, int line)
|
|||
log_error("Abort in %s:%d.\n", file, line);
|
||||
}
|
||||
|
||||
void log_yosys_abort_message(std::string_view file, int line, std::string_view func, std::string_view message)
|
||||
{
|
||||
log_error("Abort in %s:%d (%s): %s\n", file, line, func, message);
|
||||
}
|
||||
|
||||
void log_formatted_cmd_error(std::string str)
|
||||
{
|
||||
if (log_cmd_error_throw) {
|
||||
|
|
|
@ -142,7 +142,12 @@
|
|||
#define YOSYS_CONSTEVAL constexpr
|
||||
#endif
|
||||
|
||||
#define YOSYS_ABORT(s) abort()
|
||||
#define YOSYS_ABORT(s) YOSYS_NAMESPACE_PREFIX log_yosys_abort_message(__FILE__, __LINE__, __FUNCTION__, s)
|
||||
|
||||
// This has to precede including "kernel/io.h"
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
[[noreturn]] void log_yosys_abort_message(std::string_view file, int line, std::string_view func, std::string_view message);
|
||||
YOSYS_NAMESPACE_END
|
||||
|
||||
#include "kernel/io.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue