From b3b1fc908e8eefd2031bae6c671553e86bc5b982 Mon Sep 17 00:00:00 2001 From: Andrea Enrici <andrea.enrici@nokia.com> Date: Wed, 22 Apr 2015 11:51:24 +0000 Subject: [PATCH] added conversion of ctx for CPs --- src/tmltranslator/ctranslator/DoubleDmaMEC.java | 14 +++++++------- src/tmltranslator/ctranslator/SingleDmaMEC.java | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/tmltranslator/ctranslator/DoubleDmaMEC.java b/src/tmltranslator/ctranslator/DoubleDmaMEC.java index dc4b44979c..831c1df04f 100755 --- a/src/tmltranslator/ctranslator/DoubleDmaMEC.java +++ b/src/tmltranslator/ctranslator/DoubleDmaMEC.java @@ -113,19 +113,19 @@ public class DoubleDmaMEC extends CPMEC { switch( transferType ) { case CPMEC.mem2IP: - exec_code = TAB + "embb_mem2ip(&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", /*USER TODO: *SRC */, " + sizeString + " );" + CR; - init_code = TAB + archMEC.getCtxInitCode() + "(&" + ctxName + ", " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; + exec_code = TAB + "embb_mem2ip((EMBB_CONTEXT *)&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", /*USER TODO: *SRC */, " + sizeString + " );" + CR; + init_code = TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + ", " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName + ");"; break; case CPMEC.IP2mem: - exec_code = TAB + "embb_ip2mem( /* USER TODO: *DST */, &" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; - init_code = TAB + archMEC.getCtxInitCode() + "(&" + ctxName + ", " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; + exec_code = TAB + "embb_ip2mem( /* USER TODO: *DST */, (EMBB_CONTEXT *)&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; + init_code = TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + ", " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName + ");"; break; case CPMEC.IP2IP: - exec_code = TAB + "embb_ip2ip(&" + ctxName + "_0, (uintptr_t) " + memoryBaseAddress + ", &" + ctxName + "_1, (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; - init_code = TAB + archMEC.getCtxInitCode() + "(&" + ctxName + "_0, " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; - init_code += TAB + archMEC.getCtxInitCode() + "(&" + ctxName + "_1, " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; + exec_code = TAB + "embb_ip2ip((EMBB_CONTEXT *)&" + ctxName + "_0, (uintptr_t) " + memoryBaseAddress + ", (EMBB_CONTEXT *)&" + ctxName + "_1, (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; + init_code = TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + "_0, " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; + init_code += TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + "_1, " + "(uintptr_t) " + memoryBaseAddress + " );" + CR; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName + "_0);"; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName + "_1);"; break; diff --git a/src/tmltranslator/ctranslator/SingleDmaMEC.java b/src/tmltranslator/ctranslator/SingleDmaMEC.java index 53bc09a615..2f73a3b1df 100755 --- a/src/tmltranslator/ctranslator/SingleDmaMEC.java +++ b/src/tmltranslator/ctranslator/SingleDmaMEC.java @@ -102,24 +102,24 @@ public class SingleDmaMEC extends CPMEC { switch( transferType ) { case CPMEC.mem2IP: - exec_code = TAB + "embb_mem2ip(&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", /*USER TODO: *SRC */, " + sizeString + " );" + CR; - init_code = TAB + archMEC.getCtxInitCode() + "(&" + ctxName + ", " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; + exec_code = TAB + "embb_mem2ip((EMBB_CONTEXT *)&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", /*USER TODO: *SRC */, " + sizeString + " );" + CR; + init_code = TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + ", " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName +");"; break; case CPMEC.IP2mem: - exec_code = TAB + "embb_ip2mem( /* USER TODO: *DST */, &" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; - init_code = TAB + archMEC.getCtxInitCode() + "(&" + ctxName + ", " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; + exec_code = TAB + "embb_ip2mem( /* USER TODO: *DST */, (EMBB_CONTEXT *)&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; + init_code = TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + ", " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName +");"; break; case CPMEC.IP2IP: - exec_code = TAB + "embb_ip2ip(&" + ctxName + "_0, (uintptr_t) " + memoryBaseAddress + ", &" + ctxName + "_1, (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; - init_code = TAB + archMEC.getCtxInitCode() + "(&" + ctxName + "_0, " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; - init_code += TAB + archMEC.getCtxInitCode() + "(&" + ctxName + "_1, " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; + exec_code = TAB + "embb_ip2ip((EMBB_CONTEXT *)&" + ctxName + "_0, (uintptr_t) " + memoryBaseAddress + ", (EMBB_CONTEXT *)&" + ctxName + "_1, (uintptr_t) " + memoryBaseAddress + ", " + sizeString + " );" + CR; + init_code = TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + "_0, " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; + init_code += TAB + archMEC.getCtxInitCode() + "((EMBB_CONTEXT *)&" + ctxName + "_1, " + "(uintptr_t) " + archMEC.getLocalMemoryPointer() + " );" + CR; cleanup_code = TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName +"_0);"; cleanup_code += TAB + archMEC.getCtxCleanupCode() + "(&" + ctxName +"_1);"; break; default: - exec_code = TAB + "embb_mem2ip(&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", /*USER TODO: *SRC */, " + sizeString + " );" + CR; + exec_code = TAB + "embb_mem2ip((EMBB_CONTEXT *)&" + ctxName + ", (uintptr_t) " + memoryBaseAddress + ", /*USER TODO: *SRC */, " + sizeString + " );" + CR; break; } -- GitLab