Commit 2ef82aa5 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Update on routing: reaching now OUTVC but not OUT

parent a4dcb3db
......@@ -60,7 +60,7 @@ public class TaskINForVC extends TMLTask {
// Output Channels are given in the order of VCs
public void generate(TMLEvent inPacketEvent, Vector<TMLEvent> inFeedbackEvents, TMLChannel inChannel,
TMLEvent outFeedbackEvent, Vector<TMLEvent> outVCEvents, int nocSize, int xPos, int yPos) {
TMLEvent outFeedbackEvent, Vector<TMLEvent> outVCEvents, Vector<Integer> outIndexes, int nocSize, int xPos, int yPos) {
TMLSendEvent sendEvt;
TMLStopState stop;
......@@ -206,21 +206,21 @@ public class TaskINForVC extends TMLTask {
// Main choice : second branch of secondSeq
TMLChoice mainChoice = new TMLChoice("mainChoice", referenceObject);
activity.addLinkElement(secondSeq, mainChoice);
// Each link to an output for a given packet
for (int i = 0; i < outVCEvents.size(); i++) {
for (int i = 0; i < outIndexes.size(); i++) {
int index = outIndexes.get(i);
TMLForLoop packetLoop = new TMLForLoop("packetLoop", referenceObject);
packetLoop.setInit("j=0");
packetLoop.setCondition("j<pktlen-1");
packetLoop.setIncrement("j=j+1");
activity.addLinkElement(mainChoice, packetLoop);
mainChoice.addGuard("requestedOutput == " + i);
mainChoice.addGuard("requestedOutput == " + index);
// Inside packetloop
sendEvt = new TMLSendEvent("info on packet", referenceObject);
......
......@@ -358,10 +358,12 @@ public class TranslatedRouter<E> {
inChannel.setDestinationTask(taskINForVC);
Vector<TMLEvent> listOfOutVCEvents = new Vector<TMLEvent>();
Vector<Integer> listOfIndexes = new Vector<>();
for (int dom = 0; dom < NB_OF_PORTS; dom++) {
if (playingTheRoleOfPrevious[dom] != null) {
TMLEvent evt = routeEvtVCs[portNb][vcNb][dom];
listOfOutVCEvents.add(evt);
listOfIndexes.add(new Integer(dom));
evt.setOriginTask(taskINForVC);
}
}
......@@ -370,7 +372,7 @@ public class TranslatedRouter<E> {
feedback.setOriginTask(taskINForVC);
taskINForVC.generate(pktInEvtsVCs[portNb][vcNb], inFeedbacks, inChannel,
feedback, listOfOutVCEvents, noc.size, xPos, yPos);
feedback, listOfOutVCEvents, listOfIndexes, noc.size, xPos, yPos);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment