44c44
< Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr)
---
> Switch::Switch(const Params *p) : BasicRouter(p)
46,47c46
< m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr);
< m_switch_id = sid;
---
> m_perfect_switch_ptr = new PerfectSwitch(m_id, this, p->virt_nets);
61a61,67
> Switch::init()
> {
> BasicRouter::init();
> m_perfect_switch_ptr->init(m_network_ptr);
> }
>
> void
71,74d76
< Throttle* throttle_ptr = NULL;
< SimpleNetwork* net_ptr =
< safe_cast<SimpleNetwork*>(RubySystem::getNetwork());
<
76,78c78,80
< throttle_ptr = new Throttle(m_switch_id, m_throttles.size(), link_latency,
< bw_multiplier, net_ptr->getEndpointBandwidth(),
< net_ptr);
---
> Throttle* throttle_ptr = new Throttle(m_id, m_throttles.size(),
> link_latency, bw_multiplier, m_network_ptr->getEndpointBandwidth(),
> this);
87,88c89,90
< if (net_ptr->getBufferSize() > 0) {
< buffer_ptr->resize(net_ptr->getBufferSize());
---
> if (m_network_ptr->getBufferSize() > 0) {
> buffer_ptr->resize(m_network_ptr->getBufferSize());
92c94
< }
---
> }
140c142
< ccprintf(out, "switch_%d_inlinks: %d\n", m_switch_id,
---
> ccprintf(out, "switch_%d_inlinks: %d\n", m_id,
142c144
< ccprintf(out, "switch_%d_outlinks: %d\n", m_switch_id,
---
> ccprintf(out, "switch_%d_outlinks: %d\n", m_id,
160c162
< out << "links_utilized_percent_switch_" << m_switch_id << ": "
---
> out << "links_utilized_percent_switch_" << m_id << ": "
166c168
< out << " links_utilized_percent_switch_" << m_switch_id
---
> out << " links_utilized_percent_switch_" << m_id
190c192
< out << " outgoing_messages_switch_" << m_switch_id
---
> out << " outgoing_messages_switch_" << m_id
192c194
< << sum * RubySystem::getNetwork()->MessageSizeType_to_int(type)
---
> << sum * m_network_ptr->MessageSizeType_to_int(type)
217a220,225
>
> Switch *
> SwitchParams::create()
> {
> return new Switch(this);
> }