mirror of https://github.com/YosysHQ/yosys.git
Only enable code coverage counters on linux
This commit is contained in:
parent
bd3dd80526
commit
95f1eb9b87
|
@ -406,7 +406,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_COVER
|
#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
|
||||||
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
|
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
|
||||||
{
|
{
|
||||||
string filename;
|
string filename;
|
||||||
|
|
|
@ -402,7 +402,7 @@ void log_cell(RTLIL::Cell *cell, std::string indent)
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
// This is the magic behind the code coverage counters
|
// This is the magic behind the code coverage counters
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
#ifdef YOSYS_ENABLE_COVER
|
#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
|
||||||
|
|
||||||
dict<std::string, std::pair<std::string, int>> extra_coverage_data;
|
dict<std::string, std::pair<std::string, int>> extra_coverage_data;
|
||||||
|
|
||||||
|
|
|
@ -92,10 +92,10 @@ static inline void log_assert_worker(bool cond, const char *expr, const char *fi
|
||||||
// This is the magic behind the code coverage counters
|
// This is the magic behind the code coverage counters
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_COVER
|
#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
|
||||||
|
|
||||||
#define cover(_id) do { \
|
#define cover(_id) do { \
|
||||||
static CoverData __d YS_ATTRIBUTE(section("yosys_cover_list"), aligned(1), used) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
|
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1), used)) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
|
||||||
__d.counter++; \
|
__d.counter++; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ struct CoverPass : public Pass {
|
||||||
log(" printf \"%%-60s %%10d %%s\\n\", p[i], c[i], i; }' {files} | sort -k3\n");
|
log(" printf \"%%-60s %%10d %%s\\n\", p[i], c[i], i; }' {files} | sort -k3\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
log("Coverage counters are only available in debug builds of Yosys for Linux.\n");
|
log("Coverage counters are only available in Yosys for Linux.\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
}
|
}
|
||||||
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
|
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
|
||||||
|
@ -128,7 +128,7 @@ struct CoverPass : public Pass {
|
||||||
log("\n");
|
log("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_COVER
|
#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
|
||||||
for (auto &it : get_coverage_data()) {
|
for (auto &it : get_coverage_data()) {
|
||||||
if (!patterns.empty()) {
|
if (!patterns.empty()) {
|
||||||
for (auto &p : patterns)
|
for (auto &p : patterns)
|
||||||
|
|
Loading…
Reference in New Issue