Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 109)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 116)
@@ -40,15 +40,15 @@
   {
     TYPE_ALU                               = 0x0,       // 00000 - unit multiple
-    TYPE_SHIFT                             = 0x1,       // 00000 - unit multiple
-    TYPE_MOVE                              = 0x2,       // 00000 - unit multiple
-    TYPE_TEST                              = 0x3,       // 00000 - unit multiple
-    TYPE_MUL                               = 0x4,       // 00000 - unit multiple
-    TYPE_DIV                               = 0x5,       // 00000 - unit multiple, type optionnal
-    TYPE_EXTEND                            = 0x6,       // 00000 - unit multiple, type optionnal
-    TYPE_FIND                              = 0x7,       // 00000 - unit multiple, type optionnal
-    TYPE_SPECIAL                           = 0x8,       // 00000 - unit uniq
-    TYPE_CUSTOM                            = 0x9,       // 00000 - unit uniq    , type optionnal
-    TYPE_BRANCH                            = 0xa,       // 00000 - unit multiple
-    TYPE_MEMORY                            = 0xb        // 00000 - unit uniq    , type exclusive
+    TYPE_SHIFT                             = 0x1,       // 00001 - unit multiple
+    TYPE_MOVE                              = 0x2,       // 00010 - unit multiple
+    TYPE_TEST                              = 0x3,       // 00011 - unit multiple
+    TYPE_MUL                               = 0x4,       // 00100 - unit multiple
+    TYPE_DIV                               = 0x5,       // 00101 - unit multiple, type optionnal
+    TYPE_EXTEND                            = 0x6,       // 00110 - unit multiple, type optionnal
+    TYPE_FIND                              = 0x7,       // 00111 - unit multiple, type optionnal
+    TYPE_SPECIAL                           = 0x8,       // 01000 - unit uniq
+    TYPE_CUSTOM                            = 0x9,       // 01001 - unit uniq    , type optionnal
+    TYPE_BRANCH                            = 0xa,       // 01010 - unit multiple
+    TYPE_MEMORY                            = 0xb        // 01011 - unit uniq
   } type_t;
 
@@ -202,43 +202,53 @@
 
   //---------------------------------------------[ Functionnal Unit ]-----
-#  define OPERATION_ALU_L_ADD                      0x1        // 000_0000 l.add   , l.addi
-#  define OPERATION_ALU_L_ADDC                     0x2        // 000_0000 l.addc  , l.addic
-#  define OPERATION_ALU_L_SUB                      0x4        // 000_0000 l.sub
-#  define OPERATION_ALU_L_AND                      0x8        // 000_0000 l.and   , l.andi
-#  define OPERATION_ALU_L_OR                       0x10       // 000_0000 l.or    , l.ori
-#  define OPERATION_ALU_L_XOR                      0x20       // 000_0000 l.xor   , l.xori
-
-#  define OPERATION_SHIFT_L_SLL                    0x1        // 000_0000 l.sll   , l.slli
-#  define OPERATION_SHIFT_L_SRA                    0x2        // 000_0000 l.sra   , l.srai
-#  define OPERATION_SHIFT_L_SRL                    0x4        // 000_0000 l.srl   , l.srli
-#  define OPERATION_SHIFT_L_ROR                    0x8        // 000_0000 l.ror   , l.rori
-
-#  define OPERATION_MOVE_L_MOVHI                   0x1        // 000_0000 l.movhi
-#  define OPERATION_MOVE_L_CMOV                    0x2        // 000_0000 l.cmov
-
-#  define OPERATION_TEST_L_SFGES                   0x41       // 000_0000 l.sfges , l.sfges
-#  define OPERATION_TEST_L_SFGEU                   0x1        // 000_0000 l.sfgeu , l.sfgeu
-#  define OPERATION_TEST_L_SFGTS                   0x42       // 000_0000 L.sfgts , l.sfgts
-#  define OPERATION_TEST_L_SFGTU                   0x2        // 000_0000 l.sfgtu , l.sfgtu
-#  define OPERATION_TEST_L_SFLES                   0x44       // 000_0000 l.sfles , l.sfles
-#  define OPERATION_TEST_L_SFLEU                   0x4        // 000_0000 l.sfleu , l.sfleu
-#  define OPERATION_TEST_L_SFLTS                   0x48       // 000_0000 l.sflts , l.sflts
-#  define OPERATION_TEST_L_SFLTU                   0x8        // 000_0000 l.sfltu , l.sfltu
-#  define OPERATION_TEST_L_SFEQ                    0x10       // 000_0000 l.sfeq  , l.sfeqi
-#  define OPERATION_TEST_L_SFNE                    0x20       // 000_0000 l.sfne  , l.sfnei
-
-#  define OPERATION_MUL_L_MUL                      0x1        // 000_0000 l.mul   , l.muli
-#  define OPERATION_MUL_L_MULU                     0x2        // 000_0000 l.mulu
-
-#  define OPERATION_DIV_L_DIV                      0x1        // 000_0000 l.div
-#  define OPERATION_DIV_L_DIVU                     0x2        // 000_0000 l.divu
-
-#  define OPERATION_EXTEND_L_EXTEND_Z              0x1        // 000_0000 l.extbz , l.exthz, l.extwz
-#  define OPERATION_EXTEND_L_EXTEND_S              0x2        // 000_0000 l.extbs , l.exths, l.extws
-
-#  define OPERATION_FIND_L_FF1                     0x1        // 000_0000 l.ff1
-#  define OPERATION_FIND_L_FL1                     0x2        // 000_0000 l.fl1
-
-#  define OPERATION_SPECIAL_L_NOP                  0x7f       // 000_0000 l.nop   
+
+  // WARNING : Operations are coded in a one-hot implementation that is used in the functional unit's vhdl code.
+  //           Do not change that (you can still change the values as long as it respects the one-hot encoding).
+
+#  define OPERATION_ALU_L_ADD                      0x1        // 000_0001 l.add   , l.addi
+#  define OPERATION_ALU_L_ADDC                     0x2        // 000_0010 l.addc  , l.addic
+#  define OPERATION_ALU_L_SUB                      0x4        // 000_0100 l.sub
+#  define OPERATION_ALU_L_AND                      0x8        // 000_1000 l.and   , l.andi
+#  define OPERATION_ALU_L_OR                       0x10       // 001_0000 l.or    , l.ori
+#  define OPERATION_ALU_L_XOR                      0x20       // 010_0000 l.xor   , l.xori
+
+  // WARNING : Shift and rotate operation codes are hard-coded in the functional unit's vhdl code,
+  //           with bit 0 corresponding to the direction (0 for right, and 1 for left),
+  //           bit 1 to the type (0 for shift, 1 for rotate) and bit 2 is to be set to 0 for a logic
+  //           operation and 1 for an arithmetic operation.
+  //           Do not change that (unless you respect the one-hot encoding described above).
+
+#  define OPERATION_SHIFT_L_SLL                    0x1        // 000_0001 l.sll   , l.slli
+#  define OPERATION_SHIFT_L_SRA                    0x4        // 000_0100 l.sra   , l.srai
+#  define OPERATION_SHIFT_L_SRL                    0x0        // 000_0000 l.srl   , l.srli
+#  define OPERATION_SHIFT_L_ROR                    0x2        // 000_0010 l.ror   , l.rori
+
+#  define OPERATION_MOVE_L_MOVHI                   0x1        // 000_0001 l.movhi
+#  define OPERATION_MOVE_L_CMOV                    0x2        // 000_0010 l.cmov
+
+#  define OPERATION_TEST_L_SFGES                   0x45       // 100_0101 l.sfges , l.sfges
+#  define OPERATION_TEST_L_SFGEU                   0x5        // 000_0101 l.sfgeu , l.sfgeu
+#  define OPERATION_TEST_L_SFGTS                   0x46       // 100_0110 L.sfgts , l.sfgts
+#  define OPERATION_TEST_L_SFGTU                   0x6        // 000_0110 l.sfgtu , l.sfgtu
+#  define OPERATION_TEST_L_SFLES                   0x49       // 100_1001 l.sfles , l.sfles
+#  define OPERATION_TEST_L_SFLEU                   0x9        // 000_1001 l.sfleu , l.sfleu
+#  define OPERATION_TEST_L_SFLTS                   0x4A       // 100_1010 l.sflts , l.sflts
+#  define OPERATION_TEST_L_SFLTU                   0xA        // 000_1010 l.sfltu , l.sfltu
+#  define OPERATION_TEST_L_SFEQ                    0x10       // 001_0000 l.sfeq  , l.sfeqi
+#  define OPERATION_TEST_L_SFNE                    0x20       // 010_0000 l.sfne  , l.sfnei
+
+#  define OPERATION_MUL_L_MUL                      0x1        // 000_0001 l.mul   , l.muli
+#  define OPERATION_MUL_L_MULU                     0x2        // 000_0010 l.mulu
+
+#  define OPERATION_DIV_L_DIV                      0x1        // 000_0001 l.div
+#  define OPERATION_DIV_L_DIVU                     0x2        // 000_0010 l.divu
+
+#  define OPERATION_EXTEND_L_EXTEND_Z              0x1        // 000_0001 l.extbz , l.exthz, l.extwz
+#  define OPERATION_EXTEND_L_EXTEND_S              0x2        // 000_0010 l.extbs , l.exths, l.extws
+
+#  define OPERATION_FIND_L_FF1                     0x1        // 000_0001 l.ff1
+#  define OPERATION_FIND_L_FL1                     0x2        // 000_0010 l.fl1
+
+#  define OPERATION_SPECIAL_L_NOP                  0x7f       // 111_1111 l.nop   
 #  define OPERATION_SPECIAL_L_MFSPR                0x1        // 000_0001 l.mfspr
 #  define OPERATION_SPECIAL_L_MTSPR                0x2        // 000_0010 l.mtspr
@@ -253,8 +263,8 @@
 #  define OPERATION_SPECIAL_L_TRAP                 0x42       // 100_0010 l.trap 
 
-#  define OPERATION_BRANCH_NONE                    0x1        // 000_0000 l.j
-#  define OPERATION_BRANCH_L_TEST_NF               0x2        // 000_0000 l.bnf
-#  define OPERATION_BRANCH_L_TEST_F                0x4        // 000_0000 l.bf
-#  define OPERATION_BRANCH_L_JALR                  0x8        // 000_0000 l.jal   , l.jalr , l.jr
+#  define OPERATION_BRANCH_NONE                    0x1        // 000_0001 l.j
+#  define OPERATION_BRANCH_L_TEST_NF               0x2        // 000_0010 l.bnf
+#  define OPERATION_BRANCH_L_TEST_F                0x4        // 000_0100 l.bf
+#  define OPERATION_BRANCH_L_JALR                  0x8        // 000_1000 l.jal   , l.jalr , l.jr
 
   //-------------------------------------------------------[ Custom ]-----
@@ -342,4 +352,5 @@
 #  define EXCEPTION_DECOD_BUS_ERROR                0x02       //   Access at a invalid physical address
                                                                    
+  // WARNING : Keep EXCEPTION_ALU_NONE value at 0x00 (kind of hard coded in functional unit's vhdl code).
 #  define EXCEPTION_ALU_NONE                       0x00       //   Functionnal unit generate none exception
 #  define EXCEPTION_ALU_RANGE                      0x0b       //   
