Review Board 2.0.15


Ruby: Simplify SLICC and Entry/TBE handling.

Review Request #630 - Created March 31, 2011 and submitted

Information
Lisa Hsu
gem5
Reviewers
Default
ali, gblack, nate, stever
Ruby: Simplify SLICC and Entry/TBE handling.
Before this changeset, all local variables of type Entry and TBE were considered
to be pointers, but an immediate use of said variables would not be automatically
deferenced in SLICC-generated code.  Instead, deferences occurred when such
variables were passed to functions, and were automatically dereferenced in
the bodies of the functions (e.g. the implicitly passed cache_entry).

This is a more general way to do it, which leaves in place the
assumption that parameters to functions and local variables of type AbstractCacheEntry
and TBE are always pointers, but instead of dereferencing to access member variables
on a contextual basis, the dereferencing automatically occurs on a type basis at the
moment a member is being accessed.  So, now, things you can do that you couldn't before
include:

Entry foo := getCacheEntry(address);
cache_entry.DataBlk := foo.DataBlk;

or

cache_entry.DataBlk := getCacheEntry(address).DataBlk;

or even

cache_entry.DataBlk := static_cast(Entry, pointer, cache.lookup(address)).DataBlk;
So - just to add a note (this is not about testing).  I had uploaded a patch, then realized that there was some dead code that I should also remove, so I uploaded a new patch.  However, the head of my tree had changed, and that appears to have messed up my ability to update patches.  So, two upshots:

One, this newer patch gets rid of the some of the str.replace("*", "") code that was in place to auto-remove the *s from m_cache_entry and m_tbe, since now, those guys do not have *s by default.

Two, don't change the head of your tree and have outstanding patches at the same time, if you think you want to update patches.
Review request changed
Updated (March 31, 2011, 7:26 a.m.)

Testing Done:

  +

So - just to add a note (this is not about testing). I had uploaded a patch, then realized that there was some dead code that I should also remove, so I uploaded a new patch. However, the head of my tree had changed, and that appears to have messed up my ability to update patches. So, two upshots:

  +
  +

One, this newer patch gets rid of the some of the str.replace("", "") code that was in place to auto-remove the s from m_cache_entry and m_tbe, since now, those guys do not have *s by default.

  +
  +

Two, don't change the head of your tree and have outstanding patches at the same time, if you think you want to update patches.

Ship it!
Posted (March 31, 2011, 7:27 a.m.)
Lisa, the changes look fine to me. Just make sure that all the existing
protocols compile properly.
Ship it!
Posted (March 31, 2011, 9:03 a.m.)