help="check src/mem/ruby/network/topologies for complete set")
parser.add_option("--mesh-rows", type="int", default=1,
help="the number of rows in the mesh topology")
- parser.add_option("--garnet-network", type="string", default=None,
- help="'fixed'|'flexible'")
+ parser.add_option("--garnet-network", type="choice",
+ choices=['fixed', 'flexible'], help="'fixed'|'flexible'")
parser.add_option("--network-fault-model", action="store_true", default=False,
help="enable network fault model: see src/mem/ruby/network/fault_model/")
{
return new GarnetNetwork_d(this);
}
+
+uint32_t
+GarnetNetwork_d::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+
+ for (unsigned int i = 0; i < m_router_ptr_vector.size(); i++) {
+ num_functional_writes += m_router_ptr_vector[i]->functionalWrite(pkt);
+ }
+
+ for (unsigned int i = 0; i < m_ni_ptr_vector.size(); ++i) {
+ num_functional_writes += m_ni_ptr_vector[i]->functionalWrite(pkt);
+ }
+
+ for (unsigned int i = 0; i < m_link_ptr_vector.size(); ++i) {
+ num_functional_writes += m_link_ptr_vector[i]->functionalWrite(pkt);
+ }
+
+ return num_functional_writes;
+}
const NetDest& routing_table_entry,
bool isReconfiguration);
+ //! Function for performing a functional write. The return value
+ //! indicates the number of messages that were written.
+ uint32_t functionalWrite(Packet *pkt);
+
private:
void checkNetworkAllocation(NodeID id, bool ordered, int network_num,
std::string vnet_type);
m_num_buffer_reads[vnet]++;
}
}
+
+uint32_t
+InputUnit_d::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+ for (int i=0; i < m_num_vcs; i++) {
+ num_functional_writes += m_vcs[i]->functionalWrite(pkt);
+ }
+
+ return num_functional_writes;
+}
return m_num_buffer_writes[vnet];
}
+ uint32_t functionalWrite(Packet *pkt);
+
private:
int m_id;
int m_num_vcs;
{
out << "[Network Interface]";
}
+
+uint32_t
+NetworkInterface_d::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+ for (unsigned int i = 0; i < m_num_vcs; ++i) {
+ num_functional_writes += m_ni_buffers[i]->functionalWrite(pkt);
+ }
+
+ num_functional_writes += outSrcQueue->functionalWrite(pkt);
+ return num_functional_writes;
+}
void print(std::ostream& out) const;
int get_vnet(int vc);
+ uint32_t functionalWrite(Packet *);
+
private:
GarnetNetwork_d *m_net_ptr;
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
{
return new CreditLink_d(this);
}
+
+uint32_t
+NetworkLink_d::functionalWrite(Packet *pkt)
+{
+ return linkBuffer->functionalWrite(pkt);
+}
inline bool isReady(Cycles curTime)
{ return linkBuffer->isReady(curTime); }
+
inline flit_d* peekLink() { return linkBuffer->peekTopFlit(); }
inline flit_d* consumeLink() { return linkBuffer->getTopFlit(); }
- void init_net_ptr(GarnetNetwork_d* net_ptr)
- {
- m_net_ptr = net_ptr;
- }
+
+ void init_net_ptr(GarnetNetwork_d* net_ptr) { m_net_ptr = net_ptr; }
+ uint32_t functionalWrite(Packet *);
protected:
int m_id;
m_router->update_incredit(in_port, in_vc,
m_outvc_state[vc]->get_credit_count());
}
+
+uint32_t
+OutputUnit_d::functionalWrite(Packet *pkt)
+{
+ return m_out_buffer->functionalWrite(pkt);
+}
m_out_link->scheduleEvent(Cycles(1));
}
+ uint32_t functionalWrite(Packet *pkt);
+
private:
int m_id;
int m_num_vcs;
out << aggregate_fault_prob << endl;
}
+uint32_t
+Router_d::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+ num_functional_writes += m_switch->functionalWrite(pkt);
+
+ for (uint32_t i = 0; i < m_input_unit.size(); i++) {
+ num_functional_writes += m_input_unit[i]->functionalWrite(pkt);
+ }
+
+ for (uint32_t i = 0; i < m_output_unit.size(); i++) {
+ num_functional_writes += m_output_unit[i]->functionalWrite(pkt);
+ }
+
+ return num_functional_writes;
+}
+
Router_d *
GarnetRouter_dParams::create()
{
aggregate_fault_prob);
}
+ uint32_t functionalWrite(Packet *);
+
private:
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
GarnetNetwork_d *m_network_ptr;
}
}
}
+
+uint32_t
+Switch_d::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+
+ for (uint32_t i = 0; i < m_switch_buffer.size(); ++i) {
+ num_functional_writes += m_switch_buffer[i]->functionalWrite(pkt);
+ }
+
+ return num_functional_writes;
+}
void check_for_wakeup();
void print(std::ostream& out) const {};
- inline void
- update_sw_winner(int inport, flit_d *t_flit)
- {
- m_switch_buffer[inport]->insert(t_flit);
- }
+ inline void update_sw_winner(int inport, flit_d *t_flit)
+ { m_switch_buffer[inport]->insert(t_flit); }
- inline double
- get_crossbar_count()
- {
- return m_crossbar_activity;
- }
+ inline double get_crossbar_count() { return m_crossbar_activity; }
+
+ uint32_t functionalWrite(Packet *pkt);
private:
int m_num_vcs;
}
return false;
}
+
+uint32_t
+VirtualChannel_d::functionalWrite(Packet *pkt)
+{
+ return m_input_buffer->functionalWrite(pkt);
+}
return m_input_buffer->getTopFlit();
}
+ uint32_t functionalWrite(Packet *pkt);
+
private:
int m_id;
flitBuffer_d *m_input_buffer;
{
max_size = maximum;
}
+
+uint32_t
+flitBuffer_d::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+
+ for (unsigned int i = 0; i < m_buffer.size(); ++i) {
+ if (m_buffer[i]->functionalWrite(pkt)) {
+ num_functional_writes++;
+ }
+ }
+
+ return num_functional_writes;
+}
std::push_heap(m_buffer.begin(), m_buffer.end(), flit_d::greater);
}
+ uint32_t functionalWrite(Packet *pkt);
+
private:
std::vector<flit_d *> m_buffer;
int max_size;
out << "Enqueue Time=" << m_enqueue_time << " ";
out << "]";
}
+
+bool
+flit_d::functionalWrite(Packet *pkt)
+{
+ Message *msg = m_msg_ptr.get();
+ return msg->functionalWrite(pkt);
+}
m_stage.second = curTime + Cycles(1);
}
- std::pair<flit_stage, Cycles>
- get_stage()
- {
- return m_stage;
- }
+ std::pair<flit_stage, Cycles> get_stage() { return m_stage; }
void set_delay(Cycles delay) { src_delay = delay; }
Cycles get_delay() { return src_delay; }
}
}
+ bool functionalWrite(Packet *pkt);
+
private:
int m_id;
int m_vnet;