ruby: garnet: fixed: implement functional access
This commit is contained in:
parent
09b2430e95
commit
e8802fa127
21 changed files with 141 additions and 21 deletions
|
@ -53,8 +53,8 @@ def define_options(parser):
|
|||
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/")
|
||||
|
||||
|
|
|
@ -346,3 +346,23 @@ GarnetNetwork_dParams::create()
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -90,6 +90,10 @@ class GarnetNetwork_d : public BaseGarnetNetwork
|
|||
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);
|
||||
|
|
|
@ -94,3 +94,14 @@ InputUnit_d::wakeup()
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -173,6 +173,8 @@ class InputUnit_d : public Consumer
|
|||
return m_num_buffer_writes[vnet];
|
||||
}
|
||||
|
||||
uint32_t functionalWrite(Packet *pkt);
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
int m_num_vcs;
|
||||
|
|
|
@ -372,3 +372,15 @@ NetworkInterface_d::print(std::ostream& out) const
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ class NetworkInterface_d : public Consumer
|
|||
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;
|
||||
|
|
|
@ -99,3 +99,9 @@ CreditLink_dParams::create()
|
|||
{
|
||||
return new CreditLink_d(this);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
NetworkLink_d::functionalWrite(Packet *pkt)
|
||||
{
|
||||
return linkBuffer->functionalWrite(pkt);
|
||||
}
|
||||
|
|
|
@ -64,12 +64,12 @@ class NetworkLink_d : public ClockedObject, public Consumer
|
|||
|
||||
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;
|
||||
|
|
|
@ -108,3 +108,9 @@ OutputUnit_d::update_vc(int vc, int in_port, int in_vc)
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -87,6 +87,8 @@ class OutputUnit_d : public Consumer
|
|||
m_out_link->scheduleEvent(Cycles(1));
|
||||
}
|
||||
|
||||
uint32_t functionalWrite(Packet *pkt);
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
int m_num_vcs;
|
||||
|
|
|
@ -204,6 +204,23 @@ Router_d::printAggregateFaultProbability(std::ostream& out)
|
|||
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()
|
||||
{
|
||||
|
|
|
@ -105,6 +105,8 @@ class Router_d : public BasicRouter
|
|||
aggregate_fault_prob);
|
||||
}
|
||||
|
||||
uint32_t functionalWrite(Packet *);
|
||||
|
||||
private:
|
||||
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
|
||||
GarnetNetwork_d *m_network_ptr;
|
||||
|
|
|
@ -95,3 +95,15 @@ Switch_d::check_for_wakeup()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -51,17 +51,12 @@ class Switch_d : public Consumer
|
|||
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;
|
||||
|
|
|
@ -85,3 +85,9 @@ VirtualChannel_d::need_stage_nextcycle(VC_state_type state, flit_stage stage,
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
VirtualChannel_d::functionalWrite(Packet *pkt)
|
||||
{
|
||||
return m_input_buffer->functionalWrite(pkt);
|
||||
}
|
||||
|
|
|
@ -87,6 +87,8 @@ class VirtualChannel_d
|
|||
return m_input_buffer->getTopFlit();
|
||||
}
|
||||
|
||||
uint32_t functionalWrite(Packet *pkt);
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
flitBuffer_d *m_input_buffer;
|
||||
|
|
|
@ -85,3 +85,17 @@ flitBuffer_d::setMaxSize(int maximum)
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,8 @@ class flitBuffer_d
|
|||
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;
|
||||
|
|
|
@ -74,3 +74,10 @@ flit_d::print(std::ostream& out) const
|
|||
out << "Enqueue Time=" << m_enqueue_time << " ";
|
||||
out << "]";
|
||||
}
|
||||
|
||||
bool
|
||||
flit_d::functionalWrite(Packet *pkt)
|
||||
{
|
||||
Message *msg = m_msg_ptr.get();
|
||||
return msg->functionalWrite(pkt);
|
||||
}
|
||||
|
|
|
@ -79,11 +79,7 @@ class flit_d
|
|||
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; }
|
||||
|
@ -99,6 +95,8 @@ class flit_d
|
|||
}
|
||||
}
|
||||
|
||||
bool functionalWrite(Packet *pkt);
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
int m_vnet;
|
||||
|
|
Loading…
Reference in a new issue