Index: soft/giet_vm/memo/TODO
===================================================================
--- soft/giet_vm/memo/TODO	(revision 227)
+++ soft/giet_vm/memo/TODO	(revision 238)
@@ -1,2 +1,3 @@
 + Support for debug info
 + Search the sections by name, the name should correspond to vobj->name and the adresse should correspond to vseg->addresse
++ Documentation
Index: soft/giet_vm/memo/include/libelfpp/elfpp/elfpp_object.hh
===================================================================
--- soft/giet_vm/memo/include/libelfpp/elfpp/elfpp_object.hh	(revision 227)
+++ soft/giet_vm/memo/include/libelfpp/elfpp/elfpp_object.hh	(revision 238)
@@ -59,5 +59,5 @@
 
     /** Copy all header fields of obj and set the access_ variable*/
-    void copy_info(object& obj);
+    void copy_info(object& obj, size_t word_width = 0);
 
     ~object();
Index: soft/giet_vm/memo/include/memo.h
===================================================================
--- soft/giet_vm/memo/include/memo.h	(revision 227)
+++ soft/giet_vm/memo/include/memo.h	(revision 238)
@@ -1,13 +1,13 @@
 /* -*- c++ -*-
  *
- * SOCLIB_LGPL_HEADER_BEGIN
+ * GIET_VM_LGPL_HEADER_BEGIN
  * 
- * This file is part of SoCLib, GNU LGPLv2.1.
+ * This file is part of GIET_VM, GNU LGPLv2.1.
  * 
- * SoCLib is free software; you can redistribute it and/or modify it
+ * GIET_VM is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
  * 
- * SoCLib is distributed in the hope that it will be useful, but
+ * GIET_VM is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -15,9 +15,9 @@
  * 
  * You should have received a copy of the GNU Lesser General Public
- * License along with SoCLib; if not, write to the Free Software
+ * License along with GIET_VM; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
  * 
- * SOCLIB_LGPL_HEADER_END
+ * GIET_VM_LGPL_HEADER_END
  *
  * Copyright (c) UPMC, Lip6, SoC
@@ -25,6 +25,7 @@
  *
  */
-#ifndef _MEMO_H_
-#define _MEMO_H_
+
+#ifndef GIET_VM_MEMO_H
+#define GIET_VM_MEMO_H
 
 #include  <stdlib.h>
@@ -57,17 +58,17 @@
 class MeMo
 {
+// TODO: make the name defined in the map_info relative to this wd.
 
-    std::string m_path;         //map_info path name
-    std::string m_wd;           //map_info path to directory TODO: make the name defined in the map_info relative to this wd.
-    std::string m_simpleName;   //map_info filename TODO
-    void* m_data;               //map_info structure 
-    uintptr_t m_addr;           //map_info address (virtual)
-    size_t m_size;              //size of the structure
+    std::string                                   m_path;       // map_info path name
+    std::string                                   m_wd;         // map_info directory TODO
+    std::string                                   m_simpleName; // map_info filename TODO
+    void*                                         m_data;       // map_info structure 
+    uintptr_t                                     m_addr;       // map_info address (virtual)
+    size_t                                        m_size;       // size of the structure
     mutable std::map<std::string, elfpp::object*> m_loaders;
-    PSegHandler m_psegh;
-    PathHandler m_pathHandler;
-    
-    bool m_ginit;
-    elfpp::object* m_generator;
+    PSegHandler                                   m_psegh;
+    PathHandler                                   m_pathHandler;
+    bool                                          m_ginit;
+    elfpp::object*                                m_generator;
 
     size_t load_bin(std::string filename, void* buffer);    
@@ -78,5 +79,7 @@
 public:
 
-    MeMo( const std::string &name, const size_t pageSize = 4096);
+    MeMo( const std::string   &name, 
+          const size_t        pageSize = 4096);
+
     ~MeMo();
 
@@ -93,7 +96,7 @@
     }
 
+    // The following functions handle the map.bin structure
+    // They must keep synchronised with functions defined in boot_init.c.
 
-    //The following functions handle the map.bin structure
-    //inspired from the boot_init.c of the GIET
     mapping_cluster_t* get_cluster_base( mapping_header_t* header );
     mapping_pseg_t* get_pseg_base( mapping_header_t* header );
@@ -108,5 +111,5 @@
 
 
-#endif /* _MEMO_H_ */
+#endif /* GIET_VM_MEMO_H */
 
 // Local Variables:
Index: soft/giet_vm/memo/include/pseg.h
===================================================================
--- soft/giet_vm/memo/include/pseg.h	(revision 227)
+++ soft/giet_vm/memo/include/pseg.h	(revision 238)
@@ -1,13 +1,13 @@
 /* -*- c++ -*-
  *
- * SOCLIB_LGPL_HEADER_BEGIN
+ * GIET-VM_LGPL_HEADER_BEGIN
  * 
- * This file is part of SoCLib, GNU LGPLv2.1.
+ * This file is part of the GIET-VMS, GNU LGPLv2.1.
  * 
- * SoCLib is free software; you can redistribute it and/or modify it
+ * The GIET-VM is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
  * 
- * SoCLib is distributed in the hope that it will be useful, but
+ * THe GIET-VM is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -19,5 +19,5 @@
  * 02110-1301 USA
  * 
- * SOCLIB_LGPL_HEADER_END
+ * GIET-VM_LGPL_HEADER_END
  *
  * Copyright (c) UPMC, Lip6, SoC
@@ -25,6 +25,6 @@
  *          
  */
-#ifndef SOCLIB_PSEG_H_
-#define SOCLIB_PSEG_H_
+#ifndef GIET_MEMO_PSEG_H
+#define GIET_MEMO_PSEG_H
 
 #include <string>
@@ -39,4 +39,5 @@
 class MeMo;
 
+//////////
 class VSeg
 {
@@ -45,19 +46,22 @@
     friend class MeMo;
 
-    std::string m_name;
-    std::string m_file;
-    uintptr_t m_vma;   //The address of the section to load in the binary file.
-    uintptr_t m_lma;   //Physical address to which we load the seg (getted from the associated PSeg), setted by PSeg::add/addIdent.
-    size_t m_length;
-    size_t m_type;
-    bool m_loadable;     // wether this is a loadable vseg ( code, data...)
+    typedef unsigned long long paddr_t;
+
+    std::string m_name;     // vseg name
+    std::string m_file;     // file name
+    uintptr_t   m_vma;      // Virtual address of the section to load in the binary file.
+    paddr_t     m_lma;      // Physical address  
+    size_t      m_length;
+    size_t      m_type;
+    bool        m_loadable; // loadable vseg ( code, data...)
 
 public:
-    bool m_ident;//Indicate if the idententy mapping is activited. used by PSegHandler::makeIdent()
+
+    bool        m_ident;    // identity mapping required if true
 
     const std::string& name() const;
     const std::string& file() const;
     uintptr_t vma() const;
-    uintptr_t lma() const;
+    paddr_t lma() const;
     size_t length() const;
     size_t type() const;
@@ -75,50 +79,58 @@
     VSeg();
     VSeg( const VSeg &ref );
-    VSeg(std::string& binaryName, std::string& name, uintptr_t vma, size_t length, bool loadable, bool ident);
+    VSeg(std::string&   binaryName, 
+         std::string&   name, 
+         uintptr_t      vma, 
+         size_t         length, 
+         bool           loadable, 
+         bool           ident);
 
     ~VSeg();
 };
 
-
+//////////
 class PSeg
 {
-    std::string m_name;
-    uintptr_t m_lma;
-    size_t m_length;
-    size_t m_type;
+    std::string   m_name;
+    paddr_t       m_lma;
+    paddr_t       m_length;
+    size_t        m_type;
 
-    uintptr_t m_pageLimit;  //The end (m_lma + m_length)  address of the segment pageSize aligned 
-    uintptr_t m_nextLma;    //next free base 
+    paddr_t       m_pageLimit;  // m_lma + m_length aligned on page size 
+    paddr_t       m_nextLma;    // next free base 
     
-    void confNextLma();     //check that m_nextLma has a correct value: whithin the seg limits
+    void confNextLma();         // check m_nextLma is whithin the seg limits
 
 public:
+
     std::vector<VSeg> m_vsegs;
-    uintptr_t m_limit;// m_lma + m_length
 
+    paddr_t     m_limit;        // m_lma + m_length
 
     const std::string& name() const;
-    uintptr_t lma() const;
-    size_t length() const;
+    paddr_t lma() const;
+    paddr_t length() const;
     size_t type() const;
-    uintptr_t limit() const;
-    uintptr_t nextLma() const;
+    paddr_t limit() const;
+    paddr_t nextLma() const;
 
     void check() const;
 
     void setName(std::string& name);
-    void setLma( uintptr_t lma);
-    void setLength(size_t length);
+    void setLma( paddr_t lma);
+    void setLength(paddr_t length);
 
-    static size_t align( unsigned toAlign, unsigned alignPow2);
-    static size_t pageAlign( size_t toAlign );
+    static paddr_t align( paddr_t toAlign, unsigned alignPow2);
+    static paddr_t pageAlign( paddr_t toAlign );
+
     static void setPageSize(size_t pg);
+
     static size_t& pageSize();
 
-    void add( VSeg& vseg );//add a VSeg
+    void add( VSeg& vseg );    //add a VSeg
     void addIdent( VSeg& vseg );
 
-    void setNextLma( uintptr_t nextLma);
-    void incNextLma( size_t inc_next);
+    void setNextLma( paddr_t nextLma);
+    void incNextLma( size_t inc);
 
     void print( std::ostream &o ) const;
@@ -134,12 +146,12 @@
     PSeg( const PSeg &ref );
     PSeg( const std::string &name);
-    PSeg( const uintptr_t lma);
+    PSeg( const paddr_t lma);
     PSeg( const std::string &name,
-		     uintptr_t lma,
-             size_t length,
-             size_t type);
+          paddr_t lma,
+          paddr_t length,
+          size_t type);
     ~PSeg();
 };
 
 
-#endif /* SOCLIB_PSEG_H_ */
+#endif /* GIET_MEMO_PSEG_H */
Index: soft/giet_vm/memo/src/libelfpp/elfpp_object.cc
===================================================================
--- soft/giet_vm/memo/src/libelfpp/elfpp_object.cc	(revision 227)
+++ soft/giet_vm/memo/src/libelfpp/elfpp_object.cc	(revision 238)
@@ -129,7 +129,14 @@
     
 
-  void object::copy_info(object& obj)
-  {
-    this->word_width_  = obj.word_width_ ;
+  void object::copy_info(object& obj, size_t word_width)
+  {
+
+	if(word_width == 32)
+		this->word_width_  = ELFCLASS32;
+	else if(word_width == 64)
+	    this->word_width_  =  ELFCLASS64;
+	else
+	    this->word_width_  = obj.word_width_ ;
+
     this->byteorder_  = obj.byteorder_ ;
     this->machine_  = obj.machine_ ;
Index: soft/giet_vm/memo/src/memo.cpp
===================================================================
--- soft/giet_vm/memo/src/memo.cpp	(revision 227)
+++ soft/giet_vm/memo/src/memo.cpp	(revision 238)
@@ -1,13 +1,13 @@
 /* -*- c++ -*-
  *
- * SOCLIB_LGPL_HEADER_BEGIN
+ * GIET_VM_LGPL_HEADER_BEGIN
  * 
- * This file is part of SoCLib, GNU LGPLv2.1.
+ * This file is part of GIET_VM, GNU LGPLv2.1.
  * 
- * SoCLib is free software; you can redistribute vSO and/or modify vSO
+ * GIET_VM is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
  * 
- * SoCLib is distributed in the hope that vSO will be useful, but
+ * GIET_VM is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -15,9 +15,9 @@
  * 
  * You should have received a copy of the GNU Lesser General Public
- * License along with SoCLib; if not, write to the Free Software
+ * License along with GIET_VM; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
  * 
- * SOCLIB_LGPL_HEADER_END
+ * GIET_VM_LGPL_HEADER_END
  *
  * Copyright (c) UPMC, Lip6, SoC
@@ -41,15 +41,15 @@
 //#define MOVER_DEBUG
 
-MeMo::MeMo( const std::string &filename, 
-        const size_t pageSize)
-        :m_path(filename),
-        m_pathHandler(filename),
-        m_ginit(false),
-        m_generator(new elfpp::object())
-{
-    
+////////////////////////////////////////////
+MeMo::MeMo( const std::string     &filename, 
+            const size_t          pageSize)
+        : m_path(filename),
+          m_pathHandler(filename),
+          m_ginit(false),
+          m_generator(new elfpp::object())
+{
     PSeg::setPageSize(pageSize);
 
-    /* loading map_info blob */
+    // loading map_info blob 
     m_data = std::malloc(bin_size(m_path));
     if ( !m_data )
@@ -58,14 +58,13 @@
     m_size = load_bin(m_path, m_data);
 
-    /* checking signature */
+    // checking signature 
     mapping_header_t*   header = (mapping_header_t*)m_data; 
-    //assert((IN_MAPPING_SIGNATURE == header->signature) and "wrong signature");
     if((IN_MAPPING_SIGNATURE != header->signature))
     {
-        std::cout  << "wrong signature " << std::hex <<header->signature << ", should be:"<< IN_MAPPING_SIGNATURE << std::endl;
+        std::cout  << "wrong signature " 
+                   << std::hex <<header->signature 
+                   << ", should be:"<< IN_MAPPING_SIGNATURE << std::endl;
         exit(1);
     }
-    
-    
 
 #ifdef MOVER_DEBUG
@@ -92,4 +91,5 @@
 }
 
+/////////////////////////////////////////
 void MeMo::print( std::ostream &o ) const
 {
@@ -102,4 +102,5 @@
 }
 
+////////////////////////////////
 void MeMo::print_mapping() const
 {
@@ -107,4 +108,5 @@
 }
 
+////////////////////////////////////////////////////////////////////////////////
 elfpp::section* MeMo::get_sect_by_addr(elfpp::object *loader, unsigned int addr)
 {
@@ -123,5 +125,5 @@
 }
 
-
+/////////////////////////////////////////////////
 void MeMo::buildSoft(const std::string &filename)
 {
@@ -133,11 +135,10 @@
 }
 
-/* Load the content of filename in buffer, and send the size */
-////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
 size_t MeMo::load_bin(std::string filename, void* buffer)
 {
 
 #ifdef MOVER_DEBUG
-    std::cout  << "Trying to load the binary blob from file '" << filename << "'" << std::endl;
+    std::cout  << "Loading binary blob from file '" << filename << "'" << std::endl;
 #endif
 
@@ -339,35 +340,37 @@
 void MeMo::vseg_map( mapping_vseg_t* vseg)
 {
-    mapping_vobj_t*     vobj   = get_vobj_base( (mapping_header_t*) m_data );
-    PSeg *ps = &(m_psegh.get(vseg->psegid));// get physical segment pointer(PSegHandler::get)
-    elfpp::section* sect = NULL;
-    size_t cur_vaddr;
-    size_t cur_paddr;
-    bool first = true;
-    bool aligned = false;
-
-    VSeg   *vSO = new VSeg;
+    mapping_vobj_t*  vobj   = get_vobj_base( (mapping_header_t*) m_data );
+    PSeg             *ps = &(m_psegh.get(vseg->psegid));
+    elfpp::section*  sect = NULL;
+    size_t           cur_vaddr;
+    paddr_t          cur_paddr;
+    bool             first = true;
+    bool             aligned = false;
+    VSeg*            vSO = new VSeg;
+    mapping_vobj_t*  cur_vobj;
 
     vSO->m_name = std::string(vseg->name);
-    vSO->m_vma = vseg->vbase;
-    vSO->m_lma = ps->nextLma();
+    vSO->m_vma  = vseg->vbase;
+    vSO->m_lma  = ps->nextLma();
 
     cur_vaddr = vseg->vbase;
     cur_paddr = ps->nextLma();
 
-    mapping_vobj_t* cur_vobj;
     size_t simple_size = 0; //for debug
 
 #ifdef MOVER_DEBUG
-    std::cout << "--------------------vseg_map "<< vseg->name <<"---------------------" << std::endl;
-#endif
-
-    for ( size_t vobj_id = vseg->vobj_offset ; vobj_id < (vseg->vobj_offset + vseg->vobjs) ; vobj_id++ )
+std::cout << "--------------- vseg_map "<< vseg->name <<" ------------------" << std::endl;
+#endif
+
+    for ( size_t vobj_id = vseg->vobj_offset ; 
+          vobj_id < (vseg->vobj_offset + vseg->vobjs) ; vobj_id++ )
     {
         cur_vobj = &vobj[vobj_id];
 
 #ifdef MOVER_DEBUG
-        std::cout << std::hex << "current vobj("<< vobj_id <<"): " << cur_vobj->name << " (" <<cur_vobj->vaddr << ")"
-                        << " size: "<< cur_vobj->length << " type: " <<  cur_vobj->type << std::endl;
+std::cout << std::hex << "current vobj("<< vobj_id <<"): " << cur_vobj->name 
+          << " (" <<cur_vobj->vaddr << ")"
+          << " size: "<< cur_vobj->length 
+          << " type: " <<  cur_vobj->type << std::endl;
 #endif
         if(cur_vobj->type == VOBJ_TYPE_BLOB)
@@ -377,11 +380,11 @@
 
 #ifdef MOVER_DEBUG
-            std::cout << std::hex << "Handling: " << filePath << " ..." << std::endl;
-#endif
-
-            if(!filePath.compare(m_path))    //local blob: map_info
+std::cout << std::hex << "Handling: " << filePath << " ..." << std::endl;
+#endif
+
+            if(!filePath.compare(m_path))    // local blob: map_info
             {
 #ifdef MOVER_DEBUG
-                std::cout << "Found the vseg of the mapping info" << std::endl;
+std::cout << "Found the vseg of the mapping info" << std::endl;
 #endif
                 blob_size = this->m_size;
@@ -391,16 +394,15 @@
             {
 #ifdef MOVER_DEBUG
-                std::cout << "Found an BLOB vseg" << std::endl;
+std::cout << "Found an BLOB vseg" << std::endl;
 #endif
                 blob_size = bin_size(filePath);
             }
 
-
-            /**creating a new section */
+            // creating a new section 
             sect = new elfpp::section(*m_generator, elfpp::SHT_PROGBITS);
 
             sect->set_name(std::string(cur_vobj->name));
             sect->set_flags(elfpp::SHF_ALLOC | elfpp::SHF_WRITE);
-            sect->set_size(blob_size);//do the malloc for the get_content fonction
+            sect->set_size(blob_size);  //do the malloc for the get_content fonction
 
             assert(sect->get_content());//check allocation
@@ -459,5 +461,5 @@
                 /** Initailising the header of the generator from the first binary,
                 ** we suppose that the header is the same for all the binarys **/
-                m_generator->copy_info(*loader);
+                m_generator->copy_info(*loader, 64);
                 m_ginit=true;
             }
@@ -512,15 +514,18 @@
     vSO->m_ident = vseg->ident;
 
-    //should we check that we have the same type for the pseg and vobj?
-    if(ps->type() != PSEG_TYPE_PERI)//take into acount only vseg who are not of the peri type
-    {
-        //set the lma
-        if ( vseg->ident != 0 )            // identity mapping required
-            ps->addIdent( *vSO );
-        else
-            ps->add( *vSO );
-    }
-    if(!sect)
-        return;
+    //set the lma for vseg that are not peripherals
+    if(ps->type() != PSEG_TYPE_PERI)
+    {
+        if ( vseg->ident != 0 )    ps->addIdent( *vSO );
+        else                       ps->add( *vSO );
+    }
+
+    // increment NextLma if required
+    if(ps->type() == PSEG_TYPE_RAM)
+    {
+        ps->incNextLma( vSO->m_length );
+    }
+
+    if(!sect) return;
 
 #ifdef MOVER_DEBUG
@@ -550,33 +555,16 @@
 #endif
 
-#ifdef DISTRIBUTED_SCHEDULERS 
-    char found;
-#endif
-
     for ( size_t cluster_id = 0 ; cluster_id < header->clusters ; cluster_id++ )
     {
-
-#ifdef DISTRIBUTED_SCHEDULERS 
-        found    = 0;
-#endif
-
         for ( size_t pseg_id = cluster[cluster_id].pseg_offset ;
               pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs ;
               pseg_id++ )
         {
-            //build pseg
             std::string name(pseg[pseg_id].name);
-            PSeg *ps = new PSeg(name, pseg[pseg_id].base, pseg[pseg_id].length, pseg[pseg_id].type);
-
-#ifdef DISTRIBUTED_SCHEDULERS 
-            if ( (pseg[pseg_id].type == PSEG_TYPE_RAM) && (found == 0) )
-            {
-                ps->incNextLma( (cluster[cluster_id].procs << 12) );
-                found  = 1;
-            }
-            if(!found){/* we could imagine a cluster without proc, let the giet choose*/ }
-#endif
+            PSeg *ps = new PSeg( name, 
+                                 pseg[pseg_id].base, 
+                                 pseg[pseg_id].length, 
+                                 pseg[pseg_id].type );
             m_psegh.m_pSegs.push_back(*ps);
-
         }
     }
Index: soft/giet_vm/memo/src/pseg.cpp
===================================================================
--- soft/giet_vm/memo/src/pseg.cpp	(revision 227)
+++ soft/giet_vm/memo/src/pseg.cpp	(revision 238)
@@ -1,5 +1,5 @@
 /* -*- c++ -*-
  *
- * SOCLIB_LGPL_HEADER_BEGIN
+ * GIET_VM_LGPL_HEADER_BEGIN
  * 
  * This file is part of SoCLib, GNU LGPLv2.1.
@@ -19,5 +19,5 @@
  * 02110-1301 USA
  * 
- * SOCLIB_LGPL_HEADER_END
+ * GIET_VM_LGPL_HEADER_END
  *
  * Copyright (c) UPMC, Lip6, SoC
@@ -43,4 +43,5 @@
  */
 
+//////////////////////////////////////
 const std::string & VSeg::name() const
 {
@@ -48,4 +49,5 @@
 }
 
+//////////////////////////////////////
 const std::string & VSeg::file() const
 {
@@ -53,4 +55,5 @@
 }
 
+///////////////////////////
 uintptr_t VSeg::vma() const
 {
@@ -58,9 +61,11 @@
 }
 
-uintptr_t VSeg::lma() const
+/////////////////////////
+paddr_t VSeg::lma() const
 {
 	return m_lma;
 }
 
+///////////////////////////
 size_t VSeg::length() const
 {
@@ -68,4 +73,5 @@
 }
 
+/////////////////////////
 size_t VSeg::type() const
 {
@@ -73,4 +79,5 @@
 }
 
+/////////////////////////////////////////
 void VSeg::print( std::ostream &o ) const
 {
@@ -79,5 +86,5 @@
       << std::setw (8) << std::setfill('0') 
       << m_vma << ", to(paddr) 0x"
-      << std::setw (8) << std::setfill('0') 
+      << std::setw (16) << std::setfill('0') 
       << m_lma << ", size: 0x"
       << std::setw (8) << std::setfill('0') 
@@ -87,9 +94,10 @@
 }
 
+/////////////
 VSeg::~VSeg()
 {
-//    std::cout << "Deleted VSeg " << *this << std::endl;
-}
-
+}
+
+/////////////////////////////////////////
 VSeg & VSeg::operator=( const VSeg &ref )
 {
@@ -97,5 +105,4 @@
         return *this;
 
-    //std::cout << "Copying " << ref << " to " << *this << std::endl;
     m_name = ref.m_name,
     m_file = ref.m_file;
@@ -107,4 +114,5 @@
 }
 
+////////////
 VSeg::VSeg()
     : m_name("No Name"),
@@ -115,8 +123,13 @@
       m_ident(0)
 {
-    //std::cout << "New empty VSeg " << *this << std::endl;
-}
-
-VSeg::VSeg(std::string& binaryName, std::string& name, uintptr_t vma, size_t length, bool loadable, bool ident)
+}
+
+////////////////////////////////////
+VSeg::VSeg(std::string&  binaryName, 
+           std::string&  name, 
+           uintptr_t     vma, 
+           size_t        length, 
+           bool          loadable, 
+           bool          ident)
     : m_name(name),
       m_file(binaryName),
@@ -126,7 +139,7 @@
       m_ident(ident)
 {
-    //std::cout << "New VSeg " << *this << std::endl;
-}
-
+}
+
+/////////////////////////////
 VSeg::VSeg( const VSeg &ref )
     : m_name("To be copied"),
@@ -137,9 +150,6 @@
       m_ident(0)
 {
-    //std::cout << "New VSeg " << *this << " copied from " << ref << std::endl;
     (*this) = ref;
 }
-
-
 
 
@@ -147,19 +157,24 @@
  * PSeg
  */
-uintptr_t PSeg::lma() const
+
+/////////////////////////
+paddr_t PSeg::lma() const
 {
 	return m_lma;
 }
 
-uintptr_t PSeg::limit() const
+///////////////////////////
+paddr_t PSeg::limit() const
 {
 	return m_limit;
 }
 
-size_t PSeg::length() const
+/////////////////////////////
+paddr_t PSeg::length() const
 {
 	return m_length;
 }
 
+/////////////////////////
 size_t PSeg::type() const
 {
@@ -167,9 +182,11 @@
 }
 
-uintptr_t PSeg::nextLma() const
+/////////////////////////////
+paddr_t PSeg::nextLma() const
 {
 	return m_nextLma;
 }
 
+//////////////////////////////////////
 const std::string & PSeg::name() const
 {
@@ -177,4 +194,5 @@
 }
 
+//////////////////////// initialisation used[][] ??? (AG)
 void PSeg::check() const
 {
@@ -184,27 +202,27 @@
 
     std::vector<VSeg>::const_iterator it;
-    size_t size = m_vsegs.size();
-    size_t used[size][2];//lma, lma+length
-    size_t i,j,error=0;
+    size_t    size = m_vsegs.size();
+    paddr_t   used[size][2];          // lma, lma+length
+    size_t    i,j,error=0;
     
-    for(it = m_vsegs.begin(), i= 0; it < m_vsegs.end(); it++, i++)
+    for(it = m_vsegs.begin(), i= 0 ; it < m_vsegs.end() ; it++, i++)
     {
-        size_t it_limit = (*it).lma() + (*it).length();
+        paddr_t it_limit = (*it).lma() + (*it).length();
         for(j=0; j< i; j++)
         {
-           if(  (used[j][0] == (*it).lma() /*and (*it).length()?*/) ) //not the same lma ,
+            if( used[j][0] == (*it).lma() ) //not the same lma ,
             {
                 error = 1;
                 std::cout << "ok \n";
             }
-           if(  (used[j][1] == it_limit /*and (*it).legth()?*/))  // and not the same limit
+            if( used[j][1] == it_limit )  // and not the same limit
             {
                 error = 2;
             }
-           if(  ((used[j][0] < (*it).lma()) and ((*it).lma() < used[j][1] )) ) //lma  within the used slice
+            if( (used[j][0] < (*it).lma()) and ((*it).lma() < used[j][1]) ) // lma  within
             {
                 error = 3;
             }
-           if(  ((used[j][0] < it_limit) and (it_limit < used[j][1] )) )//limit not within the used slice
+            if(  ((used[j][0] < it_limit) and (it_limit < used[j][1] )) ) // limit no within
             {
                 error = 4;
@@ -228,4 +246,5 @@
 }
 
+//////////////////////////////////////
 void PSeg::setName(std::string& name )
 {
@@ -233,32 +252,33 @@
 }
 
-size_t PSeg::align( unsigned toAlign, unsigned alignPow2)
-{
-    return ((toAlign + (1 << alignPow2) - 1 ) >> alignPow2) << alignPow2;//page aligned 
-}
-
-
-size_t PSeg::pageAlign( size_t toAlign )
+/////////////////////////////////////////////////////////
+paddr_t PSeg::align( paddr_t toAlign, unsigned alignPow2)
+{
+    return ((toAlign + (1 << alignPow2) - 1 ) >> alignPow2) << alignPow2; 
+}
+
+//////////////////////////////////////////
+paddr_t PSeg::pageAlign( paddr_t toAlign )
 {
     size_t pgs = pageSize();
     size_t pageSizePow2 = __builtin_ctz(pgs);
     
-    return align(toAlign, pageSizePow2);//page aligned 
-
-}
-
-void PSeg::setLma( uintptr_t lma )
+    return align(toAlign, pageSizePow2); 
+}
+
+////////////////////////////////
+void PSeg::setLma( paddr_t lma )
 {
     m_lma = lma;
     
-    m_nextLma = pageAlign(lma);//page aligned 
+    m_nextLma = pageAlign(lma);
 
     m_pageLimit = pageAlign(m_lma+m_length); 
 
     m_limit = (m_lma + m_length);
-
-}
-
-void PSeg::setLength( size_t length )
+}
+
+/////////////////////////////////////
+void PSeg::setLength( paddr_t length )
 {
     m_length = length;
@@ -267,38 +287,36 @@
 
     m_limit = (m_lma + m_length);
-
-    //std::cout << std::hex << " length seted, m_limit: " << m_limit  << std::endl;
-    //std::cout << *this <<std::endl;
-}
-
+}
+
+////////////////////////////
 void PSeg::add( VSeg& vseg )
 {
     vseg.m_lma = m_nextLma;
-    incNextLma(vseg.length());//for the next vseg
+//    incNextLma(vseg.length());   //for the next vseg
     m_vsegs.push_back(vseg); 
 }
 
+/////////////////////////////////
 void PSeg::addIdent( VSeg& vseg )
 {
     vseg.m_lma = vseg.m_vma;
-    //incNextLma(vseg.length());//to keep track of space used
     m_vsegs.push_back(vseg); 
 }
 
-void PSeg::setNextLma( uintptr_t nextLma)
+/////////////////////////////////////////
+void PSeg::setNextLma( paddr_t nextLma)
 {
     m_nextLma = nextLma;
-
     confNextLma();
 }
 
-void PSeg::incNextLma( size_t inc_next)
-{
-
-    m_nextLma += inc_next;
-
+//////////////////////////////////
+void PSeg::incNextLma( size_t inc)
+{
+    m_nextLma += inc;
     confNextLma();
 }
 
+////////////////////////
 void PSeg::confNextLma()
 {
@@ -322,4 +340,5 @@
 }
 
+/////////////////////////////////
 void PSeg::setPageSize(size_t pg)
 {
@@ -332,4 +351,5 @@
 }
 
+////////////////////////
 size_t& PSeg::pageSize()
 {
@@ -338,10 +358,9 @@
 }
 
+/////////////////////////////////////////
 PSeg & PSeg::operator=( const PSeg &ref )
 {
     if ( &ref == this )
         return *this;
-
-    //std::cout << "Copying " << ref << " to " << *this << std::endl;
 
     m_name = ref.m_name;
@@ -357,4 +376,5 @@
 }
 
+//////////////////////////////////////////
 void PSeg::print( std::ostream &o ) const
 {
@@ -374,8 +394,9 @@
 }
 
+////////////////////////////////////
 PSeg::PSeg( const std::string &name,
-                uintptr_t lma,
-                size_t length,
-                size_t type)
+            paddr_t           lma,
+            paddr_t           length,
+            size_t            type)
 {
     m_name = name;
@@ -384,7 +405,7 @@
 
     setLma(lma);
-    //std::cout <<"New PSeg :"<< *this ;          
-}
-
+}
+
+////////////////////////////////////
 PSeg::PSeg( const std::string &name):
       m_lma(0),
@@ -396,5 +417,6 @@
 }
 
-PSeg::PSeg( uintptr_t lma):
+////////////////////////
+PSeg::PSeg( paddr_t lma):
       m_name("No name"),
       m_lma(0),
@@ -406,5 +428,5 @@
 }
 
-
+////////////
 PSeg::PSeg()
     :
@@ -415,7 +437,7 @@
       m_limit(0)
 {
-    //std::cout << "New empty PSeg " << *this << std::endl;
-}
-
+}
+
+/////////////////////////////
 PSeg::PSeg( const PSeg &ref )
     : m_name("To be copied"),
@@ -425,5 +447,4 @@
       m_limit(0)
 {
-    //std::cout << "New PSeg " << *this << " copied from " << ref << std::endl;
     (*this) = ref;
 }
@@ -431,5 +452,4 @@
 PSeg::~PSeg()
 {
-//    std::cout << "Deleted PSeg " << *this << std::endl;
 }
 
Index: soft/giet_vm/memo/src/pseg_handler.cpp
===================================================================
--- soft/giet_vm/memo/src/pseg_handler.cpp	(revision 227)
+++ soft/giet_vm/memo/src/pseg_handler.cpp	(revision 238)
@@ -1,13 +1,13 @@
 /* -*- c++ -*-
  *
- * SOCLIB_LGPL_HEADER_BEGIN
+ * GIET_VM_LGPL_HEADER_BEGIN
  * 
- * This file is part of SoCLib, GNU LGPLv2.1.
+ * This file is part of GIET_VM, GNU LGPLv2.1.
  * 
- * SoCLib is free software; you can redistribute it and/or modify it
+ * GIET_VM is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
  * 
- * SoCLib is distributed in the hope that it will be useful, but
+ * GIET_VM is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -15,9 +15,9 @@
  * 
  * You should have received a copy of the GNU Lesser General Public
- * License along with SoCLib; if not, write to the Free Software
+ * License along with GIET_VM; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
  * 
- * SOCLIB_LGPL_HEADER_END
+ * GIET_VM_LGPL_HEADER_END
  *
  * Copyright (c) UPMC, Lip6, SoC
@@ -37,10 +37,9 @@
 #include "exception.h"
 
-
-
 /*
  * PSegHandler
  */
 
+/////////////////////////////////////
 PSeg& PSegHandler::get( size_t pos  )
 {
@@ -55,4 +54,5 @@
 }
 
+//////////////////////////////////////////////////////////////
 const PSeg& PSegHandler::getByAddr(uintptr_t segAddress) const
 {
@@ -60,5 +60,5 @@
     for(it = m_pSegs.begin(); it < m_pSegs.end(); it++)
     {
-        uintptr_t lma = (*it).lma();
+        paddr_t lma = (*it).lma();
         if( lma == segAddress )
             return *it;
@@ -71,4 +71,5 @@
 }
 
+///////////////////////////////
 void PSegHandler::check() const
 {
