-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Power See merge request gwt_sdk_developer/gvsoc!21
- Loading branch information
Showing
25 changed files
with
1,339 additions
and
2,425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
/* | ||
* Authors: Germain Haugou, GreenWaves Technologies ([email protected]) | ||
*/ | ||
|
||
|
@@ -24,24 +24,35 @@ | |
|
||
#include "vp/vp_data.hpp" | ||
#include "vp/component.hpp" | ||
#include "vp/power/power.hpp" | ||
#include "gv/power.hpp" | ||
#include <pthread.h> | ||
#include <thread> | ||
|
||
namespace vp { | ||
namespace vp | ||
{ | ||
|
||
namespace power | ||
{ | ||
|
||
class engine | ||
{ | ||
public: | ||
engine(vp::component *top); | ||
|
||
void start_capture(); | ||
|
||
class power_engine : public component | ||
{ | ||
public: | ||
power_engine(js::config *config); | ||
void stop_capture(); | ||
|
||
virtual void start_capture() {} | ||
void reg_trace(vp::power::power_trace *trace); | ||
|
||
virtual void stop_capture() {} | ||
private: | ||
std::vector<vp::power::power_trace *> traces; | ||
|
||
virtual void reg_trace(vp::power_trace *trace) {} | ||
}; | ||
vp::component *time_engine; | ||
|
||
vp::component *top; | ||
}; | ||
}; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (C) 2020 GreenWaves Technologies, SAS, ETH Zurich and | ||
* University of Bologna | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Authors: Germain Haugou, GreenWaves Technologies ([email protected]) | ||
*/ | ||
|
||
|
||
#pragma once | ||
|
||
#include "vp/vp_data.hpp" | ||
#include "vp/power/power_engine.hpp" | ||
|
||
|
||
inline void vp::power::power_source::leakage_power_start() | ||
{ | ||
if (!this->is_on && this->leakage != -1) | ||
{ | ||
this->trace->inc_leakage_power(this->leakage); | ||
} | ||
this->is_on = true; | ||
} | ||
|
||
inline void vp::power::power_source::leakage_power_stop() | ||
{ | ||
if (this->is_on && this->leakage != -1) | ||
{ | ||
this->trace->inc_leakage_power(-this->leakage); | ||
} | ||
this->is_on = false; | ||
} | ||
|
||
inline void vp::power::power_source::dynamic_power_start() | ||
{ | ||
if (!this->is_on && this->background_power != -1) | ||
{ | ||
this->trace->inc_dynamic_power(this->background_power); | ||
} | ||
this->is_on = true; | ||
} | ||
|
||
inline void vp::power::power_source::dynamic_power_stop() | ||
{ | ||
if (this->is_on && this->background_power != -1) | ||
{ | ||
this->trace->inc_dynamic_power(-this->background_power); | ||
} | ||
this->is_on = false; | ||
} | ||
|
||
inline void vp::power::power_source::account_energy_quantum() | ||
{ | ||
if (this->quantum != -1) | ||
{ | ||
this->trace->inc_dynamic_energy(this->quantum); | ||
} | ||
} |
Oops, something went wrong.