Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/Makefile	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/Makefile	(revision 145)
@@ -2,11 +2,12 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
 # 
 
-#-----[ Directory ]----------------------------------------
-DIR_MORPHEO			= ../../../../..
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT                   = ../
+include                         $(DIR_COMPONENT)/Makefile.defs
 
 LIBRARY				= $(RegisterFile_Monolithic_LIBRARY)
@@ -14,7 +15,7 @@
 DIR_LIBRARY			= $(RegisterFile_Monolithic_DIR_LIBRARY)
 
-#-----[ include ]------------------------------------------
+#-----[ include ]------------------------------------------
 
-all				: library
+all				:
 				@$(MAKE) all_selftest
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_mixte.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_mixte.cfg	(revision 142)
+++ 	(revision )
@@ -1,6 +1,0 @@
-RegisterFile_Monolithic
-0	0 	*2	# nb_port_read
-0	0	*2	# nb_port_write
-1	8	*2	# nb_port_read_write
-32 	32 	*2	# nb_word
-32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_read.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_read.cfg	(revision 142)
+++ 	(revision )
@@ -1,6 +1,0 @@
-RegisterFile_Monolithic
-1	8 	*2	# nb_port_read
-1	1	*2	# nb_port_write
-0	0	*2	# nb_port_read_write
-512 	512	*2	# nb_word
-32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_size.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_size.cfg	(revision 142)
+++ 	(revision )
@@ -1,6 +1,0 @@
-RegisterFile_Monolithic
-4	4 	*2	# nb_port_read
-2	2	*2	# nb_port_write
-0	0	*2	# nb_port_read_write
-1   	128	*2	# nb_word
-32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_write.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/config_write.cfg	(revision 142)
+++ 	(revision )
@@ -1,6 +1,0 @@
-RegisterFile_Monolithic
-1	1 	*2	# nb_port_read
-2	8	*2	# nb_port_write
-0	0	*2	# nb_port_read_write
-512	512	*2	# nb_word
-32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_mixte.gen
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_mixte.gen	(revision 145)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_mixte.gen	(revision 145)
@@ -0,0 +1,6 @@
+RegisterFile_Monolithic
+0	0 	*2	# nb_port_read
+0	0	*2	# nb_port_write
+1	8	*2	# nb_port_read_write
+32 	32 	*2	# nb_word
+32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_read.gen
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_read.gen	(revision 145)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_read.gen	(revision 145)
@@ -0,0 +1,6 @@
+RegisterFile_Monolithic
+1	8 	*2	# nb_port_read
+1	1	*2	# nb_port_write
+0	0	*2	# nb_port_read_write
+512 	512	*2	# nb_word
+32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_size.gen
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_size.gen	(revision 145)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_size.gen	(revision 145)
@@ -0,0 +1,6 @@
+RegisterFile_Monolithic
+4	4 	*2	# nb_port_read
+2	2	*2	# nb_port_write
+0	0	*2	# nb_port_read_write
+1   	128	*2	# nb_word
+32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_write.gen
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_write.gen	(revision 145)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/configuration/config_write.gen	(revision 145)
@@ -0,0 +1,6 @@
+RegisterFile_Monolithic
+1	1 	*2	# nb_port_read
+2	8	*2	# nb_port_write
+0	0	*2	# nb_port_read_write
+512	512	*2	# nb_word
+32	32	*2	# size_word
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/mkf.info
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/mkf.info	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/mkf.info	(revision 145)
@@ -1,6 +1,6 @@
 
-# RegisterFile_Monolithic_0
-target_dep	all	RegisterFile_Monolithic_0.ngc
-target_dep	RegisterFile_Monolithic_0.ngc	RegisterFile_Monolithic_0.prj
-target_dep	RegisterFile_Monolithic_0.prj	RegisterFile_Monolithic_0_Pack.vhdl RegisterFile_Monolithic_0.vhdl
+# debug_0
+target_dep	all	debug_0.ngc
+target_dep	debug_0.ngc	debug_0.prj
+target_dep	debug_0.prj	debug_0_Pack.vhdl debug_0.vhdl
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h	(revision 145)
@@ -22,5 +22,5 @@
 #include "Behavioural/include/Stat.h"
 #endif
-#include "Behavioural/include/Component.h"
+// #include "Behavioural/include/Component.h"
 #ifdef VHDL
 #include "Behavioural/include/Vhdl.h"
@@ -28,9 +28,17 @@
 #include "Behavioural/include/Usage.h"
 
+
+
 namespace morpheo                    {
 namespace behavioural                {
+
+  class Component;
+  class Interfaces;
+
 namespace generic                    {
 namespace registerfile               {
 namespace registerfile_monolithic    {
+
+// #define VHDL_GAISLER
 
   typedef enum {RW_READ, RW_WRITE} rw_t;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h	(revision 145)
@@ -17,5 +17,6 @@
 namespace registerfile_monolithic    {
 
-//   typedef uint32_t Taddress_t;
+//typedef uint32_t Taddress_t;
+//typedef uint64_t Tdata_t;
   typedef Tgeneral_data_t Tdata_t;
  
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp	(revision 145)
@@ -8,4 +8,5 @@
 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
 #include "Behavioural/include/Allocation.h"
+#include "Behavioural/include/Component.h"
 
 namespace morpheo                    {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp	(revision 145)
@@ -8,4 +8,5 @@
 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
 #include "Behavioural/include/Allocation.h"
+#include "Behavioural/include/Component.h"
 
 namespace morpheo                    {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl.cpp	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl.cpp	(revision 145)
@@ -10,4 +10,6 @@
 #include "Behavioural/include/Vhdl.h"
 #include "Common/include/ToString.h"
+#include "Behavioural/include/Component.h"
+
 namespace morpheo                    {
 namespace behavioural                {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp	(revision 145)
@@ -17,4 +17,6 @@
   void RegisterFile_Monolithic::vhdl_body (Vhdl * & vhdl)
   {
+#ifndef VHDL_GAISLER
+
     vhdl->set_body   (0,"");
     vhdl->set_comment(0,"---------------------------------------------------------------------------");
@@ -107,6 +109,142 @@
     if (_param->_have_init_value)
       vhdl->set_body   (1,"end if;");
-
     vhdl->set_body   (0,"end process RegisterFile_write;");
+
+#else
+    // vhdl->set_body   (0,"");
+    // vhdl->set_comment(0,"---------------------------------------------------------------------------");
+    // vhdl->set_comment(0," Ackitement");
+    // vhdl->set_comment(0,"---------------------------------------------------------------------------");
+    // vhdl->set_body   (0,"");
+
+    // for (uint32_t i = 0; i < _param->_nb_port_read; i++)
+    //   vhdl->set_body   (0,"out_READ_"+toString(i)+"_ACK  <= '1';");
+    // for (uint32_t i = 0; i < _param->_nb_port_write; i++)
+    //   vhdl->set_body   (0,"out_WRITE_"+toString(i)+"_ACK <= '1';");
+    // for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
+    //   vhdl->set_body   (0,"out_READ_WRITE_"+toString(i)+"_ACK  <= '1';");
+
+    // vhdl->set_body   (0,"");
+    // vhdl->set_comment(0,"---------------------------------------------------------------------------");
+    // vhdl->set_comment(0," Read RegisterFile");
+    // vhdl->set_comment(0,"---------------------------------------------------------------------------");
+    // vhdl->set_body   (0,"");
+
+    // for (uint32_t num_read=0; num_read<_param->_nb_port_read; ++num_read)
+    //   {
+    //     vhdl->set_body   (0,"with in_READ_"+toString(num_read)+"_ADDRESS select");
+    //       vhdl->set_body   (1,"out_READ_"+toString(num_read)+"_DATA <=");
+    //       for (uint32_t num_word=0; num_word<_param->_nb_word-1; ++num_word)
+    //         vhdl->set_body   (1,"reg_DATA_"+toString(num_word)+" when "+std_logic_cst(_param->_size_address,num_word)+",");
+    //       vhdl->set_body   (1,"reg_DATA_"+toString(_param->_nb_word-1)+" when others;");
+    //   }
+
+    // vhdl->set_body   (0,"");
+    // vhdl->set_comment(0,"---------------------------------------------------------------------------");
+    // vhdl->set_comment(0," Write RegisterFile");
+    // vhdl->set_comment(0,"---------------------------------------------------------------------------");
+    // vhdl->set_body   (0,"");
+
+    // vhdl->set_body   (0,"RegisterFile_write: process (in_CLOCK)");
+    // vhdl->set_body   (0,"begin  -- process RegisterFile_write");
+    // vhdl->set_body   (1,"if in_CLOCK'event and in_CLOCK = '1' then");
+
+    // for (uint32_t num_write = 0; num_write < _param->_nb_port_write; num_write++)
+    //   {
+    //     vhdl->set_body   (2,"if (in_WRITE_"+toString(num_write)+"_VAL = '1') then");
+    //     for (uint32_t num_word=0; num_word<_param->_nb_word; ++num_word)
+    //       {
+    //         vhdl->set_body   (3,"if (in_WRITE_"+toString(num_write)+"_ADDRESS = "+std_logic_cst(_param->_size_address,num_word)+") then");
+    //         vhdl->set_body   (4,"reg_DATA_"+toString(num_word)+" <= in_WRITE_"+toString(num_write)+"_DATA;");
+    //         vhdl->set_body   (3,"end if;");
+    //       }
+    //     vhdl->set_body   (2,"end if;");
+    //   }
+    
+    // vhdl->set_body   (1,"end if;");
+    // vhdl->set_body   (0,"end process RegisterFile_write;");
+
+    vhdl->set_body   (0,"combinatory : process (");
+    for (uint32_t num_read=0; num_read<_param->_nb_port_read; ++num_read)
+      {
+        vhdl->set_body   (1,"in_READ_"+toString(num_read)+"_VAL,");
+	if (_param->_have_port_address)
+        vhdl->set_body   (1,"in_READ_"+toString(num_read)+"_ADDRESS,");
+      }
+    for (uint32_t num_write=0; num_write<_param->_nb_port_write; ++num_write)
+      {
+        vhdl->set_body   (1,"in_WRITE_"+toString(num_write)+"_VAL,");
+	if (_param->_have_port_address)
+        vhdl->set_body   (1,"in_WRITE_"+toString(num_write)+"_ADDRESS,");
+        vhdl->set_body   (1,"in_WRITE_"+toString(num_write)+"_DATA,");
+      }
+    for (uint32_t num_write = 0; num_write < _param->_nb_port_write; num_write++)
+    vhdl->set_body   (1,"in_NRESET,");
+    vhdl->set_body   (1,"reg_DATA)");
+    vhdl->set_body   (1,"variable sig_DATA : Treg;");
+    vhdl->set_body   (0,"begin");
+    vhdl->set_body   (1,"");
+    vhdl->set_body   (1,"sig_DATA := reg_DATA;");
+
+    vhdl->set_body   (1,"");
+    vhdl->set_body   (1," -- ack");
+    vhdl->set_body   (1,"");
+    
+    for (uint32_t i = 0; i < _param->_nb_port_read; i++)
+      vhdl->set_body   (1,"out_READ_"+toString(i)+"_ACK  <= '1';");
+    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
+      vhdl->set_body   (1,"out_WRITE_"+toString(i)+"_ACK <= '1';");
+    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
+      vhdl->set_body   (1,"out_READ_WRITE_"+toString(i)+"_ACK  <= '1';");
+    vhdl->set_body   (1,"");
+    vhdl->set_body   (1," -- Read");
+    vhdl->set_body   (1,"");
+
+    for (uint32_t i = 0; i < _param->_nb_port_read; i++)
+      {
+	std::string str_address;
+	if (_param->_have_port_address)
+	  str_address = "conv_integer(in_READ_"+toString(i)+"_ADDRESS)";
+	else
+	  str_address = "0";
+
+        vhdl->set_body   (1,"if (in_READ_"+toString(i)+"_VAL = '1') then"),
+	vhdl->set_body   (2,"out_READ_"+toString(i)+"_DATA <= sig_DATA.reg ("+str_address+");");
+        vhdl->set_body   (1,"else"),
+	vhdl->set_body   (2,"out_READ_"+toString(i)+"_DATA <= "+std_logic_others(_param->_size_word,0)+";");
+        vhdl->set_body   (1,"end if;");
+      }
+    vhdl->set_body   (1,"");
+    vhdl->set_body   (1," -- write");
+    vhdl->set_body   (1,"");
+
+    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
+      {
+	std::string str_address;
+	if (_param->_have_port_address)
+	  str_address = "conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)";
+	else
+	  str_address = "0";
+
+	vhdl->set_body   (1,"if (in_WRITE_"+toString(i)+"_VAL = '1') then");
+	vhdl->set_body   (2,"sig_DATA.reg("+str_address+") := in_WRITE_"+toString(i)+"_DATA;");
+	vhdl->set_body   (1,"end if;");
+      }
+
+    vhdl->set_body   (1,"");
+    vhdl->set_body   (1,"reg_DATA_next <= sig_DATA;");
+    vhdl->set_body   (1,"");
+    vhdl->set_body   (0,"end process combinatory;");
+
+
+    vhdl->set_body   (0,"sequential: process (in_CLOCK)");
+    vhdl->set_body   (0,"begin");
+    vhdl->set_body   (1,"if rising_edge(in_CLOCK) then");
+    vhdl->set_body   (2,"reg_DATA <= reg_DATA_NEXT;");
+    vhdl->set_body   (1,"end if;");
+    vhdl->set_body   (0,"end process sequential;");
+
+#endif
+
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_declaration.cpp	(revision 142)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_declaration.cpp	(revision 145)
@@ -18,7 +18,18 @@
   void RegisterFile_Monolithic::vhdl_declaration (Vhdl * & vhdl)
   {
+#ifndef VHDL_GAISLER
     vhdl->set_type ("Tregfile", "array " + _std_logic_range(_param->_nb_word) + " of " + std_logic(_param->_size_word));
 
     vhdl->set_signal ("reg_DATA", "Tregfile");
+#else
+    // for (uint32_t i=0; i<_param->_nb_word; ++i)
+    //   vhdl->set_signal ("reg_DATA_"+toString(i), _param->_size_word);
+
+    vhdl->set_type ("Tregfile", "array " + _std_logic_range(_param->_nb_word) + " of " + std_logic(_param->_size_word));
+    vhdl->set_type ("Treg", "record reg : Tregfile; end record");
+
+    vhdl->set_signal ("reg_DATA"     , "Treg");
+    vhdl->set_signal ("reg_DATA_next", "Treg");
+#endif
   };
 
