SST/macro
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
sstmac
hardware
router
fat_tree_global_adaptive_router.h
Go to the documentation of this file.
1
/*
2
* This file is part of SST/macroscale:
3
* The macroscale architecture simulator from the SST suite.
4
* Copyright (c) 2009 Sandia Corporation.
5
* This software is distributed under the BSD License.
6
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7
* the U.S. Government retains certain rights in this software.
8
* For more information, see the LICENSE file in the top
9
* SST/macroscale directory.
10
*/
11
12
#ifndef SSTMAC_HARDWARE_NETWORK_SWTICHES_ROUTING_FATTREEGLOBALADAPTIVEROUTER_H_INCLUDED
13
#define SSTMAC_HARDWARE_NETWORK_SWTICHES_ROUTING_FATTREEGLOBALADAPTIVEROUTER_H_INCLUDED
14
15
#include <
sstmac/hardware/router/fat_tree_router.h
>
16
#include <set>
17
18
namespace
sstmac
{
19
namespace
hw {
20
21
/**
22
* @brief The fat_tree_global_adaptive_router class
23
* Router encapsulating the special routing computations that must occur on
24
* a fat tree topology.
25
*/
26
class
fat_tree_global_adaptive_router
:
27
public
fat_tree_router
28
{
29
public
:
30
virtual
~fat_tree_global_adaptive_router
();
31
32
fat_tree_global_adaptive_router
() :
33
fat_tree_router
()
34
{
35
}
36
37
virtual
std::string
38
to_string
()
const
{
39
return
"fattreegarouter"
;
40
}
41
42
// fields used to distinguish between packets
43
struct
Match_Fields
{
44
// app id
45
// flow id
46
switch_id
src
;
47
switch_id
dst
;
48
bool
operator==
(
const
Match_Fields
& mf)
const
{
49
return
((src == mf.
src
) &&
50
(dst == mf.
dst
));
51
}
52
53
bool
operator<
(
const
Match_Fields
& mf)
const
{
54
return
((src < mf.
src
)?
true
:
55
(dst < mf.
dst
));
56
}
57
58
};
59
60
// (src, dst) -> outport
61
struct
Entry
{
62
Match_Fields
match_fields
;
63
int
vc
;
64
int
outport
;
65
66
bool
operator==
(
const
Entry
& entry)
const
{
67
return
((match_fields == entry.
match_fields
) && (vc == entry.
vc
) && (outport == entry.
outport
));
68
}
69
70
bool
operator<
(
const
Entry
& entry)
const
{
71
return
((match_fields < entry.
match_fields
)?
true
:((vc < entry.
vc
)?
true
:(outport < entry.
outport
)));
72
}
73
};
74
75
typedef
std::set <Entry>
Table
;
76
77
void
78
add_entry
(
const
Entry
& entry);
79
80
// no delete entry
81
82
Match_Fields
*
83
get_packet_metadata
(
packet
* pkt)
const
;
84
85
virtual
void
86
route
(
packet
* pkt);
87
88
private
:
89
Table
table
;
90
};
91
92
}
93
}
94
#endif
sstmac::hw::fat_tree_global_adaptive_router::Match_Fields::operator==
bool operator==(const Match_Fields &mf) const
Definition:
fat_tree_global_adaptive_router.h:48
sstmac::hw::fat_tree_global_adaptive_router::Match_Fields::src
switch_id src
Definition:
fat_tree_global_adaptive_router.h:46
fat_tree_router.h
sstmac::hw::fat_tree_global_adaptive_router::Entry::operator<
bool operator<(const Entry &entry) const
Definition:
fat_tree_global_adaptive_router.h:70
sstmac::hw::fat_tree_global_adaptive_router::add_entry
void add_entry(const Entry &entry)
sstmac::hw::packet
Definition:
packet.h:11
sstmac::hw::fat_tree_global_adaptive_router::get_packet_metadata
Match_Fields * get_packet_metadata(packet *pkt) const
sstmac::hw::fat_tree_global_adaptive_router::Entry::operator==
bool operator==(const Entry &entry) const
Definition:
fat_tree_global_adaptive_router.h:66
sstmac::hw::fat_tree_global_adaptive_router::Entry::match_fields
Match_Fields match_fields
Definition:
fat_tree_global_adaptive_router.h:62
sstmac::hw::fat_tree_global_adaptive_router::Match_Fields::operator<
bool operator<(const Match_Fields &mf) const
Definition:
fat_tree_global_adaptive_router.h:53
sstmac::hw::fat_tree_global_adaptive_router
The fat_tree_global_adaptive_router class Router encapsulating the special routing computations that ...
Definition:
fat_tree_global_adaptive_router.h:26
sstmac::switch_id
topology_id switch_id
Definition:
node_address.h:23
sstmac
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
Definition:
parallel_runtime.h:18
sstmac::hw::fat_tree_global_adaptive_router::Entry
Definition:
fat_tree_global_adaptive_router.h:61
sstmac::hw::fat_tree_router
The fat_tree_router class Router encapsulating the special routing computations that must occur on a ...
Definition:
fat_tree_router.h:26
sstmac::hw::fat_tree_global_adaptive_router::~fat_tree_global_adaptive_router
virtual ~fat_tree_global_adaptive_router()
sstmac::hw::fat_tree_global_adaptive_router::table
Table table
Definition:
fat_tree_global_adaptive_router.h:89
sstmac::hw::fat_tree_global_adaptive_router::fat_tree_global_adaptive_router
fat_tree_global_adaptive_router()
Definition:
fat_tree_global_adaptive_router.h:32
sstmac::hw::fat_tree_global_adaptive_router::to_string
virtual std::string to_string() const
Definition:
fat_tree_global_adaptive_router.h:38
sstmac::hw::fat_tree_global_adaptive_router::Entry::vc
int vc
Definition:
fat_tree_global_adaptive_router.h:63
sstmac::hw::fat_tree_global_adaptive_router::Table
std::set< Entry > Table
Definition:
fat_tree_global_adaptive_router.h:75
sstmac::hw::fat_tree_global_adaptive_router::Entry::outport
int outport
Definition:
fat_tree_global_adaptive_router.h:64
sstmac::hw::fat_tree_global_adaptive_router::Match_Fields
Definition:
fat_tree_global_adaptive_router.h:43
sstmac::hw::fat_tree_global_adaptive_router::route
virtual void route(packet *pkt)
sstmac::hw::fat_tree_global_adaptive_router::Match_Fields::dst
switch_id dst
Definition:
fat_tree_global_adaptive_router.h:47
Generated by
1.8.11