00001 /***************************************************************************** 00002 * McPAT 00003 * SOFTWARE LICENSE AGREEMENT 00004 * Copyright 2009 Hewlett-Packard Development Company, L.P. 00005 * All Rights Reserved 00006 * 00007 * Permission to use, copy, and modify this software and its documentation is 00008 * hereby granted only under the following terms and conditions. Both the 00009 * above copyright notice and this permission notice must appear in all copies 00010 * of the software, derivative works or modified versions, and any portions 00011 * thereof, and both notices must appear in supporting documentation. 00012 * 00013 * Any User of the software ("User"), by accessing and using it, agrees to the 00014 * terms and conditions set forth herein, and hereby grants back to Hewlett- 00015 * Packard Development Company, L.P. and its affiliated companies ("HP") a 00016 * non-exclusive, unrestricted, royalty-free right and license to copy, 00017 * modify, distribute copies, create derivate works and publicly display and 00018 * use, any changes, modifications, enhancements or extensions made to the 00019 * software by User, including but not limited to those affording 00020 * compatibility with other hardware or software, but excluding pre-existing 00021 * software applications that may incorporate the software. User further 00022 * agrees to use its best efforts to inform HP of any such changes, 00023 * modifications, enhancements or extensions. 00024 * 00025 * Correspondence should be provided to HP at: 00026 * 00027 * Director of Intellectual Property Licensing 00028 * Office of Strategy and Technology 00029 * Hewlett-Packard Company 00030 * 1501 Page Mill Road 00031 * Palo Alto, California 94304 00032 * 00033 * The software may be further distributed by User (but not offered for 00034 * sale or transferred for compensation) to third parties, under the 00035 * condition that such third parties agree to abide by the terms and 00036 * conditions of this license. 00037 * 00038 * THE SOFTWARE IS PROVIDED "AS IS" WITH ANY AND ALL ERRORS AND DEFECTS 00039 * AND USER ACKNOWLEDGES THAT THE SOFTWARE MAY CONTAIN ERRORS AND DEFECTS. 00040 * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THE SOFTWARE, INCLUDING ALL 00041 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 00042 * HP BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 00043 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 00044 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ACTION, ARISING 00045 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE SOFTWARE. 00046 * 00047 ***************************************************************************/ 00048 00049 #ifndef ARRAY_H_ 00050 #define ARRAY_H_ 00051 00052 #include "basic_components.h" 00053 #include "const.h" 00054 #include "cacti_interface.h" 00055 #include "parameter.h" 00056 #include "McPATcomponent.h" 00057 #include <iostream> 00058 #include <string> 00059 00060 using namespace std; 00061 00062 class ArrayST :public McPATComponent{ 00063 public: 00064 ArrayST(){}; 00065 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); 00066 00067 InputParameter l_ip; 00068 string name; 00069 enum Device_ty device_ty; 00070 bool opt_local; 00071 enum Core_type core_ty; 00072 bool is_default; 00073 uca_org_t local_result; 00074 00075 statsDef tdp_stats; 00076 statsDef rtp_stats; 00077 statsDef stats_t; 00078 powerDef power_t; 00079 00080 virtual void optimize_array(); 00081 virtual void compute_base_power(); 00082 void SSTleakage_feedback(double temperature); 00083 virtual ~ArrayST(); 00084 }; 00085 00086 class InstCache :public McPATComponent{ 00087 public: 00088 ArrayST* caches; 00089 ArrayST* missb; 00090 ArrayST* ifb; 00091 ArrayST* prefetchb; 00092 powerDef power_t;//temp value holder for both (max) power and runtime power 00093 InstCache(){caches=0;missb=0;ifb=0;prefetchb=0;}; 00094 void SSTleakage_feedback(double temperature); 00095 00096 /* SST delete 00097 ~InstCache(){ 00098 if (caches) {//caches->local_result.cleanup(); 00099 delete caches; caches=0;} 00100 if (missb) {//missb->local_result.cleanup(); 00101 delete missb; missb=0;} 00102 if (ifb) {//ifb->local_result.cleanup(); 00103 delete ifb; ifb=0;} 00104 if (prefetchb) {//prefetchb->local_result.cleanup(); 00105 delete prefetchb; prefetchb=0;} 00106 };*/ 00107 }; 00108 00109 class DataCache :public InstCache{ 00110 public: 00111 ArrayST* wbb; 00112 DataCache(){wbb=0;}; 00113 void SSTleakage_feedback(double temperature); 00114 00115 /* SST delete 00116 ~DataCache(){ 00117 if (wbb) {//wbb->local_result.cleanup(); 00118 delete wbb; wbb=0;} 00119 };*/ 00120 }; 00121 00122 #endif /* TLB_H_ */