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
Description | From | Last Updated | Status |
---|---|---|---|
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, ... | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
I could have missed this, but doesn't GPU.py need to be updated? | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
Same as above. Should use parent as default | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
Parent as default | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
Ditto. | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
Ditto. | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
Ditto. | Jason Lowe-Power | April 11, 2016, 1:30 p.m. | Open |
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")
-
src/gpu-compute/shader.cc (Diff revision 1) -
I could have missed this, but doesn't GPU.py need to be updated?
-
src/mem/protocol/MOESI_CMP_token-L1cache.sm (Diff revision 1) -
Do all of these similar lines need to be update too?
-
src/mem/ruby/slicc_interface/Controller.py (Diff revision 1) -
Same as above. Should use parent as default
-
src/mem/ruby/structures/DirectoryMemory.py (Diff revision 1) -
Parent as default
-
src/mem/ruby/structures/RubyCache.py (Diff revision 1) -
Ditto.
-
src/mem/ruby/structures/RubyPrefetcher.py (Diff revision 1) -
Ditto.
-
src/mem/ruby/system/Sequencer.py (Diff revision 1) -
Ditto.