From: Miodrag Milanovic Date: Fri, 4 Feb 2022 10:11:36 +0000 (+0100) Subject: Error detection for co-simulation X-Git-Tag: yosys-0.14~2^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0a156bcb43bb0bb42eb3f2d94c12cda9ca5ee37;p=yosys.git Error detection for co-simulation --- diff --git a/kernel/fstdata.cc b/kernel/fstdata.cc index 0b62564f6..330c4d189 100644 --- a/kernel/fstdata.cc +++ b/kernel/fstdata.cc @@ -26,6 +26,8 @@ FstData::FstData(std::string filename) : ctx(nullptr) { const std::vector g_units = { "s", "ms", "us", "ns", "ps", "fs", "as", "zs" }; ctx = (fstReaderContext *)fstReaderOpen(filename.c_str()); + if (!ctx) + log_error("Error opening '%s'\n", filename.c_str()); int scale = (int)fstReaderGetTimescale(ctx); timescale = pow(10.0, scale); timescale_str = ""; diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index b2425b531..0687e3e0f 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -961,6 +961,9 @@ struct SimWorker : SimShared log_assert(top == nullptr); fst = new FstData(sim_filename); + if (scope.empty()) + log_error("Scope must be defined for co-simulation.\n"); + top = new SimInstance(this, scope, topmod); std::vector fst_clock;