SimpleNetwork.cc (11113:5a2e1b1b5c43) SimpleNetwork.cc (11124:5d38dc2f7d66)
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;

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

33#include "base/stl_helpers.hh"
34#include "mem/ruby/common/NetDest.hh"
35#include "mem/ruby/network/MessageBuffer.hh"
36#include "mem/ruby/network/simple/SimpleLink.hh"
37#include "mem/ruby/network/simple/SimpleNetwork.hh"
38#include "mem/ruby/network/simple/Switch.hh"
39#include "mem/ruby/network/simple/Throttle.hh"
40#include "mem/ruby/profiler/Profiler.hh"
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;

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

33#include "base/stl_helpers.hh"
34#include "mem/ruby/common/NetDest.hh"
35#include "mem/ruby/network/MessageBuffer.hh"
36#include "mem/ruby/network/simple/SimpleLink.hh"
37#include "mem/ruby/network/simple/SimpleNetwork.hh"
38#include "mem/ruby/network/simple/Switch.hh"
39#include "mem/ruby/network/simple/Throttle.hh"
40#include "mem/ruby/profiler/Profiler.hh"
41#include "mem/ruby/system/RubySystem.hh"
42
43using namespace std;
44using m5::stl_helpers::deletePointers;
45
46SimpleNetwork::SimpleNetwork(const Params *p)
41
42using namespace std;
43using m5::stl_helpers::deletePointers;
44
45SimpleNetwork::SimpleNetwork(const Params *p)
47 : Network(p)
46 : Network(p), m_buffer_size(p->buffer_size),
47 m_endpoint_bandwidth(p->endpoint_bandwidth),
48 m_adaptive_routing(p->adaptive_routing)
48{
49{
49 m_buffer_size = p->buffer_size;
50 m_endpoint_bandwidth = p->endpoint_bandwidth;
51 m_adaptive_routing = p->adaptive_routing;
52
53 // Note: the parent Network Object constructor is called before the
54 // SimpleNetwork child constructor. Therefore, the member variables
55 // used below should already be initialized.
56 m_endpoint_switches.resize(m_nodes);
57
58 // record the routers
59 for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
60 i != p->routers.end(); ++i) {
61 Switch* s = safe_cast<Switch*>(*i);
62 m_switches.push_back(s);
63 s->init_net_ptr(this);
64 }
65

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

94 assert(src < m_switches.size());
95 assert(m_switches[src] != NULL);
96
97 SimpleExtLink *simple_link = safe_cast<SimpleExtLink*>(link);
98
99 m_switches[src]->addOutPort(m_fromNetQueues[dest], routing_table_entry,
100 simple_link->m_latency,
101 simple_link->m_bw_multiplier);
50 // record the routers
51 for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
52 i != p->routers.end(); ++i) {
53 Switch* s = safe_cast<Switch*>(*i);
54 m_switches.push_back(s);
55 s->init_net_ptr(this);
56 }
57

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

86 assert(src < m_switches.size());
87 assert(m_switches[src] != NULL);
88
89 SimpleExtLink *simple_link = safe_cast<SimpleExtLink*>(link);
90
91 m_switches[src]->addOutPort(m_fromNetQueues[dest], routing_table_entry,
92 simple_link->m_latency,
93 simple_link->m_bw_multiplier);
102
103 m_endpoint_switches[dest] = m_switches[src];
104}
105
106// From an endpoint node to a switch
107void
108SimpleNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
109 LinkDirection direction,
110 const NetDest& routing_table_entry)
111{

--- 113 unchanged lines hidden ---
94}
95
96// From an endpoint node to a switch
97void
98SimpleNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
99 LinkDirection direction,
100 const NetDest& routing_table_entry)
101{

--- 113 unchanged lines hidden ---