Clock: Add a Cycles wrapper class and use where applicable
Review Request #1338 - Created Aug. 2, 2012 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9178:eb77cc40e4c6 --------------------------- Clock: Add a Cycles wrapper class and use where applicable This patch addresses the comments and feedback on the preceding patch that reworks the clocks and now more clearly shows where cycles (relative cycle counts) are used to express time. Instead of bumping the existing patch I chose to make this a separate patch, merely to try and focus the discussion around a smaller set of changes. The two patches will be pushed together though. This changes done as part of this patch are mostly following directly from the introduction of the wrapper class, and change enough code to make things compile and run again. There are definitely more places where int/uint/Tick is still used to represent cycles, and it will take some time to chase them all down. Similarly, a lot of parameters should be changed from Param.Tick and Param.Unsigned to Param.Cycles. In addition, the use of curTick is questionable as there should not be an absolute cycle. Potential solutions can be built on top of this patch. There is a similar situation in the o3 CPU where lastRunningCycle is currently counting in Cycles, and is still an absolute time. More discussion to be had in other words. An additional change that would be appropriate in the future is to perform a similar wrapping of Tick and probably also introduce a Ticks class along with suitable operators for all these classes.
util/regress all passing (disregarding t1000 and eio)
one use of uint... don't need to rereview.
I'm honestly not a big fan of CycleCount. I'd much rather see Cycle. Is there something already called Cycle that would clash? I know it's not as descriptive, but it's used all over the place and shouldn't take long to get used to. Tick isn't TickCount.
-
src/cpu/BaseCPU.py (Diff revision 1) -
Seems that this should actually be params.Frequency
-
src/cpu/BaseCPU.py (Diff revision 1) -
The CPUProgrress event is really in terms of ticks right now, so I don't think that you want this. Frequency would probably be most appropriate. If you want it to be a multiple of clock cycles, then I think you need to do more work. (Though with that other diff I sent, multiple of cycles works with "1c")
-
src/sim/clocked_object.hh (Diff revision 1) -
You can always wrap code with #ifndef SWIG to avoid having swig parse stuff. Seems like you'd also want full comparisons.
-
src/sim/clocked_object.hh (Diff revision 1) -
The family of operator= should really return a const reference.
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+323 -242) |
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+339 -257) |
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+339 -257) |
I looked at the big code blocks in depth and skimmed the rest. The biggest bizarre thing to me is where there is a comment about thread ID and you replace the value with Cycles. I looked at the declarations and it looks like your right, but is there any breakage from the threadid thing or are they all just bad comments?
-
src/base/types.hh (Diff revision 4) -
Any reason this shouldn't be private?
-
src/base/types.hh (Diff revision 4) -
How about equality (or all of them really)? Is that really never used?
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+340 -256) |
