From f4b060f6fea1b01b93001972dc29390be5879144 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 3 Mar 2015 18:01:14 +0100 Subject: [PATCH] mibuild/sim: avoid updating end at each cycle (simulation speedup) --- mibuild/sim/console_tb.cpp | 2 +- mibuild/sim/server_tb.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mibuild/sim/console_tb.cpp b/mibuild/sim/console_tb.cpp index f8668e8d0..9468d24d4 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 977206f98..f92cc1678 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);