diff options
| author | Tim Rogers <[email protected]> | 2019-09-13 21:45:08 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-13 21:45:08 -0400 |
| commit | dba877b45fe11187d56904bbd169f4e0a5ad0586 (patch) | |
| tree | 649ddec731e6934cb535b569d7d3d2c754b8e89c /src/gpuwattch/array.h | |
| parent | bea40c4a22a86fddbf1f7845265697716727f8b1 (diff) | |
| parent | d65f6d38f054a48733bd1dfd22cb37864b5bded6 (diff) | |
Merge pull request #31 from rgreen/dev
Application of clang-format to make the code use standardized formatting.
Diffstat (limited to 'src/gpuwattch/array.h')
| -rw-r--r-- | src/gpuwattch/array.h | 87 |
1 files changed, 52 insertions, 35 deletions
diff --git a/src/gpuwattch/array.h b/src/gpuwattch/array.h index b7f77dc..e2dc3d1 100644 --- a/src/gpuwattch/array.h +++ b/src/gpuwattch/array.h @@ -32,69 +32,86 @@ #ifndef ARRAY_H_ #define ARRAY_H_ +#include <iostream> +#include <string> #include "basic_components.h" -#include "cacti/const.h" #include "cacti/cacti_interface.h" -#include "cacti/parameter.h" #include "cacti/component.h" -#include <iostream> -#include <string> +#include "cacti/const.h" +#include "cacti/parameter.h" using namespace std; -class ArrayST :public Component{ +class ArrayST : public Component { public: ArrayST(){}; - ArrayST(const InputParameter *configure_interface, string _name, enum Device_ty device_ty_, bool opt_local_=true, enum Core_type core_ty_=Inorder, bool _is_default=true); + ArrayST(const InputParameter* configure_interface, string _name, + enum Device_ty device_ty_, bool opt_local_ = true, + enum Core_type core_ty_ = Inorder, bool _is_default = true); InputParameter l_ip; - string name; + string name; enum Device_ty device_ty; bool opt_local; enum Core_type core_ty; - bool is_default; - uca_org_t local_result; + bool is_default; + uca_org_t local_result; - statsDef tdp_stats; - statsDef rtp_stats; - statsDef stats_t; - powerDef power_t; + statsDef tdp_stats; + statsDef rtp_stats; + statsDef stats_t; + powerDef power_t; virtual void optimize_array(); virtual void compute_base_power(); virtual ~ArrayST(); - + void leakage_feedback(double temperature); }; -class InstCache :public Component{ -public: +class InstCache : public Component { + public: ArrayST* caches; ArrayST* missb; ArrayST* ifb; ArrayST* prefetchb; - powerDef power_t;//temp value holder for both (max) power and runtime power - InstCache(){caches=0;missb=0;ifb=0;prefetchb=0;}; - ~InstCache(){ - if (caches) {//caches->local_result.cleanup(); - delete caches; caches=0;} - if (missb) {//missb->local_result.cleanup(); - delete missb; missb=0;} - if (ifb) {//ifb->local_result.cleanup(); - delete ifb; ifb=0;} - if (prefetchb) {//prefetchb->local_result.cleanup(); - delete prefetchb; prefetchb=0;} - }; + powerDef power_t; // temp value holder for both (max) power and runtime power + InstCache() { + caches = 0; + missb = 0; + ifb = 0; + prefetchb = 0; + }; + ~InstCache() { + if (caches) { // caches->local_result.cleanup(); + delete caches; + caches = 0; + } + if (missb) { // missb->local_result.cleanup(); + delete missb; + missb = 0; + } + if (ifb) { // ifb->local_result.cleanup(); + delete ifb; + ifb = 0; + } + if (prefetchb) { // prefetchb->local_result.cleanup(); + delete prefetchb; + prefetchb = 0; + } + }; }; -class DataCache :public InstCache{ -public: +class DataCache : public InstCache { + public: ArrayST* wbb; - DataCache(){wbb=0;}; - ~DataCache(){ - if (wbb) {//wbb->local_result.cleanup(); - delete wbb; wbb=0;} - }; + DataCache() { wbb = 0; }; + ~DataCache() { + if (wbb) { // wbb->local_result.cleanup(); + delete wbb; + wbb = 0; + } + }; }; #endif /* TLB_H_ */ |
