RoutingUnit.cc (11667:ebf2acd02fc5) RoutingUnit.cc (13449:2f7efa89c58b)
1/*
2 * Copyright (c) 2008 Princeton University
3 * Copyright (c) 2016 Georgia Institute of Technology
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29 * Authors: Niket Agarwal
30 * Tushar Krishna
31 */
32
33
34#include "mem/ruby/network/garnet2.0/RoutingUnit.hh"
35
36#include "base/cast.hh"
1/*
2 * Copyright (c) 2008 Princeton University
3 * Copyright (c) 2016 Georgia Institute of Technology
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29 * Authors: Niket Agarwal
30 * Tushar Krishna
31 */
32
33
34#include "mem/ruby/network/garnet2.0/RoutingUnit.hh"
35
36#include "base/cast.hh"
37#include "base/logging.hh"
37#include "mem/ruby/network/garnet2.0/InputUnit.hh"
38#include "mem/ruby/network/garnet2.0/Router.hh"
39#include "mem/ruby/slicc_interface/Message.hh"
40
41RoutingUnit::RoutingUnit(Router *router)
42{
43 m_router = router;
44 m_routing_table.clear();

--- 174 unchanged lines hidden (view full) ---

219 // "Local" or "North" or "West" or "East"
220 assert(inport_dirn != "South");
221 outport_dirn = "South";
222 }
223 } else {
224 // x_hops == 0 and y_hops == 0
225 // this is not possible
226 // already checked that in outportCompute() function
38#include "mem/ruby/network/garnet2.0/InputUnit.hh"
39#include "mem/ruby/network/garnet2.0/Router.hh"
40#include "mem/ruby/slicc_interface/Message.hh"
41
42RoutingUnit::RoutingUnit(Router *router)
43{
44 m_router = router;
45 m_routing_table.clear();

--- 174 unchanged lines hidden (view full) ---

220 // "Local" or "North" or "West" or "East"
221 assert(inport_dirn != "South");
222 outport_dirn = "South";
223 }
224 } else {
225 // x_hops == 0 and y_hops == 0
226 // this is not possible
227 // already checked that in outportCompute() function
227 assert(0);
228 panic("x_hops == y_hops == 0");
228 }
229
230 return m_outports_dirn2idx[outport_dirn];
231}
232
233// Template for implementing custom routing algorithm
234// using port directions. (Example adaptive)
235int
236RoutingUnit::outportComputeCustom(RouteInfo route,
237 int inport,
238 PortDirection inport_dirn)
239{
229 }
230
231 return m_outports_dirn2idx[outport_dirn];
232}
233
234// Template for implementing custom routing algorithm
235// using port directions. (Example adaptive)
236int
237RoutingUnit::outportComputeCustom(RouteInfo route,
238 int inport,
239 PortDirection inport_dirn)
240{
240 assert(0);
241 return -1;
241 panic("%s placeholder executed", __FUNCTION__);
242}
242}