Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 127)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 128)
@@ -15,80 +15,110 @@
 // ======================================================================
 #define ALLOC0(var,type)                        \
-  var = new type
-
-#define ALLOC1(var,type,s1)                      \
-  var = new type [s1]
-  
+  do                                            \
+    {                                           \
+      var = new type;                           \
+    } while (0)
+
+#define ALLOC1(var,type,s1)                     \
+  do                                            \
+    {                                           \
+      var = new type [s1];                      \
+    } while (0)
+
 #define ALLOC2(var,type,s1,s2)                   \
-  var = new type * [s1];                         \
-  for (uint32_t it1=0; it1<s1; ++it1)            \
+  do                                             \
     {                                            \
-      var [it1] = new type [s2];                 \
-    }
+      var = new type * [s1];                     \
+      for (uint32_t it1=0; it1<s1; ++it1)        \
+        {                                        \
+          var [it1] = new type [s2];             \
+        }                                        \
+    } while (0)
 
 #define ALLOC3(var,type,s1,s2,s3)                \
-  var = new type ** [s1];                        \
-  for (uint32_t it1=0; it1<s1; ++it1)            \
+  do                                             \
     {                                            \
-      var [it1] = new type * [s2];               \
-      for (uint32_t it2=0; it2<s2; ++it2)        \
+      var = new type ** [s1];                    \
+      for (uint32_t it1=0; it1<s1; ++it1)        \
         {                                        \
-          var [it1][it2] = new type [s3];        \
+          var [it1] = new type * [s2];           \
+          for (uint32_t it2=0; it2<s2; ++it2)    \
+            {                                    \
+              var [it1][it2] = new type [s3];    \
+            }                                    \
         }                                        \
-    }
-  
+    } while (0)
+
 #define ALLOC4(var,type,s1,s2,s3,s4)                    \
-  var = new type *** [s1];                              \
-  for (uint32_t it1=0; it1<s1; ++it1)                   \
+  do                                                    \
     {                                                   \
-      var [it1] = new type ** [s2];                     \
-      for (uint32_t it2=0; it2<s2; ++it2)               \
+      var = new type *** [s1];                          \
+      for (uint32_t it1=0; it1<s1; ++it1)               \
         {                                               \
-          var [it1][it2] = new type * [s3];             \
-          for (uint32_t it3=0; it3<s3; ++it3)           \
+          var [it1] = new type ** [s2];                 \
+          for (uint32_t it2=0; it2<s2; ++it2)           \
             {                                           \
-              var [it1][it2][it3] = new type [s4];      \
+              var [it1][it2] = new type * [s3];         \
+              for (uint32_t it3=0; it3<s3; ++it3)       \
+                {                                       \
+                  var [it1][it2][it3] = new type [s4];  \
+                }                                       \
             }                                           \
         }                                               \
-    }
+    } while (0)
 
 #define DELETE0(var)                            \
-  delete var;
-  
-#define DELETE1(var,s1)                          \
-  delete [] var;
-
-#define DELETE2(var,s1,s2)                       \
-  for (uint32_t it1=0; it1<s1; ++it1)            \
+  do                                            \
+    {                                           \
+      delete var;                               \
+    } while (0)
+
+#define DELETE1(var,s1)                         \
+  do                                            \
+    {                                           \
+      delete [] var;                            \
+    } while (0)
+
+#define DELETE2(var,s1,s2)                      \
+  do                                            \
     {                                            \
-      delete [] var [it1];                       \
-    }                                            \
-  delete [] var;                         
-  
+      for (uint32_t it1=0; it1<s1; ++it1)        \
+        {                                        \
+          delete [] var [it1];                   \
+        }                                        \
+      delete [] var;                             \
+    } while (0)
+
 #define DELETE3(var,s1,s2,s3)                    \
-  for (uint32_t it1=0; it1<s1; ++it1)            \
+  do                                             \
     {                                            \
-      for (uint32_t it2=0; it2<s2; ++it2)        \
+      for (uint32_t it1=0; it1<s1; ++it1)        \
         {                                        \
-          delete [] var [it1][it2];              \
+          for (uint32_t it2=0; it2<s2; ++it2)    \
+            {                                    \
+              delete [] var [it1][it2];          \
+            }                                    \
+          delete [] var [it1];                   \
         }                                        \
-      delete [] var [it1];                       \
-    }                                            \
-  delete [] var;
-  
-#define DELETE4(var,s1,s2,s3,s4)                 \
-  for (uint32_t it1=0; it1<s1; ++it1)            \
-    {                                            \
-      for (uint32_t it2=0; it2<s2; ++it2)        \
-        {                                        \
-          for (uint32_t it3=0; it3<s3; ++it3)    \
-            {                                    \
-              delete [] var [it1][it2][it3];     \
-            }                                    \
-          delete [] var [it1][it2];              \
-        }                                        \
-      delete [] var [it1];                       \
-    }                                            \
-  delete [] var;                                        
+      delete [] var;                             \
+    } while (0)
+
+#define DELETE4(var,s1,s2,s3,s4)                        \
+  do                                                    \
+    {                                                   \
+      for (uint32_t it1=0; it1<s1; ++it1)               \
+        {                                               \
+          for (uint32_t it2=0; it2<s2; ++it2)           \
+            {                                           \
+              for (uint32_t it3=0; it3<s3; ++it3)       \
+                {                                       \
+                  delete [] var [it1][it2][it3];        \
+                }                                       \
+              delete [] var [it1][it2];                 \
+            }                                           \
+          delete [] var [it1];                          \
+        }                                               \
+      delete [] var;                                    \
+    } while (0)
 
 // ======================================================================
@@ -108,7 +138,8 @@
 
 #define __ALLOC0_SIGNAL(sig, name, type)        \
-  {                                             \
-    sig = new type (name);                      \
-  }
+  do                                            \
+    {                                           \
+      sig = new type (name);                    \
+    } while (0)
 
 #ifdef POSITION
@@ -125,94 +156,127 @@
 
 #define ALLOC0_VAL_ACK_IN(  sig, name, type)                            \
-  {                                                                     \
-    sig = interface->set_signal_valack_in (name, type);                 \
-  }                                                                     
+  do                                                                    \
+    {                                                                   \
+      sig = interface->set_signal_valack_in (name, type);               \
+    } while (0)
+
 #define ALLOC0_VAL_ACK_OUT( sig, name, type)                            \
-  {                                                                     \
-    sig = interface->set_signal_valack_out(name, type);                 \
-  }                                                                     
+  do                                                                    \
+    {                                                                   \
+      sig = interface->set_signal_valack_out(name, type);               \
+    } while (0)
+                                                                  
 #define ALLOC0_VALACK_IN(     sig, type)                                \
-  {                                                                     \
-    sig = interface->set_signal_valack_in (type);                       \
-  }                                                                     
-#define ALLOC0_VALACK_OUT(    sig, type)                                 \
-  {                                                                     \
-    sig = interface->set_signal_valack_out(type);                       \
-  }                                                                     
-#define ALLOC0_SIGNAL_IN(  sig, name, type, size)                        \
-  if (size > 0)                                                         \
-    {                                                                   \
-      sig = interface->set_signal_in <type> (name, size);               \
-    }                                                                   \
-  else                                                                  \
-    {                                                                   \
-      PRINT_SIZE_NUL(_component,interface,name);                        \
-    }
-  
-#define ALLOC0_SIGNAL_OUT( sig, name, type, size)                        \
-  if (size > 0)                                                         \
-    {                                                                   \
-      sig = interface->set_signal_out<type> (name, size);               \
-    }                                                                   \
-  else                                                                  \
-    {                                                                   \
-      PRINT_SIZE_NUL(_component,interface,name); \
-    }
+  do                                                                    \
+    {                                                                   \
+      sig = interface->set_signal_valack_in (type);                     \
+    } while (0)
+                                                                    
+#define ALLOC0_VALACK_OUT(    sig, type)                                \
+  do                                                                    \
+    {                                                                   \
+      sig = interface->set_signal_valack_out(type);                     \
+    } while (0)
+                                                                     
+#define ALLOC0_SIGNAL_IN(  sig, name, type, size)                       \
+  do                                                                    \
+    {                                                                   \
+      if (size > 0)                                                     \
+        {                                                               \
+          sig = interface->set_signal_in <type> (name, size);           \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          PRINT_SIZE_NUL(_component,interface,name);                    \
+        }                                                               \
+    } while (0)
+
+#define ALLOC0_SIGNAL_OUT( sig, name, type, size)                       \
+  do                                                                    \
+    {                                                                   \
+      if (size > 0)                                                     \
+        {                                                               \
+          sig = interface->set_signal_out<type> (name, size);           \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          PRINT_SIZE_NUL(_component,interface,name);                    \
+        }                                                               \
+    } while (0)
 
 #define DELETE0_SIGNAL( sig, size)                                      \
-  if (size > 0)                                                         \
-    {                                                                   \
+  do                                                                    \
+    {                                                                   \
+      if (size > 0)                                                     \
+        {                                                               \
+          delete sig;                                                   \
+        }                                                               \
+    } while (0)
+
+#define ALLOC0_FOREIGN_SIGNAL_IN(  sig, interface, name, type, size)    \
+  do                                                                    \
+    {                                                                   \
+      if (size > 0)                                                     \
+        {                                                               \
+          std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \
+          sig = new SC_IN    (type) (str.c_str());                      \
+        }                                                               \
+    } while (0)
+
+#define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size)    \
+  do                                                                    \
+    {                                                                   \
+      if (size > 0)                                                     \
+        {                                                               \
+          std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \
+          sig = new SC_OUT   (type) (str.c_str());                      \
+        }                                                               \
+    } while (0)
+
+#define DELETE0_FOREIGN_SIGNAL( sig, size)                              \
+  do                                                                    \
+    {                                                                   \
+      DELETE0_SIGNAL(sig,size);                                         \
+    } while (0)
+
+#define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size)      \
+  do                                                                    \
+    {                                                                   \
+      if (size > 0)                                                     \
+        {                                                               \
+          INSTANCE_FOREIGN_PRINT(name);                                 \
+          _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \
+        }                                                               \
+    } while (0)
+
+#define ALLOC0_SC_SIGNAL(  sig, name, type)                             \
+  do                                                                    \
+    {                                                                   \
+      sig = new sc_signal<type> (name);                                 \
+      PRINT_SIGNAL_ADDRESS(name,sig);                                   \
+    } while (0)
+
+#define INSTANCE0_SC_SIGNAL(component, sig)                             \
+  do                                                                    \
+    {                                                                   \
+      TEST_SIGNAL(component->sig->name(),component->sig);               \
+      TEST_SIGNAL(sig           ->name(),sig);                          \
+      (*(component->sig)) (*(sig));                                     \
+    } while (0)
+
+#define _INSTANCE0_SC_SIGNAL(component, sig1,sig2)                      \
+  do                                                                    \
+    {                                                                   \
+      TEST_SIGNAL(component->sig1->name(),component->sig1);             \
+      TEST_SIGNAL(sig2           ->name(),sig2);                        \
+      (*(component->sig1)) (*(sig2));                                   \
+    } while (0)
+
+#define DELETE0_SC_SIGNAL( sig)                                         \
+  do                                                                    \
+    {                                                                   \
+      PRINT_SIGNAL_ADDRESS("",sig);                                     \
       delete sig;                                                       \
-    }
-
-#define ALLOC0_FOREIGN_SIGNAL_IN(  sig, interface, name, type, size)    \
-  if (size > 0)                                                         \
-    {                                                                   \
-      std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \
-      sig = new SC_IN    (type) (str.c_str());                          \
-    }
-
-#define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size)    \
-  if (size > 0)                                                         \
-    {                                                                   \
-      std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \
-      sig = new SC_OUT   (type) (str.c_str());                          \
-    }
-
-#define DELETE0_FOREIGN_SIGNAL( sig, size) \
-  {                                        \
-    DELETE0_SIGNAL(sig,size);              \
-  }
-
-#define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size)      \
-  if (size > 0)                                                         \
-    {                                                                   \
-      INSTANCE_FOREIGN_PRINT(name);                                     \
-      _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \
-    }
-
-#define ALLOC0_SC_SIGNAL(  sig, name, type)                             \
-  sig = new sc_signal<type> (name);                                     \
-  PRINT_SIGNAL_ADDRESS(name,sig);
-
-#define INSTANCE0_SC_SIGNAL(component, sig)                    \
-  {                                                            \
-    TEST_SIGNAL(component->sig->name(),component->sig);        \
-    TEST_SIGNAL(sig           ->name(),sig);                   \
-    (*(component->sig)) (*(sig));                              \
-  }
-
-#define _INSTANCE0_SC_SIGNAL(component, sig1,sig2)                      \
-  {                                                                     \
-    TEST_SIGNAL(component->sig1->name(),component->sig1);               \
-    TEST_SIGNAL(sig2           ->name(),sig2);                          \
-    (*(component->sig1)) (*(sig2));                                     \
-  }
-
-#define DELETE0_SC_SIGNAL( sig)                  \
-  {                                              \
-    PRINT_SIGNAL_ADDRESS("",sig);                \
-    delete sig;                                  \
-  }
+    } while (0)
 
 // ----------------------------------------------------------------------
@@ -220,5 +284,5 @@
 // ----------------------------------------------------------------------
 
-#define __ALLOC1_INTERFACE_BEGIN(name, x1)                                    \
+#define __ALLOC1_INTERFACE_BEGIN(name, x1)                              \
   INTERFACE_PRINT(name);                                                \
   const std::string interface_name = name;                              \
@@ -228,24 +292,27 @@
 
 #define __ALLOC1_SIGNAL_IN( sig, name, type)                            \
-  {                                                                     \
-    sig = new SC_IN(type) * [iterator_1];                               \
-    std::string separator="_";                                          \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        std::string str = "in_"+interface_name+separator+toString(it1)+separator+name; \
-        sig [it1] = new SC_IN(type) (str.c_str());                      \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN(type) * [iterator_1];                             \
+      std::string separator="_";                                        \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          std::string str = "in_"+interface_name+separator+toString(it1)+separator+name; \
+          sig [it1] = new SC_IN(type) (str.c_str());                    \
+        }                                                               \
+    } while (0)
+
 
 #define __ALLOC1_SIGNAL_OUT( sig, name, type)                           \
-  {                                                                     \
-    sig = new SC_OUT(type) * [iterator_1];                              \
-    std::string separator="_";                                          \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        std::string str = "out_"+interface_name+separator+toString(it1)+separator+name; \
-        sig [it1] = new SC_OUT(type) (str.c_str());                     \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT(type) * [iterator_1];                            \
+      std::string separator="_";                                        \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          std::string str = "out_"+interface_name+separator+toString(it1)+separator+name; \
+          sig [it1] = new SC_OUT(type) (str.c_str());                   \
+        }                                                               \
+    } while (0)
 
 #ifdef POSITION
@@ -264,5 +331,5 @@
   }
 #else
-#define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1)   \
+#define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -279,148 +346,175 @@
 #endif
 
-#define ALLOC1_INTERFACE_END(x1)                \
-  delete [] interface;
+#define ALLOC1_INTERFACE_END(x1)                                        \
+  do                                                                    \
+    {                                                                   \
+      delete [] interface;                                              \
+    } while (0)
 
 #define ALLOC1_VAL_ACK_IN( sig, name, type)                             \
-  {                                                                     \
-    sig = new SC_IN (Tcontrol_t) * [iterator_1];                        \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        sig [it1] = interface[it1]->set_signal_valack_in (name, type);  \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (Tcontrol_t) * [iterator_1];                      \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          sig [it1] = interface[it1]->set_signal_valack_in (name, type); \
+        }                                                               \
+    } while (0)
+
 #define ALLOC1_VAL_ACK_OUT(sig, name, type)                             \
-  {                                                                     \
-    sig = new SC_OUT(Tcontrol_t) * [iterator_1];                        \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        sig [it1] = interface[it1]->set_signal_valack_out(name, type);  \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT(Tcontrol_t) * [iterator_1];                      \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          sig [it1] = interface[it1]->set_signal_valack_out(name, type); \
+        }                                                               \
+    } while (0)
+
 #define ALLOC1_VALACK_IN(    sig, type)                                 \
-  {                                                                     \
-    sig = new SC_IN (Tcontrol_t) * [iterator_1];                        \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        sig [it1] = interface[it1]->set_signal_valack_in (type);        \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (Tcontrol_t) * [iterator_1];                      \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          sig [it1] = interface[it1]->set_signal_valack_in (type);      \
+        }                                                               \
+    } while (0)
+
 #define ALLOC1_VALACK_OUT(   sig, type)                                 \
-  {                                                                     \
-    sig = new SC_OUT(Tcontrol_t) * [iterator_1];                        \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        sig [it1] = interface[it1]->set_signal_valack_out(type);        \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT(Tcontrol_t) * [iterator_1];                      \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          sig [it1] = interface[it1]->set_signal_valack_out(type);      \
+        }                                                               \
+    } while (0)
+
 #define ALLOC1_SIGNAL_IN( sig, name, type, size)                        \
-  {                                                                     \
-    sig = new SC_IN (type) * [iterator_1];                              \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (type) * [iterator_1];                            \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          if (size > 0)                                                 \
+            {                                                           \
+              sig [it1] = interface[it1]->set_signal_in <type> (name, size); \
+            }                                                           \
+          else                                                          \
+            {                                                           \
+              PRINT_SIZE_NUL(_component,interface[it1],name);           \
+            }                                                           \
+        }                                                               \
+    } while (0)
+
+#define ALLOC1_SIGNAL_OUT(sig, name, type, size)                        \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT(type) * [iterator_1];                            \
+      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
+        {                                                               \
+          if (size > 0)                                                 \
+            {                                                           \
+              sig [it1] = interface[it1]->set_signal_out<type> (name, size); \
+            }                                                           \
+          else                                                          \
+            {                                                           \
+              PRINT_SIZE_NUL(_component,interface[it1],name);           \
+            }                                                           \
+        }                                                               \
+    } while (0)
+
+#define DELETE1_SIGNAL(sig, x1, size)                                   \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          if (size > 0)                                                 \
+            {                                                           \
+              delete sig[it1];                                          \
+            }                                                           \
+        }                                                               \
+      delete [] sig;                                                    \
+    } while (0)
+
+#define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1)   \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (type) * [x1];                                    \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
         if (size > 0)                                                   \
           {                                                             \
-            sig [it1] = interface[it1]->set_signal_in <type> (name, size); \
+            std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \
+            sig [it1] = new SC_IN (type) (str.c_str());                 \
           }                                                             \
-        else                                                            \
+    } while (0)
+
+#define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1)  \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (type) * [x1];                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        if (size > 0)                                                   \
           {                                                             \
-            PRINT_SIZE_NUL(_component,interface[it1],name);             \
+            std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \
+            sig [it1] = new SC_OUT (type) (str.c_str());                \
+          }                                                             \
+    } while (0)
+
+#define DELETE1_FOREIGN_SIGNAL( sig, size,x1)                           \
+  do                                                                    \
+    {                                                                   \
+      DELETE1_SIGNAL(sig,x1,size);                                      \
+    } while (0)
+
+#define ALLOC1_SC_SIGNAL( sig, name, type, x1)                          \
+  do                                                                    \
+    {                                                                   \
+      sig = new sc_signal<type> * [x1];                                 \
+      {                                                                 \
+        std::string separator="_";                                      \
+        std::string str;                                                \
+        for (uint32_t it1=0; it1<x1; it1++)                             \
+          {                                                             \
+            str = name+separator+toString(it1);                         \
+            sig [it1] = new sc_signal<type> (str.c_str());              \
+            PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1]);                 \
           }                                                             \
       }                                                                 \
-  }
-
-#define ALLOC1_SIGNAL_OUT(sig, name, type, size)                        \
-  {                                                                     \
-    sig = new SC_OUT(type) * [iterator_1];                              \
-    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
-      {                                                                 \
-        if (size > 0)                                                   \
-          {                                                             \
-            sig [it1] = interface[it1]->set_signal_out<type> (name, size); \
-          }                                                             \
-        else                                                            \
-          {                                                             \
-            PRINT_SIZE_NUL(_component,interface[it1],name);             \
-          }                                                             \
-      }                                                                 \
-  }
-
-#define DELETE1_SIGNAL(sig, x1, size)                                   \
-  {                                                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        if (size > 0)                                                   \
-          {                                                             \
-            delete sig[it1];                                            \
-          }                                                             \
-      }                                                                 \
-    delete [] sig;                                                      \
-  }
-
-#define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1)   \
-  {                                                                     \
-    sig = new SC_IN (type) * [x1];                                   \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      if (size > 0)                                                     \
-        {                                                               \
-          std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \
-          sig [it1] = new SC_IN (type) (str.c_str());                   \
-        }                                                               \
-  }
-
-#define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1)  \
-  {                                                                     \
-    sig = new SC_OUT (type) * [x1];                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      if (size > 0)                                                     \
-        {                                                               \
-          std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \
-          sig [it1] = new SC_OUT (type) (str.c_str());                  \
-        }                                                               \
-  }
-
-#define DELETE1_FOREIGN_SIGNAL( sig, size,x1)            \
-  {                                                      \
-    DELETE1_SIGNAL(sig,x1,size);                         \
-  }
-
-#define ALLOC1_SC_SIGNAL( sig, name, type, x1)                          \
-  sig = new sc_signal<type> * [x1];                                     \
-  {                                                                     \
-    std::string separator="_";                                          \
-    std::string str;                                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        str = name+separator+toString(it1);                             \
-        sig [it1] = new sc_signal<type> (str.c_str());                  \
-        PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1]);                     \
-      }                                                                 \
-  }
-
-#define INSTANCE1_SC_SIGNAL(component, sig, x1) \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    {                                                                   \
-      TEST_SIGNAL(component->sig [it1]->name(),component->sig [it1]);   \
-      TEST_SIGNAL(sig            [it1]->name(),sig            [it1]);   \
-      (*(component->sig[it1])) (*(sig[it1]));                           \
-    }
-
-#define _INSTANCE1_SC_SIGNAL(component, sig1, sig2, x1) \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    {                                                                   \
-      TEST_SIGNAL(component->sig1 [it1]->name(),component->sig1 [it1]); \
-      TEST_SIGNAL(sig2            [it1]->name(),sig2            [it1]); \
-      (*(component->sig1[it1])) (*(sig2[it1]));                         \
-    }
+    } while (0)
+
+#define INSTANCE1_SC_SIGNAL(component, sig, x1)                         \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          TEST_SIGNAL(component->sig [it1]->name(),component->sig [it1]); \
+          TEST_SIGNAL(sig            [it1]->name(),sig            [it1]); \
+          (*(component->sig[it1])) (*(sig[it1]));                       \
+        }                                                               \
+    } while (0)
+
+#define _INSTANCE1_SC_SIGNAL(component, sig1, sig2, x1)                 \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          TEST_SIGNAL(component->sig1 [it1]->name(),component->sig1 [it1]); \
+          TEST_SIGNAL(sig2            [it1]->name(),sig2            [it1]); \
+          (*(component->sig1[it1])) (*(sig2[it1]));                     \
+        }                                                               \
+    } while (0)
 
 #define DELETE1_SC_SIGNAL(sig, x1)                                      \
-  {                                                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        PRINT_SIGNAL_ADDRESS("",sig[it1]);                         \
-        delete sig[it1];                                                \
-      }                                                                 \
-    delete [] sig;                                                      \
-  }
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          PRINT_SIGNAL_ADDRESS("",sig[it1]);                            \
+          delete sig[it1];                                              \
+        }                                                               \
+      delete [] sig;                                                    \
+    } while (0)
 
 // ----------------------------------------------------------------------
@@ -429,5 +523,5 @@
 
 #ifdef POSITION
-#define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2)   \
+#define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2) \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -449,5 +543,5 @@
   }
 #else
-#define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2)   \
+#define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2) \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -471,99 +565,108 @@
 
 #define ALLOC2_INTERFACE_END(x1, x2)                                    \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    delete [] interface [it1];                                          \
-  delete [] interface;
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        delete [] interface [it1];                                      \
+      delete [] interface;                                              \
+    } while (0)
 
 #define _ALLOC2_VAL_ACK_IN( sig, name, type, x1, x2)                    \
-  {                                                                     \
-    sig = new SC_IN (Tcontrol_t) ** [x1];                               \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (Tcontrol_t) * [x2];                      \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (name, type); \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (Tcontrol_t) ** [x1];                             \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (Tcontrol_t) * [x2];                    \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (name, type); \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC2_VAL_ACK_OUT( sig, name, type, x1, x2)                   \
-  {                                                                     \
-    sig = new SC_OUT (Tcontrol_t) ** [x1];                              \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (Tcontrol_t) * [x2];                     \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (name, type); \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (Tcontrol_t) ** [x1];                            \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (Tcontrol_t) * [x2];                   \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (name, type); \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC2_VALACK_IN(    sig,type, x1, x2)                         \
-  {                                                                     \
-    sig = new SC_IN (Tcontrol_t) ** [x1];                               \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (Tcontrol_t) * [x2];                      \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (type); \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (Tcontrol_t) ** [x1];                             \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (Tcontrol_t) * [x2];                    \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (type); \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC2_VALACK_OUT(    sig,type, x1, x2)                        \
-  {                                                                     \
-    sig = new SC_OUT (Tcontrol_t) ** [x1];                              \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (Tcontrol_t) * [x2];                     \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (type); \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (Tcontrol_t) ** [x1];                            \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (Tcontrol_t) * [x2];                   \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (type); \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC2_SIGNAL_IN( sig, name, type, size, x1, x2)               \
-  {                                                                     \
-    sig = new SC_IN (type) ** [x1];                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (type) * [x2];                            \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            if (size > 0)                                               \
-              {                                                         \
-                sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \
-              }                                                         \
-            else                                                        \
-              {                                                         \
-                PRINT_SIZE_NUL(_component,interface[it1][it2],name);    \
-              }                                                         \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (type) ** [x1];                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (type) * [x2];                          \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              if (size > 0)                                             \
+                {                                                       \
+                  sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \
+                }                                                       \
+              else                                                      \
+                {                                                       \
+                  PRINT_SIZE_NUL(_component,interface[it1][it2],name);  \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC2_SIGNAL_OUT( sig, name, type, size, x1, x2)              \
-  {                                                                     \
-    sig = new SC_OUT (type) ** [x1];                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (type) * [x2];                           \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            if (size > 0)                                               \
-              {                                                         \
-                sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \
-              }                                                         \
-            else                                                        \
-              {                                                         \
-                PRINT_SIZE_NUL(_component,interface[it1][it2],name);    \
-              }                                                         \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (type) ** [x1];                                  \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (type) * [x2];                         \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              if (size > 0)                                             \
+                {                                                       \
+                  sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \
+                }                                                       \
+              else                                                      \
+                {                                                       \
+                  PRINT_SIZE_NUL(_component,interface[it1][it2],name);  \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define ALLOC2_VAL_ACK_IN( sig, name, type      ) _ALLOC2_VAL_ACK_IN( sig, name, type      , iterator_1, iterator_2) 
@@ -575,103 +678,116 @@
 
 #define DELETE2_SIGNAL(sig, x1,x2, size)                                \
-  {                                                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              if (size > 0)                                             \
+                {                                                       \
+                  delete sig[it1][it2];                                 \
+                }                                                       \
+            }                                                           \
+          delete [] sig[it1];                                           \
+        }                                                               \
+      delete [] sig;                                                    \
+    } while (0)
+
+#define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (type) ** [x1];                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (type) * [x2];                          \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            if (size > 0)                                               \
+              {                                                         \
+                std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \
+                sig [it1][it2] = new SC_IN    (type) (str.c_str());     \
+              }                                                         \
+        }                                                               \
+    } while (0)
+
+#define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (type) ** [x1];                                  \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (type) * [x2];                         \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            if (size > 0)                                               \
+              {                                                         \
+                std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \
+                sig [it1][it2] = new SC_IN    (type) (str.c_str());     \
+              }                                                         \
+        }                                                               \
+    } while (0)
+
+#define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2)            \
+  do                                                        \
+    {                                                       \
+      DELETE2_SIGNAL(sig,x1,x2,size);                       \
+    } while (0)
+
+#define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2)                      \
+  do                                                                    \
+    {                                                                   \
+      sig = new sc_signal<type> ** [x1];                                \
       {                                                                 \
+        std::string separator="_";                                      \
+        std::string str;                                                \
+        for (uint32_t it1=0; it1<x1; it1++)                             \
+          {                                                             \
+            sig [it1] = new sc_signal<type> * [x2];                     \
+            for (uint32_t it2=0; it2<x2; it2++)                         \
+              {                                                         \
+                str = name+separator+toString(it1)+separator+toString(it2); \
+                sig [it1][it2] = new sc_signal<type> (str.c_str());     \
+                PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2]);        \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+    } while (0)
+
+#define INSTANCE2_SC_SIGNAL(component, sig, x1, x2)                     \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
         for (uint32_t it2=0; it2<x2; it2++)                             \
           {                                                             \
-            if (size > 0)                                               \
-              {                                                         \
-                delete sig[it1][it2];                                   \
-              }                                                         \
+            TEST_SIGNAL(component->sig  [it1][it2]->name(),component->sig  [it1][it2]); \
+            TEST_SIGNAL(sig             [it1][it2]->name(),sig             [it1][it2]); \
+            (*(component->sig[it1][it2])) (*(sig[it1][it2]));           \
           }                                                             \
-        delete [] sig[it1];                                             \
-      }                                                                 \
-    delete [] sig;                                                      \
-  }
-
-
-#define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \
-  {                                                                     \
-    sig = new SC_IN (type) ** [x1];                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (type) * [x2];                            \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          if (size > 0)                                                 \
-            {                                                           \
-              std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \
-              sig [it1][it2] = new SC_IN    (type) (str.c_str()); \
-            }                                                           \
-      }                                                                 \
-  }
-
-#define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \
-  {                                                                     \
-    sig = new SC_OUT (type) ** [x1];                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (type) * [x2];                           \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          if (size > 0)                                                 \
-            {                                                           \
-              std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \
-              sig [it1][it2] = new SC_IN    (type) (str.c_str());       \
-            }                                                           \
-      }                                                                 \
-  }
-
-#define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2)            \
-  {                                                         \
-    DELETE2_SIGNAL(sig,x1,x2,size);                         \
-  }
-
-#define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2)                      \
-  sig = new sc_signal<type> ** [x1];                                    \
-  {                                                                     \
-    std::string separator="_";                                          \
-    std::string str;                                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new sc_signal<type> * [x2];                         \
+    } while (0)
+
+#define _INSTANCE2_SC_SIGNAL(component, sig1, sig2, x1, x2)             \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
         for (uint32_t it2=0; it2<x2; it2++)                             \
           {                                                             \
-            str = name+separator+toString(it1)+separator+toString(it2); \
-            sig [it1][it2] = new sc_signal<type> (str.c_str());         \
-            PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2]);            \
+            TEST_SIGNAL(component->sig1 [it1][it2]->name(),component->sig1 [it1][it2]); \
+            TEST_SIGNAL(sig2            [it1][it2]->name(),sig2            [it1][it2]); \
+            (*(component->sig1[it1][it2])) (*(sig2[it1][it2]));         \
           }                                                             \
-      }                                                                 \
-  }
-
-#define INSTANCE2_SC_SIGNAL(component, sig, x1, x2)                     \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    for (uint32_t it2=0; it2<x2; it2++)                                 \
-      {                                                                 \
-        TEST_SIGNAL(component->sig  [it1][it2]->name(),component->sig  [it1][it2]); \
-        TEST_SIGNAL(sig             [it1][it2]->name(),sig             [it1][it2]); \
-        (*(component->sig[it1][it2])) (*(sig[it1][it2]));               \
-      }
-
-#define _INSTANCE2_SC_SIGNAL(component, sig1, sig2, x1, x2)             \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    for (uint32_t it2=0; it2<x2; it2++)                                 \
-      {                                                                 \
-        TEST_SIGNAL(component->sig1 [it1][it2]->name(),component->sig1 [it1][it2]); \
-        TEST_SIGNAL(sig2            [it1][it2]->name(),sig2            [it1][it2]); \
-        (*(component->sig1[it1][it2])) (*(sig2[it1][it2]));             \
-      }
+    } while (0)
 
 #define DELETE2_SC_SIGNAL(sig,x1,x2)                                    \
-  {                                                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            PRINT_SIGNAL_ADDRESS("",sig[it1][it2]);                     \
-            delete sig[it1][it2];                                       \
-          }                                                             \
-        delete [] sig[it1];                                             \
-      }                                                                 \
-    delete [] sig;                                                      \
-  }
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              PRINT_SIGNAL_ADDRESS("",sig[it1][it2]);                   \
+              delete sig[it1][it2];                                     \
+            }                                                           \
+          delete [] sig[it1];                                           \
+        }                                                               \
+      delete [] sig;                                                    \
+    } while (0)
 
 // ----------------------------------------------------------------------
@@ -734,11 +850,14 @@
 
 #define ALLOC3_INTERFACE_END(x1, x2, x3)                         \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    {                                                                   \
-      for (uint32_t it2=0; it2<x2; it2++)                               \
-        delete [] interface [it1][it2];                                 \
-      delete [] interface [it1];                                        \
-    }                                                                   \
-  delete [] interface;
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            delete [] interface [it1][it2];                             \
+          delete [] interface [it1];                                    \
+        }                                                               \
+      delete [] interface;                                              \
+    } while (0)
 
 // #define _ALLOC3_VAL_ACK_IN( sig, name, type, x1, x2, x3)
@@ -746,85 +865,89 @@
 
 #define _ALLOC3_VALACK_IN(    sig,type, x1, x2, x3)                     \
-  {                                                                     \
-    sig = new SC_IN (Tcontrol_t) *** [x1];                              \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (Tcontrol_t) ** [x2];                     \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = new SC_IN (Tcontrol_t) * [x3];             \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              {                                                         \
-                sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_in (type); \
-              }                                                         \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (Tcontrol_t) *** [x1];                            \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (Tcontrol_t) ** [x2];                   \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = new SC_IN (Tcontrol_t) * [x3];           \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                {                                                       \
+                  sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_in (type); \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC3_VALACK_OUT(    sig,type, x1, x2, x3)                    \
-  {                                                                     \
-    sig = new SC_OUT (Tcontrol_t) *** [x1];                             \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (Tcontrol_t) ** [x2];                    \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = new SC_OUT (Tcontrol_t) * [x3];            \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              {                                                         \
-                sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_out (type); \
-              }                                                         \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (Tcontrol_t) *** [x1];                           \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (Tcontrol_t) ** [x2];                  \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = new SC_OUT (Tcontrol_t) * [x3];          \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                {                                                       \
+                  sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_out (type); \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 
 #define _ALLOC3_SIGNAL_IN( sig, name, type, size, x1, x2,x3)            \
-  {                                                                     \
-    sig = new SC_IN (type) *** [x1];                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (type) ** [x2];                           \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = new SC_IN (type) * [x3];                   \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              {                                                         \
-                if (size > 0)                                           \
-                  {                                                     \
-                    sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_in <type> (name, size); \
-                  }                                                     \
-                else                                                    \
-                  {                                                     \
-                    PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \
-                  }                                                     \
-              }                                                         \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (type) *** [x1];                                  \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (type) ** [x2];                         \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = new SC_IN (type) * [x3];                 \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                {                                                       \
+                  if (size > 0)                                         \
+                    {                                                   \
+                      sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_in <type> (name, size); \
+                    }                                                   \
+                  else                                                  \
+                    {                                                   \
+                      PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \
+                    }                                                   \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 #define _ALLOC3_SIGNAL_OUT( sig, name, type, size, x1, x2,x3)           \
-  {                                                                     \
-    sig = new SC_OUT (type) *** [x1];                                   \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (type) ** [x2];                          \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = new SC_OUT (type) * [x3];                  \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              {                                                         \
-                if (size > 0)                                           \
-                  {                                                     \
-                    sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_out <type> (name, size); \
-                  }                                                     \
-                else                                                    \
-                  {                                                     \
-                    PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \
-                  }                                                     \
-              }                                                         \
-          }                                                             \
-      }                                                                 \
-  }
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (type) *** [x1];                                 \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (type) ** [x2];                        \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = new SC_OUT (type) * [x3];                \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                {                                                       \
+                  if (size > 0)                                         \
+                    {                                                   \
+                      sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_out <type> (name, size); \
+                    }                                                   \
+                  else                                                  \
+                    {                                                   \
+                      PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \
+                    }                                                   \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    } while (0)
 
 // #define ALLOC3_VAL_ACK_IN( sig, name, type      ) _ALLOC3_VAL_ACK_IN( sig, name, type      , iterator_1, iterator_2, iterator_3) 
@@ -836,124 +959,138 @@
 
 #define DELETE3_SIGNAL(sig, x1, x2, x3, size)                           \
-  {                                                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              {                                                         \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                {                                                       \
+                  if (size > 0)                                         \
+                    {                                                   \
+                      delete sig[it1][it2][it3];                        \
+                    }                                                   \
+                }                                                       \
+              delete [] sig[it1][it2];                                  \
+            }                                                           \
+          delete [] sig[it1];                                           \
+        }                                                               \
+      delete [] sig;                                                    \
+    } while (0)
+
+#define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3)     \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_IN (type) *** [x1];                                  \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_IN (type) ** [x2];                         \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = new SC_IN (type) * [x3];                 \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
                 if (size > 0)                                           \
                   {                                                     \
-                    delete sig[it1][it2][it3];                          \
+                    std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \
+                    sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \
+                  }                                                     \
+            }                                                           \
+        }                                                               \
+    } while (0)
+
+#define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3)    \
+  do                                                                    \
+    {                                                                   \
+      sig = new SC_OUT (type) *** [x1];                                 \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          sig [it1] = new SC_OUT (type) ** [x2];                        \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
+              sig [it1][it2] = new SC_OUT (type) * [x3];                \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                if (size > 0)                                           \
+                  {                                                     \
+                    std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \
+                    sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \
+                  }                                                     \
+            }                                                           \
+        }                                                               \
+    } while (0)
+
+#define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3)            \
+  do                                                           \
+    {                                                          \
+      DELETE3_SIGNAL(sig,x1,x2,x3,size);                       \
+    } while (0)
+
+#define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3)                  \
+  do                                                                    \
+    {                                                                   \
+      sig = new sc_signal<type> *** [x1];                               \
+      {                                                                 \
+        std::string separator="_";                                      \
+        std::string str;                                                \
+        for (uint32_t it1=0; it1<x1; it1++)                             \
+          {                                                             \
+            sig [it1] = new sc_signal<type> ** [x2];                    \
+            for (uint32_t it2=0; it2<x2; it2++)                         \
+              {                                                         \
+                sig [it1][it2] = new sc_signal<type> * [x3];            \
+                for (uint32_t it3=0; it3<x3; it3++)                     \
+                  {                                                     \
+                    str = name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3); \
+                    sig [it1][it2][it3] = new sc_signal<type> (str.c_str()); \
+                    PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2][it3]); \
                   }                                                     \
               }                                                         \
-            delete [] sig[it1][it2];                                    \
-          }                                                             \
-        delete [] sig[it1];                                             \
-      }                                                                 \
-    delete [] sig;                                                      \
-  }
-
-#define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3)     \
-  {                                                                     \
-    sig = new SC_IN (type) *** [x1];                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_IN (type) ** [x2];                           \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = new SC_IN (type) * [x3];                   \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              if (size > 0)                                             \
-                {                                                       \
-                  std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \
-                  sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \
-                }                                                       \
           }                                                             \
       }                                                                 \
-  }
-
-#define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3)    \
-  {                                                                     \
-    sig = new SC_OUT (type) *** [x1];                                   \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        sig [it1] = new SC_OUT (type) ** [x2];                          \
+    } while (0)
+
+#define INSTANCE3_SC_SIGNAL(component, sig, x1, x2, x3)                 \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
         for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            sig [it1][it2] = new SC_OUT (type) * [x3];                  \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              if (size > 0)                                             \
-                {                                                       \
-                  std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \
-                  sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \
-                }                                                       \
-          }                                                             \
-      }                                                                 \
-  }
-
-#define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3)            \
-  {                                                            \
-    DELETE3_SIGNAL(sig,x1,x2,x3,size);                         \
-  }
-
-#define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3)                  \
-  sig = new sc_signal<type> *** [x1];                                   \
-  {                                                                     \
-    std::string separator="_";                                          \
-    std::string str;                                                    \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-         sig [it1] = new sc_signal<type> ** [x2];                       \
-         for (uint32_t it2=0; it2<x2; it2++)                            \
-           {                                                            \
-              sig [it1][it2] = new sc_signal<type> * [x3];              \
+          for (uint32_t it3=0; it3<x3; it3++)                           \
+            {                                                           \
+              TEST_SIGNAL(component->sig  [it1][it2][it3]->name(),component->sig  [it1][it2][it3]); \
+              TEST_SIGNAL(sig             [it1][it2][it3]->name(),sig             [it1][it2][it3]); \
+              (*(component->sig[it1][it2][it3])) (*(sig[it1][it2][it3])); \
+            }                                                           \
+    } while (0)
+
+#define _INSTANCE3_SC_SIGNAL(component, sig1, sig2, x1, x2, x3)         \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          for (uint32_t it3=0; it3<x3; it3++)                           \
+            {                                                           \
+              TEST_SIGNAL(component->sig1 [it1][it2][it3]->name(),component->sig1 [it1][it2][it3]); \
+              TEST_SIGNAL(sig2            [it1][it2][it3]->name(),sig2            [it1][it2][it3]); \
+              (*(component->sig1[it1][it2][it3])) (*(sig2[it1][it2][it3])); \
+            }                                                           \
+    } while (0)
+
+#define DELETE3_SC_SIGNAL(sig,x1,x2,x3)                                 \
+  do                                                                    \
+    {                                                                   \
+      for (uint32_t it1=0; it1<x1; it1++)                               \
+        {                                                               \
+          for (uint32_t it2=0; it2<x2; it2++)                           \
+            {                                                           \
               for (uint32_t it3=0; it3<x3; it3++)                       \
                 {                                                       \
-                  str = name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3); \
-                  sig [it1][it2][it3] = new sc_signal<type> (str.c_str()); \
-                  PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2][it3]); \
+                  PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]);          \
+                  delete sig[it1][it2][it3];                            \
                 }                                                       \
-           }                                                            \
-      }                                                                 \
-  }
-
-#define INSTANCE3_SC_SIGNAL(component, sig, x1, x2, x3)                 \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    for (uint32_t it2=0; it2<x2; it2++)                                 \
-      for (uint32_t it3=0; it3<x3; it3++)                               \
-        {                                                               \
-          TEST_SIGNAL(component->sig  [it1][it2][it3]->name(),component->sig  [it1][it2][it3]); \
-          TEST_SIGNAL(sig             [it1][it2][it3]->name(),sig             [it1][it2][it3]); \
-          (*(component->sig[it1][it2][it3])) (*(sig[it1][it2][it3]));   \
-        }
-
-#define _INSTANCE3_SC_SIGNAL(component, sig1, sig2, x1, x2, x3)         \
-  for (uint32_t it1=0; it1<x1; it1++)                                   \
-    for (uint32_t it2=0; it2<x2; it2++)                                 \
-      for (uint32_t it3=0; it3<x3; it3++)                               \
-        {                                                               \
-          TEST_SIGNAL(component->sig1 [it1][it2][it3]->name(),component->sig1 [it1][it2][it3]); \
-          TEST_SIGNAL(sig2            [it1][it2][it3]->name(),sig2            [it1][it2][it3]); \
-          (*(component->sig1[it1][it2][it3])) (*(sig2[it1][it2][it3])); \
-        }
-
-#define DELETE3_SC_SIGNAL(sig,x1,x2,x3)                                 \
-  {                                                                     \
-    for (uint32_t it1=0; it1<x1; it1++)                                 \
-      {                                                                 \
-        for (uint32_t it2=0; it2<x2; it2++)                             \
-          {                                                             \
-            for (uint32_t it3=0; it3<x3; it3++)                         \
-              {                                                         \
-                PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]);            \
-                delete sig[it1][it2][it3];                              \
-              }                                                         \
-            delete [] sig[it1][it2];                                    \
-          }                                                             \
-        delete [] sig[it1];                                             \
-      }                                                                 \
-    delete [] sig;                                                      \
-  }
+              delete [] sig[it1][it2];                                  \
+            }                                                           \
+          delete [] sig[it1];                                           \
+        }                                                               \
+      delete [] sig;                                                    \
+    } while (0)
 
 #endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 127)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 128)
@@ -16,13 +16,13 @@
 
   // ***** general
+  typedef uint32_t           Tcounter_t; // universal counter
+  typedef uint32_t           Tptr_t;     // universal pointer
   typedef uint32_t           Tinstruction_t;
   typedef bool               Tcontrol_t;
   typedef uint8_t            Texception_t;
   typedef uint8_t            Tcontext_t;
-  typedef uint16_t           Tpacket_t;
+  typedef Tptr_t             Tpacket_t;
   typedef uint8_t            Toperation_t;
   typedef uint8_t            Ttype_t;
-  typedef uint32_t           Tcounter_t; // universal counter
-  typedef uint32_t           Tptr_t;     // universal pointer
   typedef uint32_t           Tspr_t;
   typedef uint16_t           Tspr_address_t;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h	(revision 127)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h	(revision 128)
@@ -10,8 +10,8 @@
 #define MORPHEO_MAJOR_VERSION "0"
 #define MORPHEO_MINOR_VERSION "2"
-#define MORPHEO_REVISION      "127"
+#define MORPHEO_REVISION      "128"
 #define MORPHEO_CODENAME      "Castor"
 
-#define MORPHEO_DATE_DAY      "17"  
+#define MORPHEO_DATE_DAY      "26"  
 #define MORPHEO_DATE_MONTH    "06"
 #define MORPHEO_DATE_YEAR     "2009" 
