64 fatal_if(
p.data_msg_size >
p.ruby_system->getBlockSizeBytes(),
65 "%s: data message size > cache line size",
name());
68 params().ruby_system->registerNetwork(
this);
75 std::unordered_map<MachineType, std::vector<NodeID>> localNodeVersions;
76 for (
auto &it :
params().ext_links) {
84 for (
int i = 0;
i < MachineType_base_level(MachineType_NUM); ++
i) {
85 MachineType mach =
static_cast<MachineType
>(
i);
86 if (localNodeVersions.count(mach)) {
87 for (
auto &ver : localNodeVersions.at(mach)) {
89 NodeID global_node_id = MachineType_base_number(mach) + ver;
105 p.ext_links,
p.int_links);
123 i !=
p.ext_links.end(); ++
i) {
128 if (!ranges.empty()) {
141 for (
auto &it :
dynamic_cast<Network *
>(
this)->
params().ext_links) {
142 it->params().ext_node->initNetQueues();
148 for (
int node = 0; node <
m_nodes; node++) {
167 case MessageSizeType_Control:
168 case MessageSizeType_Request_Control:
169 case MessageSizeType_Reissue_Control:
170 case MessageSizeType_Response_Control:
171 case MessageSizeType_Writeback_Control:
172 case MessageSizeType_Broadcast_Control:
173 case MessageSizeType_Multicast_Control:
174 case MessageSizeType_Forwarded_Control:
175 case MessageSizeType_Invalidate_Control:
176 case MessageSizeType_Unblock_Control:
177 case MessageSizeType_Persistent_Control:
178 case MessageSizeType_Completion_Control:
180 case MessageSizeType_Data:
181 case MessageSizeType_Response_Data:
182 case MessageSizeType_ResponseLocal_Data:
183 case MessageSizeType_ResponseL2hit_Data:
184 case MessageSizeType_Writeback_Data:
187 panic(
"Invalid range for type MessageSizeType");
195 std::string vnet_type)
239 const auto &matching_ranges =
addrMap.equal_range(mtype);
240 for (
auto it = matching_ranges.first; it != matching_ranges.second; it++) {
242 auto &ranges = node.
ranges;
244 if (range.contains(
addr)) {
249 return MachineType_base_count(mtype);
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
ClockedObjectParams Params
Parameters of ClockedObject.
virtual std::string name() const
void initNetworkPtr(Network *net_ptr)
MachineID getMachineID() const
const AddrRangeList & getAddrRanges() const
MachineType getType() const
NodeID getVersion() const
void setToNetQueue(NodeID global_id, bool ordered, int netNumber, std::string vnet_type, MessageBuffer *b)
virtual void setFromNetQueue(NodeID global_id, bool ordered, int netNumber, std::string vnet_type, MessageBuffer *b)
std::unordered_multimap< MachineType, AddrMapNode > addrMap
std::vector< bool > m_ordered
static uint32_t m_data_msg_size
static uint32_t m_control_msg_size
Topology * m_topology_ptr
virtual void checkNetworkAllocation(NodeID local_id, bool ordered, int network_num, std::string vnet_type)
static uint32_t m_virtual_networks
static uint32_t MessageSizeType_to_int(MessageSizeType size_type)
std::vector< std::vector< MessageBuffer * > > m_fromNetQueues
std::unordered_map< NodeID, NodeID > globalToLocalMap
NodeID getLocalNodeID(NodeID global_id) const
virtual void collateStats()=0
NodeID addressToNodeID(Addr addr, MachineType mtype)
Map an address to the correct NodeID.
std::vector< std::vector< MessageBuffer * > > m_toNetQueues
std::vector< std::string > m_vnet_type_names
#define panic(...)
This implements a cprintf based panic() function.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
const Params & params() const
void registerDumpCallback(const std::function< void()> &callback)
Register a callback that should be called whenever statistics are about to be dumped.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
MachineType getType() const