Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 72)
@@ -6,174 +6,365 @@
 
   //=========================================================[ Type ]=====
-#define TYPE_MEMORY                              0x1      // 00001  
+#  define TYPE_ALU                                 0x0        // 000000 - unit multiple
+#  define TYPE_BRANCH                              0x1        // 000001 - unit multiple, to a special routing
+#  define TYPE_MEMORY                              0x2        // 000010 - unit uniq
+#  define TYPE_MAC                                 0x4        // 000100 - unit uniq
+#  define TYPE_TIMER                               0x8        // 001000 - unit uniq
+#  define TYPE_CUSTOM                              0x10       // 010000 - unit uniq
 
   //====================================================[ Operation ]=====
 
   //-------------------------------------------------------[ Memory ]-----
-#define OPERATION_MEMORY_LOAD                    0x0      // 000_0000
-#define OPERATION_MEMORY_LOAD_8_Z                0x0      // 000_0000
-#define OPERATION_MEMORY_LOAD_16_Z               0x20     // 010_0000
-#define OPERATION_MEMORY_LOAD_32_Z               0x40     // 100_0000
-#define OPERATION_MEMORY_LOAD_64_Z               0x60     // 110_0000
-#define OPERATION_MEMORY_LOAD_8_S                0x10     // 001_0000
-#define OPERATION_MEMORY_LOAD_16_S               0x30     // 011_0000
-#define OPERATION_MEMORY_LOAD_32_S               0x50     // 101_0000
-#define OPERATION_MEMORY_LOAD_64_S               0x70     // 111_0000
-
-#define OPERATION_MEMORY_STORE_8                 0x8      // 000_1000
-#define OPERATION_MEMORY_STORE_16                0x9      // 000_1001
-#define OPERATION_MEMORY_STORE_32                0xa      // 000_1010
-#define OPERATION_MEMORY_STORE_64                0xb      // 000_1011
-#define OPERATION_MEMORY_STORE_HEAD_OK           0xc      // 000_1100
-#define OPERATION_MEMORY_STORE_HEAD_KO           0xd      // 000_1101
-
-#define OPERATION_MEMORY_LOCK                    0x1      // 000_0001
-#define OPERATION_MEMORY_INVALIDATE              0x2      // 000_0010
-#define OPERATION_MEMORY_PREFETCH                0x3      // 000_0011
-#define OPERATION_MEMORY_FLUSH                   0x6      // 000_0110
-#define OPERATION_MEMORY_SYNCHRONIZATION         0x7      // 000_0111
-
+#  define OPERATION_MEMORY_LOAD                    0x0        // 000_0000
+#  define OPERATION_MEMORY_LOAD_8_Z                0x0        // 000_0000
+#  define OPERATION_MEMORY_LOAD_16_Z               0x20       // 010_0000
+#  define OPERATION_MEMORY_LOAD_32_Z               0x40       // 100_0000
+#  define OPERATION_MEMORY_LOAD_64_Z               0x60       // 110_0000
+#  define OPERATION_MEMORY_LOAD_8_S                0x10       // 001_0000
+#  define OPERATION_MEMORY_LOAD_16_S               0x30       // 011_0000
+#  define OPERATION_MEMORY_LOAD_32_S               0x50       // 101_0000
+#  define OPERATION_MEMORY_LOAD_64_S               0x70       // 111_0000
+
+#  define OPERATION_MEMORY_STORE_8                 0x8        // 000_1000
+#  define OPERATION_MEMORY_STORE_16                0x9        // 000_1001
+#  define OPERATION_MEMORY_STORE_32                0xa        // 000_1010
+#  define OPERATION_MEMORY_STORE_64                0xb        // 000_1011
+#  define OPERATION_MEMORY_STORE_HEAD_OK           0xc        // 000_1100
+#  define OPERATION_MEMORY_STORE_HEAD_KO           0xd        // 000_1101
+
+#  define OPERATION_MEMORY_LOCK                    0x1        // 000_0001
+#  define OPERATION_MEMORY_INVALIDATE              0x2        // 000_0010
+#  define OPERATION_MEMORY_PREFETCH                0x3        // 000_0011
+#  define OPERATION_MEMORY_FLUSH                   0x6        // 000_0110
+#  define OPERATION_MEMORY_SYNCHRONIZATION         0x7        // 000_0111
+  
 #define is_operation_memory_load(x)             \
-	((x == OPERATION_MEMORY_LOAD_8_Z ) or	\
-	 (x == OPERATION_MEMORY_LOAD_16_Z) or	\
-	 (x == OPERATION_MEMORY_LOAD_32_Z) or	\
-	 (x == OPERATION_MEMORY_LOAD_64_Z) or	\
-	 (x == OPERATION_MEMORY_LOAD_8_S ) or	\
-	 (x == OPERATION_MEMORY_LOAD_16_S) or	\
-	 (x == OPERATION_MEMORY_LOAD_32_S) or	\
-	 (x == OPERATION_MEMORY_LOAD_64_S) )
-
-#define is_operation_memory_store(x)                    \
-	((x == OPERATION_MEMORY_STORE_8      ) or	\
-	 (x == OPERATION_MEMORY_STORE_16     ) or	\
-	 (x == OPERATION_MEMORY_STORE_32     ) or	\
-	 (x == OPERATION_MEMORY_STORE_64     ) or	\
-	 (x == OPERATION_MEMORY_STORE_HEAD_OK) or	\
-	 (x == OPERATION_MEMORY_STORE_HEAD_KO))
-
-#define is_operation_memory_store_head(x)               \
-	((x == OPERATION_MEMORY_STORE_HEAD_OK) or	\
-	 (x == OPERATION_MEMORY_STORE_HEAD_KO))
-
+  ((x == OPERATION_MEMORY_LOAD_8_Z ) or		\
+   (x == OPERATION_MEMORY_LOAD_16_Z) or		\
+   (x == OPERATION_MEMORY_LOAD_32_Z) or		\
+   (x == OPERATION_MEMORY_LOAD_64_Z) or		\
+   (x == OPERATION_MEMORY_LOAD_8_S ) or		\
+   (x == OPERATION_MEMORY_LOAD_16_S) or		\
+   (x == OPERATION_MEMORY_LOAD_32_S) or		\
+   (x == OPERATION_MEMORY_LOAD_64_S) )
+  
+#define is_operation_memory_store(x)		\
+  ((x == OPERATION_MEMORY_STORE_8      ) or	\
+   (x == OPERATION_MEMORY_STORE_16     ) or	\
+   (x == OPERATION_MEMORY_STORE_32     ) or	\
+   (x == OPERATION_MEMORY_STORE_64     ) or	\
+   (x == OPERATION_MEMORY_STORE_HEAD_OK) or	\
+   (x == OPERATION_MEMORY_STORE_HEAD_KO))
+
+#define is_operation_memory_store_head(x)       \
+  ((x == OPERATION_MEMORY_STORE_HEAD_OK) or	\
+   (x == OPERATION_MEMORY_STORE_HEAD_KO))
+  
 #define is_operation_memory_load_signed(x)      \
-        ((x == OPERATION_MEMORY_LOAD_8_S ) or	\
-	 (x == OPERATION_MEMORY_LOAD_16_S) or	\
-	 (x == OPERATION_MEMORY_LOAD_32_S) or	\
-	 (x == OPERATION_MEMORY_LOAD_64_S) )
-
-#define MEMORY_ACCESS_8                          0x0
-#define MEMORY_ACCESS_16                         0x1
-#define MEMORY_ACCESS_32                         0x2
-#define MEMORY_ACCESS_64                         0x3
-
-#define MEMORY_SIZE_8                            8 
-#define MEMORY_SIZE_16                           16
-#define MEMORY_SIZE_32                           32
-#define MEMORY_SIZE_64                           64
-
-#define MASK_MEMORY_ACCESS_8                     0x0
-#define MASK_MEMORY_ACCESS_16                    0x1
-#define MASK_MEMORY_ACCESS_32                    0x3
-#define MASK_MEMORY_ACCESS_64                    0x7
-
-#define memory_size(x)                                                           \
-	(((x==OPERATION_MEMORY_LOAD_16_Z)or					 \
-	   (x==OPERATION_MEMORY_LOAD_16_S)or					 \
-	   (x==OPERATION_MEMORY_STORE_16 ))?MEMORY_SIZE_16:			 \
-	  (((x==OPERATION_MEMORY_LOAD_32_Z)or					 \
-	    (x==OPERATION_MEMORY_LOAD_32_S)or					 \
-	    (x==OPERATION_MEMORY_STORE_32 ))?MEMORY_SIZE_32:			 \
-	   (((x==OPERATION_MEMORY_LOAD_64_Z)or					 \
-	     (x==OPERATION_MEMORY_LOAD_64_S)or					 \
-	     (x==OPERATION_MEMORY_STORE_64 ))?MEMORY_SIZE_64:MEMORY_SIZE_8)))
-
-#define memory_access(x)                                                         \
-	(((x==OPERATION_MEMORY_LOAD_16_Z)or					 \
-	   (x==OPERATION_MEMORY_LOAD_16_S)or					 \
-	   (x==OPERATION_MEMORY_STORE_16 ))?MEMORY_ACCESS_16:			 \
-	  (((x==OPERATION_MEMORY_LOAD_32_Z)or					 \
-	    (x==OPERATION_MEMORY_LOAD_32_S)or					 \
-	    (x==OPERATION_MEMORY_STORE_32 ))?MEMORY_ACCESS_32:			 \
-	   (((x==OPERATION_MEMORY_LOAD_64_Z)or					 \
-	     (x==OPERATION_MEMORY_LOAD_64_S)or					 \
-	     (x==OPERATION_MEMORY_STORE_64 ))?MEMORY_ACCESS_64:MEMORY_ACCESS_8)))
-    
-#define mask_memory_access(x)                                                    \
-	(((x==OPERATION_MEMORY_LOAD_16_Z)or					 \
-	   (x==OPERATION_MEMORY_LOAD_16_S)or					 \
-	   (x==OPERATION_MEMORY_STORE_16 ))?MASK_MEMORY_ACCESS_16:	         \
-	  (((x==OPERATION_MEMORY_LOAD_32_Z)or					 \
-	    (x==OPERATION_MEMORY_LOAD_32_S)or					 \
-	    (x==OPERATION_MEMORY_STORE_32 ))?MASK_MEMORY_ACCESS_32:		 \
-	   (((x==OPERATION_MEMORY_LOAD_64_Z)or					 \
-	     (x==OPERATION_MEMORY_LOAD_64_S)or					 \
-	     (x==OPERATION_MEMORY_STORE_64 ))?MASK_MEMORY_ACCESS_64:MASK_MEMORY_ACCESS_8)))
-    
+  ((x == OPERATION_MEMORY_LOAD_8_S ) or		\
+   (x == OPERATION_MEMORY_LOAD_16_S) or		\
+   (x == OPERATION_MEMORY_LOAD_32_S) or		\
+   (x == OPERATION_MEMORY_LOAD_64_S) )
+
+#  define MEMORY_ACCESS_8                          0x0
+#  define MEMORY_ACCESS_16                         0x1
+#  define MEMORY_ACCESS_32                         0x2
+#  define MEMORY_ACCESS_64                         0x3
+
+#  define MEMORY_SIZE_8                            8 
+#  define MEMORY_SIZE_16                           16
+#  define MEMORY_SIZE_32                           32
+#  define MEMORY_SIZE_64                           64
+
+#  define MASK_MEMORY_ACCESS_8                     0x0
+#  define MASK_MEMORY_ACCESS_16                    0x1
+#  define MASK_MEMORY_ACCESS_32                    0x3
+#  define MASK_MEMORY_ACCESS_64                    0x7
+
+#define memory_size(x)							\
+  (((x==OPERATION_MEMORY_LOAD_16_Z)or					\
+    (x==OPERATION_MEMORY_LOAD_16_S)or					\
+    (x==OPERATION_MEMORY_STORE_16 ))?MEMORY_SIZE_16:			\
+   (((x==OPERATION_MEMORY_LOAD_32_Z)or					\
+     (x==OPERATION_MEMORY_LOAD_32_S)or					\
+     (x==OPERATION_MEMORY_STORE_32 ))?MEMORY_SIZE_32:			\
+    (((x==OPERATION_MEMORY_LOAD_64_Z)or					\
+      (x==OPERATION_MEMORY_LOAD_64_S)or					\
+      (x==OPERATION_MEMORY_STORE_64 ))?MEMORY_SIZE_64:MEMORY_SIZE_8)))
+  
+#define memory_access(x)						\
+  (((x==OPERATION_MEMORY_LOAD_16_Z)or					\
+    (x==OPERATION_MEMORY_LOAD_16_S)or					\
+    (x==OPERATION_MEMORY_STORE_16 ))?MEMORY_ACCESS_16:			\
+   (((x==OPERATION_MEMORY_LOAD_32_Z)or					\
+     (x==OPERATION_MEMORY_LOAD_32_S)or					\
+     (x==OPERATION_MEMORY_STORE_32 ))?MEMORY_ACCESS_32:			\
+    (((x==OPERATION_MEMORY_LOAD_64_Z)or					\
+      (x==OPERATION_MEMORY_LOAD_64_S)or					\
+      (x==OPERATION_MEMORY_STORE_64 ))?MEMORY_ACCESS_64:MEMORY_ACCESS_8)))
+  
+#define mask_memory_access(x)						\
+  (((x==OPERATION_MEMORY_LOAD_16_Z)or					\
+    (x==OPERATION_MEMORY_LOAD_16_S)or					\
+    (x==OPERATION_MEMORY_STORE_16 ))?MASK_MEMORY_ACCESS_16:		\
+   (((x==OPERATION_MEMORY_LOAD_32_Z)or					\
+     (x==OPERATION_MEMORY_LOAD_32_S)or					\
+     (x==OPERATION_MEMORY_STORE_32 ))?MASK_MEMORY_ACCESS_32:		\
+    (((x==OPERATION_MEMORY_LOAD_64_Z)or					\
+      (x==OPERATION_MEMORY_LOAD_64_S)or					\
+      (x==OPERATION_MEMORY_STORE_64 ))?MASK_MEMORY_ACCESS_64:MASK_MEMORY_ACCESS_8)))
+
+  //---------------------------------------------[ Functionnal Unit ]-----
+#  define OPERATION_ALU_L_ADD                      0x0        // 000_0000 l.add   , l.addi
+#  define OPERATION_ALU_L_ADDC                     0x1        // 000_0000 l.addc  , l.addic
+#  define OPERATION_ALU_L_SUB                      0x2        // 000_0000 l.sub
+#  define OPERATION_ALU_L_MUL                      0x3        // 000_0000 l.mul   , l.muli
+#  define OPERATION_ALU_L_MULU                     0x4        // 000_0000 l.mulu
+#  define OPERATION_ALU_L_DIV                      0x5        // 000_0000 l.div
+#  define OPERATION_ALU_L_DIVU                     0x6        // 000_0000 l.divu
+#  define OPERATION_ALU_L_AND                      0x7        // 000_0000 l.and   , l.andi
+#  define OPERATION_ALU_L_OR                       0x8        // 000_0000 l.or    , l.ori
+#  define OPERATION_ALU_L_XOR                      0x9        // 000_0000 l.xor   , l.xori
+#  define OPERATION_ALU_L_TEST_F                   0xa        // 000_0000 l.bf
+#  define OPERATION_ALU_L_TEST_NF                  0xb        // 000_0000 l.bnf
+#  define OPERATION_ALU_L_JALR                     0xc        // 000_0000 l.jal   , l.jalr , l.jr
+#  define OPERATION_ALU_L_SLL                      0xd        // 000_0000 l.sll   , l.slli
+#  define OPERATION_ALU_L_SRA                      0xe        // 000_0000 l.sra   , l.srai
+#  define OPERATION_ALU_L_SRL                      0xf        // 000_0000 l.srl   , l.srli
+#  define OPERATION_ALU_L_ROR                      0x10       // 000_0000 l.ror   , l.rori
+#  define OPERATION_ALU_L_MOVHI                    0x11       // 000_0000 l.movhi
+#  define OPERATION_ALU_L_EXTEND_S                 0x12       // 000_0000 l.extbs , l.exths, l.extws
+#  define OPERATION_ALU_L_EXTEND_Z                 0x13       // 000_0000 l.extbz , l.exthz, l.extwz
+#  define OPERATION_ALU_L_CMOV                     0x14       // 000_0000 l.cmov
+#  define OPERATION_ALU_L_FF1                      0x15       // 000_0000 l.ff1
+#  define OPERATION_ALU_L_FL1                      0x16       // 000_0000 l.fl1
+#  define OPERATION_ALU_L_MFSPR                    0x17       // 000_0000 l.mfspr
+#  define OPERATION_ALU_L_MTSPR                    0x18       // 000_0000 l.mtspr
+#  define OPERATION_ALU_L_SFGES                    0x19       // 000_0000 l.sfges , l.sfges
+#  define OPERATION_ALU_L_SFGEU                    0x1a       // 000_0000 l.sfgeu , l.sfgeu
+#  define OPERATION_ALU_L_SFGTS                    0x1b       // 000_0000 L.sfgts , l.sfgts
+#  define OPERATION_ALU_L_SFGTU                    0x1c       // 000_0000 l.sfgtu , l.sfgtu
+#  define OPERATION_ALU_L_SFLES                    0x1d       // 000_0000 l.sfles , l.sfles
+#  define OPERATION_ALU_L_SFLEU                    0x1e       // 000_0000 l.sfleu , l.sfleu
+#  define OPERATION_ALU_L_SFLTS                    0x1f       // 000_0000 l.sflts , l.sflts
+#  define OPERATION_ALU_L_SFLTU                    0x20       // 000_0000 l.sfltu , l.sfltu
+#  define OPERATION_ALU_L_SFEQ                     0x21       // 000_0000 l.sfeq  , l.sfeqi
+#  define OPERATION_ALU_L_SFNE                     0x22       // 000_0000 l.sfne  , l.sfnei
+#  define OPERATION_ALU_L_MAC                      0x23       // 000_0000 l.mac   , l.maci
+#  define OPERATION_ALU_L_MACRC                    0x24       // 000_0000 l.macrc
+#  define OPERATION_ALU_L_MSB                      0x25       // 000_0000 l.msb
+
+  //-------------------------------------------------------[ Custom ]-----
+
+#  define OPERATION_CUSTOM_L_1                     0x40       // 100_0000
+#  define OPERATION_CUSTOM_L_2                     0x41       // 100_0001
+#  define OPERATION_CUSTOM_L_3                     0x42       // 100_0010
+#  define OPERATION_CUSTOM_L_4                     0x43       // 100_0011
+#  define OPERATION_CUSTOM_L_5                     0x44       // 100_0100
+#  define OPERATION_CUSTOM_L_6                     0x45       // 100_0101
+#  define OPERATION_CUSTOM_L_7                     0x46       // 100_0110
+#  define OPERATION_CUSTOM_L_8                     0x47       // 100_0111
+#  define OPERATION_CUSTOM_LF_1_D                  0x48       // 100_1000
+#  define OPERATION_CUSTOM_LF_1_S                  0x49       // 100_1001
+#  define OPERATION_CUSTOM_LV_1                    0x4c       // 100_1100
+#  define OPERATION_CUSTOM_LV_2                    0x4d       // 100_1101
+#  define OPERATION_CUSTOM_LV_3                    0x4e       // 100_1110
+#  define OPERATION_CUSTOM_LV_4                    0x4f       // 100_1111
+
+#  define MAX_OPERATION                            0x80
+
   //====================================================[ Exception ]=====
   // Exception - OpenRISC
 
-#define EXCEPTION_NONE                           0x00 // none exception
-#define EXCEPTION_RESET                          0x01 // software or hardware reset
-#define EXCEPTION_BUS_ERROR                      0x02 // Access at a invalid physical adress
-#define EXCEPTION_DATA_PAGE                      0x03 // No matching or page violation protection in pages tables
-#define EXCEPTION_INSTRUCTION_PAGE               0x04 // No matching or page violation protection in pages tables
-#define EXCEPTION_TICK_TIMER                     0x05 // Tick timer interruption
-#define EXCEPTION_ALIGNMENT                      0x06 // Load/Store access is not aligned
-#define EXCEPTION_ILLEGAL_INSTRUCTION            0x07 // Instruction is illegal (no implemented)
-#define EXCEPTION_INTERRUPT                      0x08 // External interruption 
-#define EXCEPTION_DATA_TLB                       0x09 // DTLB miss
-#define EXCEPTION_INSTRUCTION_TLB                0x0a // ITLB miss
-#define EXCEPTION_RANGE                          0x0b // Overflow or access at a unimplemented register or context
-#define EXCEPTION_SYSCALL                        0x0c // System Call
-#define EXCEPTION_FLOATING_POINT                 0x0d // Caused by a floating instruction
-#define EXCEPTION_TRAP                           0x0e // L.trap or debug unit
-#define EXCEPTION_RESERVED_0                     0x0f // Reserved for a futur usage
-#define EXCEPTION_RESERVED_1                     0x10 // Reserved for a futur usage
-#define EXCEPTION_RESERVED_2                     0x11 // Reserved for a futur usage
-#define EXCEPTION_RESERVED_3                     0x12 // Reserved for a futur usage
-#define EXCEPTION_RESERVED_4                     0x13 // Reserved for a futur usage
-#define EXCEPTION_RESERVED_5                     0x14 // Reserved for a futur usage
-#define EXCEPTION_RESERVED_6                     0x15 // Reserved for implemented specific exceptions
-#define EXCEPTION_RESERVED_7                     0x16 // Reserved for implemented specific exceptions
-#define EXCEPTION_RESERVED_8                     0x17 // Reserved for implemented specific exceptions
-#define EXCEPTION_RESERVED_9                     0x18 // Reserved for implemented specific exceptions
-#define EXCEPTION_CUSTOM_0                       0x19 // Reserved for custom exceptions
-#define EXCEPTION_CUSTOM_1                       0x1a // Reserved for custom exceptions
-#define EXCEPTION_CUSTOM_2                       0x1b // Reserved for custom exceptions
-#define EXCEPTION_CUSTOM_3                       0x1c // Reserved for custom exceptions
-#define EXCEPTION_CUSTOM_4                       0x1d // Reserved for custom exceptions
-#define EXCEPTION_CUSTOM_5                       0x1e // Reserved for custom exceptions
-#define EXCEPTION_CUSTOM_6                       0x1f // Reserved for custom exceptions
+#  define SIZE_EXCEPTION                           5
+
+#  define EXCEPTION_NONE                           0x00       // none exception
+#  define EXCEPTION_RESET                          0x01       // software or hardware reset
+#  define EXCEPTION_BUS_ERROR                      0x02       // Access at a invalid physical adress
+#  define EXCEPTION_DATA_PAGE                      0x03       // No matching or page violation protection in pages tables
+#  define EXCEPTION_INSTRUCTION_PAGE               0x04       // No matching or page violation protection in pages tables
+#  define EXCEPTION_TICK_TIMER                     0x05       // Tick timer interruption
+#  define EXCEPTION_ALIGNMENT                      0x06       // Load/Store access is not aligned
+#  define EXCEPTION_ILLEGAL_INSTRUCTION            0x07       // Instruction is illegal (no implemented)
+#  define EXCEPTION_INTERRUPT                      0x08       // External interruption 
+#  define EXCEPTION_DATA_TLB                       0x09       // DTLB miss
+#  define EXCEPTION_INSTRUCTION_TLB                0x0a       // ITLB miss
+#  define EXCEPTION_RANGE                          0x0b       // Overflow or access at a unimplemented register or context
+#  define EXCEPTION_SYSCALL                        0x0c       // System Call
+#  define EXCEPTION_FLOATING_POINT                 0x0d       // Caused by a floating instruction
+#  define EXCEPTION_TRAP                           0x0e       // L.trap or debug unit
+#  define EXCEPTION_RESERVED_0                     0x0f       // Reserved for a futur usage
+#  define EXCEPTION_RESERVED_1                     0x10       // Reserved for a futur usage
+#  define EXCEPTION_RESERVED_2                     0x11       // Reserved for a futur usage
+#  define EXCEPTION_RESERVED_3                     0x12       // Reserved for a futur usage
+#  define EXCEPTION_RESERVED_4                     0x13       // Reserved for a futur usage
+#  define EXCEPTION_RESERVED_5                     0x14       // Reserved for a futur usage
+#  define EXCEPTION_RESERVED_6                     0x15       // Reserved for implemented specific exceptions
+#  define EXCEPTION_RESERVED_7                     0x16       // Reserved for implemented specific exceptions
+#  define EXCEPTION_RESERVED_8                     0x17       // Reserved for implemented specific exceptions
+#  define EXCEPTION_RESERVED_9                     0x18       // Reserved for implemented specific exceptions
+#  define EXCEPTION_CUSTOM_0                       0x19       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_1                       0x1a       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_2                       0x1b       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_3                       0x1c       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_4                       0x1d       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_5                       0x1e       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_6                       0x1f       // Reserved for custom exceptions
+
+#define exception_to_address(x) (x<<8)
 
   // Exception Execution
-#define EXCEPTION_MEMORY_NONE                    0x0  // Load/Store access is not aligned
-#define EXCEPTION_MEMORY_ALIGNMENT               0x1  // Load/Store access is not aligned
-#define EXCEPTION_MEMORY_DATA_TLB                0x2  // DTLB miss
-#define EXCEPTION_MEMORY_DATA_PAGE               0x3  // No matching or page violation protection in pages tables
-#define EXCEPTION_MEMORY_BUS_ERROR               0x4  // Access at a invalid physical address
-#define EXCEPTION_MEMORY_MISS_SPECULATION        0x5  // Load miss speculation
-#define EXCEPTION_MEMORY_LOAD_SPECULATIVE        0x6  // The load is speculative : write in register file, but don't commit
-
-  //==================================================[ dcache_type ]=====
-#  define DCACHE_LOAD                    0x0 // 0000
-#  define DCACHE_LOCK                    0x1 // 0001
-#  define DCACHE_INVALIDATE              0x2 // 0010
-#  define DCACHE_PREFETCH                0x3 // 0011
-//#define DCACHE_                        0x4 // 0100
-//#define DCACHE_                        0x5 // 0101
-#  define DCACHE_FLUSH                   0x6 // 0110
-#  define DCACHE_SYNCHRONIZATION         0x7 // 0111
-#  define DCACHE_STORE_8                 0x8 // 1000
-#  define DCACHE_STORE_16                0x9 // 1001
-#  define DCACHE_STORE_32                0xa // 1010
-#  define DCACHE_STORE_64                0xb // 1011
-//#define DCACHE_                        0xc // 1100
-//#define DCACHE_                        0xd // 1101
-//#define DCACHE_                        0xe // 1110
-//#define DCACHE_                        0xf // 1111
-
+#  define EXCEPTION_MEMORY_NONE                    0x0        // Load/Store generate none exception
+#  define EXCEPTION_MEMORY_ALIGNMENT               0x1        // Load/Store access is not aligned
+#  define EXCEPTION_MEMORY_DATA_TLB                0x2        // DTLB miss
+#  define EXCEPTION_MEMORY_DATA_PAGE               0x3        // No matching or page violation protection in pages tables
+#  define EXCEPTION_MEMORY_BUS_ERROR               0x4        // Access at a invalid physical address
+#  define EXCEPTION_MEMORY_MISS_SPECULATION        0x5        // Load miss speculation
+#  define EXCEPTION_MEMORY_LOAD_SPECULATIVE        0x6        // The load is speculative : write in register file, but don't commit
+
+#  define EXCEPTION_CUSTOM_NONE                    0x1        // Custom unit generate none exception
+#  define EXCEPTION_CUSTOM_CUST_0                  0x1        // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_1                  0x2        // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_2                  0x3        // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_3                  0x4        // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_4                  0x5        // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_5                  0x6        // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_6                  0x7        // Reserved for custom exceptions
+
+#  define EXCEPTION_ALU_NONE                       0x0        // Functionnal unit generate none exception
+#  define EXCEPTION_ALU_RANGE                      0x1        // 
+#  define EXCEPTION_ALU_SPR_ACCESS_INVALID         0x2        // SPR     present in ALU but not compatible privilege
+#  define EXCEPTION_ALU_SPR_ACCESS_NOT_COMPLETE    0x3        // SPR not present in ALU
+
+  //=======================================================[ dcache ]=====
+
+  //--------------------------------------------------[ dcache_type ]-----
+
+#  define SIZE_DCACHE_TYPE                              4
+
+#  define DCACHE_TYPE_LOAD                              0x0        // 0000
+#  define DCACHE_TYPE_LOCK                              0x1        // 0001
+#  define DCACHE_TYPE_INVALIDATE                        0x2        // 0010
+#  define DCACHE_TYPE_PREFETCH                          0x3        // 0011
+//#define DCACHE_TYPE_                                  0x4        // 0100
+//#define DCACHE_TYPE_                                  0x5        // 0101
+#  define DCACHE_TYPE_FLUSH                             0x6        // 0110
+#  define DCACHE_TYPE_SYNCHRONIZATION                   0x7        // 0111
+#  define DCACHE_TYPE_STORE_8                           0x8        // 1000
+#  define DCACHE_TYPE_STORE_16                          0x9        // 1001
+#  define DCACHE_TYPE_STORE_32                          0xa        // 1010
+#  define DCACHE_TYPE_STORE_64                          0xb        // 1011
+//#define DCACHE_TYPE_                                  0xc        // 1100
+//#define DCACHE_TYPE_                                  0xd        // 1101
+//#define DCACHE_TYPE_                                  0xe        // 1110
+//#define DCACHE_TYPE_                                  0xf        // 1111
 
 // just take the 4 less significative bits.
 #define operation_to_dcache_type(x) (x&0xf)
+
+  //-------------------------------------------------[ dcache_error ]-----
+
+#  define SIZE_DCACHE_ERROR                             1
+
+#  define DCACHE_ERROR_NONE                             0x0
+#  define DCACHE_ERROR_BUS_ERROR                        0x1
+
+  //=================================================[ special_data ]=====
+
+#  define SIZE_SPECIAL_DATA                             2
+
+// Position of flag in "rename register SR" (NOT IN "SR")
+#  define FLAG_POSITION_F                               0x0         // Conditionnal branch flag
+#  define FLAG_POSITION_CY                              0x1         // Carry was produced by last arithmetic operation
+#  define FLAG_POSITION_OV                              0x0         // Overflow occured during last arithmetic operation
+
+#  define FLAG_F                                        (1<<FLAG_POSITION_F ) // Conditionnal branch flag
+#  define FLAG_CY                                       (1<<FLAG_POSITION_CY) // Carry was produced by last arithmetic operation
+#  define FLAG_OV                                       (1<<FLAG_POSITION_OV) // Overflow occured during last arithmetic operation
+
+  //==========================================================[ spr ]=====
+
+  enum
+    {
+      GROUP_SYSTEM_AND_CONTROL,  // 0
+      GROUP_DMMU,                // 1
+      GROUP_IMMU,                // 2
+      GROUP_DCACHE,              // 3
+      GROUP_ICACHE,              // 4
+      GROUP_MAC,                 // 5
+      GROUP_DEBUG,               // 6
+      GROUP_PERFORMANCE_COUNTER, // 7
+      GROUP_POWER_MANAGEMENT,    // 8
+      GROUP_PIC,                 // 9
+      GROUP_TICK_TIMER,          // 10
+      GROUP_FLOATING_POINT,      // 11
+      GROUP_RESERVED_1,          // 12     
+      GROUP_RESERVED_2,          // 13     
+      GROUP_RESERVED_3,          // 14     
+      GROUP_RESERVED_4,          // 15     
+      GROUP_RESERVED_5,          // 16     
+      GROUP_RESERVED_6,          // 17     
+      GROUP_RESERVED_7,          // 18     
+      GROUP_RESERVED_8,          // 19     
+      GROUP_RESERVED_9,          // 20     
+      GROUP_RESERVED_10,         // 21     
+      GROUP_RESERVED_11,         // 22     
+      GROUP_RESERVED_12,         // 23
+      GROUP_CUSTOM_1,            // 24     
+      GROUP_CUSTOM_2,            // 25     
+      GROUP_CUSTOM_3,            // 26     
+      GROUP_CUSTOM_4,            // 27     
+      GROUP_CUSTOM_5,            // 28     
+      GROUP_CUSTOM_6,            // 29     
+      GROUP_CUSTOM_7,            // 30     
+      GROUP_CUSTOM_8             // 31     
+    };
+
+#  define NB_GROUP                                 32
+#  define NB_REG_GROUP_SYSTEM_AND_CONTROL          1536
+#  define NB_REG_GROUP_DMMU                        1536
+#  define NB_REG_GROUP_IMMU                        1536
+#  define NB_REG_GROUP_DCACHE                      6
+#  define NB_REG_GROUP_ICACHE                      4
+#  define NB_REG_GROUP_MAC                         3
+#  define NB_REG_GROUP_DEBUG                       22
+#  define NB_REG_GROUP_PERFORMANCE_COUNTER         16
+#  define NB_REG_GROUP_POWER_MANAGEMENT            1
+#  define NB_REG_GROUP_PIC                         3
+#  define NB_REG_GROUP_TICK_TIMER                  2
+#  define NB_REG_GROUP_FLOATING_POINT              0
+#  define NB_REG_GROUP_RESERVED_1                  0
+#  define NB_REG_GROUP_RESERVED_2                  0
+#  define NB_REG_GROUP_RESERVED_3                  0
+#  define NB_REG_GROUP_RESERVED_4                  0
+#  define NB_REG_GROUP_RESERVED_5                  0
+#  define NB_REG_GROUP_RESERVED_6                  0
+#  define NB_REG_GROUP_RESERVED_7                  0
+#  define NB_REG_GROUP_RESERVED_8                  0
+#  define NB_REG_GROUP_RESERVED_9                  0
+#  define NB_REG_GROUP_RESERVED_10                 0
+#  define NB_REG_GROUP_RESERVED_11                 0
+#  define NB_REG_GROUP_RESERVED_12                 0
+#  define NB_REG_GROUP_CUSTOM_1                    0
+#  define NB_REG_GROUP_CUSTOM_2                    0
+#  define NB_REG_GROUP_CUSTOM_3                    0
+#  define NB_REG_GROUP_CUSTOM_4                    0
+#  define NB_REG_GROUP_CUSTOM_5                    0
+#  define NB_REG_GROUP_CUSTOM_6                    0
+#  define NB_REG_GROUP_CUSTOM_7                    0
+#  define NB_REG_GROUP_CUSTOM_8                    0
+					           
+					           
+  // GROUP_MAC				           
+#  define SPR_MACLO                                1          // MAC Low
+#  define SPR_MACHI                                2          // MAC High
+
+  //----------------------------------------------[ spr_mode_access ]-----
+
+#  define SPR_ACCESS_MODE_NONE                     0x0        // 000
+#  define SPR_ACCESS_MODE_READ_ONLY                0x1        // 001
+#  define SPR_ACCESS_MODE_WRITE_ONLY               0x2        // 010
+#  define SPR_ACCESS_MODE_READ_WRITE               0x3        // 011
+#  define SPR_ACCESS_MODE_READ_ONLY_COND           0x5        // 101 special read
 
   /*
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 72)
@@ -21,5 +21,6 @@
 #define         DEBUG_Multi_Execute_unit                          false
 #define           DEBUG_Execute_unit                              false
-#define             DEBUG_Load_store_unit                         true 
+#define             DEBUG_Functionnal_unit                        true 
+#define             DEBUG_Load_store_unit                         false
 #define         DEBUG_Multi_Read_unit				  false
 #define           DEBUG_Read_unit				  false
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 72)
@@ -13,4 +13,5 @@
 #include <math.h>
 #include "Behavioural/include/Environnement.h"
+#include "Behavioural/include/Constants.h"
 #include "Common/include/ErrorMorpheo.h"
 #include "Common/include/ToString.h"
@@ -25,8 +26,7 @@
   {
     // -----[ fields ]----------------------------------------------------
-  public   : static const uint32_t   _size_exception      = 4 ;
-  public   : static const uint32_t   _size_dcache_address = 32;
-  public   : static const uint32_t   _size_dcache_type    = 4;
-  public   : static const uint32_t   _size_dcache_error   = 1;
+  public   : static const uint32_t   _size_exception      = SIZE_EXCEPTION;
+  public   : static const uint32_t   _size_dcache_type    = SIZE_DCACHE_TYPE;
+  public   : static const uint32_t   _size_dcache_error   = SIZE_DCACHE_ERROR;
 
     // -----[ methods ]---------------------------------------------------
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h	(revision 72)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h	(revision 72)
@@ -0,0 +1,43 @@
+#ifndef morpheo_behavioural_SPR_access_mode_h
+#define morpheo_behavioural_SPR_access_mode_h
+
+#include "Common/include/BitManipulation.h"
+#include "Common/include/ErrorMorpheo.h"
+#include "Behavioural/include/Constants.h"
+#include "Behavioural/include/Types.h"
+
+namespace morpheo {
+namespace behavioural {
+
+  typedef struct
+  {
+    Tgeneral_data_t _group;
+    Tgeneral_data_t _register;
+  } spr_address_t;
+
+
+  class SPR_access_mode
+  {
+  private : spr_access_mode_t   ** _spr_generic;
+  private : uint32_t             * _max_register_by_group;
+
+  public  : SPR_access_mode();
+  public  : ~SPR_access_mode();
+
+  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          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);
+  };
+  
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 72)
@@ -42,4 +42,19 @@
   typedef uint32_t      Tdcache_type_t;
 
+  //----------------------------------------------[ spr_mode_access ]-----
+  class spr_access_mode_t
+  {
+  public : uint8_t _user_access_mode      ;
+  public : uint8_t _supervisor_access_mode;
+    
+  public : spr_access_mode_t (uint32_t user_access_mode       = SPR_ACCESS_MODE_NONE,
+			      uint32_t supervisor_access_mode = SPR_ACCESS_MODE_NONE)
+    {
+      _user_access_mode       = user_access_mode      ;
+      _supervisor_access_mode = supervisor_access_mode;
+    }
+  };
+
+
 }; // end namespace behavioural
 }; // end namespace morpheo              
