RubyPort and Sequencer: Fix draining
Review Request #1386 - Created Aug. 31, 2012 and submitted
| Information | |
|---|---|
| Joel Hestness | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9228:0b63b7c87cde --------------------------- RubyPort and Sequencer: Fix draining Fix the drain functionality of the RubyPort to only call drain on child ports during a system-wide drain process, instead of calling each time that a ruby_hit_callback is executed. This fixes the issue of the RubyPort ports being reawakened during the drain simulation, possibly with work they didn't previously have to complete. If they have new work, they may call process on the drain event that they had not registered work for, causing an assertion failure when completing the drain event. Also, in RubyPort, set the drainEvent to NULL when there are no events to be drained. If not set to NULL, the drain loop can result in stale drainEvents used.
Verified that all prior working Ruby checkpointing configurations still work correctly. Verified that this fixes checkpoint restore into timing CPU and then switch to detailed CPU with x86. Will need to verify that this works when restoring in full-system simulation, functionality which is currently obscured by another bug when restoring into detailed CPU in FS.
Posted (Aug. 31, 2012, 12:06 p.m.)
-
src/mem/ruby/system/RubyPort.cc (Diff revision 1) -
Why do you need to remove this local variable? Now you are calling outstandingCount() twice.
-
src/mem/ruby/system/Sequencer.cc (Diff revision 1) -
Are you sure this is correct?
-
src/mem/ruby/system/Sequencer.cc (Diff revision 1) -
I think there is one more place in Sequencer.cc where the deadlock event is scheduled. You might want to put the same check there as well.
Posted (Aug. 31, 2012, 12:35 p.m.)
Looking at the code it seems as though drain is only called on the child ports during a system-wide drain. It's true that testDrainComplete() is called every time ruby_hit_callback() is called, but, if the drainEvent is not NULL it will not do anything, i.e., it WILL only be called when draining.
Review request changed
Updated (Aug. 31, 2012, 2:54 p.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+8 -3) |
Posted (Sept. 1, 2012, 6:56 a.m.)
-
src/mem/ruby/system/RubyPort.cc (Diff revision 2) -
Why has this function call changed to outstandingCount()?
Review request changed
Updated (Sept. 21, 2012, 2:08 p.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+24 -20) |
Overall this is fine with me. We have done some tinkering with the whole way draining works, by removing the state and relying entirely on the counters in a "tree" that reflects where there is still activity. This patch seems to move in the same direction (but only for the RubyPort).
-
src/mem/ruby/system/RubyPort.cc (Diff revision 3) -
unsigned int?
-
src/mem/ruby/system/Sequencer.cc (Diff revision 3) -
Why the == false instead of adding a ! at the start of the line?
