blob: 87836adcd7b4fe0d31e27cec33e246bbd7063c85 [file] [log] [blame]
Anthony Gutierreze553a7b2014-04-01 12:44:30 -04001/*****************************************************************************
2 * McPAT/CACTI
3 * SOFTWARE LICENSE AGREEMENT
4 * Copyright 2012 Hewlett-Packard Development Company, L.P.
Yasuko Eckert0deef372014-06-03 13:32:59 -07005 * Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
Anthony Gutierreze553a7b2014-04-01 12:44:30 -04006 * All Rights Reserved
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met: redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer;
12 * redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution;
15 * neither the name of the copyright holders nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Yasuko Eckert0deef372014-06-03 13:32:59 -070029 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Anthony Gutierreze553a7b2014-04-01 12:44:30 -040030 *
31 ***************************************************************************/
32
33
34#ifndef __UCACHE_H__
35#define __UCACHE_H__
36
37#include <list>
38
39#include "area.h"
40#include "nuca.h"
41#include "router.h"
42
Yasuko Eckert0deef372014-06-03 13:32:59 -070043class min_values_t {
44public:
Anthony Gutierreze553a7b2014-04-01 12:44:30 -040045 double min_delay;
46 double min_dyn;
47 double min_leakage;
48 double min_area;
49 double min_cyc;
50
51 min_values_t() : min_delay(BIGNUM), min_dyn(BIGNUM), min_leakage(BIGNUM), min_area(BIGNUM), min_cyc(BIGNUM) { }
52
53 void update_min_values(const min_values_t * val);
54 void update_min_values(const uca_org_t & res);
55 void update_min_values(const nuca_org_t * res);
56 void update_min_values(const mem_array * res);
57};
58
59
60
Yasuko Eckert0deef372014-06-03 13:32:59 -070061struct solution {
62 int tag_array_index;
63 int data_array_index;
64 list<mem_array *>::iterator tag_array_iter;
65 list<mem_array *>::iterator data_array_iter;
66 double access_time;
67 double cycle_time;
68 double area;
69 double efficiency;
70 powerDef total_power;
Anthony Gutierreze553a7b2014-04-01 12:44:30 -040071};
72
73
74
75bool calculate_time(
76 bool is_tag,
77 int pure_ram,
78 bool pure_cam,
79 double Nspd,
80 unsigned int Ndwl,
81 unsigned int Ndbl,
82 unsigned int Ndcm,
83 unsigned int Ndsam_lev_1,
84 unsigned int Ndsam_lev_2,
85 mem_array *ptr_array,
86 int flag_results_populate,
87 results_mem_array *ptr_results,
88 uca_org_t *ptr_fin_res,
89 bool is_main_mem);
90void update(uca_org_t *fin_res);
91
92void solve(uca_org_t *fin_res);
93void init_tech_params(double tech, bool is_tag);
94
95
Yasuko Eckert0deef372014-06-03 13:32:59 -070096struct calc_time_mt_wrapper_struct {
97 uint32_t tid;
98 bool is_tag;
99 bool pure_ram;
100 bool pure_cam;
101 bool is_main_mem;
102 double Nspd_min;
Anthony Gutierreze553a7b2014-04-01 12:44:30 -0400103
Yasuko Eckert0deef372014-06-03 13:32:59 -0700104 min_values_t * data_res;
105 min_values_t * tag_res;
Anthony Gutierreze553a7b2014-04-01 12:44:30 -0400106
Yasuko Eckert0deef372014-06-03 13:32:59 -0700107 list<mem_array *> data_arr;
108 list<mem_array *> tag_arr;
Anthony Gutierreze553a7b2014-04-01 12:44:30 -0400109};
110
111void *calc_time_mt_wrapper(void * void_obj);
112
113#endif