ENABLE_PLUGINS := 1
ENABLE_READLINE := 1
ENABLE_VERIFIC := 0
+ENABLE_COVER := 0
# other configuration flags
ENABLE_GPROF := 0
LDLIBS += $(patsubst %,$(VERIFIC_DIR)/%/*-linux.a,$(VERIFIC_COMPONENTS))
endif
+ifeq ($(ENABLE_COVER),1)
+CXXFLAGS += -DYOSYS_ENABLE_COVER
+endif
+
ifeq ($(PRETTY), 1)
P_STATUS = 0
P_OFFSET = 0
log("%s\n", out_count ? "" : " no commands executed");
}
-#ifdef COVER_ACTIVE
+#ifdef YOSYS_ENABLE_COVER
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
{
char filename_buffer[4096];
// ---------------------------------------------------
// This is the magic behind the code coverage counters
// ---------------------------------------------------
-#ifdef COVER_ACTIVE
+#ifdef YOSYS_ENABLE_COVER
std::map<std::string, std::pair<std::string, int>> extra_coverage_data;
// This is the magic behind the code coverage counters
// ---------------------------------------------------
-#if defined(__linux__) && !defined(NDEBUG)
-#define COVER_ACTIVE
+#ifdef YOSYS_ENABLE_COVER
#define cover(_id) do { \
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1))) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
log("\n");
}
-#ifdef COVER_ACTIVE
+#ifdef YOSYS_ENABLE_COVER
for (auto &it : get_coverage_data()) {
if (!patterns.empty()) {
for (auto &p : patterns)
for (auto f : out_files)
fclose(f);
- log_cmd_error("Coverage counters are only available in debug builds of Yosys for Linux.\n");
+ log_cmd_error("This version of Yosys was not built with support for code coverage counters.\n");
#endif
for (auto f : out_files)