Error detection for co-simulation
authorMiodrag Milanovic <mmicko@gmail.com>
Fri, 4 Feb 2022 10:11:36 +0000 (11:11 +0100)
committerMiodrag Milanovic <mmicko@gmail.com>
Fri, 4 Feb 2022 10:11:36 +0000 (11:11 +0100)
kernel/fstdata.cc
passes/sat/sim.cc

index 0b62564f6d76525b5062167868a5737bd2cf1cae..330c4d1893ebced0b7a9c799b1318560e9b1c5c4 100644 (file)
@@ -26,6 +26,8 @@ FstData::FstData(std::string filename) : ctx(nullptr)
 {
        const std::vector<std::string> 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 = "";
index b2425b531f8108465c99a83deee849156f834c76..0687e3e0fc32a68de27a6722e6eccccea98e5972 100644 (file)
@@ -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<fstHandle> fst_clock;