Review Board 2.0.15


ruby: add a couple of members to ruby objects to remove statics

Review Request #3421 - Created April 4, 2016 and updated

Information
Brandon Potter
gem5
default
Reviewers
Default
Changeset 11423:41c966b4e307
---------------------------
ruby: add a couple of members to ruby objects to remove statics

The block_size_bits and block_size_bytes members are added to all of the
ruby objects which previously relied on their respective 'RubySystem::'
variants. The goal is to pass in the values through Python parameter lists
and inheritance rather than rely on global variables to pass values.

This changeset does not modify the functions and methods to use the
the new members; that will happen in subsequent changesets with the goal of
providing some clarity to the new changes rather than a large indecipherable
changeset.

   

Issue Summary

8 7 0 1
Posted (April 11, 2016, 1:30 p.m.)

Why did you choose to pass this parameter around to everything instead of keeping the canonical value with the RubySystem instance and changing the accessor to not be static (i.e., RubySystem::getBlockSizeBytes() to ruby_system->getBlockSizeBytes()). Most of these objects have a pointer to a RubySystem already. I really don't like having to change add this parameter to so many constructors, etc. The block size is inherent to the system, it shouldn't ever change (in a running system). Therefore, it should be a parameter at object creation (in the Python scripts), not a parameter every single time a function is called.

Let me know if this isn't clear, and I can point out in the patch where I would like to see this parameter removed. However, I think moving towards ruby_system->getBlockSizeBytes() will fix most places.

Also, there seems to be many place where this would need to be updated in the SLICC files (e.g., int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";). I noted one below, but a quick grep reveals many others.

Finally, as noted below, in cases where the entire object needs the value, you should get the default value from the parent using Parent.cache_line_size. This will reduce the possibility for accidentally missing one place where someone forgot to change it.

src/gpu-compute/GPU.py (Diff revision 1)
 
 
Get this from the a parent? (See Tags.py)

    # Get the block size from the parent (system)
    block_size = Param.Int(Parent.cache_line_size, "block size in bytes")
  1. This is a nice catch; nice way to pass in the value rather than having it hard coded as it is now. I'll fix this.

src/gpu-compute/shader.cc (Diff revision 1)
 
 

I could have missed this, but doesn't GPU.py need to be updated?

Do all of these similar lines need to be update too?

  1. This is resolved in http://reviews.gem5.org/r/3430/.

Same as above. Should use parent as default

Parent as default

src/mem/ruby/structures/RubyCache.py (Diff revision 1)
 
 

Ditto.

Ditto.

src/mem/ruby/system/Sequencer.py (Diff revision 1)
 
 

Ditto.