Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h	(revision 86)
@@ -37,4 +37,9 @@
 
   void instruction_illegal             (decod_instruction_t * inst, decod_param_t * param);
+
+  void instruction_l_custom            (decod_instruction_t * inst, decod_param_t * param);
+  void instruction_lf_custom           (decod_instruction_t * inst, decod_param_t * param);
+  void instruction_lv_custom           (decod_instruction_t * inst, decod_param_t * param);
+  void instruction_custom              (decod_instruction_t * inst, decod_param_t * param);
   
   // ORBIS
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Types.h	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Types.h	(revision 86)
@@ -63,13 +63,16 @@
   public : Tgeneral_data_t    _mask_data ;
   public : Tgeneral_data_t    _mask_shift;
-  public : void (*** _function_decod) (decod_instruction_t *, decod_param_t *); // [type][opcod]
+  public : void (*** _function_decod ) (decod_instruction_t *, decod_param_t *); // [type][opcod]
+  public : void (*** _function_custom) (decod_instruction_t *, decod_param_t *); // [type][opcod]
   
   public : decod_param_t (uint32_t size_data,
-			  void (*** function_decod) (decod_instruction_t *, decod_param_t *))
+			  void (*** function_decod ) (decod_instruction_t *, decod_param_t *),
+			  void (*** function_custom) (decod_instruction_t *, decod_param_t *))
     {
-      _size_data      = size_data;
-      _mask_data      = gen_mask<Tgeneral_data_t> (size_data);
-      _mask_shift     = gen_mask<Tgeneral_data_t> (log2(size_data));
-      _function_decod = function_decod;
+      _size_data       = size_data;
+      _mask_data       = gen_mask<Tgeneral_data_t> (size_data);
+      _mask_shift      = gen_mask<Tgeneral_data_t> (log2(size_data));
+      _function_decod  = function_decod;
+      _function_custom = function_custom;
     };
   public : ~decod_param_t (void)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/src/Instruction.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/src/Instruction.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/src/Instruction.cpp	(revision 86)
@@ -13,4 +13,5 @@
 
 #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h"
+#include "Behavioural/include/Constants.h"
 
 namespace morpheo {
@@ -130,4 +131,119 @@
 
     inst->_event_type         = EVENT_TYPE_EXCEPTION;
+  }
+
+  void instruction_l_custom            (decod_instruction_t * inst, decod_param_t * param)
+  {
+    log_printf(TRACE,Decod,"instruction_l_custom","  * instruction   : custom");
+
+    uint32_t opcod = range<uint32_t>(inst->_instruction,31,26);
+
+    inst->_type = TYPE_CUSTOM;
+    switch (opcod)
+      {
+      case OPCOD_L_CUST1 : {inst->_operation = OPERATION_CUSTOM_L_1; break;}
+      case OPCOD_L_CUST2 : {inst->_operation = OPERATION_CUSTOM_L_2; break;}
+      case OPCOD_L_CUST3 : {inst->_operation = OPERATION_CUSTOM_L_3; break;}
+      case OPCOD_L_CUST4 : {inst->_operation = OPERATION_CUSTOM_L_4; break;}
+      case OPCOD_L_CUST5 : {inst->_operation = OPERATION_CUSTOM_L_5; break;}
+      case OPCOD_L_CUST6 : {inst->_operation = OPERATION_CUSTOM_L_6; break;}
+      case OPCOD_L_CUST7 : {inst->_operation = OPERATION_CUSTOM_L_7; break;}
+      case OPCOD_L_CUST8 : {inst->_operation = OPERATION_CUSTOM_L_8; break;}
+      default            : {throw ERRORMORPHEO("instruction_l_custom",_("Invalid Custom Opcod."));}
+      }
+    
+    (* param->_function_custom[ 0][opcod]) (inst,param);
+
+    instruction_custom(inst,param);
+  }
+
+  void instruction_lf_custom           (decod_instruction_t * inst, decod_param_t * param)
+  {
+    log_printf(TRACE,Decod,"instruction_lf_custom","  * instruction   : custom");
+
+    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 0);
+
+    inst->_type = TYPE_CUSTOM;
+    switch (opcod)
+      {
+//       case OPCOD_LF_CUST1_D : {inst->_operation = OPERATION_CUSTOM_LF_1_D; break;}
+//       case OPCOD_LF_CUST1_S : {inst->_operation = OPERATION_CUSTOM_LF_1_S; break;}
+      default               : {throw ERRORMORPHEO("instruction_lf_custom",_("Invalid Custom Opcod."));}
+      }
+    
+    (* param->_function_custom[ 1][opcod]) (inst,param);
+
+    instruction_custom(inst,param);
+  }
+
+  void instruction_lv_custom           (decod_instruction_t * inst, decod_param_t * param)
+  {
+    log_printf(TRACE,Decod,"instruction_lv_custom","  * instruction   : custom");
+
+    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 0);
+
+    inst->_type = TYPE_CUSTOM;
+    switch (opcod)
+      {
+//       case OPCOD_LV_CUST1 : {inst->_operation = OPERATION_CUSTOM_LV_1; break;}
+//       case OPCOD_LV_CUST2 : {inst->_operation = OPERATION_CUSTOM_LV_2; break;}
+//       case OPCOD_LV_CUST3 : {inst->_operation = OPERATION_CUSTOM_LV_3; break;}
+//       case OPCOD_LV_CUST4 : {inst->_operation = OPERATION_CUSTOM_LV_4; break;}
+      default             : {throw ERRORMORPHEO("instruction_lv_custom",_("Invalid Custom Opcod."));}
+      }
+    
+    (* param->_function_custom[ 2][opcod]) (inst,param);
+
+    instruction_custom(inst,param);
+  }
+
+  void instruction_custom              (decod_instruction_t * inst, decod_param_t * param)
+  {
+    // Test custom operation
+    
+    std::string msg = "";
+
+    if (inst->_exception_use !=  EXCEPTION_USE_ILLEGAL_INSTRUCTION)
+      {
+	if (inst->_type != TYPE_CUSTOM)
+	  msg += _("Invalid Type.\n");
+	
+	if ((inst->_operation != OPERATION_CUSTOM_L_1   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_2   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_3   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_4   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_5   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_6   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_7   ) and
+	    (inst->_operation != OPERATION_CUSTOM_L_8   ) and
+	    (inst->_operation != OPERATION_CUSTOM_LF_1_D) and
+	    (inst->_operation != OPERATION_CUSTOM_LF_1_S) and
+	    (inst->_operation != OPERATION_CUSTOM_LV_1  ) and
+	    (inst->_operation != OPERATION_CUSTOM_LV_2  ) and
+	    (inst->_operation != OPERATION_CUSTOM_LV_3  ) and
+	    (inst->_operation != OPERATION_CUSTOM_LV_4  ))
+	  msg += _("Invalid Operation.\n");
+	
+	if ((inst->_exception_use !=  EXCEPTION_USE_NONE               ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_RANGE              ) and
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_0           ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_1           ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_2           ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_3           ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_4           ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_5           ) and 
+	    (inst->_exception_use !=  EXCEPTION_USE_CUSTOM_6           ))
+	  msg += _("Invalid Exception.\n");
+
+	if ((inst->_event_type != EVENT_TYPE_NONE      ) and
+	    (inst->_event_type != EVENT_TYPE_SPR_ACCESS))
+	  msg += _("Invalid Event_type.\n");
+
+	if (inst->_address_next != (inst->_address+1))
+	  msg += _("Address must be in sequence.\n");
+
+	if (msg != "")
+	  throw ERRORMORPHEO("instruction_custom","Invalid decod : "+msg);
+      }
   }
   
@@ -706,5 +822,5 @@
     inst->_operation          = OPERATION_BRANCH_L_JALR;
     inst->_has_immediat       = 1;
-    inst->_immediat           = inst->_address_next+4;
+    inst->_immediat           = inst->_address_next+1;
     inst->_read_ra            = 0;
 //  inst->_num_reg_ra         = ;
