Commit d9ed9aca authored by apvrille's avatar apvrille

Update on routing between evets

parent 826f8a84
......@@ -170,39 +170,39 @@ public class TaskINForVC extends TMLTask {
TMLChoice firstRoutingChoice = new TMLChoice("firstRoutingChoice", referenceObject);
activity.addLinkElement(secondSeq, firstRoutingChoice);
TMLActionState requested3 = new TMLActionState("requested3", referenceObject);
requested3.setAction("requestedOutput = 1");
activity.addLinkElement(firstRoutingChoice, requested3);
TMLActionState requested1 = new TMLActionState("requested1", referenceObject);
requested1.setAction("requestedOutput = 1");
activity.addLinkElement(firstRoutingChoice, requested1);
firstRoutingChoice.addGuard("dstX>x");
activity.addLinkElement(requested3, new TMLStopState("stopOfRequest3", referenceObject));
activity.addLinkElement(requested1, new TMLStopState("stopOfRequest1", referenceObject));
TMLActionState requested2 = new TMLActionState("requested2", referenceObject);
requested2.setAction("requestedOutput = 0");
activity.addLinkElement(firstRoutingChoice, requested2);
TMLActionState requested0 = new TMLActionState("requested0", referenceObject);
requested0.setAction("requestedOutput = 0");
activity.addLinkElement(firstRoutingChoice, requested0);
firstRoutingChoice.addGuard("dstX<x");
activity.addLinkElement(requested2, new TMLStopState("stopOfRequest2", referenceObject));
activity.addLinkElement(requested0, new TMLStopState("stopOfRequest0", referenceObject));
TMLChoice secondRoutingChoice = new TMLChoice("secondRoutingChoice", referenceObject);
activity.addLinkElement(firstRoutingChoice, secondRoutingChoice);
firstRoutingChoice.addGuard("dstX==x");
TMLActionState requested0 = new TMLActionState("requested0", referenceObject);
requested0.setAction("requestedOutput = 3");
activity.addLinkElement(secondRoutingChoice, requested0);
firstRoutingChoice.addGuard("dstY<y");
activity.addLinkElement(requested0, new TMLStopState("stopOfRequest0", referenceObject));
TMLActionState requested3 = new TMLActionState("requested3", referenceObject);
requested3.setAction("requestedOutput = 3");
activity.addLinkElement(secondRoutingChoice, requested3);
secondRoutingChoice.addGuard("dstY<y");
activity.addLinkElement(requested3, new TMLStopState("stopOfRequest3", referenceObject));
TMLActionState requested4 = new TMLActionState("requested4", referenceObject);
requested4.setAction("requestedOutput = 4");
activity.addLinkElement(secondRoutingChoice, requested4);
firstRoutingChoice.addGuard("dstY==y");
secondRoutingChoice.addGuard("dstY==y");
activity.addLinkElement(requested4, new TMLStopState("stopOfRequest4", referenceObject));
TMLActionState requested1 = new TMLActionState("requested1", referenceObject);
requested1.setAction("requestedOutput = 2");
activity.addLinkElement(secondRoutingChoice, requested1);
firstRoutingChoice.addGuard("dstY<y");
activity.addLinkElement(requested1, new TMLStopState("stopOfRequest1", referenceObject));
TMLActionState requested2 = new TMLActionState("requested2", referenceObject);
requested2.setAction("requestedOutput = 2");
activity.addLinkElement(secondRoutingChoice, requested2);
secondRoutingChoice.addGuard("dstY<y");
activity.addLinkElement(requested2, new TMLStopState("stopOfRequest2", referenceObject));
......
......@@ -48,6 +48,7 @@ import java.util.List;
import java.util.Vector;
/**
* Class TranslatedRouter
* Creation: 17/01/2019
......@@ -346,9 +347,11 @@ public class TranslatedRouter<E> {
pktInEvtsVCs[portNb][vcNb].setDestinationTask(taskINForVC);
Vector<TMLEvent> inFeedbacks = new Vector<>();
for (int k = 0; k < TMAP2Network.DOMAIN + 1; k++) {
inFeedbacks.add(routeEvtVCsFeedback[portNb][vcNb][k]);
routeEvtVCsFeedback[portNb][vcNb][k].setDestinationTask(taskINForVC);
for (int k = 0; k < NB_OF_PORTS; k++) {
if (playingTheRoleOfPrevious[k] != null) {
inFeedbacks.add(routeEvtVCsFeedback[portNb][vcNb][k]);
routeEvtVCsFeedback[portNb][vcNb][k].setDestinationTask(taskINForVC);
}
}
TMLChannel inChannel = pktInChsVCs[portNb][vcNb];
......@@ -356,9 +359,11 @@ public class TranslatedRouter<E> {
Vector<TMLEvent> listOfOutVCEvents = new Vector<TMLEvent>();
for (int dom = 0; dom < NB_OF_PORTS; dom++) {
TMLEvent evt = routeEvtVCs[portNb][vcNb][dom];
listOfOutVCEvents.add(evt);
evt.setOriginTask(taskINForVC);
if (playingTheRoleOfPrevious[dom] != null) {
TMLEvent evt = routeEvtVCs[portNb][vcNb][dom];
listOfOutVCEvents.add(evt);
evt.setOriginTask(taskINForVC);
}
}
TMLEvent feedback = playingTheRoleOfNext[portNb].feedbackPerVC[vcNb];
......@@ -387,12 +392,14 @@ public class TranslatedRouter<E> {
Vector<TMLEvent> inPackets = new Vector<>();
Vector<TMLEvent> outFeedbacks = new Vector<>();
for (int k = 0; k < TMAP2Network.DOMAIN + 1; k++) {
inPackets.add(routeEvtVCs[portNb][vcNb][k]);
routeEvtVCs[portNb][vcNb][k].setDestinationTask(taskOUTForVC);
for (int k = 0; k < NB_OF_PORTS; k++) {
if ((playingTheRoleOfNext[k] != null) || (k == NB_OF_PORTS - 1)) {
inPackets.add(routeEvtVCs[k][vcNb][portNb]);
routeEvtVCs[k][vcNb][portNb].setDestinationTask(taskOUTForVC);
outFeedbacks.add(routeEvtVCsFeedback[portNb][vcNb][k]);
routeEvtVCsFeedback[portNb][vcNb][k].setOriginTask(taskOUTForVC);
outFeedbacks.add(routeEvtVCsFeedback[k][vcNb][portNb]);
routeEvtVCsFeedback[k][vcNb][portNb].setOriginTask(taskOUTForVC);
}
}
......@@ -526,22 +533,24 @@ public class TranslatedRouter<E> {
// Between INVC and OUTVC
routeEvtVCs = new TMLEvent[NB_OF_PORTS][nbOfVCs][NB_OF_PORTS];
routeEvtVCsFeedback = new TMLEvent[NB_OF_PORTS][nbOfVCs][NB_OF_PORTS];
for (int i = 0; i < TMAP2Network.DOMAIN + 1; i++) {
for (int i = 0; i < NB_OF_PORTS; i++) {
if ((playingTheRoleOfNext[i] != null) || (i == NB_OF_PORTS - 1)) {
for (int j = 0; j < nbOfVCs; j++) {
for (int k = 0; k < TMAP2Network.DOMAIN + 1; k++) {
routeEvtVCs[i][j][k] = new TMLEvent("evtroute_" + i + "_vc" + j + "_" + k + "_" +
xPos + "_" + yPos, null, 8, true);
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
tmlm.addEvent(routeEvtVCs[i][j][k]);
routeEvtVCsFeedback[i][j][k] = new TMLEvent("evtfeedback_" + i + "_vc" + j + "_" + k + "_" +
xPos + "_" + yPos, null, 8, true);
tmlm.addEvent(routeEvtVCsFeedback[i][j][k]);
for (int k = 0; k < NB_OF_PORTS; k++) {
if ((playingTheRoleOfPrevious[k] != null) || (k == NB_OF_PORTS - 1)) {
routeEvtVCs[i][j][k] = new TMLEvent("evtroute_" + i + "_vc" + j + "_" + k + "_" +
xPos + "_" + yPos, null, 8, true);
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
routeEvtVCs[i][j][k].addParam(new TMLType(TMLType.NATURAL));
tmlm.addEvent(routeEvtVCs[i][j][k]);
routeEvtVCsFeedback[i][j][k] = new TMLEvent("evtfeedback_" + i + "_vc" + j + "_" + k + "_" +
xPos + "_" + yPos, null, 8, true);
tmlm.addEvent(routeEvtVCsFeedback[i][j][k]);
}
}
}
}
......@@ -549,9 +558,9 @@ public class TranslatedRouter<E> {
// Between OUTVC and OUT
evtOutVCs = new TMLEvent[TMAP2Network.DOMAIN + 1][nbOfVCs];
evtSelectVC = new TMLEvent[TMAP2Network.DOMAIN + 1][nbOfVCs];
for (int i = 0; i < TMAP2Network.DOMAIN + 1; i++) {
evtOutVCs = new TMLEvent[NB_OF_PORTS][nbOfVCs];
evtSelectVC = new TMLEvent[NB_OF_PORTS][nbOfVCs];
for (int i = 0; i < NB_OF_PORTS; i++) {
if ((playingTheRoleOfPrevious[i] != null) || (i == NB_OF_PORTS - 1)) {
for (int j = 0; j < nbOfVCs; j++) {
evtOutVCs[i][j] = new TMLEvent("evt_out" + i + "_vc" + j + "_" + 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