Hi Tim,

Sorry for the delay in getting back to you... it's been a busy few
weeks.  I had to go back and look at your earlier patches to make
sense of this one.  I'll send some comments on those separately.

I'd say the main thing that could be cleaned up here is that you want
to extend the "ExecContext" interface (see
http://m5sim.org/wiki/index.php/ExecContext) with the
finishTranslation() function, and then find the right instance using
templates; this lets you not only avoid the virtual function call as
Gabe said, but more importantly will let you get rid of the separate
DataTranslationCpu and DataTranslationInst classes.  Roughly speaking,
you want something like:

template <class ExecContext>
class DataTranslation : public BaseTLB::Translation
{
    ExecContext *xc;

   void finish(...) {
        xc->finishTranslation(...);
   }
}

then instantiate DataTranslation<TimingSimpleCPU> and DataTranslation<
BaseDynInst<Impl> > (or something like that; maybe that last template
param needs to be O3-specific).  Then you only need to define
finishTranslation as a non-virtual function on those template argument
classes.  Does that make sense?

Steve
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to