My Tx methods are like as follows :-
void NoximRouter::txProcess_mode1()
{
if( buffer_snd.Size()!=0) //Going with just one buffer(may be corresponding to the router,... but actually forthe processing element)
{
NoximPacket packet = buffer_snd.Front();
NoximRouteData route_data;
route_data.current_id = local_id;
route_data.src_id = packet.src_id;
route_data.dst_id = packet.dst_id;
const vector < vector<int> > o = Route(route_data);
//stats.power.Arbitration(o.size());
int src= packet.src_id;
vector <int> path;
int col =0;
// checking in the global table the channels which are free and writhing to the res[ective channels
path.push_back(src);
packet.dir=checkdir(o);
if(checkmode1(path,o,src,col,packet)==1)
{
buffer_snd.Pop();
// cout<<"Mode1\n";
packet.seq_no=path;
packet.mode_tx=1;
flit_tx.write(packet);
mode1_traffic++;
stats.pkthist.push_back(makePacketHist(packet));
for(int i=0;i<path.size();i++){
MappingTable[path[i]].channel_status_neighbor.available =0;
}
}
}
}
//Checkmode function...........................
int NoximRouter::checkmode1( vector <int> &path,const vector < vector<int> > &o, int src,int col, const NoximPacket &packet)
{
for(int i=0;i<o.size()-1;i++)
{
src = getNeighborId(src, o.at(i).at(col));
if(MappingTable[src].channel_status_neighbor.available ==0)
path.push_back(src);
else
{
if ((i != o.size()-2) && (col ==0))
{
path.clear();
src=packet.src_id;
path.push_back(src);
i=-1;
col=1;
}
else
{
if(col == 1)
return 0;
}
}//else
}//end of for loop
/***************UPDATING MAP*****************/
path.push_back(packet.dst_id);
//cout<<"Path details:";
for(int j=0;j<path.size();j++)
{
MappingTable[path[j]].channel_status_neighbor.available =1;
}
return 1;
}
Similar to above i have implemented all other tx methods... Lemme know if u guys need any more details.... Another Information :- When i rearrange the sequence of registering methods inside SC_CTOR , the tx process which starts getting executed changes...... At one time it is txProcess_mode1.... If i change the ordering then only txProcess_mode4 gets executed..... But in both cases rxProcess_local gets executed regardless as it gets stimuli from other signals... Another Interesting Observation :- If change the placement of rxProcess_local inside the constructor then the execution of txProcess_mode processes change.
i.e
if i do the following inside SC_CTOR
SC_METHOD(txProcess_mode2);
sensitive << reset;
sensitive << clock.pos();
SC_METHOD(rxProcess_local);
sensitive << reset;
sensitive << clock.pos();
Only rxProcess_local and txProcess_mode2 gets executed...
& if i do
SC_METHOD(txProcess_mode3);
sensitive << reset;
sensitive << clock.pos();
SC_METHOD(rxProcess_local);
sensitive << reset;
sensitive << clock.pos();
Then only rxProcess_local and txProcess_mode3 gets executed