Commit 8af27d2c authored by Ludovic Apvrille's avatar Ludovic Apvrille

Solving bugs on network gen

parent f909a8cb
......@@ -144,6 +144,8 @@ public class HwNoC extends HwCommunicationNode {
HashMap<String, Point> map = new HashMap<>();
placement = placement.trim();
TraceManager.addDev("Placement:" + placement);
if (placement.length() == 0) {
return map;
}
......@@ -191,9 +193,11 @@ public class HwNoC extends HwCommunicationNode {
for(String s: placementMap.keySet()) {
Point p = placementMap.get(s);
if (p.x == x && p.y == y) {
TraceManager.addDev("Found " + s + " for x=" + x + " y=" +y);
return s;
}
}
TraceManager.addDev("Returning null for x=" + x + " y=" +y);
return null;
}
......
......@@ -234,6 +234,12 @@ public class TMLTextSpecification<E> {
sb += SP + ch.getMax();
}
TraceManager.addDev("Declaration. Handling channel " + ch.getName());
if (ch.getOriginTask() == null) {
TraceManager.addDev("Missing origin Task in " + ch.getName());
}
if (ch.getDestinationTask() == null) {
TraceManager.addDev("Missing destination Task in " + ch.getName());
}
sb += SP + "OUT" + SP + ch.getOriginTask().getName() + SP + "IN" + SP + ch.getDestinationTask().getName() + CR;
if (ch.isLossy()) {
......
......@@ -135,23 +135,23 @@ public class TranslatedRouter<E> {
int i, j;
TMLTask t;
TMLModeling tmlm = tmlmap.getTMLModeling();
HwExecutionNode execNode = null;
// MUX for the different writing tasks
// For each writing channel of the corresponding CPU, we need MUX to be created.
// We first get the corresponding CPU
String nameOfExecNode = noc.getHwExecutionNode(xPos, yPos);
HwExecutionNode execNode = tmlmap.getTMLArchitecture().getHwExecutionNodeByName(nameOfExecNode);
if (nameOfExecNode == null) {
nameOfExecNode = "fakeCPU_" + xPos + "_" + yPos;
}
if (execNode == null) {
TraceManager.addDev("Could NOT find an exec node for (" + xPos + "," + yPos + ")");
} else {
TraceManager.addDev("Found an exec node for (" + xPos + "," + yPos + "): " + execNode.getName());
execNode = tmlmap.getTMLArchitecture().getHwExecutionNodeByName(nameOfExecNode);
if (execNode == null) {
TraceManager.addDev("Could NOT find an exec node for (" + xPos + "," + yPos + ")");
} else {
TraceManager.addDev("Found an exec node for (" + xPos + "," + yPos + "): " + execNode.getName());
}
}
// Then, we need to find the channels starting from/arriving to a task mapped on this execNode
......@@ -258,7 +258,7 @@ public class TranslatedRouter<E> {
for (int portNb = 0; portNb < NB_OF_PORTS; portNb++) {
if (fromPreviousRouters[portNb] != null) {
TaskINForDispatch inDispatch = new TaskINForDispatch("IN_" + execNode, null,
TaskINForDispatch inDispatch = new TaskINForDispatch("IN_" + nameOfExecNode, null,
null);
tmlm.addTask(inDispatch);
Vector<TMLEvent> listOfOutEvents = new Vector<TMLEvent>();
......@@ -300,7 +300,7 @@ public class TranslatedRouter<E> {
if (fromPreviousRouters[portNb] != null) {
for (int vcNb = 0; vcNb < nbOfVCs; vcNb++) {
TaskINForVC taskINForVC = new TaskINForVC("IN_" + execNode + "_" + vcNb, null,
TaskINForVC taskINForVC = new TaskINForVC("IN_" + nameOfExecNode + "_" + vcNb, null,
null);
tmlm.addTask(taskINForVC);
dispatchInVCs[portNb][vcNb] = taskINForVC;
......@@ -341,7 +341,7 @@ public class TranslatedRouter<E> {
TranslatedRouter routerToConnectWith = main.getRouterFrom(xPos, yPos, portNb);
if (routerToConnectWith != null) {
if (TMAP2Network.hasRouterAt(xPos, yPos, portNb, noc.size)) {
TaskOUTForVC taskOUTForVC = new TaskOUTForVC("OUTVC_" + execNode + "_" + vcNb, null,
TaskOUTForVC taskOUTForVC = new TaskOUTForVC("OUTVC_" + nameOfExecNode + "_" + vcNb, null,
null);
tmlm.addTask(taskOUTForVC);
dispatchOutVCs[portNb][vcNb] = taskOUTForVC;
......@@ -375,7 +375,7 @@ public class TranslatedRouter<E> {
for (int portNb = 0; portNb < NB_OF_PORTS; portNb++) {
if (toNextRouters[portNb] != null) {
TaskOUTForDispatch outDispatch = new TaskOUTForDispatch("OUT_" + execNode, null,
TaskOUTForDispatch outDispatch = new TaskOUTForDispatch("OUT_" + nameOfExecNode, null,
null);
tmlm.addTask(outDispatch);
......
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