In SimpleNetwork, switches were assigned an index depending on their position in params().routers. But switches are also referenced by their router_id parameter in other locations of the ruby network system (e.g., src and dst node parameter in links). If the router_id does not match the position in SimpleNetwork::m_switches, the network initialization might fail or implement a different topology from what the user intended. This patch fixes this issue by storing switches in a map instead of a vector. Change-Id: I398f950ad404efbf9516ea9bbced598970a2bc24 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55723 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>