110152Satgutier@umich.edu/*****************************************************************************
210152Satgutier@umich.edu *                                McPAT
310152Satgutier@umich.edu *                      SOFTWARE LICENSE AGREEMENT
410152Satgutier@umich.edu *            Copyright 2012 Hewlett-Packard Development Company, L.P.
510234Syasuko.eckert@amd.com *            Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
610152Satgutier@umich.edu *                          All Rights Reserved
710152Satgutier@umich.edu *
810152Satgutier@umich.edu * Redistribution and use in source and binary forms, with or without
910152Satgutier@umich.edu * modification, are permitted provided that the following conditions are
1010152Satgutier@umich.edu * met: redistributions of source code must retain the above copyright
1110152Satgutier@umich.edu * notice, this list of conditions and the following disclaimer;
1210152Satgutier@umich.edu * redistributions in binary form must reproduce the above copyright
1310152Satgutier@umich.edu * notice, this list of conditions and the following disclaimer in the
1410152Satgutier@umich.edu * documentation and/or other materials provided with the distribution;
1510152Satgutier@umich.edu * neither the name of the copyright holders nor the names of its
1610152Satgutier@umich.edu * contributors may be used to endorse or promote products derived from
1710152Satgutier@umich.edu * this software without specific prior written permission.
1810152Satgutier@umich.edu
1910152Satgutier@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2010152Satgutier@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2110152Satgutier@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2210152Satgutier@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2310152Satgutier@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2410152Satgutier@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2510152Satgutier@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2610152Satgutier@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2710152Satgutier@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2810152Satgutier@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2910234Syasuko.eckert@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3010152Satgutier@umich.edu *
3110152Satgutier@umich.edu ***************************************************************************/
3210152Satgutier@umich.edu
3310152Satgutier@umich.edu
3410152Satgutier@umich.edu#ifndef __INTERCONNECT_H__
3510152Satgutier@umich.edu#define __INTERCONNECT_H__
3610152Satgutier@umich.edu
3710152Satgutier@umich.edu#include "assert.h"
3810152Satgutier@umich.edu#include "basic_circuit.h"
3910152Satgutier@umich.edu#include "basic_components.h"
4010152Satgutier@umich.edu#include "cacti_interface.h"
4110152Satgutier@umich.edu#include "component.h"
4210152Satgutier@umich.edu#include "parameter.h"
4310152Satgutier@umich.edu#include "subarray.h"
4410152Satgutier@umich.edu#include "wire.h"
4510152Satgutier@umich.edu
4610234Syasuko.eckert@amd.comclass InterconnectParameters {
4710234Syasuko.eckert@amd.compublic:
4810234Syasuko.eckert@amd.com    double active_ports;
4910234Syasuko.eckert@amd.com};
5010152Satgutier@umich.edu
5110234Syasuko.eckert@amd.comclass InterconnectStatistics {
5210234Syasuko.eckert@amd.compublic:
5310234Syasuko.eckert@amd.com    double duty_cycle;
5410234Syasuko.eckert@amd.com    double accesses;
5510234Syasuko.eckert@amd.com};
5610152Satgutier@umich.edu
5710234Syasuko.eckert@amd.comclass Interconnect : public McPATComponent {
5810234Syasuko.eckert@amd.compublic:
5910234Syasuko.eckert@amd.com    static double width_scaling_threshold;
6010152Satgutier@umich.edu
6110234Syasuko.eckert@amd.com    enum Device_ty device_ty;
6210152Satgutier@umich.edu    double in_rise_time, out_rise_time;
6310234Syasuko.eckert@amd.com    InputParameter l_ip;
6410234Syasuko.eckert@amd.com    uca_org_t local_result;
6510152Satgutier@umich.edu    Area no_device_under_wire_area;
6610152Satgutier@umich.edu    double max_unpipelined_link_delay;
6710152Satgutier@umich.edu    powerDef power_bit;
6810152Satgutier@umich.edu
6910152Satgutier@umich.edu    double wire_bw;
7010234Syasuko.eckert@amd.com    double init_wire_bw;
7110152Satgutier@umich.edu    double base_width;
7210152Satgutier@umich.edu    double base_height;
7310152Satgutier@umich.edu    int data_width;
7410152Satgutier@umich.edu    enum Wire_type wt;
7510152Satgutier@umich.edu    double width_scaling, space_scaling;
7610152Satgutier@umich.edu    int start_wiring_level;
7710152Satgutier@umich.edu    double length;
7810152Satgutier@umich.edu    double min_w_nmos;
7910152Satgutier@umich.edu    double min_w_pmos;
8010152Satgutier@umich.edu    double latency, throughput;
8110234Syasuko.eckert@amd.com    bool latency_overflow;
8210234Syasuko.eckert@amd.com    bool throughput_overflow;
8310234Syasuko.eckert@amd.com    double interconnect_latency;
8410234Syasuko.eckert@amd.com    double interconnect_throughput;
8510152Satgutier@umich.edu    bool opt_local;
8610152Satgutier@umich.edu    enum Core_type core_ty;
8710152Satgutier@umich.edu    bool pipelinable;
8810152Satgutier@umich.edu    double route_over_perc;
8910234Syasuko.eckert@amd.com    int num_pipe_stages;
9010234Syasuko.eckert@amd.com    TechnologyParameter::DeviceType* deviceType;
9110234Syasuko.eckert@amd.com    InterconnectParameters int_params;
9210234Syasuko.eckert@amd.com    InterconnectStatistics int_stats;
9310152Satgutier@umich.edu
9410234Syasuko.eckert@amd.com    Interconnect(XMLNode* _xml_data, string  name_,
9510234Syasuko.eckert@amd.com                 enum Device_ty device_ty_, double base_w,
9610234Syasuko.eckert@amd.com                 double base_h, int data_w, double len,
9710234Syasuko.eckert@amd.com                 const InputParameter *configure_interface,
9810234Syasuko.eckert@amd.com                 int start_wiring_level_,
9910234Syasuko.eckert@amd.com                 double _clockRate = 0.0f,
10010234Syasuko.eckert@amd.com                 bool pipelinable_ = false, double route_over_perc_ = 0.5,
10110234Syasuko.eckert@amd.com                 bool opt_local_ = true, enum Core_type core_ty_ = Inorder,
10210234Syasuko.eckert@amd.com                 enum Wire_type wire_model = Global, double width_s = 1.0,
10310234Syasuko.eckert@amd.com                 double space_s = 1.0,
10410234Syasuko.eckert@amd.com                 TechnologyParameter::DeviceType *dt = &(g_tp.peri_global));
10510234Syasuko.eckert@amd.comprivate:
10610234Syasuko.eckert@amd.com    void calcWireData();
10710234Syasuko.eckert@amd.compublic:
10810234Syasuko.eckert@amd.com    void computeArea();
10910234Syasuko.eckert@amd.com    void computeEnergy();
11010234Syasuko.eckert@amd.com    void set_params_stats(double active_ports,
11110234Syasuko.eckert@amd.com                          double duty_cycle, double accesses);
11210234Syasuko.eckert@amd.com    void leakage_feedback(double temperature);
11310234Syasuko.eckert@amd.com    ~Interconnect() {};
11410152Satgutier@umich.edu};
11510152Satgutier@umich.edu
11610152Satgutier@umich.edu#endif
11710152Satgutier@umich.edu
118