gem5 v24.0.0.0
Loading...
Searching...
No Matches
RoutingUnit.hh
Go to the documentation of this file.
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
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30
31#ifndef __MEM_RUBY_NETWORK_GARNET_0_ROUTINGUNIT_HH__
32#define __MEM_RUBY_NETWORK_GARNET_0_ROUTINGUNIT_HH__
33
39
40namespace gem5
41{
42
43namespace ruby
44{
45
46namespace garnet
47{
48
49class InputUnit;
50class Router;
51
53{
54 public:
55 RoutingUnit(Router *router);
56 int outportCompute(RouteInfo route,
57 int inport,
58 PortDirection inport_dirn);
59
60 // Topology-agnostic Routing Table based routing (default)
61 void addRoute(std::vector<NetDest>& routing_table_entry);
62 void addWeight(int link_weight);
63
64 // get output port from routing table
65 int lookupRoutingTable(int vnet, NetDest net_dest);
66
67 // Topology-specific direction based routing
68 void addInDirection(PortDirection inport_dirn, int inport);
69 void addOutDirection(PortDirection outport_dirn, int outport);
70
71 // Routing for Mesh
73 int inport,
74 PortDirection inport_dirn);
75
76 // Custom Routing Algorithm using Port Directions
78 int inport,
79 PortDirection inport_dirn);
80
81 // Returns true if vnet is present in the vector
82 // of vnets or if the vector supports all vnets.
83 bool supportsVnet(int vnet, std::vector<int> sVnets);
84
85
86 private:
88
89 // Routing Table
92
93 // Inport and Outport direction to idx maps
94 std::map<PortDirection, int> m_inports_dirn2idx;
95 std::map<int, PortDirection> m_inports_idx2dirn;
96 std::map<int, PortDirection> m_outports_idx2dirn;
97 std::map<PortDirection, int> m_outports_dirn2idx;
98};
99
100} // namespace garnet
101} // namespace ruby
102} // namespace gem5
103
104#endif // __MEM_RUBY_NETWORK_GARNET_0_ROUTINGUNIT_HH__
void addOutDirection(PortDirection outport_dirn, int outport)
int outportComputeCustom(RouteInfo route, int inport, PortDirection inport_dirn)
int lookupRoutingTable(int vnet, NetDest net_dest)
void addInDirection(PortDirection inport_dirn, int inport)
std::vector< int > m_weight_table
std::vector< std::vector< NetDest > > m_routing_table
std::map< int, PortDirection > m_inports_idx2dirn
int outportComputeXY(RouteInfo route, int inport, PortDirection inport_dirn)
void addRoute(std::vector< NetDest > &routing_table_entry)
std::map< int, PortDirection > m_outports_idx2dirn
bool supportsVnet(int vnet, std::vector< int > sVnets)
std::map< PortDirection, int > m_outports_dirn2idx
void addWeight(int link_weight)
std::map< PortDirection, int > m_inports_dirn2idx
int outportCompute(RouteInfo route, int inport, PortDirection inport_dirn)
STL vector class.
Definition stl.hh:37
std::string PortDirection
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0