> I think a wrapper class make sense and it would indeed present a huge 
> reduction in the risk of mixing ticks and cycle counts. We could also do it 
> the other way round and make ticks a wrapper (or both). What makes more sense?

I'd prefer to see both wrappers, but I worry that there's just too
much math on ticks that will make it a major pain in the butt to get
working.  Hard to say.

> I am not sure I understand the template idea. Won't it still be possible to 
> have e.g different objects of the same type using each others cycle counters 
> by mistake? What would the templated type be?

template <class T>
class Clock
{
    ....
};


You just don't use the "T" anywhere.  It's there to force each class
to be a different type.  If there are places where you want to take
any kind of Clock object, you can simply templatize those functions on
T as well (and T ought to be inferred if it is a function paramater).
The class T that you use can either be a dummy class like "namespace {
class Foo {}; } typedef Clock<Foo> MyClock;"  or it can be whatever
type you have handy, perhaps BaseCPU.

Make sense?

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

Reply via email to