ruby: removes g_system_ptr and replaces with object based references
Review Request #2902 - Created June 18, 2015 and submitted
| Information | |
|---|---|
| Brandon Potter | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10877:2e6e2150542a --------------------------- ruby: removes g_system_ptr and replaces with object based references
Issue Summary
| Description | From | Last Updated | Status |
|---|---|---|---|
| I strongly suggest that you write a patch that is applied before this ruby system patch. The new patch would ... | Nilay Vaish | July 6, 2015, 12:35 p.m. | Open |
| This should not be done. Please write a patch that either makes CacheMemory into a ClockedObject or get the time ... | Nilay Vaish | July 1, 2015, 10:31 p.m. | Open |
Overall, this is a patch that moves Ruby in the right direction.
One overall comment: there are places where variable names are inconsistent. For instance, the local variable for the RubySystem is rs, ruby_system, and r_sys in different places below. I'm certainly not going to hold up this patch for something so trivial, but I think it's something we should keep in mind and try to aviod.
Just to double check, have you compiled all of the Ruby protocols and run a simple test with them (e.g. hello)? I find that often each protocol exercises unique parts of Ruby.
-
configs/ruby/MESI_Three_Level.py (Diff revision 1) -
All of these can be removed if you use Parent.any in CacheMemory.py like you do in Sequencer.py
This is an important change so that all of us with external Ruby configurations don't have to make/merge these changes.
-
src/mem/protocol/RubySlicc_Types.sm (Diff revision 1) -
Why is this being commented out? Was this a mistake?
-
src/mem/ruby/profiler/AddressProfiler.hh (Diff revision 1) -
I don't know if it's officially part of the code guidelines, but I think you should have the variable name for the RubySystem here.
-
src/mem/ruby/profiler/Profiler.hh (Diff revision 1) -
Same as above, but I guess this one was already like that.
-
src/mem/ruby/structures/Cache.py (Diff revision 1) -
Here, you can use "Parant.any" and then you won't have to make all of the changes to the Python config files. This is the most important thing to change in this patch.
-
src/mem/ruby/structures/RubyMemoryControl.cc (Diff revision 1) -
IMO, before this patch is committed this issue should be resolved. Either remove the debug statement, leave out the time from the printed info, or pass the ruby_system to the RubyMemoryController. The second is my prefered solution, but I don't have strong feelings on which to use.
-
src/mem/ruby/system/Sequencer.cc (Diff revision 1) -
What is the purpose of this change? Functionally, it's exactly the same. Do you plan to make m_warmup_enabled not static in a future patch (which IMO we should)? Either way, a getter/setter seems like a more extensible pattern to use here.
I'm not pushing for any particular change, but I would like to know the purpose of this update. Especially since this has already been a contentious piece of code (though, I don't know why).
-
src/mem/slicc/symbols/Type.py (Diff revision 1) -
Again, I don't like just commenting out code that this change makes difficult. It should be solved, or the code removed.
In this case, I think it's OK to remove the code, though I don't quite understand when this function is called.
-
src/python/swig/pyobject.cc (Diff revision 1) -
Is it possible for a message buffer to connect two different RubySystems? This seems like a recipie for bugs in the future. Maybe assert that the two systems are the same if there is a buffer between two controllers.
Can you please expand on the commit message? I understand that these changes are to allow multiple RubySystem instances, but some detailed information about this should be available in the commit log.
Diff: |
Revision 2 (+123 -99) |
|---|
-
src/mem/ruby/system/Sequencer.cc (Diff revision 1) -
Currently, all references to warm-up and cool-down variables should use the static accessors, RubySystem::getWarmupEnabled() and RubySystem::getCooldownEnabled(), respectively.
I stand by my observation that warm-up and cool-down are simulation-wide operations, not per-RubySystem instance. This is because controller activity from one RubySystem instance may affect controllers in other RubySystems (e.g. cache flushing during cool-down). m_warmup_enabled and m_cooldown_enabled should remain static variables of the RubySystem class.
Is there something getting in the way of leaving these static?
-
src/mem/ruby/network/MessageBuffer.cc (Diff revision 2) -
Per my other post: This change should not occur here.
-
src/mem/ruby/system/Sequencer.cc (Diff revision 2) -
This should still use the accessor getWarmupEnabled()
-
src/mem/ruby/system/Sequencer.cc (Diff revision 2) -
Same: Use accessor
-
src/mem/ruby/system/Sequencer.cc (Diff revision 2) -
Same: Use accessor
-
src/mem/ruby/system/System.hh (Diff revision 2) -
These should not be public. Access them using the accessor.
-
src/mem/ruby/system/System.cc (Diff revision 2) -
These are already initialized statically at the head of this file. These accesses should not occur here.
-
src/python/swig/pyobject.cc (Diff revision 2) -
the include order seems off
Diff: |
Revision 3 (+103 -95) |
|---|
Thanks for all the updates. Other than the minor thing below it looks ready to go.
-
src/mem/ruby/system/Sequencer.cc (Diff revision 3) -
Typo? Shouldn't this be a function call? I could be missing something, though.
Brandon, overall I would suggest, if it is possible, that you spend sometime on making
RubySystem a sim object. That way you would not require to copy the pointer to so
many places. I think objects that need clock really should be clocked objects
themselves or hold pointer to some real clocked object. RubySystem is really a glue
object which should not have a clock of its own.
-
src/mem/ruby/network/MessageBuffer.hh (Diff revision 3) -
Why is RubySystem required here? If you can, move it to MessageBuffer.cc.
-
src/mem/ruby/profiler/AddressProfiler.hh (Diff revision 3) -
??
-
src/mem/ruby/profiler/Profiler.cc (Diff revision 3) -
OK. Pass this pointer here and in AddressProfiler.cc, directly make the function call on the Profiler.
-
src/mem/ruby/structures/BankedArray.cc (Diff revision 3) -
I strongly suggest that you write a patch that is applied before this ruby system patch. The new patch would do away with this tick handling. Everything should be handled in Cycles. The function tryAccess() would receive a current cycle time value as input, which means that curTick() would not be called. When CacheMemory object calls tryAccess(), either CacheMemory should itself receive a current cycle value as input, or CacheMemory itself should be converted to a ClockedObject. Ultimately the BankedArray class should not require ruby system at all.
-
src/mem/ruby/structures/Cache.py (Diff revision 3) -
This should not be done. Please write a patch that either makes CacheMemory into a ClockedObject or get the time value from its controller.
-
src/mem/slicc/symbols/StateMachine.py (Diff revision 3) -
Really! How come Brad and Steve not chide you for this?
