Skip to content
Snippets Groups Projects
Commit 96cd9c7e authored by Daniela Genius's avatar Daniela Genius
Browse files

modification channel mappings

parent 6641fa16
No related branches found
No related tags found
No related merge requests found
...@@ -199,12 +199,13 @@ public class TasksAndMainGenerator { ...@@ -199,12 +199,13 @@ public class TasksAndMainGenerator {
//for(AvatarRelation ar: avspec.getRelations()) { //for(AvatarRelation ar: avspec.getRelations()) {
for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) {
//for(AvatarChannel ar: avspec.getChannels()) { //for(AvatarChannel ar: avspec.getChannels()) {
for(AvatarChannel channel: ram.getChannels()){ //for(AvatarChannel channel: ram.getChannels()){
for(AvatarRelation ar: avspec.getRelations()) {//DG 15.05.2017
mainFile.appendToBeforeMainCode("#define CHANNEL"+d+" __attribute__((section(\"section_channel"+d+"\")))" + CR ); mainFile.appendToBeforeMainCode("#define CHANNEL"+d+" __attribute__((section(\"section_channel"+d+"\")))" + CR );
mainFile.appendToBeforeMainCode("#define LOCK"+d+" __attribute__((section(\"section_lock"+d+"\")))" + CR );//one lock per channel mainFile.appendToBeforeMainCode("#define LOCK"+d+" __attribute__((section(\"section_lock"+d+"\")))" + CR );//one lock per channel
d++; d++;
}
}
mainFile.appendToBeforeMainCode("#define base(arg) arg" + CR2 ); mainFile.appendToBeforeMainCode("#define base(arg) arg" + CR2 );
...@@ -215,6 +216,9 @@ public class TasksAndMainGenerator { ...@@ -215,6 +216,9 @@ public class TasksAndMainGenerator {
mainFile.appendToMainCode("pthread_attr_t *attr_t = malloc(sizeof(pthread_attr_t));" +CR); mainFile.appendToMainCode("pthread_attr_t *attr_t = malloc(sizeof(pthread_attr_t));" +CR);
mainFile.appendToMainCode("pthread_attr_init(attr_t);" + CR ); mainFile.appendToMainCode("pthread_attr_init(attr_t);" + CR );
mainFile.appendToMainCode("pthread_mutex_init(&__mainMutex, NULL);" +CR2); mainFile.appendToMainCode("pthread_mutex_init(&__mainMutex, NULL);" +CR2);
}
}
} }
public void makeSynchronousChannels() { public void makeSynchronousChannels() {
...@@ -226,7 +230,9 @@ public class TasksAndMainGenerator { ...@@ -226,7 +230,9 @@ public class TasksAndMainGenerator {
for(AvatarRelation ar: avspec.getRelations()) { for(AvatarRelation ar: avspec.getRelations()) {
if (!ar.isAsynchronous()) { if (!ar.isAsynchronous()) {
ar.setId(j); j++; //ar.setId(j);
ar.setId(i);//DG 15.05.2017
j++;
for(i=0; i<ar.nbOfSignals() ; i++) { for(i=0; i<ar.nbOfSignals() ; i++) {
mainFile.appendToHCode("extern syncchannel __" + getChannelName(ar, i) + ";" + CR); mainFile.appendToHCode("extern syncchannel __" + getChannelName(ar, i) + ";" + CR);
...@@ -273,9 +279,10 @@ public class TasksAndMainGenerator { ...@@ -273,9 +279,10 @@ public class TasksAndMainGenerator {
mainFile.appendToBeforeMainCode("uint8_t "+getChannelName(ar, i) +"_data[32] CHANNEL"+ar.getId()+";" + CR); mainFile.appendToBeforeMainCode("uint8_t "+getChannelName(ar, i) +"_data[32] CHANNEL"+ar.getId()+";" + CR);
mainFile.appendToBeforeMainCode("struct mwmr_s "+getChannelName(ar, i) +" CHANNEL"+ar.getId()+";" + CR2); mainFile.appendToBeforeMainCode("struct mwmr_s "+getChannelName(ar, i) +" CHANNEL"+ar.getId()+";" + CR2);
} }
} }
} }
} }
public void makeAsynchronousChannels() { public void makeAsynchronousChannels() {
......
...@@ -73,12 +73,16 @@ ...@@ -73,12 +73,16 @@
package ddtranslatorSoclib.toTopCell; package ddtranslatorSoclib.toTopCell;
import ddtranslatorSoclib.*; import ddtranslatorSoclib.*;
import java.util.*; import java.util.*;
import avatartranslator.AvatarRelation;
import avatartranslator.AvatarSpecification;
public class Deployinfo { public class Deployinfo {
private final static String CR = "\n"; private final static String CR = "\n";
private final static String CR2 = "\n\n"; private final static String CR2 = "\n\n";
public static AvatarSpecification avspec;//DG 15.05.2017
/* for the moment, this is specific to PowerPC */ /* for the moment, this is specific to PowerPC */
public static String getDeployInfo() { public static String getDeployInfo() {
...@@ -173,8 +177,12 @@ deployinfo = deployinfo + "#define DEPLOY_RAM" + ram.getNo_ram() + "_ADDR 0x" + ...@@ -173,8 +177,12 @@ deployinfo = deployinfo + "#define DEPLOY_RAM" + ram.getNo_ram() + "_ADDR 0x" +
deployinfo_map += "#define MAP_A\\" + CR; deployinfo_map += "#define MAP_A\\" + CR;
for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) { for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) {
if (!(ram.getChannels().isEmpty())){ //if (!(ram.getChannels().isEmpty())){
for (AvatarChannel channel : ram.getChannels()) { // for (AvatarChannel channel : ram.getChannels()) {
//DG 15.05.2017
for (AvatarRelation relation : avspec.getRelations()) {
//if (!(ram.getRelations().isEmpty())){
deployinfo_map = deployinfo_map +"\n .channel"+i+" : { \\" + CR; deployinfo_map = deployinfo_map +"\n .channel"+i+" : { \\" + CR;
deployinfo_map = deployinfo_map + "*(section_channel"+i+ ")\\"+ CR; deployinfo_map = deployinfo_map + "*(section_channel"+i+ ")\\"+ CR;
...@@ -183,7 +191,9 @@ deployinfo = deployinfo + "#define DEPLOY_RAM" + ram.getNo_ram() + "_ADDR 0x" + ...@@ -183,7 +191,9 @@ deployinfo = deployinfo + "#define DEPLOY_RAM" + ram.getNo_ram() + "_ADDR 0x" +
} }
i=0; i=0;
for (AvatarChannel channel : ram.getChannels()) { // for (AvatarChannel channel : ram.getChannels()) {
for (AvatarRelation relation : avspec.getRelations()) {
//DG 15.05.2017
deployinfo_map = deployinfo_map +"\n .lock"+i+" : { \\" + CR; deployinfo_map = deployinfo_map +"\n .lock"+i+" : { \\" + CR;
deployinfo_map = deployinfo_map + "*(section_lock"+i+ ")\\"+ CR; deployinfo_map = deployinfo_map + "*(section_lock"+i+ ")\\"+ CR;
// if(use_vcilocks) deployinfo_map=deployinfo_map+ "} > vci_locks\\"+ CR; // if(use_vcilocks) deployinfo_map=deployinfo_map+ "} > vci_locks\\"+ CR;
...@@ -191,8 +201,7 @@ deployinfo = deployinfo + "#define DEPLOY_RAM" + ram.getNo_ram() + "_ADDR 0x" + ...@@ -191,8 +201,7 @@ deployinfo = deployinfo + "#define DEPLOY_RAM" + ram.getNo_ram() + "_ADDR 0x" +
i++; i++;
} }
} }
}
return deployinfo_map; return deployinfo_map;
} }
......
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