noc.cc (10152:52c552138ba1) | noc.cc (10234:5cb711fa6176) |
---|---|
1/***************************************************************************** 2 * McPAT 3 * SOFTWARE LICENSE AGREEMENT 4 * Copyright 2012 Hewlett-Packard Development Company, L.P. | 1/***************************************************************************** 2 * McPAT 3 * SOFTWARE LICENSE AGREEMENT 4 * Copyright 2012 Hewlett-Packard Development Company, L.P. |
5 * Copyright (c) 2010-2013 Advanced Micro Devices, Inc. |
|
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 --- 7 unchanged lines hidden (view full) --- 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 | 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 --- 7 unchanged lines hidden (view full) --- 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 |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.” | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 * 30 ***************************************************************************/ 31 32#include <algorithm> 33#include <cassert> 34#include <cmath> 35#include <iostream> 36#include <string> 37 | 30 * 31 ***************************************************************************/ 32 33#include <algorithm> 34#include <cassert> 35#include <cmath> 36#include <iostream> 37#include <string> 38 |
38#include "XML_Parse.h" | |
39#include "basic_circuit.h" | 39#include "basic_circuit.h" |
40#include "common.h" |
|
40#include "const.h" 41#include "io.h" 42#include "noc.h" 43#include "parameter.h" 44 | 41#include "const.h" 42#include "io.h" 43#include "noc.h" 44#include "parameter.h" 45 |
45NoC::NoC(ParseXML *XML_interface, int ithNoC_, InputParameter* interface_ip_, double M_traffic_pattern_, double link_len_) 46:XML(XML_interface), 47ithNoC(ithNoC_), 48interface_ip(*interface_ip_), 49router(0), 50link_bus(0), 51link_bus_exist(false), 52router_exist(false), 53M_traffic_pattern(M_traffic_pattern_) 54{ 55 /* 56 * initialize, compute and optimize individual components. 57 */ | 46OnChipNetwork::OnChipNetwork(XMLNode* _xml_data, int ithNoC_, 47 InputParameter* interface_ip_) 48 : McPATComponent(_xml_data), router(NULL), link_bus(NULL), ithNoC(ithNoC_), 49 interface_ip(*interface_ip_), link_bus_exist(false), 50 router_exist(false) { 51 name = "On-Chip Network"; 52 set_param_stats(); 53 local_result = init_interface(&interface_ip, name); 54 scktRatio = g_tp.sckt_co_eff; |
58 | 55 |
59 if (XML->sys.Embedded) 60 { 61 interface_ip.wt =Global_30; 62 interface_ip.wire_is_mat_type = 0; 63 interface_ip.wire_os_mat_type = 1; 64 } 65 else 66 { 67 interface_ip.wt =Global; 68 interface_ip.wire_is_mat_type = 2; 69 interface_ip.wire_os_mat_type = 2; 70 } 71 set_noc_param(); 72 local_result=init_interface(&interface_ip); 73 scktRatio = g_tp.sckt_co_eff; 74 75 if (nocdynp.type) 76 {/* 77 * if NOC compute router, router links must be computed separately 78 * and called from external 79 * since total chip area must be known first 80 */ 81 init_router(); 82 } 83 else 84 { 85 init_link_bus(link_len_); //if bus compute bus 86 } 87 88 // //clock power 89 // clockNetwork.init_wire_external(is_default, &interface_ip); 90 // clockNetwork.clk_area =area*1.1;//10% of placement overhead. rule of thumb 91 // clockNetwork.end_wiring_level =5;//toplevel metal 92 // clockNetwork.start_wiring_level =5;//toplevel metal 93 // clockNetwork.num_regs = corepipe.tot_stage_vector; 94 // clockNetwork.optimize_wire(); | 56 // TODO: Routers and links should be children of the NOC component 57 if (noc_params.type) { 58 init_router(); 59 } else { 60 init_link_bus(); 61 } |
95} 96 | 62} 63 |
97void NoC::init_router() 98{ 99 router = new Router(nocdynp.flit_size, 100 nocdynp.virtual_channel_per_port*nocdynp.input_buffer_entries_per_vc, 101 nocdynp.virtual_channel_per_port, &(g_tp.peri_global), 102 nocdynp.input_ports,nocdynp.output_ports, M_traffic_pattern); 103 //router->print_router(); 104 area.set_area(area.get_area()+ router->area.get_area()*nocdynp.total_nodes); | 64void OnChipNetwork::init_router() { 65 router = new Router(noc_params.flit_size, 66 noc_params.virtual_channel_per_port * 67 noc_params.input_buffer_entries_per_vc, 68 noc_params.virtual_channel_per_port, 69 &(g_tp.peri_global), 70 noc_params.input_ports, noc_params.output_ports, 71 noc_params.M_traffic_pattern); 72 // TODO: Make a router class within McPAT that descends from McPATComponent 73 // children.push_back(router); 74 area.set_area(area.get_area() + router->area.get_area() * 75 noc_params.total_nodes); |
105 | 76 |
106 double long_channel_device_reduction = longer_channel_device_reduction(Uncore_device); 107 router->power.readOp.longer_channel_leakage = router->power.readOp.leakage * long_channel_device_reduction; 108 router->buffer.power.readOp.longer_channel_leakage = router->buffer.power.readOp.leakage * long_channel_device_reduction; 109 router->crossbar.power.readOp.longer_channel_leakage = router->crossbar.power.readOp.leakage * long_channel_device_reduction; 110 router->arbiter.power.readOp.longer_channel_leakage = router->arbiter.power.readOp.leakage * long_channel_device_reduction; 111 router_exist = true; | 77 double long_channel_device_reduction = longer_channel_device_reduction(Uncore_device); 78 router->power.readOp.longer_channel_leakage = router->power.readOp.leakage * long_channel_device_reduction; 79 router->buffer.power.readOp.longer_channel_leakage = router->buffer.power.readOp.leakage * long_channel_device_reduction; 80 router->crossbar.power.readOp.longer_channel_leakage = router->crossbar.power.readOp.leakage * long_channel_device_reduction; 81 router->arbiter.power.readOp.longer_channel_leakage = router->arbiter.power.readOp.leakage * long_channel_device_reduction; 82 router_exist = true; |
112} 113 | 83} 84 |
114void NoC ::init_link_bus(double link_len_) 115{ | 85void OnChipNetwork::init_link_bus() { 86 if (noc_params.type) { 87 link_name = "Links"; 88 } else { 89 link_name = "Bus"; 90 } |
116 | 91 |
92 interface_ip.throughput = noc_params.link_throughput / 93 noc_params.clockRate; 94 interface_ip.latency = noc_params.link_latency / noc_params.clockRate; |
|
117 | 95 |
118// if (nocdynp.min_ports==1 ) 119 if (nocdynp.type) 120 link_name = "Links"; 121 else 122 link_name = "Bus"; | 96 link_len /= (noc_params.horizontal_nodes + noc_params.vertical_nodes) / 2; |
123 | 97 |
124 link_len=link_len_; 125 assert(link_len>0); | 98 if (noc_params.total_nodes > 1) { 99 //All links are shared by neighbors 100 link_len /= 2; 101 } 102 link_bus = new Interconnect(xml_data, "Link", Uncore_device, 103 noc_params.link_base_width, 104 noc_params.link_base_height, 105 noc_params.flit_size, link_len, &interface_ip, 106 noc_params.link_start_wiring_level, 107 noc_params.clockRate, true/*pipelinable*/, 108 noc_params.route_over_perc); 109 children.push_back(link_bus); |
126 | 110 |
127 interface_ip.throughput = nocdynp.link_throughput/nocdynp.clockRate; 128 interface_ip.latency = nocdynp.link_latency/nocdynp.clockRate; 129 130 link_len /= (nocdynp.horizontal_nodes + nocdynp.vertical_nodes)/2; 131 132 if (nocdynp.total_nodes >1) link_len /=2; //All links are shared by neighbors 133 link_bus = new interconnect(name, Uncore_device, 1, 1, nocdynp.flit_size, 134 link_len, &interface_ip, 3, true/*pipelinable*/, nocdynp.route_over_perc); 135 136 link_bus_tot_per_Router.area.set_area(link_bus_tot_per_Router.area.get_area()+ link_bus->area.get_area() 137 * nocdynp.global_linked_ports); 138 139 area.set_area(area.get_area()+ link_bus_tot_per_Router.area.get_area()* nocdynp.total_nodes); 140 link_bus_exist = true; | 111 link_bus_exist = true; |
141} | 112} |
142void NoC::computeEnergy(bool is_tdp) 143{ 144 //power_point_product_masks 145 double pppm_t[4] = {1,1,1,1}; 146 double M=nocdynp.duty_cycle; 147 if (is_tdp) 148 { 149 //init stats for TDP 150 stats_t.readAc.access = M; 151 tdp_stats = stats_t; 152 if (router_exist) 153 { 154 set_pppm(pppm_t, 1*M, 1, 1, 1);//reset traffic pattern 155 router->power = router->power*pppm_t; 156 set_pppm(pppm_t, nocdynp.total_nodes, nocdynp.total_nodes, nocdynp.total_nodes, nocdynp.total_nodes); 157 power = power + router->power*pppm_t; 158 } 159 if (link_bus_exist) 160 { 161 if (nocdynp.type) 162 set_pppm(pppm_t, 1*M_traffic_pattern*M*(nocdynp.min_ports -1), nocdynp.global_linked_ports, 163 nocdynp.global_linked_ports, nocdynp.global_linked_ports); 164 //reset traffic pattern; local port do not have router links 165 else 166 set_pppm(pppm_t, 1*M_traffic_pattern*M*(nocdynp.min_ports), nocdynp.global_linked_ports, 167 nocdynp.global_linked_ports, nocdynp.global_linked_ports);//reset traffic pattern | |
168 | 113 |
169 link_bus_tot_per_Router.power = link_bus->power*pppm_t; | 114// TODO: This should use the McPATComponent::computeEnergy function to 115// recursively calculate energy of routers and links and then add 116void OnChipNetwork::computeEnergy() { 117 double pppm_t[4] = {1, 1, 1, 1}; |
170 | 118 |
171 set_pppm(pppm_t, nocdynp.total_nodes, 172 nocdynp.total_nodes, 173 nocdynp.total_nodes, 174 nocdynp.total_nodes); 175 power = power + link_bus_tot_per_Router.power*pppm_t; | 119 // Initialize stats for TDP 120 tdp_stats.reset(); 121 tdp_stats.readAc.access = noc_stats.duty_cycle; 122 if (router_exist) { 123 // TODO: Define a regression to exercise routers 124 // TODO: Clean this up: it is too invasive and breaks abstraction 125 set_pppm(pppm_t, 1 * tdp_stats.readAc.access, 1, 1, 1); 126 router->power = router->power * pppm_t; 127 set_pppm(pppm_t, noc_params.total_nodes, 128 noc_params.total_nodes, 129 noc_params.total_nodes, 130 noc_params.total_nodes); 131 } 132 if (link_bus_exist) { 133 if (noc_params.type) { 134 link_bus->int_params.active_ports = noc_params.min_ports - 1; 135 } else { 136 link_bus->int_params.active_ports = noc_params.min_ports; 137 } 138 link_bus->int_stats.duty_cycle = 139 noc_params.M_traffic_pattern * noc_stats.duty_cycle; |
176 | 140 |
177 } 178 } 179 else 180 { 181 //init stats for runtime power (RTP) 182 stats_t.readAc.access = XML->sys.NoC[ithNoC].total_accesses; 183 rtp_stats = stats_t; 184 set_pppm(pppm_t, 1, 0 , 0, 0); 185 if (router_exist) 186 { 187 router->buffer.rt_power.readOp.dynamic = (router->buffer.power.readOp.dynamic + router->buffer.power.writeOp.dynamic)*rtp_stats.readAc.access ; 188 router->crossbar.rt_power.readOp.dynamic = router->crossbar.power.readOp.dynamic*rtp_stats.readAc.access ; 189 router->arbiter.rt_power.readOp.dynamic = router->arbiter.power.readOp.dynamic*rtp_stats.readAc.access ; | 141 // TODO: Decide how to roll multiple routers into a single top-level 142 // NOC module. I would prefer not to, but it might be a nice feature 143 set_pppm(pppm_t, noc_params.total_nodes, 144 noc_params.total_nodes, 145 noc_params.total_nodes, 146 noc_params.total_nodes); 147 } |
190 | 148 |
191 router->rt_power = router->rt_power + (router->buffer.rt_power + router->crossbar.rt_power + router->arbiter.rt_power)*pppm_t + 192 router->power*pppm_lkg;//TDP power must be calculated first! 193 rt_power = rt_power + router->rt_power; 194 } 195 if (link_bus_exist) 196 { 197 set_pppm(pppm_t, rtp_stats.readAc.access, 1 , 1, rtp_stats.readAc.access); 198 link_bus->rt_power = link_bus->power * pppm_t; 199 rt_power = rt_power + link_bus->rt_power; 200 } | 149 // Initialize stats for runtime energy and power 150 rtp_stats.reset(); 151 rtp_stats.readAc.access = noc_stats.total_access; 152 set_pppm(pppm_t, 1, 0 , 0, 0); 153 if (router_exist) { 154 // TODO: Move this to a McPATComponent parent class of Router 155 router->buffer.rt_power.readOp.dynamic = 156 (router->buffer.power.readOp.dynamic + 157 router->buffer.power.writeOp.dynamic) * rtp_stats.readAc.access; 158 router->crossbar.rt_power.readOp.dynamic = 159 router->crossbar.power.readOp.dynamic * rtp_stats.readAc.access; 160 router->arbiter.rt_power.readOp.dynamic = 161 router->arbiter.power.readOp.dynamic * rtp_stats.readAc.access; |
201 | 162 |
202 } | 163 router->rt_power = router->rt_power + 164 (router->buffer.rt_power + router->crossbar.rt_power + 165 router->arbiter.rt_power) * pppm_t + 166 router->power * pppm_lkg;//TDP power must be calculated first! 167 } 168 if (link_bus_exist) { 169 link_bus->int_stats.accesses = noc_stats.total_access; 170 } 171 172 // Recursively compute energy 173 McPATComponent::computeEnergy(); |
203} 204 | 174} 175 |
176void OnChipNetwork::set_param_stats() { 177 // TODO: Remove this or move initialization elsewhere 178 memset(&noc_params, 0, sizeof(OnChipNetworkParameters)); |
|
205 | 179 |
206void NoC::displayEnergy(uint32_t indent,int plevel,bool is_tdp) 207{ 208 string indent_str(indent, ' '); 209 string indent_str_next(indent+2, ' '); 210 bool long_channel = XML->sys.longer_channel_device; | 180 int num_children = xml_data->nChildNode("param"); 181 int i; 182 int mat_type; 183 for (i = 0; i < num_children; i++) { 184 XMLNode* paramNode = xml_data->getChildNodePtr("param", &i); 185 XMLCSTR node_name = paramNode->getAttribute("name"); 186 XMLCSTR value = paramNode->getAttribute("value"); |
211 | 187 |
212 double M =M_traffic_pattern*nocdynp.duty_cycle; 213 /*only router as a whole has been applied the M_traffic_pattern(0.6 by default) factor in router.cc; 214 * When power of crossbars, arbiters, etc need to be displayed, the M_traffic_pattern factor need to 215 * be applied together with McPAT's extra traffic pattern. 216 * */ 217 if (is_tdp) 218 { 219 cout << name << endl; 220 cout << indent_str << "Area = " << area.get_area()*1e-6<< " mm^2" << endl; 221 cout << indent_str<< "Peak Dynamic = " << power.readOp.dynamic*nocdynp.clockRate << " W" << endl; 222 cout << indent_str << "Subthreshold Leakage = " 223 << (long_channel? power.readOp.longer_channel_leakage:power.readOp.leakage) <<" W" << endl; 224 cout << indent_str << "Gate Leakage = " << power.readOp.gate_leakage << " W" << endl; 225 cout << indent_str<< "Runtime Dynamic = " << rt_power.readOp.dynamic/nocdynp.executionTime << " W" << endl; 226 cout<<endl; | 188 if (!node_name) 189 warnMissingParamName(paramNode->getAttribute("id")); |
227 | 190 |
228 if (router_exist) 229 { 230 cout << indent_str << "Router: " << endl; 231 cout << indent_str_next << "Area = " << router->area.get_area()*1e-6<< " mm^2" << endl; 232 cout << indent_str_next<< "Peak Dynamic = " << router->power.readOp.dynamic*nocdynp.clockRate << " W" << endl; 233 cout << indent_str_next << "Subthreshold Leakage = " 234 << (long_channel? router->power.readOp.longer_channel_leakage:router->power.readOp.leakage) <<" W" << endl; 235 cout << indent_str_next << "Gate Leakage = " << router->power.readOp.gate_leakage << " W" << endl; 236 cout << indent_str_next<< "Runtime Dynamic = " << router->rt_power.readOp.dynamic/nocdynp.executionTime << " W" << endl; 237 cout<<endl; 238 if (plevel >2){ 239 cout << indent_str<< indent_str << "Virtual Channel Buffer:" << endl; 240 cout << indent_str<< indent_str_next << "Area = " << router->buffer.area.get_area()*1e-6*nocdynp.input_ports<< " mm^2" << endl; 241 cout << indent_str<< indent_str_next << "Peak Dynamic = " <<(router->buffer.power.readOp.dynamic + router->buffer.power.writeOp.dynamic) 242 *nocdynp.min_ports*M*nocdynp.clockRate << " W" << endl; 243 cout << indent_str<< indent_str_next << "Subthreshold Leakage = " 244 << (long_channel? router->buffer.power.readOp.longer_channel_leakage*nocdynp.input_ports:router->buffer.power.readOp.leakage*nocdynp.input_ports) <<" W" << endl; 245 cout << indent_str<< indent_str_next << "Gate Leakage = " << router->buffer.power.readOp.gate_leakage*nocdynp.input_ports << " W" << endl; 246 cout << indent_str<< indent_str_next << "Runtime Dynamic = " << router->buffer.rt_power.readOp.dynamic/nocdynp.executionTime << " W" << endl; 247 cout <<endl; 248 cout << indent_str<< indent_str<< "Crossbar:" << endl; 249 cout << indent_str<< indent_str_next << "Area = " << router->crossbar.area.get_area()*1e-6 << " mm^2" << endl; 250 cout << indent_str<< indent_str_next << "Peak Dynamic = " << router->crossbar.power.readOp.dynamic*nocdynp.clockRate*nocdynp.min_ports*M << " W" << endl; 251 cout << indent_str<< indent_str_next << "Subthreshold Leakage = " 252 << (long_channel? router->crossbar.power.readOp.longer_channel_leakage:router->crossbar.power.readOp.leakage) << " W" << endl; 253 cout << indent_str<< indent_str_next << "Gate Leakage = " << router->crossbar.power.readOp.gate_leakage << " W" << endl; 254 cout << indent_str<< indent_str_next << "Runtime Dynamic = " << router->crossbar.rt_power.readOp.dynamic/nocdynp.executionTime << " W" << endl; 255 cout <<endl; 256 cout << indent_str<< indent_str<< "Arbiter:" << endl; 257 cout << indent_str<< indent_str_next << "Peak Dynamic = " << router->arbiter.power.readOp.dynamic*nocdynp.clockRate*nocdynp.min_ports*M << " W" << endl; 258 cout << indent_str<< indent_str_next << "Subthreshold Leakage = " 259 << (long_channel? router->arbiter.power.readOp.longer_channel_leakage:router->arbiter.power.readOp.leakage) << " W" << endl; 260 cout << indent_str<< indent_str_next << "Gate Leakage = " << router->arbiter.power.readOp.gate_leakage << " W" << endl; 261 cout << indent_str<< indent_str_next << "Runtime Dynamic = " << router->arbiter.rt_power.readOp.dynamic/nocdynp.executionTime << " W" << endl; 262 cout <<endl; 263 } 264 } 265 if (link_bus_exist) 266 { 267 cout << indent_str << (nocdynp.type? "Per Router ":"") << link_name<<": " << endl; 268 cout << indent_str_next << "Area = " << link_bus_tot_per_Router.area.get_area()*1e-6<< " mm^2" << endl; 269 cout << indent_str_next<< "Peak Dynamic = " << link_bus_tot_per_Router.power.readOp.dynamic* 270 nocdynp.clockRate << " W" << endl; 271 cout << indent_str_next << "Subthreshold Leakage = " 272 << (long_channel? link_bus_tot_per_Router.power.readOp.longer_channel_leakage:link_bus_tot_per_Router.power.readOp.leakage) 273 <<" W" << endl; 274 cout << indent_str_next << "Gate Leakage = " << link_bus_tot_per_Router.power.readOp.gate_leakage 275 << " W" << endl; 276 cout << indent_str_next<< "Runtime Dynamic = " << link_bus->rt_power.readOp.dynamic/nocdynp.executionTime << " W" << endl; 277 cout<<endl; | 191 ASSIGN_INT_IF("type", noc_params.type); 192 ASSIGN_FP_IF("clockrate", noc_params.clockRate); 193 ASSIGN_INT_IF("flit_bits", noc_params.flit_size); 194 ASSIGN_FP_IF("link_len", link_len); 195 ASSIGN_FP_IF("link_throughput", noc_params.link_throughput); 196 ASSIGN_FP_IF("link_latency", noc_params.link_latency); 197 ASSIGN_INT_IF("input_ports", noc_params.input_ports); 198 ASSIGN_INT_IF("output_ports", noc_params.output_ports); 199 ASSIGN_INT_IF("global_linked_ports", noc_params.global_linked_ports); 200 ASSIGN_INT_IF("horizontal_nodes", noc_params.horizontal_nodes); 201 ASSIGN_INT_IF("vertical_nodes", noc_params.vertical_nodes); 202 ASSIGN_FP_IF("chip_coverage", noc_params.chip_coverage); 203 ASSIGN_FP_IF("link_routing_over_percentage", 204 noc_params.route_over_perc); 205 ASSIGN_INT_IF("has_global_link", noc_params.has_global_link); 206 ASSIGN_INT_IF("virtual_channel_per_port", 207 noc_params.virtual_channel_per_port); 208 ASSIGN_INT_IF("input_buffer_entries_per_vc", 209 noc_params.input_buffer_entries_per_vc); 210 ASSIGN_FP_IF("M_traffic_pattern", noc_params.M_traffic_pattern); 211 ASSIGN_FP_IF("link_base_width", noc_params.link_base_width); 212 ASSIGN_FP_IF("link_base_height", noc_params.link_base_height); 213 ASSIGN_INT_IF("link_start_wiring_level", 214 noc_params.link_start_wiring_level); 215 ASSIGN_INT_IF("wire_mat_type", mat_type); 216 ASSIGN_ENUM_IF("wire_type", interface_ip.wt, Wire_type); |
278 | 217 |
279 } | 218 else { 219 warnUnrecognizedParam(node_name); |
280 } | 220 } |
281 else 282 { 283// cout << indent_str_next << "Instruction Fetch Unit Peak Dynamic = " << ifu->rt_power.readOp.dynamic*clockRate << " W" << endl; 284// cout << indent_str_next << "Instruction Fetch Unit Subthreshold Leakage = " << ifu->rt_power.readOp.leakage <<" W" << endl; 285// cout << indent_str_next << "Instruction Fetch Unit Gate Leakage = " << ifu->rt_power.readOp.gate_leakage << " W" << endl; 286// cout << indent_str_next << "Load Store Unit Peak Dynamic = " << lsu->rt_power.readOp.dynamic*clockRate << " W" << endl; 287// cout << indent_str_next << "Load Store Unit Subthreshold Leakage = " << lsu->rt_power.readOp.leakage << " W" << endl; 288// cout << indent_str_next << "Load Store Unit Gate Leakage = " << lsu->rt_power.readOp.gate_leakage << " W" << endl; 289// cout << indent_str_next << "Memory Management Unit Peak Dynamic = " << mmu->rt_power.readOp.dynamic*clockRate << " W" << endl; 290// cout << indent_str_next << "Memory Management Unit Subthreshold Leakage = " << mmu->rt_power.readOp.leakage << " W" << endl; 291// cout << indent_str_next << "Memory Management Unit Gate Leakage = " << mmu->rt_power.readOp.gate_leakage << " W" << endl; 292// cout << indent_str_next << "Execution Unit Peak Dynamic = " << exu->rt_power.readOp.dynamic*clockRate << " W" << endl; 293// cout << indent_str_next << "Execution Unit Subthreshold Leakage = " << exu->rt_power.readOp.leakage << " W" << endl; 294// cout << indent_str_next << "Execution Unit Gate Leakage = " << exu->rt_power.readOp.gate_leakage << " W" << endl; 295 } 296} | 221 } |
297 | 222 |
298void NoC::set_noc_param() 299{ | 223 // Change from MHz to Hz 224 noc_params.clockRate *= 1e6; |
300 | 225 |
301 nocdynp.type = XML->sys.NoC[ithNoC].type; 302 nocdynp.clockRate =XML->sys.NoC[ithNoC].clockrate; 303 nocdynp.clockRate *= 1e6; 304 nocdynp.executionTime = XML->sys.total_cycles/(XML->sys.target_core_clockrate*1e6); | 226 interface_ip.wire_is_mat_type = mat_type; 227 interface_ip.wire_os_mat_type = mat_type; |
305 | 228 |
306 nocdynp.flit_size = XML->sys.NoC[ithNoC].flit_bits; 307 if (nocdynp.type) 308 { 309 nocdynp.input_ports = XML->sys.NoC[ithNoC].input_ports; 310 nocdynp.output_ports = XML->sys.NoC[ithNoC].output_ports;//later minus 1 311 nocdynp.min_ports = min(nocdynp.input_ports,nocdynp.output_ports); 312 nocdynp.global_linked_ports = (nocdynp.input_ports-1) + (nocdynp.output_ports-1); 313 /* 314 * Except local i/o ports, all ports needs links( global_linked_ports); 315 * However only min_ports can be fully active simultaneously 316 * since the fewer number of ports (input or output ) is the bottleneck. 317 */ 318 } 319 else 320 { 321 nocdynp.input_ports = 1; 322 nocdynp.output_ports = 1; 323 nocdynp.min_ports = min(nocdynp.input_ports,nocdynp.output_ports); 324 nocdynp.global_linked_ports = 1; 325 } | 229 num_children = xml_data->nChildNode("stat"); 230 for (i = 0; i < num_children; i++) { 231 XMLNode* statNode = xml_data->getChildNodePtr("stat", &i); 232 XMLCSTR node_name = statNode->getAttribute("name"); 233 XMLCSTR value = statNode->getAttribute("value"); |
326 | 234 |
327 nocdynp.virtual_channel_per_port = XML->sys.NoC[ithNoC].virtual_channel_per_port; 328 nocdynp.input_buffer_entries_per_vc = XML->sys.NoC[ithNoC].input_buffer_entries_per_vc; | 235 if (!node_name) 236 warnMissingStatName(statNode->getAttribute("id")); |
329 | 237 |
330 nocdynp.horizontal_nodes = XML->sys.NoC[ithNoC].horizontal_nodes; 331 nocdynp.vertical_nodes = XML->sys.NoC[ithNoC].vertical_nodes; 332 nocdynp.total_nodes = nocdynp.horizontal_nodes*nocdynp.vertical_nodes; 333 nocdynp.duty_cycle = XML->sys.NoC[ithNoC].duty_cycle; 334 nocdynp.has_global_link = XML->sys.NoC[ithNoC].has_global_link; 335 nocdynp.link_throughput = XML->sys.NoC[ithNoC].link_throughput; 336 nocdynp.link_latency = XML->sys.NoC[ithNoC].link_latency; 337 nocdynp.chip_coverage = XML->sys.NoC[ithNoC].chip_coverage; 338 nocdynp.route_over_perc = XML->sys.NoC[ithNoC].route_over_perc; | 238 ASSIGN_FP_IF("duty_cycle", noc_stats.duty_cycle); 239 ASSIGN_FP_IF("total_accesses", noc_stats.total_access); |
339 | 240 |
340 assert (nocdynp.chip_coverage <=1); 341 assert (nocdynp.route_over_perc <=1); | 241 else { 242 warnUnrecognizedStat(node_name); 243 } 244 } |
342 | 245 |
343 if (nocdynp.type) 344 name = "NOC"; 345 else 346 name = "BUSES"; | 246 clockRate = noc_params.clockRate; 247 noc_params.min_ports = 248 min(noc_params.input_ports, noc_params.output_ports); 249 if (noc_params.type) { 250 noc_params.global_linked_ports = (noc_params.input_ports - 1) + 251 (noc_params.output_ports - 1); 252 } 253 noc_params.total_nodes = 254 noc_params.horizontal_nodes * noc_params.vertical_nodes; |
347 | 255 |
256 assert(noc_params.chip_coverage <= 1); 257 assert(noc_params.route_over_perc <= 1); 258 assert(link_len > 0); |
|
348} 349 | 259} 260 |
261OnChipNetwork ::~OnChipNetwork() { |
|
350 | 262 |
351NoC ::~NoC(){ 352 353 if(router) {delete router; router = 0;} 354 if(link_bus) {delete link_bus; link_bus = 0;} | 263 if (router) { 264 delete router; 265 router = 0; 266 } 267 if (link_bus) { 268 delete link_bus; 269 link_bus = 0; 270 } |
355} | 271} |