Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 112)
@@ -14,4 +14,7 @@
 // =====[ ALLOCATION / DELETE of ARRAY ]=================================
 // ======================================================================
+#define ALLOC0(var,type)                        \
+  var = new type
+
 #define ALLOC1(var,type,s1)                      \
   var = new type [s1]
@@ -103,5 +106,6 @@
 // ----------------------------------------------------------------------
 
-#define __ALLOC_SIGNAL(sig, name, type)         \
+
+#define __ALLOC0_SIGNAL(sig, name, type)         \
   {                                             \
     sig = new type (name);                      \
@@ -109,30 +113,32 @@
 
 #ifdef POSITION
-#define ALLOC_INTERFACE( name, direction, localisation, str)            \
+#define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str)            \
   INTERFACE_PRINT(name);                                                \
   morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name, direction, localisation, str);
 #else
-#define ALLOC_INTERFACE( name, direction, localisation, str)            \
+#define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str)            \
   INTERFACE_PRINT(name);                                                \
   morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name);
 #endif
 
-#define ALLOC_VAL_ACK_IN(  sig, name, type)                             \
+#define ALLOC0_INTERFACE_END()
+
+#define ALLOC0_VAL_ACK_IN(  sig, name, type)                             \
   {                                                                     \
     sig = interface->set_signal_valack_in (name, type);                 \
   }                                                                     
-#define ALLOC_VAL_ACK_OUT( sig, name, type)                             \
+#define ALLOC0_VAL_ACK_OUT( sig, name, type)                             \
   {                                                                     \
     sig = interface->set_signal_valack_out(name, type);                 \
   }                                                                     
-#define ALLOC_VALACK_IN(     sig, type)                                 \
+#define ALLOC0_VALACK_IN(     sig, type)                                 \
   {                                                                     \
     sig = interface->set_signal_valack_in (type);                       \
   }                                                                     
-#define ALLOC_VALACK_OUT(    sig, type)                                 \
+#define ALLOC0_VALACK_OUT(    sig, type)                                 \
   {                                                                     \
     sig = interface->set_signal_valack_out(type);                       \
   }                                                                     
-#define ALLOC_SIGNAL_IN(  sig, name, type, size)                        \
+#define ALLOC0_SIGNAL_IN(  sig, name, type, size)                        \
   if (size > 0)                                                         \
     {                                                                   \
@@ -144,5 +150,5 @@
     }
   
-#define ALLOC_SIGNAL_OUT( sig, name, type, size)                        \
+#define ALLOC0_SIGNAL_OUT( sig, name, type, size)                        \
   if (size > 0)                                                         \
     {                                                                   \
@@ -154,5 +160,5 @@
     }
 
-#define DELETE_SIGNAL( sig, size)                                       \
+#define DELETE0_SIGNAL( sig, size)                                       \
   if (size > 0)                                                         \
     {                                                                   \
@@ -160,9 +166,9 @@
     }
 
-#define ALLOC_SC_SIGNAL(  sig, name, type)                              \
+#define ALLOC0_SC_SIGNAL(  sig, name, type)                              \
   sc_signal<type> * sig = new sc_signal<type> (name);                   \
   PRINT_SIGNAL_ADDRESS(name,sig);
 
-#define INSTANCE_SC_SIGNAL(component, sig)                     \
+#define INSTANCE0_SC_SIGNAL(component, sig)                     \
   {                                                            \
     TEST_SIGNAL(component->sig->name(),component->sig);        \
@@ -171,5 +177,5 @@
   }
 
-#define _INSTANCE_SC_SIGNAL(component, sig1,sig2)                       \
+#define _INSTANCE0_SC_SIGNAL(component, sig1,sig2)                       \
   {                                                                     \
     TEST_SIGNAL(component->sig1->name(),component->sig1);               \
@@ -178,26 +184,8 @@
   }
 
-#define DELETE_SC_SIGNAL( sig)                  \
+#define DELETE0_SC_SIGNAL( sig)                  \
   {                                             \
     delete sig;                                 \
   }
-
-
-#define __ALLOC0_SIGNAL(sig, name, type)                      __ALLOC_SIGNAL(sig, name, type)
-
-#define ALLOC0_INTERFACE( name, direction, localisation, str) ALLOC_INTERFACE( name, direction, localisation, str)
-
-#define ALLOC0_VAL_ACK_IN(  sig, name, type)                  ALLOC_VAL_ACK_IN(  sig, name, type)
-#define ALLOC0_VAL_ACK_OUT( sig, name, type)                  ALLOC_VAL_ACK_OUT( sig, name, type)
-#define ALLOC0_VALACK_IN(     sig, type)                      ALLOC_VALACK_IN(     sig, type)
-#define ALLOC0_VALACK_OUT(    sig, type)                      ALLOC_VALACK_OUT(    sig, type)
-#define ALLOC0_SIGNAL_IN(  sig, name, type, size)             ALLOC_SIGNAL_IN(  sig, name, type, size)
-#define ALLOC0_SIGNAL_OUT( sig, name, type, size)             ALLOC_SIGNAL_OUT( sig, name, type, size)
-#define DELETE0_SIGNAL( sig, size)                            DELETE_SIGNAL( sig, size)
-
-#define ALLOC0_SC_SIGNAL(  sig, name, type)                   ALLOC_SC_SIGNAL(  sig, name, type)
-#define INSTANCE0_SC_SIGNAL(component, sig)                   INSTANCE_SC_SIGNAL(component, sig)
-#define _INSTANCE0_SC_SIGNAL(component, sig)                  _INSTANCE_SC_SIGNAL(component, sig)
-#define DELETE0_SC_SIGNAL( sig)                               DELETE_SC_SIGNAL( sig)
 
 // ----------------------------------------------------------------------
@@ -205,9 +193,11 @@
 // ----------------------------------------------------------------------
 
-#define __ALLOC1_INTERFACE(name, x1)                                    \
+#define __ALLOC1_INTERFACE_BEGIN(name, x1)                                    \
   INTERFACE_PRINT(name);                                                \
   const std::string interface_name = name;                              \
   const uint32_t iterator_1 = x1;
 
+#define __ALLOC1_INTERFACE_END(x1)
+
 #define __ALLOC1_SIGNAL_IN( sig, name, type)                            \
   {                                                                     \
@@ -233,5 +223,5 @@
 
 #ifdef POSITION
-#define ALLOC1_INTERFACE( name, direction, localisation, str, x1)       \
+#define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1)       \
   INTERFACE_PRINT(name);                                                \
   const uint32_t iterator_1 = x1;                                       \
@@ -245,5 +235,5 @@
   }
 #else
-#define ALLOC1_INTERFACE( name, direction, localisation, str, x1)       \
+#define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1)       \
   INTERFACE_PRINT(name);                                                \
   const uint32_t iterator_1 = x1;                                       \
@@ -257,4 +247,6 @@
   }
 #endif
+
+#define ALLOC1_INTERFACE_END(x1)
 
 #define ALLOC1_VAL_ACK_IN( sig, name, type)                             \
@@ -377,5 +369,5 @@
 
 #ifdef POSITION
-#define ALLOC2_INTERFACE( name, direction, localisation, str, x1, x2)   \
+#define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2)   \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -397,5 +389,5 @@
   }
 #else
-#define ALLOC2_INTERFACE( name, direction, localisation, str, x1, x2)   \
+#define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2)   \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -417,4 +409,9 @@
   }
 #endif
+
+#define ALLOC2_INTERFACE_END(x1, x2)                             \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    delete interface [it1];                                             \
+  delete [] interface;
 
 #define _ALLOC2_VAL_ACK_IN( sig, name, type, x1, x2)                    \
@@ -586,5 +583,5 @@
 
 #ifdef POSITION
-#define ALLOC3_INTERFACE( name, direction, localisation, str, x1, x2, x3) \
+#define ALLOC3_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2, x3) \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -612,5 +609,5 @@
   }
 #else
-#define ALLOC3_INTERFACE( name, direction, localisation, str, x1, x2, x3) \
+#define ALLOC3_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2, x3) \
   INTERFACE_PRINT(name);                                                \
   uint32_t iterator_1 = 0;                                              \
@@ -638,4 +635,13 @@
   }
 #endif
+
+#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;
 
 // #define _ALLOC3_VAL_ACK_IN( sig, name, type, x1, x2, x3)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 112)
@@ -11,5 +11,8 @@
 #  define   DEBUG_Configuration                                   true
 #  define     DEBUG_Generic                                       true
+#  define       DEBUG_Comparator                                  true 
 #  define       DEBUG_Counter                                     true 
+#  define       DEBUG_Divider                                     true 
+#  define       DEBUG_Multiplier                                  true 
 #  define       DEBUG_Priority                                    true
 #  define       DEBUG_Queue                                       true 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h	(revision 112)
@@ -0,0 +1,63 @@
+#ifndef morpheo_behavioural_Model_h
+#define morpheo_behavioural_Model_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Common/include/ErrorMorpheo.h"
+#include <map>
+
+namespace morpheo              {
+namespace behavioural          {
+
+  typedef enum
+    {
+      MODEL_SYSTEMC,
+      MODEL_VHDL
+    } model_type_t;
+
+  typedef struct
+  {
+    model_type_t      type ;
+    debug_verbosity_t debug;
+  } model_t;
+    
+  class Model
+  {
+  private : static const model_type_t      default_type  = MODEL_SYSTEMC;
+  private : static const debug_verbosity_t default_debug = DEBUG_NONE;
+
+  private : std::map<std::string,model_t> models;
+
+  public  :                    Model (void);
+  public  :                   ~Model (void);
+  public  : void              set_model (std::string component, model_type_t type, debug_verbosity_t debug);
+  public  : model_type_t      get_type  (std::string component);
+  public  : debug_verbosity_t get_debug (std::string component);
+  };
+  
+}; // end namespace behavioural          
+
+  template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x)
+  {
+    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_SYSTEMC))) == 0) or
+         (x.compare("model_systemc") == 0) or
+         (x.compare("systemc") == 0)
+         )
+      return morpheo::behavioural::MODEL_SYSTEMC;
+    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_VHDL))) == 0) or
+         (x.compare("model_vhdl") == 0) or
+         (x.compare("vhdl") == 0))
+      return morpheo::behavioural::MODEL_VHDL;
+    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\"\n"));
+  };
+
+}; // end namespace morpheo              
+
+#endif
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h	(revision 112)
@@ -32,18 +32,19 @@
   public  : ~SPR_access_mode();
 
-  public  : spr_address_t translate_address (Tgeneral_data_t address);
+  public  : spr_address_t     translate_address (Tgeneral_data_t address);
 
-  public  : bool          valid (uint32_t num_group, uint32_t num_reg);
-  public  : bool          valid (spr_address_t address);
-  public  : bool          exist (uint32_t num_group, uint32_t num_reg);
-  public  : bool          exist (spr_address_t address);
-  public  : bool          read  (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA);
-  public  : bool          write (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA);
-
-  public  : void          implement_group (uint32_t num_group, uint32_t nb_reg);
-  public  : uint32_t      implement_group (uint32_t num_group);
-  public  : void          change_mode     (uint32_t num_group, uint32_t num_reg, spr_access_mode_t new_mode);
-  public  : void          invalid_register(uint32_t num_group, uint32_t num_reg);
-
+  public  : bool              valid           (uint32_t num_group, uint32_t num_reg);
+  public  : bool              valid           (spr_address_t address);
+  public  : bool              exist           (uint32_t num_group, uint32_t num_reg);
+  public  : bool              exist           (spr_address_t address);
+  public  : bool              read            (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA);
+  public  : bool              write           (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA);
+  public  : spr_access_mode_t get_mode        (uint32_t num_group, uint32_t num_reg);
+  public  : spr_access_mode_t get_mode        (spr_address_t address);
+    
+  public  : void              implement_group (uint32_t num_group, uint32_t nb_reg);
+  public  : uint32_t          implement_group (uint32_t num_group);
+  public  : void              change_mode     (uint32_t num_group, uint32_t num_reg, spr_access_mode_t new_mode);
+  public  : void              invalid_register(uint32_t num_group, uint32_t num_reg);
   };
   
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h	(revision 112)
@@ -11,5 +11,5 @@
 
 #include "Common/include/Debug.h"
-
+#include "Behavioural/include/Model.h"
 #include <stdint.h>
 #include <systemc.h>
@@ -22,4 +22,5 @@
 extern double              _simulation_nb_instruction;
 extern std::vector<double> _simulation_nb_instruction_commited;
+extern Model               _model;
 
   bool simulation_test_end (void);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h	(revision 112)
@@ -10,9 +10,9 @@
 #define MORPHEO_MAJOR_VERSION "0"
 #define MORPHEO_MINOR_VERSION "2"
-#define MORPHEO_REVISION      "111"
+#define MORPHEO_REVISION      "112"
 #define MORPHEO_CODENAME      "Castor"
 
-#define MORPHEO_DATE_DAY      "27"  
-#define MORPHEO_DATE_MONTH    "02"
+#define MORPHEO_DATE_DAY      "18"  
+#define MORPHEO_DATE_MONTH    "03"
 #define MORPHEO_DATE_YEAR     "2009" 
 
