From: Florent Kermarrec Date: Tue, 3 Mar 2015 17:01:14 +0000 (+0100) Subject: mibuild/sim: avoid updating end at each cycle (simulation speedup) X-Git-Tag: 24jan2021_ls180~2099^2~215 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4b060f6fea1b01b93001972dc29390be5879144;p=litex.git mibuild/sim: avoid updating end at each cycle (simulation speedup) --- diff --git a/mibuild/sim/console_tb.cpp b/mibuild/sim/console_tb.cpp index f8668e8d..9468d24d 100644 --- a/mibuild/sim/console_tb.cpp +++ b/mibuild/sim/console_tb.cpp @@ -115,7 +115,6 @@ void sim_tick(struct sim *s) if (trace) tfp->dump(s->tick); s->tick++; - s->end = clock(); } void sim_init(struct sim *s) @@ -157,6 +156,7 @@ int main(int argc, char **argv, char **env) s.run = false; } } + s.end = clock(); speed = (s.tick/2)/((s.end-s.start)/CLOCKS_PER_SEC); diff --git a/mibuild/sim/server_tb.cpp b/mibuild/sim/server_tb.cpp index 977206f9..f92cc167 100644 --- a/mibuild/sim/server_tb.cpp +++ b/mibuild/sim/server_tb.cpp @@ -150,7 +150,6 @@ void sim_tick(struct sim *s) if (trace) tfp->dump(s->tick); s->tick++; - s->end = clock(); } void sim_init(struct sim *s) @@ -193,6 +192,7 @@ int main(int argc, char **argv, char **env) s.run = false; } } + s.end = clock(); tfp->close(); pthread_cancel(sim_receive_thread);