clocked_object.hh (9418:9923a5ab8c13) | clocked_object.hh (9545:508784fad4e5) |
---|---|
1/* 2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 89 unchanged lines hidden (view full) --- 98 // if not, we have to recalculate the cycle and tick, we 99 // perform the calculations in terms of relative cycles to 100 // allow changes to the clock period in the future 101 Cycles elapsedCycles(divCeil(curTick() - tick, clock)); 102 cycle += elapsedCycles; 103 tick += elapsedCycles * clock; 104 } 105 | 1/* 2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 89 unchanged lines hidden (view full) --- 98 // if not, we have to recalculate the cycle and tick, we 99 // perform the calculations in terms of relative cycles to 100 // allow changes to the clock period in the future 101 Cycles elapsedCycles(divCeil(curTick() - tick, clock)); 102 cycle += elapsedCycles; 103 tick += elapsedCycles * clock; 104 } 105 |
106 protected: 107 | |
108 // Clock period in ticks 109 Tick clock; 110 | 106 // Clock period in ticks 107 Tick clock; 108 |
109 protected: 110 |
|
111 /** 112 * Create a clocked object and set the clock based on the 113 * parameters. 114 */ 115 ClockedObject(const ClockedObjectParams* p) : 116 SimObject(p), tick(0), cycle(0), clock(p->clock) 117 { 118 if (clock == 0) { --- 74 unchanged lines hidden --- | 111 /** 112 * Create a clocked object and set the clock based on the 113 * parameters. 114 */ 115 ClockedObject(const ClockedObjectParams* p) : 116 SimObject(p), tick(0), cycle(0), clock(p->clock) 117 { 118 if (clock == 0) { --- 74 unchanged lines hidden --- |