I am wondering if it's possible to multiply a Cycles type variable in gem5. What I want to represent is a certain latency that is added an n number of times. So something like this:
return lookupLatency * n;
I'm getting this error:
error: could not convert '(((const BaseCache*)this)->BaseCache::lookupLatency.Cycles::operator uint64_t() * ((uint64_t)n))' from 'uint64_t {aka long unsigned int}' to 'Cycles'
Is there any way to do that quickly?
Cycles is just a wrapper class around uint64_t, and you can check its functionality in src/base/types.hh.
That being said, the constructor must be explicit, and you are trying to implicitly create a Cycles variable from lookupLatency * n, which is a uint64_t. Just call the constructor to make it Cycles again:
return Cycles(lookupLatency * n);