From 418e795235a0b2b8ebd5a39d8b0fa32c8707f0e7 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Wed, 16 Apr 2025 19:03:05 +0200 Subject: [PATCH] liberty: Error when a read liberty file has no nodes --- passes/techmap/libparse.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/passes/techmap/libparse.h b/passes/techmap/libparse.h index f834044ae..e52f91e77 100644 --- a/passes/techmap/libparse.h +++ b/passes/techmap/libparse.h @@ -176,6 +176,14 @@ namespace Yosys LibertyParser(std::istream &f) : f(f), line(1) { shared_ast.reset(parse()); ast = shared_ast.get(); + if (!ast) { +#ifdef FILTERLIB + fprintf(stderr, "No entries found in liberty file.\n"); + exit(1); +#else + log_error("No entries found in liberty file.\n"); +#endif + } } #ifndef FILTERLIB @@ -186,6 +194,9 @@ namespace Yosys LibertyAstCache::instance.parsed_ast(fname, shared_ast); } ast = shared_ast.get(); + if (!ast) { + log_error("No entries found in liberty file `%s'.\n", fname.c_str()); + } } #endif };