noc.h revision 10234
110448Snilay@cs.wisc.edu/*****************************************************************************
210448Snilay@cs.wisc.edu *                                McPAT
310448Snilay@cs.wisc.edu *                      SOFTWARE LICENSE AGREEMENT
410448Snilay@cs.wisc.edu *            Copyright 2012 Hewlett-Packard Development Company, L.P.
510448Snilay@cs.wisc.edu *            Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
610448Snilay@cs.wisc.edu *                          All Rights Reserved
710448Snilay@cs.wisc.edu *
810448Snilay@cs.wisc.edu * Redistribution and use in source and binary forms, with or without
910448Snilay@cs.wisc.edu * modification, are permitted provided that the following conditions are
1010448Snilay@cs.wisc.edu * met: redistributions of source code must retain the above copyright
1110448Snilay@cs.wisc.edu * notice, this list of conditions and the following disclaimer;
1210448Snilay@cs.wisc.edu * redistributions in binary form must reproduce the above copyright
1310448Snilay@cs.wisc.edu * notice, this list of conditions and the following disclaimer in the
1410448Snilay@cs.wisc.edu * documentation and/or other materials provided with the distribution;
1510448Snilay@cs.wisc.edu * neither the name of the copyright holders nor the names of its
1610448Snilay@cs.wisc.edu * contributors may be used to endorse or promote products derived from
1710448Snilay@cs.wisc.edu * this software without specific prior written permission.
1810448Snilay@cs.wisc.edu
1910448Snilay@cs.wisc.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2010448Snilay@cs.wisc.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2110448Snilay@cs.wisc.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2210447Snilay@cs.wisc.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2310447Snilay@cs.wisc.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2410447Snilay@cs.wisc.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2510447Snilay@cs.wisc.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2610447Snilay@cs.wisc.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2710447Snilay@cs.wisc.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2810447Snilay@cs.wisc.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2910447Snilay@cs.wisc.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3010447Snilay@cs.wisc.edu *
3110447Snilay@cs.wisc.edu ***************************************************************************/
3210447Snilay@cs.wisc.edu
3310447Snilay@cs.wisc.edu#ifndef NOC_H_
3410447Snilay@cs.wisc.edu#define NOC_H_
3510447Snilay@cs.wisc.edu
3610447Snilay@cs.wisc.edu#include "array.h"
3710447Snilay@cs.wisc.edu#include "basic_components.h"
3810447Snilay@cs.wisc.edu#include "interconnect.h"
3910447Snilay@cs.wisc.edu#include "logic.h"
4010447Snilay@cs.wisc.edu#include "parameter.h"
4110447Snilay@cs.wisc.edu#include "router.h"
4210447Snilay@cs.wisc.edu
4310447Snilay@cs.wisc.educlass OnChipNetworkParameters {
4410447Snilay@cs.wisc.edupublic:
4510447Snilay@cs.wisc.edu    double clockRate;
4610447Snilay@cs.wisc.edu    int flit_size;
4710447Snilay@cs.wisc.edu    int input_ports;
4810447Snilay@cs.wisc.edu    int output_ports;
4910447Snilay@cs.wisc.edu    int min_ports;
5010447Snilay@cs.wisc.edu    int global_linked_ports;
5110447Snilay@cs.wisc.edu    int virtual_channel_per_port;
5210447Snilay@cs.wisc.edu    int input_buffer_entries_per_vc;
5310447Snilay@cs.wisc.edu    int horizontal_nodes;
5410447Snilay@cs.wisc.edu    int vertical_nodes;
5510447Snilay@cs.wisc.edu    int total_nodes;
56    double link_throughput;
57    double link_latency;
58    double chip_coverage;
59    double route_over_perc;
60    bool has_global_link;
61    bool type;
62    double M_traffic_pattern;
63    double link_base_width;
64    double link_base_height;
65    int link_start_wiring_level;
66};
67
68class OnChipNetworkStatistics {
69public:
70    double duty_cycle;
71    double total_access;
72};
73
74class OnChipNetwork : public McPATComponent {
75public:
76    Router* router;
77    Interconnect* link_bus;
78    Component link_bus_tot_per_Router;
79
80    int ithNoC;
81    InputParameter interface_ip;
82    double link_len;
83    double scktRatio, chip_PR_overhead, macro_PR_overhead;
84    OnChipNetworkParameters noc_params;
85    OnChipNetworkStatistics noc_stats;
86    uca_org_t local_result;
87    statsDef stats_t;
88    bool link_bus_exist;
89    bool router_exist;
90    string link_name;
91
92    OnChipNetwork(XMLNode* _xml_data, int ithNoC_,
93                  InputParameter* interface_ip_);
94    void set_param_stats();
95    void computeEnergy();
96    void init_link_bus();
97    void init_router();
98    ~OnChipNetwork();
99};
100
101#endif /* NOC_H_ */
102