Skip to content

Commit 8bc2e20

Browse files
committed
Remove cover() coverage tracking
1 parent 10fd978 commit 8bc2e20

File tree

6 files changed

+8
-477
lines changed

6 files changed

+8
-477
lines changed

Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ ENABLE_VERIFIC_HIER_TREE := 1
2121
ENABLE_VERIFIC_YOSYSHQ_EXTENSIONS := 0
2222
ENABLE_VERIFIC_EDIF := 0
2323
ENABLE_VERIFIC_LIBERTY := 0
24-
ENABLE_COVER := 1
2524
ENABLE_LIBYOSYS := 0
2625
ENABLE_ZLIB := 1
2726
ENABLE_HELP_SOURCE := 0
@@ -248,9 +247,6 @@ ifneq ($(SANITIZER),)
248247
$(info [Clang Sanitizer] $(SANITIZER))
249248
CXXFLAGS += -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=$(SANITIZER)
250249
LINKFLAGS += -g -fsanitize=$(SANITIZER)
251-
ifneq ($(findstring address,$(SANITIZER)),)
252-
ENABLE_COVER := 0
253-
endif
254250
ifneq ($(findstring memory,$(SANITIZER)),)
255251
CXXFLAGS += -fPIE -fsanitize-memory-track-origins
256252
LINKFLAGS += -fPIE -fsanitize-memory-track-origins
@@ -544,10 +540,6 @@ LIBS_VERIFIC += -Wl,--whole-archive $(patsubst %,$(VERIFIC_DIR)/%/*-linux.a,$(VE
544540
endif
545541
endif
546542

547-
ifeq ($(ENABLE_COVER),1)
548-
CXXFLAGS += -DYOSYS_ENABLE_COVER
549-
endif
550-
551543
ifeq ($(ENABLE_CCACHE),1)
552544
CXX := ccache $(CXX)
553545
else
@@ -725,7 +717,6 @@ OBJS += passes/hierarchy/hierarchy.o
725717
OBJS += passes/cmds/select.o
726718
OBJS += passes/cmds/show.o
727719
OBJS += passes/cmds/stat.o
728-
OBJS += passes/cmds/cover.o
729720
OBJS += passes/cmds/design.o
730721
OBJS += passes/cmds/plugin.o
731722

kernel/log.h

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -290,53 +290,6 @@ void log_abort_internal(const char *file, int line);
290290
#define log_ping() YOSYS_NAMESPACE_PREFIX log("-- %s:%d %s --\n", __FILE__, __LINE__, __PRETTY_FUNCTION__)
291291

292292

293-
// ---------------------------------------------------
294-
// This is the magic behind the code coverage counters
295-
// ---------------------------------------------------
296-
297-
#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
298-
299-
#define cover(_id) do { \
300-
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1), used)) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
301-
__d.counter++; \
302-
} while (0)
303-
304-
struct CoverData {
305-
const char *file, *func, *id;
306-
int line, counter;
307-
} YS_ATTRIBUTE(packed);
308-
309-
// this two symbols are created by the linker for the "yosys_cover_list" ELF section
310-
extern "C" struct CoverData __start_yosys_cover_list[];
311-
extern "C" struct CoverData __stop_yosys_cover_list[];
312-
313-
extern dict<std::string, std::pair<std::string, int>> extra_coverage_data;
314-
315-
void cover_extra(std::string parent, std::string id, bool increment = true);
316-
dict<std::string, std::pair<std::string, int>> get_coverage_data();
317-
318-
#define cover_list(_id, ...) do { cover(_id); \
319-
std::string r = cover_list_worker(_id, __VA_ARGS__); \
320-
log_assert(r.empty()); \
321-
} while (0)
322-
323-
static inline std::string cover_list_worker(std::string, std::string last) {
324-
return last;
325-
}
326-
327-
template<typename... T>
328-
std::string cover_list_worker(std::string prefix, std::string first, T... rest) {
329-
std::string selected = cover_list_worker(prefix, rest...);
330-
cover_extra(prefix, prefix + "." + first, first == selected);
331-
return first == selected ? "" : selected;
332-
}
333-
334-
#else
335-
# define cover(...) do { } while (0)
336-
# define cover_list(...) do { } while (0)
337-
#endif
338-
339-
340293
// ------------------------------------------------------------
341294
// everything below this line are utilities for troubleshooting
342295
// ------------------------------------------------------------

0 commit comments

Comments
 (0)