NetDest.hh (7055:4e24742201d7) NetDest.hh (7454:3a3e8e8cce1b)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

30// This is backward compatible with the Set class that was previously
31// used to specify network destinations.
32// NetDest supports both node networks and component networks
33
34#ifndef __MEM_RUBY_COMMON_NETDEST_HH__
35#define __MEM_RUBY_COMMON_NETDEST_HH__
36
37#include <iostream>
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

30// This is backward compatible with the Set class that was previously
31// used to specify network destinations.
32// NetDest supports both node networks and component networks
33
34#ifndef __MEM_RUBY_COMMON_NETDEST_HH__
35#define __MEM_RUBY_COMMON_NETDEST_HH__
36
37#include <iostream>
38#include <vector>
38
39
39#include "mem/gems_common/Vector.hh"
40#include "mem/protocol/MachineType.hh"
41#include "mem/ruby/common/Global.hh"
42#include "mem/ruby/common/Set.hh"
43#include "mem/ruby/system/MachineID.hh"
44#include "mem/ruby/system/NodeID.hh"
45
46class NetDest
47{

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

84
85 bool isSuperset(const NetDest& test) const;
86 bool isSubset(const NetDest& test) const { return test.isSuperset(*this); }
87 bool isElement(MachineID element) const;
88 bool isBroadcast() const;
89 bool isEmpty() const;
90
91 // For Princeton Network
40#include "mem/protocol/MachineType.hh"
41#include "mem/ruby/common/Global.hh"
42#include "mem/ruby/common/Set.hh"
43#include "mem/ruby/system/MachineID.hh"
44#include "mem/ruby/system/NodeID.hh"
45
46class NetDest
47{

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

84
85 bool isSuperset(const NetDest& test) const;
86 bool isSubset(const NetDest& test) const { return test.isSuperset(*this); }
87 bool isElement(MachineID element) const;
88 bool isBroadcast() const;
89 bool isEmpty() const;
90
91 // For Princeton Network
92 Vector<NodeID> getAllDest();
92 std::vector<NodeID> getAllDest();
93
94 MachineID smallestElement() const;
95 MachineID smallestElement(MachineType machine) const;
96
93
94 MachineID smallestElement() const;
95 MachineID smallestElement(MachineType machine) const;
96
97 void setSize();
97 void resize();
98 int getSize() const { return m_bits.size(); }
99
100 // get element for a index
101 NodeID elementAt(MachineID index);
102
103 void print(std::ostream& out) const;
104
105 private:

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

114 }
115
116 NodeID
117 bitIndex(NodeID index) const
118 {
119 return index;
120 }
121
98 int getSize() const { return m_bits.size(); }
99
100 // get element for a index
101 NodeID elementAt(MachineID index);
102
103 void print(std::ostream& out) const;
104
105 private:

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

114 }
115
116 NodeID
117 bitIndex(NodeID index) const
118 {
119 return index;
120 }
121
122 Vector <Set> m_bits; // a Vector of bit vectors - i.e. Sets
122 std::vector<Set> m_bits; // a vector of bit vectors - i.e. Sets
123};
124
125inline std::ostream&
126operator<<(std::ostream& out, const NetDest& obj)
127{
128 obj.print(out);
129 out << std::flush;
130 return out;
131}
132
133#endif // __MEM_RUBY_COMMON_NETDEST_HH__
134
123};
124
125inline std::ostream&
126operator<<(std::ostream& out, const NetDest& obj)
127{
128 obj.print(out);
129 out << std::flush;
130 return out;
131}
132
133#endif // __MEM_RUBY_COMMON_NETDEST_HH__
134