Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation/src/Operation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation/src/Operation.cpp	(revision 100)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation/src/Operation.cpp	(revision 101)
@@ -90,5 +90,7 @@
 
     bool            overflow  = ovf  (param->_size_data,gpr1,gpr2,gpr3);
-    bool            carry_out = carry(param->_size_data,gpr1,gpr2,gpr3);
+//  bool            carry_out = carry(param->_size_data,gpr1,gpr2,gpr3);
+    // In ISA : l.sub don't change flag carry
+    bool            carry_out  = get_flag(op->_data_rc,FLAG_CY);
 
     // Result
@@ -104,4 +106,126 @@
 
 #undef  FUNCTION
+#define FUNCTION "Functionnal_unit::operation_l_mul"
+  void operation_l_mul         (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
+  {
+    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_mul");
+
+    Tgeneral_data_t gpr1      = unsigned(param->_size_data,op->_data_ra);
+    Tgeneral_data_t gpr2      = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
+    Tgeneral_data_t gpr3      ;
+    bool            overflow  ;
+    bool            carry_out ;
+
+    if (param->_size_data == 32)
+      {
+        int64_t res = static_cast<int64_t>(gpr1) * static_cast<int64_t>(gpr2);
+
+        log_printf(TRACE,Functionnal_unit,FUNCTION,"  * res   : %llx",res);
+
+        gpr3      = param->_mask_data & static_cast<Tgeneral_data_t>(res);
+        carry_out = res != gpr3; 
+        overflow  = carry_out;
+      }
+    else
+      {
+        throw ERRORMORPHEO(FUNCTION,_("64 bits multiplcation : not yet implemented\n"));
+      }
+
+    // Result
+    op->_timing       = param->_timing[op->_type][op->_operation];
+    op->_data_rd      = gpr3;
+    op->_data_re      = 0;
+    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
+    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
+    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
+    op->_no_sequence  = 0;
+  //op->_address      = 0;
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Functionnal_unit::operation_l_mulu"
+  void operation_l_mulu        (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
+  {
+    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_mulu");
+
+    Tgeneral_data_t gpr1      = unsigned(param->_size_data,op->_data_ra);
+    Tgeneral_data_t gpr2      = unsigned(param->_size_data,op->_data_rb);
+    Tgeneral_data_t gpr3      ;
+    bool            overflow  ;
+    bool            carry_out ;
+
+    if (param->_size_data == 32)
+      {
+        uint64_t res = static_cast<uint64_t>(gpr1) * static_cast<uint64_t>(gpr2);
+
+        log_printf(TRACE,Functionnal_unit,FUNCTION,"  * res   : %llx",res);
+
+        gpr3      = param->_mask_data & static_cast<Tgeneral_data_t>(res);
+        carry_out = res != gpr3; 
+        overflow  = carry_out;
+      }
+    else
+      {
+        throw ERRORMORPHEO(FUNCTION,_("64 bits multiplcation : not yet implemented\n"));
+      }
+
+    // Result
+    op->_timing       = param->_timing[op->_type][op->_operation];
+    op->_data_rd      = gpr3;
+    op->_data_re      = 0;
+    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
+    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
+    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
+    op->_no_sequence  = 0;
+  //op->_address      = 0;
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Functionnal_unit::operation_l_div"
+  void operation_l_div         (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
+  {
+    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_div");
+
+    Tgeneral_data_t gpr1      = signed(param->_size_data,op->_data_ra);
+    Tgeneral_data_t gpr2      = signed(param->_size_data,op->_data_rb);
+    Tgeneral_data_t gpr3      = (gpr2!=0)?(gpr1/gpr2):0;
+    bool            overflow  = ovf  (param->_size_data,gpr1,gpr2,gpr3);
+    bool            carry_out = (gpr2==0);
+
+    // Result
+    op->_timing       = param->_timing[op->_type][op->_operation];
+    op->_data_rd      = gpr3;
+    op->_data_re      = 0;
+    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
+    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
+    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
+    op->_no_sequence  = 0;
+  //op->_address      = 0;
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Functionnal_unit::operation_l_divu"
+  void operation_l_divu        (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
+  {
+    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_divu");
+
+    Tgeneral_data_t gpr1      = unsigned(param->_size_data,op->_data_ra);
+    Tgeneral_data_t gpr2      = unsigned(param->_size_data,op->_data_rb);
+    Tgeneral_data_t gpr3      = (gpr2!=0)?(gpr1/gpr2):0;
+    bool            overflow  = ovf  (param->_size_data,gpr1,gpr2,gpr3);
+    bool            carry_out = (gpr2==0);
+
+    // Result
+    op->_timing       = param->_timing[op->_type][op->_operation];
+    op->_data_rd      = gpr3;
+    op->_data_re      = 0;
+    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
+    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
+    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
+    op->_no_sequence  = 0;
+  //op->_address      = 0;
+  };
+
+#undef  FUNCTION
 #define FUNCTION "Functionnal_unit::operation_l_and"
   void operation_l_and         (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
@@ -465,4 +589,5 @@
     Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
 
+    // Tgeneral_data_t is unsigned
     bool            f_out      = (gpr1 >= gpr2);
 
@@ -485,4 +610,5 @@
     Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
 
+    // Tgeneral_data_t is unsigned
     bool            f_out      = (gpr1 >  gpr2);
 
@@ -505,4 +631,5 @@
     Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
 
+    // Tgeneral_data_t is unsigned
     bool            f_out      = (gpr1 <= gpr2);
 
@@ -525,4 +652,5 @@
     Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
 
+    // Tgeneral_data_t is unsigned
     bool            f_out      = (gpr1 <  gpr2);
 
@@ -544,20 +672,18 @@
     Tgeneral_data_t gpr1       =   op->_data_ra;
     Tgeneral_data_t gpr2       =   (op->_has_immediat==1)?op->_immediat:op->_data_rb;
-    
-    log_printf(TRACE,Functionnal_unit,FUNCTION," * data_ra  : %.8x",unsigned(param->_size_data,op->_data_ra));
-    log_printf(TRACE,Functionnal_unit,FUNCTION," * data_ras : %.8x",  signed(param->_size_data,op->_data_ra));
-    log_printf(TRACE,Functionnal_unit,FUNCTION," * data_rb  : %.8x",unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb));
-    log_printf(TRACE,Functionnal_unit,FUNCTION," * data_rbs : %.8x",  signed(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb));
-    
+        
     bool            f_out;
 
-    switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
-      {
-      case 1 /*b01*/ : f_out = 1                               ; break;
-      case 2 /*b10*/ : f_out = 0                               ; break;
-      default        : f_out = signed(param->_size_data,gpr1) >= signed(param->_size_data,gpr2); break;
-      }
-
-    log_printf(TRACE,Functionnal_unit,FUNCTION," * f_out    : %.8x",f_out);
+    if (param->_size_data == 32)
+      f_out = static_cast<int32_t>(gpr1) >= static_cast<int32_t>(gpr2);
+    else
+      f_out = static_cast<int64_t>(gpr1) >= static_cast<int64_t>(gpr2);
+
+//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
+//       {
+//       case 1 /*b01*/ : f_out = 1                               ; break;
+//       case 2 /*b10*/ : f_out = 0                               ; break;
+//       default        : f_out = signed(param->_size_data,gpr1) >= signed(param->_size_data,gpr2); break;
+//       }
 
     // Result
@@ -581,10 +707,15 @@
     bool            f_out;
 
-    switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
-      {
-      case 1 /*b01*/ : f_out = 1; break;
-      case 2 /*b10*/ : f_out = 0; break;
-      default        : f_out = signed(param->_size_data,gpr1) >  signed(param->_size_data,gpr2); break;
-      }
+    if (param->_size_data == 32)
+      f_out = static_cast<int32_t>(gpr1) >  static_cast<int32_t>(gpr2);
+    else
+      f_out = static_cast<int64_t>(gpr1) >  static_cast<int64_t>(gpr2);
+
+//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
+//       {
+//       case 1 /*b01*/ : f_out = 1; break;
+//       case 2 /*b10*/ : f_out = 0; break;
+//       default        : f_out = signed(param->_size_data,gpr1) >  signed(param->_size_data,gpr2); break;
+//       }
 
     // Result
@@ -608,10 +739,15 @@
     bool            f_out;
 
-    switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
-      {
-      case 1 /*b01*/ : f_out = 0; break;
-      case 2 /*b10*/ : f_out = 1; break;
-      default        : f_out = signed(param->_size_data,gpr1) <= signed(param->_size_data,gpr2); break;
-      }
+    if (param->_size_data == 32)
+      f_out = static_cast<int32_t>(gpr1) <= static_cast<int32_t>(gpr2);
+    else
+      f_out = static_cast<int64_t>(gpr1) <= static_cast<int64_t>(gpr2);
+
+//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
+//       {
+//       case 1 /*b01*/ : f_out = 0; break;
+//       case 2 /*b10*/ : f_out = 1; break;
+//       default        : f_out = signed(param->_size_data,gpr1) <= signed(param->_size_data,gpr2); break;
+//       }
     
     // Result
@@ -635,10 +771,15 @@
     bool            f_out;
 
-    switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
-      {
-      case 1 /*b01*/ : f_out = 0; break;
-      case 2 /*b10*/ : f_out = 1; break;
-      default        : f_out = signed(param->_size_data,gpr1) <  signed(param->_size_data,gpr2); break;
-      }
+    if (param->_size_data == 32)
+      f_out = static_cast<int32_t>(gpr1) <  static_cast<int32_t>(gpr2);
+    else
+      f_out = static_cast<int64_t>(gpr1) <  static_cast<int64_t>(gpr2);
+
+//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
+//       {
+//       case 1 /*b01*/ : f_out = 0; break;
+//       case 2 /*b10*/ : f_out = 1; break;
+//       default        : f_out = signed(param->_size_data,gpr1) <  signed(param->_size_data,gpr2); break;
+//       }
 
     // Result
