router.h revision 10152:52c552138ba1
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
34#ifndef __ROUTER_H__
35#define __ROUTER_H__
36
37#include <assert.h>
38
39#include <iostream>
40
41#include "arbiter.h"
42#include "basic_circuit.h"
43#include "cacti_interface.h"
44#include "component.h"
45#include "crossbar.h"
46#include "mat.h"
47#include "parameter.h"
48#include "wire.h"
49
50class Router : public Component
51{
52  public:
53    Router(
54        double flit_size_,
55        double vc_buf, /* vc size = vc_buffer_size * flit_size */
56        double vc_count,
57        TechnologyParameter::DeviceType *dt = &(g_tp.peri_global),
58        double I_ = 5,
59        double O_ = 5,
60        double M_ = 0.6);
61    ~Router();
62
63
64    void print_router();
65
66    Component arbiter, crossbar, buffer;
67
68    double cycle_time, max_cyc;
69    double flit_size;
70    double vc_count;
71    double vc_buffer_size; /* vc size = vc_buffer_size * flit_size */
72
73  private:
74        TechnologyParameter::DeviceType *deviceType;
75        double FREQUENCY; // move this to config file --TODO
76    double Cw3(double len);
77    double gate_cap(double w);
78    double diff_cap(double w, int type /*0 for n-mos and 1 for p-mos*/, double stack);
79    enum Wire_type wtype;
80    enum Wire_placement wire_placement;
81    //corssbar
82    double NTtr, PTtr, wt, ht, I, O, NTi, PTi, NTid, PTid, NTod, PTod, TriS1, TriS2;
83    double M; //network load
84    double transmission_buf_inpcap();
85    double transmission_buf_outcap();
86    double transmission_buf_ctrcap();
87    double crossbar_inpline();
88    double crossbar_outline();
89    double crossbar_ctrline();
90    double tr_crossbar_power();
91    void  cb_stats ();
92    double arb_power();
93    void  arb_stats ();
94    double buffer_params();
95    void buffer_stats();
96
97
98    //arbiter
99
100    //buffer
101
102    //router params
103    double Vdd;
104
105    void calc_router_parameters();
106    void get_router_area();
107    void get_router_power();
108    void get_router_delay();
109
110    double min_w_pmos;
111
112
113};
114
115#endif
116