Switch.cc (7054:7d6862b80049) | Switch.cc (7055:4e24742201d7) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 20 unchanged lines hidden (view full) --- 29#include "mem/protocol/MessageSizeType.hh" 30#include "mem/protocol/Protocol.hh" 31#include "mem/ruby/buffers/MessageBuffer.hh" 32#include "mem/ruby/network/Network.hh" 33#include "mem/ruby/network/simple/PerfectSwitch.hh" 34#include "mem/ruby/network/simple/Switch.hh" 35#include "mem/ruby/network/simple/Throttle.hh" 36 | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 20 unchanged lines hidden (view full) --- 29#include "mem/protocol/MessageSizeType.hh" 30#include "mem/protocol/Protocol.hh" 31#include "mem/ruby/buffers/MessageBuffer.hh" 32#include "mem/ruby/network/Network.hh" 33#include "mem/ruby/network/simple/PerfectSwitch.hh" 34#include "mem/ruby/network/simple/Switch.hh" 35#include "mem/ruby/network/simple/Throttle.hh" 36 |
37using namespace std; 38 |
|
37Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr) 38{ 39 m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr); 40 m_switch_id = sid; 41 m_throttles.setSize(0); 42} 43 44Switch::~Switch() --- 79 unchanged lines hidden (view full) --- 124Switch::getThrottles() const 125{ 126 return &m_throttles; 127} 128 129void 130Switch::printStats(std::ostream& out) const 131{ | 39Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr) 40{ 41 m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr); 42 m_switch_id = sid; 43 m_throttles.setSize(0); 44} 45 46Switch::~Switch() --- 79 unchanged lines hidden (view full) --- 126Switch::getThrottles() const 127{ 128 return &m_throttles; 129} 130 131void 132Switch::printStats(std::ostream& out) const 133{ |
132 using namespace std; 133 | |
134 ccprintf(out, "switch_%d_inlinks: %d\n", m_switch_id, 135 m_perfect_switch_ptr->getInLinks()); 136 ccprintf(out, "switch_%d_outlinks: %d\n", m_switch_id, 137 m_perfect_switch_ptr->getOutLinks()); 138 139 // Average link utilizations 140 double average_utilization = 0.0; 141 int throttle_count = 0; --- 78 unchanged lines hidden --- | 134 ccprintf(out, "switch_%d_inlinks: %d\n", m_switch_id, 135 m_perfect_switch_ptr->getInLinks()); 136 ccprintf(out, "switch_%d_outlinks: %d\n", m_switch_id, 137 m_perfect_switch_ptr->getOutLinks()); 138 139 // Average link utilizations 140 double average_utilization = 0.0; 141 int throttle_count = 0; --- 78 unchanged lines hidden --- |