routers, int_links, ext_links = topology.makeTopology(options,
IntLinkClass, ExtLinkClass, RouterClass)
- net_topology.routers = routers
+ net_topology.num_routers = len(routers)
net_topology.int_links = int_links
net_topology.ext_links = ext_links
+ network = NetworkClass(ruby_system = ruby, topology = net_topology,
+ routers = routers)
if options.network_fault_model:
assert(options.garnet_network == "fixed")
- fault_model = FaultModel()
- network = NetworkClass(ruby_system = ruby, topology = net_topology,\
- enable_fault_model=True, fault_model = fault_model)
- else:
- network = NetworkClass(ruby_system = ruby, topology = net_topology)
+ network.enable_fault_model = True
+ network.fault_model = FaultModel()
#
# Loop through the directory controlers.
cxx_header = "mem/ruby/network/Topology.hh"
description = Param.String("Not Specified",
"the name of the imported topology module")
+ num_routers = Param.UInt32("Number of routers in the network")
ext_links = VectorParam.BasicExtLink("Links to external nodes")
int_links = VectorParam.BasicIntLink("Links between internal nodes")
- routers = VectorParam.BasicRouter("Network routers")
- print_config = Param.Bool(False,
- "display topology config in the stats file")
class RubyNetwork(ClockedObject):
type = 'RubyNetwork'
topology = Param.Topology("");
control_msg_size = Param.Int(8, "");
ruby_system = Param.RubySystem("");
+ routers = VectorParam.BasicRouter("Network routers")
Topology::Topology(const Params *p)
: SimObject(p)
{
- m_number_of_switches = p->routers.size();
+ m_number_of_switches = p->num_routers;
// initialize component latencies record
m_component_latencies.resize(0);
}
// record the routers
- for (vector<BasicRouter*>::const_iterator i =
- m_topology_ptr->params()->routers.begin();
- i != m_topology_ptr->params()->routers.end(); ++i) {
+ for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
+ i != p->routers.end(); ++i) {
Router_d* router = safe_cast<Router_d*>(*i);
m_router_ptr_vector.push_back(router);
}
router->printFaultVector(cout);
}
}
-
}
GarnetNetwork_d::~GarnetNetwork_d()
m_number_of_pipe_stages = p->number_of_pipe_stages;
// record the routers
- for (vector<BasicRouter*>::const_iterator i =
- m_topology_ptr->params()->routers.begin();
- i != m_topology_ptr->params()->routers.end(); ++i) {
+ for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
+ i != p->routers.end(); ++i) {
Router* router = safe_cast<Router*>(*i);
m_router_ptr_vector.push_back(router);
}
}
// record the routers
- for (vector<BasicRouter*>::const_iterator i =
- m_topology_ptr->params()->routers.begin();
- i != m_topology_ptr->params()->routers.end(); ++i) {
+ for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
+ i != p->routers.end(); ++i) {
Switch* s = safe_cast<Switch*>(*i);
m_switch_ptr_vector.push_back(s);
s->init_net_ptr(this);