clocked_object.hh (9550:e0e2c8f83d08) | clocked_object.hh (9648:f10eb34e3e38) |
---|---|
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 --- 158 unchanged lines hidden (view full) --- 167 { 168 // align cycle to the next clock edge. 169 update(); 170 171 return cycle; 172 } 173 174 /** | 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 --- 158 unchanged lines hidden (view full) --- 167 { 168 // align cycle to the next clock edge. 169 update(); 170 171 return cycle; 172 } 173 174 /** |
175 * Based on the clock of the object, determine the tick when the 176 * next cycle begins, in other words, return the next clock edge. | 175 * Based on the clock of the object, determine the tick when the next 176 * cycle begins, in other words, return the next clock edge. 177 * (This can never be the current tick.) |
177 * 178 * @return The tick when the next cycle starts 179 */ 180 Tick nextCycle() const | 178 * 179 * @return The tick when the next cycle starts 180 */ 181 Tick nextCycle() const |
181 { return clockEdge(); } | 182 { return clockEdge(Cycles(1)); } |
182 183 inline uint64_t frequency() const { return SimClock::Frequency / clock; } 184 185 inline Tick clockPeriod() const { return clock; } 186 187 inline Cycles ticksToCycles(Tick t) const 188 { return Cycles(t / clock); } 189 190}; 191 192#endif //__SIM_CLOCKED_OBJECT_HH__ | 183 184 inline uint64_t frequency() const { return SimClock::Frequency / clock; } 185 186 inline Tick clockPeriod() const { return clock; } 187 188 inline Cycles ticksToCycles(Tick t) const 189 { return Cycles(t / clock); } 190 191}; 192 193#endif //__SIM_CLOCKED_OBJECT_HH__ |