Ucache.h revision 10234
11689SN/A/***************************************************************************** 21689SN/A * McPAT/CACTI 39919Ssteve.reinhardt@amd.com * SOFTWARE LICENSE AGREEMENT 41689SN/A * Copyright 2012 Hewlett-Packard Development Company, L.P. 51689SN/A * Copyright (c) 2010-2013 Advanced Micro Devices, Inc. 61689SN/A * All Rights Reserved 71689SN/A * 81689SN/A * Redistribution and use in source and binary forms, with or without 91689SN/A * modification, are permitted provided that the following conditions are 101689SN/A * met: redistributions of source code must retain the above copyright 111689SN/A * notice, this list of conditions and the following disclaimer; 121689SN/A * redistributions in binary form must reproduce the above copyright 131689SN/A * notice, this list of conditions and the following disclaimer in the 141689SN/A * documentation and/or other materials provided with the distribution; 151689SN/A * neither the name of the copyright holders nor the names of its 161689SN/A * contributors may be used to endorse or promote products derived from 171689SN/A * this software without specific prior written permission. 181689SN/A 191689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 201689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 211689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 221689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 231689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 241689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 251689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 261689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 271689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 282665Ssaidi@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 292665Ssaidi@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 301689SN/A * 311689SN/A ***************************************************************************/ 322292SN/A 332292SN/A 341060SN/A#ifndef __UCACHE_H__ 351060SN/A#define __UCACHE_H__ 361060SN/A 371060SN/A#include <list> 382669Sktlim@umich.edu 391684SN/A#include "area.h" 401717SN/A#include "nuca.h" 419919Ssteve.reinhardt@amd.com#include "router.h" 428232Snate@binkert.org 431060SN/Aclass min_values_t { 441060SN/Apublic: 459919Ssteve.reinhardt@amd.com double min_delay; 469919Ssteve.reinhardt@amd.com double min_dyn; 479919Ssteve.reinhardt@amd.com double min_leakage; 489919Ssteve.reinhardt@amd.com double min_area; 499919Ssteve.reinhardt@amd.com double min_cyc; 509919Ssteve.reinhardt@amd.com 519919Ssteve.reinhardt@amd.com min_values_t() : min_delay(BIGNUM), min_dyn(BIGNUM), min_leakage(BIGNUM), min_area(BIGNUM), min_cyc(BIGNUM) { } 529919Ssteve.reinhardt@amd.com 539919Ssteve.reinhardt@amd.com void update_min_values(const min_values_t * val); 549919Ssteve.reinhardt@amd.com void update_min_values(const uca_org_t & res); 559919Ssteve.reinhardt@amd.com void update_min_values(const nuca_org_t * res); 569919Ssteve.reinhardt@amd.com void update_min_values(const mem_array * res); 579919Ssteve.reinhardt@amd.com}; 589919Ssteve.reinhardt@amd.com 599919Ssteve.reinhardt@amd.com 609919Ssteve.reinhardt@amd.com 619919Ssteve.reinhardt@amd.comstruct solution { 629919Ssteve.reinhardt@amd.com int tag_array_index; 639919Ssteve.reinhardt@amd.com int data_array_index; 649919Ssteve.reinhardt@amd.com list<mem_array *>::iterator tag_array_iter; 659919Ssteve.reinhardt@amd.com list<mem_array *>::iterator data_array_iter; 669919Ssteve.reinhardt@amd.com double access_time; 679919Ssteve.reinhardt@amd.com double cycle_time; 689919Ssteve.reinhardt@amd.com double area; 699919Ssteve.reinhardt@amd.com double efficiency; 709919Ssteve.reinhardt@amd.com powerDef total_power; 719919Ssteve.reinhardt@amd.com}; 729919Ssteve.reinhardt@amd.com 739919Ssteve.reinhardt@amd.com 749919Ssteve.reinhardt@amd.com 759919Ssteve.reinhardt@amd.combool calculate_time( 769919Ssteve.reinhardt@amd.com bool is_tag, 779919Ssteve.reinhardt@amd.com int pure_ram, 789919Ssteve.reinhardt@amd.com bool pure_cam, 799919Ssteve.reinhardt@amd.com double Nspd, 809919Ssteve.reinhardt@amd.com unsigned int Ndwl, 819919Ssteve.reinhardt@amd.com unsigned int Ndbl, 829919Ssteve.reinhardt@amd.com unsigned int Ndcm, 831060SN/A unsigned int Ndsam_lev_1, 841060SN/A unsigned int Ndsam_lev_2, 851060SN/A mem_array *ptr_array, 861060SN/A int flag_results_populate, 871060SN/A results_mem_array *ptr_results, 881060SN/A uca_org_t *ptr_fin_res, 891060SN/A bool is_main_mem); 902292SN/Avoid update(uca_org_t *fin_res); 912292SN/A 922292SN/Avoid solve(uca_org_t *fin_res); 931060SN/Avoid init_tech_params(double tech, bool is_tag); 941060SN/A 959919Ssteve.reinhardt@amd.com 961060SN/Astruct calc_time_mt_wrapper_struct { 971060SN/A uint32_t tid; 989919Ssteve.reinhardt@amd.com bool is_tag; 999919Ssteve.reinhardt@amd.com bool pure_ram; 1009919Ssteve.reinhardt@amd.com bool pure_cam; 1019919Ssteve.reinhardt@amd.com bool is_main_mem; 1029919Ssteve.reinhardt@amd.com double Nspd_min; 1031060SN/A 1049919Ssteve.reinhardt@amd.com min_values_t * data_res; 1051060SN/A min_values_t * tag_res; 1061060SN/A 1079919Ssteve.reinhardt@amd.com list<mem_array *> data_arr; 1081060SN/A list<mem_array *> tag_arr; 1099919Ssteve.reinhardt@amd.com}; 1109919Ssteve.reinhardt@amd.com 1119919Ssteve.reinhardt@amd.comvoid *calc_time_mt_wrapper(void * void_obj); 1129919Ssteve.reinhardt@amd.com 1139919Ssteve.reinhardt@amd.com#endif 1141060SN/A