71c71
< PerfectSwitch::addInPort(const map<int, MessageBuffer*>& in)
---
> PerfectSwitch::addInPort(const vector<MessageBuffer*>& in)
76,77c76,78
< for (auto& it : in) {
< it.second->setConsumer(this);
---
> for (int i = 0; i < in.size(); ++i) {
> if (in[i] != nullptr) {
> in[i]->setConsumer(this);
79,80c80,83
< string desc = csprintf("[Queue from port %s %s %s to PerfectSwitch]",
< to_string(m_switch_id), to_string(port), to_string(it.first));
---
> string desc =
> csprintf("[Queue from port %s %s %s to PerfectSwitch]",
> to_string(m_switch_id), to_string(port),
> to_string(i));
82,84c85,88
< it.second->setDescription(desc);
< it.second->setIncomingLink(port);
< it.second->setVnet(it.first);
---
> in[i]->setDescription(desc);
> in[i]->setIncomingLink(port);
> in[i]->setVnet(i);
> }
89,90c93,94
< PerfectSwitch::addOutPort(const map<int, MessageBuffer*>& out,
< const NetDest& routing_table_entry)
---
> PerfectSwitch::addOutPort(const vector<MessageBuffer*>& out,
> const NetDest& routing_table_entry)
134,135c138
< auto it = m_in[incoming].find(vnet);
< if (it == m_in[incoming].end())
---
> if (m_in[incoming].size() <= vnet) {
137c140
< MessageBuffer *buffer = (*it).second;
---
> }
138a142,146
> MessageBuffer *buffer = m_in[incoming][vnet];
> if (buffer == nullptr) {
> continue;
> }
>