nuca.h revision 10152
1/***************************************************************************** 2 * McPAT/CACTI 3 * SOFTWARE LICENSE AGREEMENT 4 * Copyright 2012 Hewlett-Packard Development Company, L.P. 5 * All Rights Reserved 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are 9 * met: redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer; 11 * redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution; 14 * neither the name of the copyright holders nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.” 29 * 30 ***************************************************************************/ 31 32 33#ifndef __NUCA_H__ 34#define __NUCA_H__ 35 36#include <iostream> 37 38#include "assert.h" 39#include "basic_circuit.h" 40#include "cacti_interface.h" 41#include "component.h" 42#include "io.h" 43#include "mat.h" 44#include "parameter.h" 45#include "router.h" 46#include "wire.h" 47 48class nuca_org_t { 49 public: 50 ~nuca_org_t(); 51// int size; 52 /* area, power, access time, and cycle time stats */ 53 Component nuca_pda; 54 Component bank_pda; 55 Component wire_pda; 56 Wire *h_wire; 57 Wire *v_wire; 58 Router *router; 59 /* for particular network configuration 60 * calculated based on a cycle accurate 61 * simulation Ref: CACTI 6 - Tech report 62 */ 63 double contention; 64 65 /* grid network stats */ 66 double avg_hops; 67 int rows; 68 int columns; 69 int bank_count; 70}; 71 72 73 74class Nuca : public Component 75{ 76 public: 77 Nuca( 78 TechnologyParameter::DeviceType *dt); 79 void print_router(); 80 ~Nuca(); 81 void sim_nuca(); 82 void init_cont(); 83 int calc_cycles(double lat, double oper_freq); 84 void calculate_nuca_area (nuca_org_t *nuca); 85 int check_nuca_org (nuca_org_t *n, min_values_t *minval); 86 nuca_org_t * find_optimal_nuca (list<nuca_org_t *> *n, min_values_t *minval); 87 void print_nuca(nuca_org_t *n); 88 void print_cont_stats(); 89 90 private: 91 92 TechnologyParameter::DeviceType *deviceType; 93 int wt_min, wt_max; 94 Wire *wire_vertical[WIRE_TYPES], 95 *wire_horizontal[WIRE_TYPES]; 96 97}; 98 99 100#endif 101