Skip to content
Snippets Groups Projects
Commit f7899e37 authored by Letitia Li's avatar Letitia Li
Browse files

HSM Generation fix

parent 6a11fcdd
No related branches found
No related tags found
No related merge requests found
...@@ -1450,7 +1450,9 @@ public class DSEConfiguration implements Runnable { ...@@ -1450,7 +1450,9 @@ public class DSEConfiguration implements Runnable {
x=10; x=10;
for (HwNode node:hwnodes){ for (HwNode node:hwnodes){
if (node instanceof HwBus){ if (node instanceof HwBus){
HwBus hwbus = (HwBus) node;
TMLArchiBUSNode bus = new TMLArchiBUSNode(x, y, ap.getMinX(), ap.getMaxX(), ap.getMinY(), ap.getMaxY(), false, null, ap); TMLArchiBUSNode bus = new TMLArchiBUSNode(x, y, ap.getMinX(), ap.getMaxX(), ap.getMinY(), ap.getMaxY(), false, null, ap);
bus.setPrivacy(hwbus.privacy);
x+=300; x+=300;
bus.setName(node.getName()); bus.setName(node.getName());
ap.addComponent(bus,x,y,false,true); ap.addComponent(bus,x,y,false,true);
...@@ -1620,14 +1622,15 @@ public class DSEConfiguration implements Runnable { ...@@ -1620,14 +1622,15 @@ public class DSEConfiguration implements Runnable {
private void addMemories(Vector<TMLMapping> maps){ private void addMemories(Vector<TMLMapping> maps){
for (TMLMapping map: maps){ for (TMLMapping map: maps){
TMLArchitecture arch = map.getArch(); TMLArchitecture arch = map.getArch();
ArrayList<HwExecutionNode> nodes = map.getNodes(); ArrayList<HwNode> nodes = arch.getCPUs();
for (HwExecutionNode node:nodes){ for (HwNode node:nodes){
HwBus bus = new HwMemory("bus " +node.getName()); HwBus bus = new HwBus("bus " +node.getName());
bus.privacy=1;
HwMemory mem = new HwMemory("memory " +node.getName()); HwMemory mem = new HwMemory("memory " +node.getName());
HwLink hwlink = new HwLink("link_memory" +node.getName() + "_to_memorybus); HwLink hwlink = new HwLink("link_memory" +node.getName() + "_to_memorybus");
hwlink.bus=bus; hwlink.bus=bus;
hwlink.hwnode=node; hwlink.hwnode=node;
HwLink hwlink2 = new HwLink("link_" +node.getName() + "_to_memorybus); HwLink hwlink2 = new HwLink("link_" +node.getName() + "_to_memorybus");
hwlink2.bus=bus; hwlink2.bus=bus;
hwlink2.hwnode=mem; hwlink2.hwnode=mem;
arch.addHwNode(mem); arch.addHwNode(mem);
......
...@@ -56,8 +56,6 @@ public class TMLMapping { ...@@ -56,8 +56,6 @@ public class TMLMapping {
private TMLModeling tmlm; private TMLModeling tmlm;
private TMLArchitecture tmla; private TMLArchitecture tmla;
private TMLCP tmlcp; private TMLCP tmlcp;
public List<String> securityPatterns = new ArrayList<String>();
private ArrayList<HwExecutionNode> onnodes; private ArrayList<HwExecutionNode> onnodes;
private ArrayList<TMLTask> mappedtasks; private ArrayList<TMLTask> mappedtasks;
private ArrayList<HwCommunicationNode> oncommnodes; private ArrayList<HwCommunicationNode> oncommnodes;
...@@ -111,14 +109,23 @@ public List<String> securityPatterns = new ArrayList<String>(); ...@@ -111,14 +109,23 @@ public List<String> securityPatterns = new ArrayList<String>();
} }
public ArrayList<SecurityPattern> getMappedPatterns(HwMemory mem){ public ArrayList<SecurityPattern> getMappedPatterns(HwMemory mem){
ArrayList<SecurityPattern> l = new ArrayList<SecurityPattern>(); ArrayList<SecurityPattern> l = new ArrayList<SecurityPattern>();
for (SecurityPattern sp: mappedSecurity.keySet()){ for (SecurityPattern sp: mappedSecurity.keySet()){
if (mappedSecurity.get(sp).contains(mem)){ if (mappedSecurity.get(sp).contains(mem)){
l.add(sp); l.add(sp);
} }
} }
return l; return l;
} }
public SecurityPattern getSecurityPatternByName(String name){
for (SecurityPattern sp: tmlm.secPatterns){
if (sp.name.equals(name)){
return sp;
}
}
return null;
}
public void makeMinimumMapping() { public void makeMinimumMapping() {
HwCPU cpu; HwCPU cpu;
HwMemory mem; HwMemory mem;
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment