1/*****************************************************************************
2 *                                McPAT/CACTI
3 *                      SOFTWARE LICENSE AGREEMENT
4 *            Copyright 2012 Hewlett-Packard Development Company, L.P.
5 *            Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
6 *                          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
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 ***************************************************************************/
32
33
34
35#ifndef __WIRE_H__
36#define __WIRE_H__
37
38#include <iostream>
39#include <list>
40
41#include "assert.h"
42#include "basic_circuit.h"
43#include "cacti_interface.h"
44#include "component.h"
45#include "parameter.h"
46
47class Wire : public Component {
48public:
49    Wire(enum Wire_type wire_model, double len /* in u*/,
50         int nsense = 1/* no. of sense amps connected to the low-swing wire */,
51         double width_scaling = 1,
52         double spacing_scaling = 1,
53         enum Wire_placement wire_placement = outside_mat,
54         double resistivity = CU_RESISTIVITY,
55         TechnologyParameter::DeviceType *dt = &(g_tp.peri_global));
56    ~Wire();
57
58    Wire( double width_scaling = 1,
59          double spacing_scaling = 1,
60          enum Wire_placement wire_placement = outside_mat,
61          double resistivity = CU_RESISTIVITY,
62          TechnologyParameter::DeviceType *dt = &(g_tp.peri_global)
63        ); // should be used only once for initializing static members
64    void init_wire();
65
66    void calculate_wire_stats();
67    void delay_optimal_wire();
68    double wire_cap(double len, bool call_from_outside = false);
69    double wire_res(double len);
70    void low_swing_model();
71    double signal_fall_time();
72    double signal_rise_time();
73    double sense_amp_input_cap();
74
75    enum Wire_type wt;
76    double wire_spacing;
77    double wire_width;
78    enum Wire_placement wire_placement;
79    double repeater_size;
80    double repeater_spacing;
81    double wire_length;
82    double in_rise_time, out_rise_time;
83
84    void set_in_rise_time(double rt) {
85        in_rise_time = rt;
86    }
87    static Component global;
88    static Component global_5;
89    static Component global_10;
90    static Component global_20;
91    static Component global_30;
92    static Component low_swing;
93    static double wire_width_init;
94    static double wire_spacing_init;
95    void print_wire();
96
97private:
98
99    int nsense; // no. of sense amps connected to a low-swing wire if it
100    // is broadcasting data to multiple destinations
101    // width and spacing scaling factor can be used
102    // to model low level wires or special
103    // fat wires
104    double w_scale, s_scale;
105    double resistivity;
106    powerDef wire_model (double space, double size, double *delay);
107    list <Component> repeated_wire;
108    void update_fullswing();
109    static int initialized;
110
111
112    //low-swing
113    Component transmitter;
114    Component l_wire;
115    Component sense_amp;
116
117    double min_w_pmos;
118
119    TechnologyParameter::DeviceType *deviceType;
120
121};
122
123#endif
124