summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-24 04:16:32 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-24 04:16:32 +0200
commit798f71362975c625f4e24b0c981b15b5684ab33d (patch)
tree05982d83450f4d4f00d0482258dd3b129dc44110
parent1b0d5fc22d1a1e590cb8f2252956ef1b0a38dda0 (diff)
Added support for YOSYS_COVER_FILE env variable
-rw-r--r--kernel/driver.cc13
-rw-r--r--kernel/rtlil.cc2
2 files changed, 12 insertions, 3 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 4992686b..9749ff30 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -750,11 +750,18 @@ int main(int argc, char **argv)
yosys_design = NULL;
#ifndef NDEBUG
- if (getenv("YOSYS_COVER_DIR"))
+ if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
{
char filename_buffer[4096];
- snprintf(filename_buffer, 4096, "%s/yosys_cover_%d_XXXXXX.txt", getenv("YOSYS_COVER_DIR"), getpid());
- FILE *f = fdopen(mkstemps(filename_buffer, 4), "w");
+ FILE *f;
+
+ if (getenv("YOSYS_COVER_DIR")) {
+ snprintf(filename_buffer, 4096, "%s/yosys_cover_%d_XXXXXX.txt", getenv("YOSYS_COVER_DIR"), getpid());
+ f = fdopen(mkstemps(filename_buffer, 4), "w");
+ } else {
+ snprintf(filename_buffer, 4096, "%s", getenv("YOSYS_COVER_FILE"));
+ f = fopen(filename_buffer, "w");
+ }
if (f == NULL)
log_error("Can't create coverage file `%s'.\n", filename_buffer);
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 4a0ac60f..ca8e9b6d 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -1947,6 +1947,7 @@ bool RTLIL::SigSpec::operator <(const RTLIL::SigSpec &other) const
return chunks_[i] < other.chunks_[i];
}
+ cover("kernel.rtlil.sigspec.comp_lt.equal");
return false;
}
@@ -1978,6 +1979,7 @@ bool RTLIL::SigSpec::operator ==(const RTLIL::SigSpec &other) const
return false;
}
+ cover("kernel.rtlil.sigspec.comp_eq.equal");
return true;
}