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 __UCACHE_H__ 00050 #define __UCACHE_H__ 00051 00052 #include <list> 00053 #include "area.h" 00054 #include "router.h" 00055 #include "nuca.h" 00056 00057 00058 class min_values_t 00059 { 00060 public: 00061 double min_delay; 00062 double min_dyn; 00063 double min_leakage; 00064 double min_area; 00065 double min_cyc; 00066 00067 min_values_t() : min_delay(BIGNUM), min_dyn(BIGNUM), min_leakage(BIGNUM), min_area(BIGNUM), min_cyc(BIGNUM) { } 00068 00069 void update_min_values(const min_values_t * val); 00070 void update_min_values(const uca_org_t & res); 00071 void update_min_values(const nuca_org_t * res); 00072 void update_min_values(const mem_array * res); 00073 }; 00074 00075 00076 00077 struct solution 00078 { 00079 int tag_array_index; 00080 int data_array_index; 00081 list<mem_array *>::iterator tag_array_iter; 00082 list<mem_array *>::iterator data_array_iter; 00083 double access_time; 00084 double cycle_time; 00085 double area; 00086 double efficiency; 00087 powerDef total_power; 00088 }; 00089 00090 00091 00092 bool calculate_time( 00093 bool is_tag, 00094 int pure_ram, 00095 bool pure_cam, 00096 double Nspd, 00097 unsigned int Ndwl, 00098 unsigned int Ndbl, 00099 unsigned int Ndcm, 00100 unsigned int Ndsam_lev_1, 00101 unsigned int Ndsam_lev_2, 00102 mem_array *ptr_array, 00103 int flag_results_populate, 00104 results_mem_array *ptr_results, 00105 uca_org_t *ptr_fin_res, 00106 bool is_main_mem); 00107 00108 00109 void solve(uca_org_t *fin_res); 00110 void init_tech_params(double tech, bool is_tag); 00111 00112 00113 struct calc_time_mt_wrapper_struct 00114 { 00115 uint32_t tid; 00116 bool is_tag; 00117 bool pure_ram; 00118 bool pure_cam; 00119 bool is_main_mem; 00120 double Nspd_min; 00121 00122 min_values_t * data_res; 00123 min_values_t * tag_res; 00124 00125 list<mem_array *> data_arr; 00126 list<mem_array *> tag_arr; 00127 }; 00128 00129 void *calc_time_mt_wrapper(void * void_obj); 00130 00131 #endif