mirror of https://github.com/YosysHQ/yosys.git
Disabled cover() for non-linux builds
This commit is contained in:
parent
a8706b73a2
commit
c4e4f79a2a
|
@ -749,7 +749,7 @@ int main(int argc, char **argv)
|
||||||
delete yosys_design;
|
delete yosys_design;
|
||||||
yosys_design = NULL;
|
yosys_design = NULL;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef COVER_ACTIVE
|
||||||
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
|
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
|
||||||
{
|
{
|
||||||
char filename_buffer[4096];
|
char filename_buffer[4096];
|
||||||
|
|
|
@ -75,7 +75,8 @@ 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
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#if defined(__linux__) && !defined(NDEBUG)
|
||||||
|
#define COVER_ACTIVE
|
||||||
|
|
||||||
#define cover(_id) do { \
|
#define cover(_id) do { \
|
||||||
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1))) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
|
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1))) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
|
||||||
|
|
|
@ -71,6 +71,9 @@ struct CoverPass : public Pass {
|
||||||
log(" gawk '{ p[$3] = $1; c[$3] += $2; } END { for (i in p)\n");
|
log(" gawk '{ p[$3] = $1; c[$3] += $2; } END { for (i in p)\n");
|
||||||
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("Coverage counters are only available in debug builds of Yosys for Linux.\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)
|
||||||
{
|
{
|
||||||
|
@ -113,7 +116,7 @@ struct CoverPass : public Pass {
|
||||||
log("\n");
|
log("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef COVER_ACTIVE
|
||||||
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)
|
||||||
|
@ -131,7 +134,7 @@ struct CoverPass : public Pass {
|
||||||
for (auto f : out_files)
|
for (auto f : out_files)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
log_cmd_error("Coverage counters are only available in debug builds of Yosys.");
|
log_cmd_error("Coverage counters are only available in debug builds of Yosys for Linux.\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (auto f : out_files)
|
for (auto f : out_files)
|
||||||
|
|
Loading…
Reference in New Issue