From: Florent Kermarrec Date: Fri, 11 Jan 2019 14:01:58 +0000 (+0100) Subject: build/sim/core: fix coverage X-Git-Tag: 24jan2021_ls180~1409 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=387ee04130dbb217fb560c17f47d1d7edea5fd55;p=litex.git build/sim/core: fix coverage --- diff --git a/litex/build/sim/core/Makefile b/litex/build/sim/core/Makefile index 7693abb7..9adb9763 100644 --- a/litex/build/sim/core/Makefile +++ b/litex/build/sim/core/Makefile @@ -1,7 +1,7 @@ include variables.mak CC = gcc -CFLAGS = -Wall -O3 -ggdb +CFLAGS = -Wall -O3 -ggdb $(if $(COVERAGE), -DVM_COVERAGE) LDFLAGS = -lpthread -ljson-c -lm -lstdc++ -ldl -levent CC_SRCS ?= "--cc dut.v" diff --git a/litex/build/sim/core/sim.c b/litex/build/sim/core/sim.c index 6e62c5cf..32124ee1 100644 --- a/litex/build/sim/core/sim.c +++ b/litex/build/sim/core/sim.c @@ -190,10 +190,12 @@ static void cb(int sock, short which, void *arg) if(!s->tickfirst) s->module->tick(s->session); } - } - if (litex_sim_got_finish()) - event_base_loopbreak(base); + if (litex_sim_got_finish()) { + event_base_loopbreak(base); + break; + } + } if (!evtimer_pending(ev, NULL)) { event_del(ev); @@ -232,7 +234,6 @@ int main() goto out; } - tv.tv_sec = 0; tv.tv_usec = 0; ev = event_new(base, -1, EV_PERSIST, cb, vdut);