gem5 v24.1.0.1
|
These methods and macros provide access to gem5's logging system. More...
Macros | |
#define | panic(...) exit_message(::gem5::Logger::getPanic(), __VA_ARGS__) |
This implements a cprintf based panic() function. | |
#define | fatal(...) exit_message(::gem5::Logger::getFatal(), __VA_ARGS__) |
This implements a cprintf based fatal() function. | |
#define | panic_if(cond, ...) |
Conditional panic macro that checks the supplied condition and only panics if the condition is true and allows the programmer to specify diagnostic printout. | |
#define | fatal_if(cond, ...) |
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condition is true and allows the programmer to specify diagnostic printout. | |
#define | gem5_assert(cond, ...) |
The assert macro will function like a normal assert, but will use panic instead of straight abort(). | |
#define | hack_once(...) base_message_once(::gem5::Logger::getHack(), __VA_ARGS__) |
#define | warn_if_once(cond, ...) |
These methods and macros provide access to gem5's logging system.
#define fatal | ( | ... | ) | exit_message(::gem5::Logger::getFatal(), __VA_ARGS__) |
This implements a cprintf based fatal() function.
fatal() should be called when the simulation cannot continue due to some condition that is the user's fault (bad configuration, invalid arguments, etc.) and not a simulator bug. fatal() might call exit, unlike panic().
Definition at line 200 of file logging.hh.
#define fatal_if | ( | cond, | |
... | |||
) |
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condition is true and allows the programmer to specify diagnostic printout.
Useful to replace if + fatal, or if + print + assert, etc.
cond | Condition that is checked; if true -> fatal |
... | Printf-based format string with arguments, extends printout. |
Definition at line 236 of file logging.hh.
#define gem5_assert | ( | cond, | |
... | |||
) |
The assert macro will function like a normal assert, but will use panic instead of straight abort().
This allows to perform some cleaning up in ExitLogger::exit() before calling abort().
cond | Condition that is checked; if false -> panic |
... | Printf-based format string with arguments, extends printout. |
Definition at line 317 of file logging.hh.
#define hack_once | ( | ... | ) | base_message_once(::gem5::Logger::getHack(), __VA_ARGS__) |
Definition at line 264 of file logging.hh.
#define panic | ( | ... | ) | exit_message(::gem5::Logger::getPanic(), __VA_ARGS__) |
This implements a cprintf based panic() function.
panic() should be called when something happens that should never ever happen regardless of what the user does (i.e., an acutal m5 bug). panic() might call abort which can dump core or enter the debugger.
Definition at line 188 of file logging.hh.
#define panic_if | ( | cond, | |
... | |||
) |
Conditional panic macro that checks the supplied condition and only panics if the condition is true and allows the programmer to specify diagnostic printout.
Useful to replace if + panic, or if + print + assert, etc.
cond | Condition that is checked; if true -> panic |
... | Printf-based format string with arguments, extends printout. |
Definition at line 214 of file logging.hh.
#define warn_if_once | ( | cond, | |
... | |||
) |
Definition at line 290 of file logging.hh.