PerfectSwitch.hh (9863:9483739f83ee) | PerfectSwitch.hh (10311:ad9c042dce54) |
---|---|
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; --- 51 unchanged lines hidden (view full) --- 60 public: 61 PerfectSwitch(SwitchID sid, Switch *, uint32_t); 62 ~PerfectSwitch(); 63 64 std::string name() 65 { return csprintf("PerfectSwitch-%i", m_switch_id); } 66 67 void init(SimpleNetwork *); | 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; --- 51 unchanged lines hidden (view full) --- 60 public: 61 PerfectSwitch(SwitchID sid, Switch *, uint32_t); 62 ~PerfectSwitch(); 63 64 std::string name() 65 { return csprintf("PerfectSwitch-%i", m_switch_id); } 66 67 void init(SimpleNetwork *); |
68 void addInPort(const std::vector<MessageBuffer*>& in); 69 void addOutPort(const std::vector<MessageBuffer*>& out, | 68 void addInPort(const std::map<int, MessageBuffer*>& in); 69 void addOutPort(const std::map<int, MessageBuffer*>& out, |
70 const NetDest& routing_table_entry); | 70 const NetDest& routing_table_entry); |
71 |
|
71 int getInLinks() const { return m_in.size(); } 72 int getOutLinks() const { return m_out.size(); } 73 74 void wakeup(); 75 void storeEventInfo(int info); 76 77 void clearStats(); 78 void collateStats(); 79 void print(std::ostream& out) const; 80 81 private: 82 // Private copy constructor and assignment operator 83 PerfectSwitch(const PerfectSwitch& obj); 84 PerfectSwitch& operator=(const PerfectSwitch& obj); 85 86 SwitchID m_switch_id; 87 88 // vector of queues from the components | 72 int getInLinks() const { return m_in.size(); } 73 int getOutLinks() const { return m_out.size(); } 74 75 void wakeup(); 76 void storeEventInfo(int info); 77 78 void clearStats(); 79 void collateStats(); 80 void print(std::ostream& out) const; 81 82 private: 83 // Private copy constructor and assignment operator 84 PerfectSwitch(const PerfectSwitch& obj); 85 PerfectSwitch& operator=(const PerfectSwitch& obj); 86 87 SwitchID m_switch_id; 88 89 // vector of queues from the components |
89 std::vector<std::vector<MessageBuffer*> > m_in; 90 std::vector<std::vector<MessageBuffer*> > m_out; | 90 std::vector<std::map<int, MessageBuffer*> > m_in; 91 std::vector<std::map<int, MessageBuffer*> > m_out; 92 |
91 std::vector<NetDest> m_routing_table; 92 std::vector<LinkOrder> m_link_order; 93 94 uint32_t m_virtual_networks; 95 int m_round_robin_start; 96 int m_wakeups_wo_switch; 97 98 SimpleNetwork* m_network_ptr; --- 12 unchanged lines hidden --- | 93 std::vector<NetDest> m_routing_table; 94 std::vector<LinkOrder> m_link_order; 95 96 uint32_t m_virtual_networks; 97 int m_round_robin_start; 98 int m_wakeups_wo_switch; 99 100 SimpleNetwork* m_network_ptr; --- 12 unchanged lines hidden --- |