@@ -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