Add nonfatal error support and use for timing failures
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
51d1363dfe
commit
b035cb9fcf
@ -270,7 +270,7 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx)
|
|||||||
deinit_python();
|
deinit_python();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return had_nonfatal_error ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandHandler::conflicting_options(const boost::program_options::variables_map &vm, const char *opt1,
|
void CommandHandler::conflicting_options(const boost::program_options::variables_map &vm, const char *opt1,
|
||||||
|
@ -39,6 +39,7 @@ std::string log_last_error;
|
|||||||
void (*log_error_atexit)() = NULL;
|
void (*log_error_atexit)() = NULL;
|
||||||
|
|
||||||
static int log_newline_count = 0;
|
static int log_newline_count = 0;
|
||||||
|
bool had_nonfatal_error = false;
|
||||||
|
|
||||||
std::string stringf(const char *fmt, ...)
|
std::string stringf(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -177,6 +178,15 @@ void log_break()
|
|||||||
log("\n");
|
log("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void log_nonfatal_error(const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, format);
|
||||||
|
logv_prefixed("ERROR: ", format, ap, LogLevel::ERROR);
|
||||||
|
va_end(ap);
|
||||||
|
had_nonfatal_error = true;
|
||||||
|
}
|
||||||
|
|
||||||
void log_flush()
|
void log_flush()
|
||||||
{
|
{
|
||||||
for (auto f : log_streams)
|
for (auto f : log_streams)
|
||||||
|
@ -56,6 +56,7 @@ extern log_write_type log_write_function;
|
|||||||
|
|
||||||
extern std::string log_last_error;
|
extern std::string log_last_error;
|
||||||
extern void (*log_error_atexit)();
|
extern void (*log_error_atexit)();
|
||||||
|
extern bool had_nonfatal_error;
|
||||||
|
|
||||||
std::string stringf(const char *fmt, ...);
|
std::string stringf(const char *fmt, ...);
|
||||||
std::string vstringf(const char *fmt, va_list ap);
|
std::string vstringf(const char *fmt, va_list ap);
|
||||||
@ -66,7 +67,7 @@ void log_always(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2));
|
|||||||
void log_info(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2));
|
void log_info(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2));
|
||||||
void log_warning(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2));
|
void log_warning(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2));
|
||||||
NPNR_NORETURN void log_error(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2), noreturn);
|
NPNR_NORETURN void log_error(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2), noreturn);
|
||||||
|
void log_nonfatal_error(const char *format, ...) NPNR_ATTRIBUTE(format(printf, 1, 2));
|
||||||
void log_break();
|
void log_break();
|
||||||
void log_flush();
|
void log_flush();
|
||||||
|
|
||||||
|
@ -698,7 +698,7 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
|
|||||||
log_info("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
|
log_info("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
|
||||||
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);
|
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);
|
||||||
else
|
else
|
||||||
log_warning("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
|
log_nonfatal_error("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "",
|
||||||
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);
|
clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target);
|
||||||
}
|
}
|
||||||
for (auto &eclock : empty_clocks) {
|
for (auto &eclock : empty_clocks) {
|
||||||
|
Loading…
Reference in New Issue
Block a user