mathexpr_powermodel.cc (11968:f5da4fc4a6ff) mathexpr_powermodel.cc (11972:9503a0d8c352)
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
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
42#include "base/statistics.hh"
43#include "params/MathExprPowerModel.hh"
44#include "sim/mathexpr.hh"
45#include "sim/power/thermal_model.hh"
46#include "sim/sim_object.hh"
47
48MathExprPowerModel::MathExprPowerModel(const Params *p)
49 : PowerModelState(p), dyn_expr(p->dyn), st_expr(p->st), failed(false)

--- 7 unchanged lines hidden (view full) ---

57 basename += path[i] + ".";
58}
59
60void
61MathExprPowerModel::startup()
62{
63 // Create a map with stats and pointers for quick access
64 // Has to be done here, since we need access to the statsList
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
65 for (auto & i: Stats::statsList())
66 if (i->name.find(basename) == 0)
67 for (auto & i: Stats::statsList()) {
68 if (i->name.find(basename) == 0) {
69 // Add stats for this sim object and its child objects
67 stats_map[i->name.substr(basename.size())] = i;
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 }
68
69 tryEval(st_expr);
70 const bool st_failed = failed;
71
72 tryEval(dyn_expr);
73 const bool dyn_failed = failed;
74
75 if (st_failed || dyn_failed) {

--- 79 unchanged lines hidden ---
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 ---