summaryrefslogtreecommitdiff
path: root/util/systemc/sc_logger.cc
diff options
context:
space:
mode:
authorAndrew Bardsley <Andrew.Bardsley@arm.com>2014-12-02 06:08:09 -0500
committerAndrew Bardsley <Andrew.Bardsley@arm.com>2014-12-02 06:08:09 -0500
commite5e5b80690f736c65c9b51ef96660637210f3938 (patch)
tree4c2f6422209fd55e2c97bcb48689c5091c000072 /util/systemc/sc_logger.cc
parent05bba75cdc346184da7ff40958673da980a06df2 (diff)
downloadgem5-e5e5b80690f736c65c9b51ef96660637210f3938.tar.xz
config: Fix to SystemC example's event handling
This patch fixes checkpoint restore in the SystemC hosting example by handling early PollEvent events correctly before any EventQueue events are posted. The SystemC event queue handler (SCEventQueue) reports an error if the event loop is entered with no Events posted. It is possible for this to happen after instantiate due to PollEvent events. This patch separates out `external' events into a different handler in sc_module.cc to prevent the error from occurring. This fix also improves the event handling of asynchronous events by: 1) Making asynchronous events 'catch up' gem5 time to SystemC time to avoid the appearance that events have been lost while servicing an asynchronous event that schedules an event loop exit event 2) Add an in_simulate data member to Module to allow the event loop to check whether events should be processed or deferred until the next time Module::simulate is entered 3) Cancel pending events around the entry/exit of the event loop in Module::simulate 4) Moving the state initialisation of the example entirely into run to correct a problem with early events in checkpoint restore. It is still possible to schedule asynchronous events (and talk PollQueue actions) while simulate is not running. This behaviour may stil cause some problems.
Diffstat (limited to 'util/systemc/sc_logger.cc')
-rw-r--r--util/systemc/sc_logger.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/systemc/sc_logger.cc b/util/systemc/sc_logger.cc
index 8f8abaeb6..a8b9020f4 100644
--- a/util/systemc/sc_logger.cc
+++ b/util/systemc/sc_logger.cc
@@ -87,10 +87,10 @@ void CuttingStreambuf::outputLine()
/** This is pretty much the least efficient way of doing this, but it has the
* advantage of having very few corners to get wrong.
*
- * A newly allocated streambuf will have no buffer to serve to its [oi]stream.
- * It will, therefore, call overflow for every character it wants to insert
- * into the output stream. Those characters are captured one by one here and
- * added to this->line. */
+ * A newly allocated streambuf will have no buffer to serve to its
+ * [oi]stream. It will, therefore, call overflow for every character it
+ * wants to insert into the output stream. Those characters are captured one
+ * by one here and added to this->line. */
int
CuttingStreambuf::overflow(int chr)
{