changeset 46e9b3bf447f in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=46e9b3bf447f description: garnet: added orion2.0 for network power calculation
diffstat: src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc | 15 +- src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh | 12 +- src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh | 3 +- src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc | 30 +- src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh | 13 +- src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc | 13 +- src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh | 11 +- src/mem/ruby/network/orion/Allocator/Arbiter.cc | 93 + src/mem/ruby/network/orion/Allocator/Arbiter.hh | 87 + src/mem/ruby/network/orion/Allocator/MatrixArbiter.cc | 251 + src/mem/ruby/network/orion/Allocator/MatrixArbiter.hh | 71 + src/mem/ruby/network/orion/Allocator/RRArbiter.cc | 238 + src/mem/ruby/network/orion/Allocator/RRArbiter.hh | 72 + src/mem/ruby/network/orion/Allocator/SConscript | 38 + src/mem/ruby/network/orion/Allocator/SWAllocator.cc | 175 + src/mem/ruby/network/orion/Allocator/SWAllocator.hh | 95 + src/mem/ruby/network/orion/Allocator/VCAllocator.cc | 302 + src/mem/ruby/network/orion/Allocator/VCAllocator.hh | 123 + src/mem/ruby/network/orion/Buffer/AmpUnit.cc | 72 + src/mem/ruby/network/orion/Buffer/AmpUnit.hh | 73 + src/mem/ruby/network/orion/Buffer/BitlineUnit.cc | 199 + src/mem/ruby/network/orion/Buffer/BitlineUnit.hh | 93 + src/mem/ruby/network/orion/Buffer/Buffer.cc | 187 + src/mem/ruby/network/orion/Buffer/Buffer.hh | 96 + src/mem/ruby/network/orion/Buffer/DecoderUnit.cc | 171 + src/mem/ruby/network/orion/Buffer/DecoderUnit.hh | 88 + src/mem/ruby/network/orion/Buffer/MemUnit.cc | 132 + src/mem/ruby/network/orion/Buffer/MemUnit.hh | 80 + src/mem/ruby/network/orion/Buffer/OutdrvUnit.cc | 175 + src/mem/ruby/network/orion/Buffer/OutdrvUnit.hh | 89 + src/mem/ruby/network/orion/Buffer/PrechargeUnit.cc | 136 + src/mem/ruby/network/orion/Buffer/PrechargeUnit.hh | 90 + src/mem/ruby/network/orion/Buffer/Register.cc | 113 + src/mem/ruby/network/orion/Buffer/Register.hh | 73 + src/mem/ruby/network/orion/Buffer/SConscript | 43 + src/mem/ruby/network/orion/Buffer/SRAM.cc | 271 + src/mem/ruby/network/orion/Buffer/SRAM.hh | 120 + src/mem/ruby/network/orion/Buffer/WordlineUnit.cc | 150 + src/mem/ruby/network/orion/Buffer/WordlineUnit.hh | 87 + src/mem/ruby/network/orion/Clock.cc | 183 + src/mem/ruby/network/orion/Clock.hh | 77 + src/mem/ruby/network/orion/ConfigFile.cc | 170 + src/mem/ruby/network/orion/ConfigFile.hh | 252 + src/mem/ruby/network/orion/Crossbar/Crossbar.cc | 393 ++ src/mem/ruby/network/orion/Crossbar/Crossbar.hh | 130 + src/mem/ruby/network/orion/Crossbar/MatrixCrossbar.cc | 152 + src/mem/ruby/network/orion/Crossbar/MatrixCrossbar.hh | 73 + src/mem/ruby/network/orion/Crossbar/MultreeCrossbar.cc | 162 + src/mem/ruby/network/orion/Crossbar/MultreeCrossbar.hh | 69 + src/mem/ruby/network/orion/Crossbar/SConscript | 36 + src/mem/ruby/network/orion/FlipFlop.cc | 138 + src/mem/ruby/network/orion/FlipFlop.hh | 87 + src/mem/ruby/network/orion/NetworkPower.cc | 593 +- src/mem/ruby/network/orion/NetworkPower.hh | 21 +- src/mem/ruby/network/orion/OrionConfig.cc | 201 + src/mem/ruby/network/orion/OrionConfig.hh | 158 + src/mem/ruby/network/orion/OrionLink.cc | 98 + src/mem/ruby/network/orion/OrionLink.hh | 72 + src/mem/ruby/network/orion/OrionRouter.cc | 495 ++ src/mem/ruby/network/orion/OrionRouter.hh | 119 + src/mem/ruby/network/orion/SConscript | 23 +- src/mem/ruby/network/orion/SIM_port.hh | 172 - src/mem/ruby/network/orion/SIM_power.hh | 385 - src/mem/ruby/network/orion/SIM_power_test.hh | 285 - src/mem/ruby/network/orion/TechParameter.cc | 1476 +++++++ src/mem/ruby/network/orion/TechParameter.hh | 414 ++ src/mem/ruby/network/orion/Type.hh | 45 + src/mem/ruby/network/orion/Wire.cc | 383 + src/mem/ruby/network/orion/Wire.hh | 92 + src/mem/ruby/network/orion/orion.hh | 39 + src/mem/ruby/network/orion/parm_technology.hh | 474 -- src/mem/ruby/network/orion/power_arbiter.cc | 392 - src/mem/ruby/network/orion/power_arbiter.hh | 90 - src/mem/ruby/network/orion/power_array.cc | 2158 ----------- src/mem/ruby/network/orion/power_array.hh | 394 -- src/mem/ruby/network/orion/power_bus.cc | 215 - src/mem/ruby/network/orion/power_bus.hh | 64 - src/mem/ruby/network/orion/power_crossbar.cc | 365 - src/mem/ruby/network/orion/power_crossbar.hh | 81 - src/mem/ruby/network/orion/power_ll.cc | 270 - src/mem/ruby/network/orion/power_ll.hh | 53 - src/mem/ruby/network/orion/power_router_init.cc | 260 - src/mem/ruby/network/orion/power_router_init.hh | 126 - src/mem/ruby/network/orion/power_static.cc | 46 - src/mem/ruby/network/orion/power_static.hh | 39 - src/mem/ruby/network/orion/power_utils.cc | 164 - src/mem/ruby/network/orion/power_utils.hh | 39 - src/mem/ruby/network/orion/router.cfg | 146 + 88 files changed, 10041 insertions(+), 6508 deletions(-) diffs (truncated from 17081 to 300 lines): diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc --- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc Sun Feb 06 22:14:17 2011 -0800 @@ -40,9 +40,14 @@ m_id = id; m_router = router; m_num_vcs = m_router->get_num_vcs(); + m_vc_per_vnet = m_router->get_vc_per_vnet(); - m_num_buffer_reads = 0; - m_num_buffer_writes = 0; + m_num_buffer_reads.resize(m_num_vcs/m_vc_per_vnet); + m_num_buffer_writes.resize(m_num_vcs/m_vc_per_vnet); + for (int i = 0; i < m_num_buffer_reads.size(); i++) { + m_num_buffer_reads[i] = 0; + m_num_buffer_writes[i] = 0; + } creditQueue = new flitBuffer_d(); // Instantiating the virtual channels @@ -82,11 +87,11 @@ // write flit into input buffer m_vcs[vc]->insertFlit(t_flit); - + int vnet = vc/m_vc_per_vnet; // number of writes same as reads // any flit that is written will be read only once - m_num_buffer_writes++; - m_num_buffer_reads++; + m_num_buffer_writes[vnet]++; + m_num_buffer_reads[vnet]++; } } diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh --- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh Sun Feb 06 22:14:17 2011 -0800 @@ -162,21 +162,23 @@ } inline double - get_buf_read_count() + get_buf_read_count(int vnet) { - return m_num_buffer_reads; + return m_num_buffer_reads[vnet]; } inline double - get_buf_write_count() + get_buf_write_count(int vnet) { - return m_num_buffer_writes; + return m_num_buffer_writes[vnet]; } private: int m_id; int m_num_vcs; - double m_num_buffer_writes, m_num_buffer_reads; + int m_vc_per_vnet; + std::vector<double> m_num_buffer_writes; + std::vector<double> m_num_buffer_reads; Router_d *m_router; NetworkLink_d *m_in_link; diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh Sun Feb 06 22:14:17 2011 -0800 @@ -37,7 +37,7 @@ #include "mem/ruby/network/garnet/NetworkHeader.hh" #include "mem/ruby/common/Consumer.hh" #include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh" -#include "mem/ruby/network/orion/power_bus.hh" +#include "mem/ruby/network/orion/NetworkPower.hh" class GarnetNetwork_d; @@ -56,7 +56,6 @@ int get_id(){return m_id;} void wakeup(); - double calculate_offline_power(power_bus*); double calculate_power(); inline bool isReady() { return linkBuffer->isReady(); } diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc Sun Feb 06 22:14:17 2011 -0800 @@ -60,13 +60,19 @@ m_input_unit.clear(); m_output_unit.clear(); - buf_read_count = 0; - buf_write_count = 0; crossbar_count = 0; - vc_local_arbit_count = 0; - vc_global_arbit_count = 0; sw_local_arbit_count = 0; sw_global_arbit_count = 0; + buf_read_count.resize(m_virtual_networks); + buf_write_count.resize(m_virtual_networks); + vc_local_arbit_count.resize(m_virtual_networks); + vc_global_arbit_count.resize(m_virtual_networks); + for (int i = 0; i < m_virtual_networks; i++) { + buf_read_count[i] = 0; + buf_write_count[i] = 0; + vc_local_arbit_count[i] = 0; + vc_global_arbit_count[i] = 0; + } } Router_d::~Router_d() @@ -154,15 +160,19 @@ void Router_d::calculate_performance_numbers() { - for (int i = 0; i < m_input_unit.size(); i++) { - buf_read_count += m_input_unit[i]->get_buf_read_count(); - buf_write_count += m_input_unit[i]->get_buf_write_count(); + for (int j = 0; j < m_virtual_networks; j++) { + for (int i = 0; i < m_input_unit.size(); i++) { + buf_read_count[j] += m_input_unit[i]->get_buf_read_count(j); + buf_write_count[j] += m_input_unit[i]->get_buf_write_count(j); + } + + vc_local_arbit_count[j] = m_vc_alloc->get_local_arbit_count(j); + vc_global_arbit_count[j] = m_vc_alloc->get_global_arbit_count(j); } - crossbar_count = m_switch->get_crossbar_count(); - vc_local_arbit_count = m_vc_alloc->get_local_arbit_count(); - vc_global_arbit_count = m_vc_alloc->get_global_arbit_count(); + sw_local_arbit_count = m_sw_alloc->get_local_arbit_count(); sw_global_arbit_count = m_sw_alloc->get_global_arbit_count(); + crossbar_count = m_switch->get_crossbar_count(); } void diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh Sun Feb 06 22:14:17 2011 -0800 @@ -37,7 +37,7 @@ #include "mem/ruby/network/garnet/NetworkHeader.hh" #include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh" #include "mem/ruby/common/NetDest.hh" -#include "mem/ruby/network/orion/power_router_init.hh" +#include "mem/ruby/network/orion/NetworkPower.hh" class GarnetNetwork_d; class NetworkLink_d; @@ -78,10 +78,7 @@ void swarb_req(); void printConfig(std::ostream& out); - void power_router_initialize(power_router *router, - power_router_info *info); double calculate_power(); - double calculate_offline_power(power_router*, power_router_info*); void calculate_performance_numbers(); private: @@ -90,10 +87,12 @@ GarnetNetwork_d *m_network_ptr; int m_flit_width; - double buf_read_count, buf_write_count; + std::vector<double> buf_read_count; + std::vector<double> buf_write_count; + std::vector<double> vc_local_arbit_count; + std::vector<double> vc_global_arbit_count; + double sw_local_arbit_count, sw_global_arbit_count; double crossbar_count; - double vc_local_arbit_count, vc_global_arbit_count; - double sw_local_arbit_count, sw_global_arbit_count; std::vector<InputUnit_d *> m_input_unit; std::vector<OutputUnit_d *> m_output_unit; diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc --- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc Sun Feb 06 22:14:17 2011 -0800 @@ -39,8 +39,13 @@ m_router = router; m_num_vcs = m_router->get_num_vcs(); m_vc_per_vnet = m_router->get_vc_per_vnet(); - m_local_arbiter_activity = 0; - m_global_arbiter_activity = 0; + + m_local_arbiter_activity.resize(m_num_vcs/m_vc_per_vnet); + m_global_arbiter_activity.resize(m_num_vcs/m_vc_per_vnet); + for (int i = 0; i < m_local_arbiter_activity.size(); i++) { + m_local_arbiter_activity[i] = 0; + m_global_arbiter_activity[i] = 0; + } } void @@ -158,7 +163,7 @@ outvc_offset = 0; int outvc = outvc_base + outvc_offset; if (m_output_unit[outport]->is_vc_idle(outvc)) { - m_local_arbiter_activity++; + m_local_arbiter_activity[vnet]++; m_outvc_req[outport][outvc][inport_iter][invc_iter] = true; if (!m_outvc_is_req[outport][outvc]) m_outvc_is_req[outport][outvc] = true; @@ -220,7 +225,7 @@ } int invc = invc_base + invc_offset; if (m_outvc_req[outport_iter][outvc_iter][inport][invc]) { - m_global_arbiter_activity++; + m_global_arbiter_activity[vnet]++; m_input_unit[inport]->grant_vc(invc, outvc_iter); m_output_unit[outport_iter]->update_vc( outvc_iter, inport, invc); diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh --- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh Sun Feb 06 22:14:16 2011 -0800 +++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh Sun Feb 06 22:14:17 2011 -0800 @@ -58,15 +58,15 @@ void select_outvc(int inport_iter, int invc_iter); inline double - get_local_arbit_count() + get_local_arbit_count(int vnet) { - return m_local_arbiter_activity; + return m_local_arbiter_activity[vnet]; } inline double - get_global_arbit_count() + get_global_arbit_count(int vnet) { - return m_global_arbiter_activity; + return m_global_arbiter_activity[vnet]; } private: @@ -74,7 +74,8 @@ int m_num_inports; int m_num_outports; - double m_local_arbiter_activity, m_global_arbiter_activity; + std::vector<double > m_local_arbiter_activity; + std::vector<double > m_global_arbiter_activity; Router_d *m_router; diff -r 8439266ec9e5 -r 46e9b3bf447f src/mem/ruby/network/orion/Allocator/Arbiter.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mem/ruby/network/orion/Allocator/Arbiter.cc Sun Feb 06 22:14:17 2011 -0800 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2009 Princeton University, and + * Regents of the University of California + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Hangsheng Wang (Orion 1.0, Princeton) + * Xinping Zhu (Orion 1.0, Princeton) + * Xuning Chen (Orion 1.0, Princeton) + * Bin Li (Orion 2.0, Princeton) + * Kambiz Samadi (Orion 2.0, UC San Diego) + */ + +#include <iostream> +#include <cassert> + +#include "mem/ruby/network/orion/Allocator/Arbiter.hh" +#include "mem/ruby/network/orion/Allocator/MatrixArbiter.hh" +#include "mem/ruby/network/orion/Allocator/RRArbiter.hh" +#include "mem/ruby/network/orion/TechParameter.hh" + +using namespace std; + +Arbiter::Arbiter(const ArbiterModel arb_model_, + const uint32_t req_width_, _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev