From 95f1eb9b87064719c17d45f24775c3e97497b6df Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 9 Jan 2015 17:32:53 +0100 Subject: Only enable code coverage counters on linux --- kernel/driver.cc | 2 +- kernel/log.cc | 2 +- kernel/log.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel') diff --git a/kernel/driver.cc b/kernel/driver.cc index 1698e216c..c7f233c54 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -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")) { string filename; diff --git a/kernel/log.cc b/kernel/log.cc index 70bff8f5b..401dbeeb0 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -402,7 +402,7 @@ void log_cell(RTLIL::Cell *cell, std::string indent) // --------------------------------------------------- // This is the magic behind the code coverage counters // --------------------------------------------------- -#ifdef YOSYS_ENABLE_COVER +#if defined(YOSYS_ENABLE_COVER) && defined(__linux__) dict> extra_coverage_data; diff --git a/kernel/log.h b/kernel/log.h index fa02d2396..e61d19b62 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -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 // --------------------------------------------------- -#ifdef YOSYS_ENABLE_COVER +#if defined(YOSYS_ENABLE_COVER) && defined(__linux__) #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++; \ } while (0) -- cgit v1.2.3