/* the first CPU is the gateway */
if (i == 0)
gateway = host;
- /* create 2 links for a full-duplex communication */
- sg4::Link* link_up = host_zone->create_link("link-up-" + cpu_name, link_bw)->set_latency(link_lat)->seal();
- sg4::Link* link_down = host_zone->create_link("link-down-" + cpu_name, link_bw)->set_latency(link_lat)->seal();
- /* link UP, connection from CPU to outer world */
- host_zone->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, std::vector<sg4::Link*>{link_up}, false);
- /* link DOWN, connection from outer to CPU */
- host_zone->add_route(nullptr, host->get_netpoint(), nullptr, nullptr, std::vector<sg4::Link*>{link_down}, false);
+ /* create split-duplex link */
+ sg4::SplitDuplexLink* link = host_zone->create_split_duplex_link("link-" + cpu_name, link_bw);
+ link->set_latency(link_lat)->seal();
+ /* connecting CPU to outer world */
+ host_zone->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, {{link, sg4::LinkInRoute::Direction::UP}},
+ true);
}
/* seal newly created netzone */
host_zone->seal();