1/* 2 * Copyright (c) 2016-2017 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 --- 25 unchanged lines hidden (view full) --- 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 * 37 * Authors: David Guillen Fandos 38 */ 39 40#include "sim/power/mathexpr_powermodel.hh" 41 |
42#include <string> 43 |
44#include "base/statistics.hh" 45#include "params/MathExprPowerModel.hh" 46#include "sim/mathexpr.hh" 47#include "sim/power/thermal_model.hh" 48#include "sim/sim_object.hh" 49 50MathExprPowerModel::MathExprPowerModel(const Params *p) 51 : PowerModelState(p), dyn_expr(p->dyn), st_expr(p->st), failed(false) --- 7 unchanged lines hidden (view full) --- 59 basename += path[i] + "."; 60} 61 62void 63MathExprPowerModel::startup() 64{ 65 // Create a map with stats and pointers for quick access 66 // Has to be done here, since we need access to the statsList |
67 for (auto & i: Stats::statsList()) { 68 if (i->name.find(basename) == 0) { 69 // Add stats for this sim object and its child objects |
70 stats_map[i->name.substr(basename.size())] = i; |
71 } else if (i->name.find(".") == std::string::npos) { 72 // Add global stats (sim_seconds, for example) 73 stats_map[i->name] = i; 74 } 75 } |
76 77 tryEval(st_expr); 78 const bool st_failed = failed; 79 80 tryEval(dyn_expr); 81 const bool dyn_failed = failed; 82 83 if (st_failed || dyn_failed) { --- 79 unchanged lines hidden --- |