From 0b3c27f14975718c00367e901fb548fda2bc7dd1 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 2 Nov 2005 14:45:35 -0500 Subject: Fix bug where simulation terminates same cycle as last stat dump causing a duplicate row in db --HG-- extra : convert_revision : 45877c6feeaddf921eb0f4764246bf66e1705a1d --- sim/stat_control.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sim') diff --git a/sim/stat_control.cc b/sim/stat_control.cc index 2f6e56b44..85c405b7f 100644 --- a/sim/stat_control.cc +++ b/sim/stat_control.cc @@ -61,6 +61,7 @@ namespace Stats { Time statTime(true); Tick startTick; +Tick lastDump(0); class SimTicksReset : public Callback { @@ -194,6 +195,11 @@ list OutputList; void DumpNow() { + assert(lastDump <= curTick); + if (lastDump == curTick) + return; + lastDump = curTick; + list::iterator i = OutputList.begin(); list::iterator end = OutputList.end(); for (; i != end; ++i) { -- cgit v1.2.3