From 3e263f223c0c74143afef60ebe17cd2725ae2aed Mon Sep 17 00:00:00 2001 From: Rowan Goemans Date: Mon, 12 Aug 2024 15:05:57 +0200 Subject: [PATCH] kernel/sdc: Add error on EOF when fetching strings --- common/kernel/sdc.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/kernel/sdc.cc b/common/kernel/sdc.cc index 294ecc88..aa3291f3 100644 --- a/common/kernel/sdc.cc +++ b/common/kernel/sdc.cc @@ -194,6 +194,9 @@ struct SDCParser s += c; while (true) { + if (eof()) + log_error("EOF while parsing string '%s'\n", s.c_str()); + char c = peek(); if (!in_quotes && !in_braces && !escaped && (std::isblank(c) || c == ']')) { break; @@ -361,6 +364,7 @@ struct SDCParser net = ctx->ports.at(ety.name).net; else log_error("create_clock applies only to cells, cell pins, or IO ports (line %d)\n", lineno); + ctx->addClock(net->name, 1000.0f / period); } }