Changeset 210


Ignore:
Timestamp:
Aug 21, 2012, 9:30:46 AM (12 years ago)
Author:
karaoui
Message:

Avoid incremmentinting Pseg of "PERI" type, to permit multiple mapping.

Location:
soft/giet_vm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/boot/boot_init.c

    r207 r210  
    795795    }
    796796
    797     // set the next_base field in vseg
    798     if ( vseg->ident == 0 )
    799         pseg->next_base = vseg->pbase + vseg->length;
    800797
    801798#if BOOT_DEBUG_PT
     
    809806boot_puts("\n");
    810807#endif 
     808
     809    // set the next_base field in vseg
     810    if ( vseg->ident == 0 && pseg->type != PSEG_TYPE_PERI )
     811        pseg->next_base = vseg->pbase + vseg->length;
    811812
    812813} // end boot_vseg_map()
  • soft/giet_vm/memo/Makefile

    r197 r210  
    99INCLUDES = -Iinclude/libelfpp -Iinclude/libelfpp/elfpp -Iinclude/ -I../xml
    1010memo.x: $(SRCS) $(HDRS)
    11         #g++ -Wall -g  $(SRCS) $(INCLUDES) -o memo.x
    1211        g++ -Wall -g -DDISTRIBUTED_SCHEDULERS   $(SRCS) $(INCLUDES) -o memo.x
    1312
  • soft/giet_vm/memo/include/memo.h

    r187 r210  
    2525 *
    2626 */
    27 #ifndef SOCLIB_VLOADER_H_
    28 #define SOCLIB_VLOADER_H_
     27#ifndef _MEMO_H_
     28#define _MEMO_H_
    2929
    3030#include  <stdlib.h>
     
    5050
    5151#include "stdint.h"
     52#include "mapping_info.h"
    5253#include "pseg_handler.h"
    5354#include "path_handler.h"
    54 
    5555
    5656
     
    109109
    110110
    111 #endif /* SOCLIB_VLOADER_H_ */
     111#endif /* _MEMO_H_ */
    112112
    113113// Local Variables:
  • soft/giet_vm/memo/include/pseg.h

    r163 r210  
    3434
    3535#include "stdint.h"
     36#include "mapping_info.h"
    3637
    3738
     
    4950    uintptr_t m_lma;   //Physical address to which we load the seg (getted from the associated PSeg), setted by PSeg::add/addIdent.
    5051    size_t m_length;
     52    size_t m_type;
    5153    bool m_loadable;     // wether this is a loadable vseg ( code, data...)
    5254
     
    5961    uintptr_t lma() const;
    6062    size_t length() const;
     63    size_t type() const;
    6164    //void add( VObj& vobj );//add a VObj
    6265
     
    8386    uintptr_t m_lma;
    8487    size_t m_length;
     88    size_t m_type;
    8589
    8690    uintptr_t m_pageLimit;  //The end (m_lma + m_length)  address of the segment pageSize aligned
     
    97101    uintptr_t lma() const;
    98102    size_t length() const;
     103    size_t type() const;
    99104    uintptr_t limit() const;
    100105    uintptr_t nextLma() const;
     
    132137    PSeg( const std::string &name,
    133138                     uintptr_t lma,
    134              size_t length);
     139             size_t length,
     140             size_t type);
    135141    ~PSeg();
    136142};
  • soft/giet_vm/memo/src/memo.cpp

    r195 r210  
    507507    vSO->m_ident = vseg->ident;
    508508
    509     //set the lma
    510     if ( vseg->ident != 0 )            // identity mapping required
    511         ps->addIdent( *vSO );
    512     else
    513         ps->add( *vSO );
    514 
     509    //should we check that we have the same type for the pseg and vobj?
     510    if(ps->type() != VOBJ_TYPE_PERI)//take into acount only vseg who are not of the peri type
     511    {
     512        //set the lma
     513        if ( vseg->ident != 0 )            // identity mapping required
     514            ps->addIdent( *vSO );
     515        else
     516            ps->add( *vSO );
     517    }
    515518    if(!sect)
    516519        return;
     
    559562            //build pseg
    560563            std::string name(pseg[pseg_id].name);
    561             PSeg *ps = new PSeg(name, pseg[pseg_id].base, pseg[pseg_id].length);
     564            PSeg *ps = new PSeg(name, pseg[pseg_id].base, pseg[pseg_id].length, pseg[pseg_id].type);
    562565
    563566#ifdef DISTRIBUTED_SCHEDULERS
     
    567570                found  = 1;
    568571            }
     572            if(!found){/* we could imagine a cluster without proc, let the giet choose*/ }
    569573#endif
    570574            m_psegh.m_pSegs.push_back(*ps);
  • soft/giet_vm/memo/src/pseg.cpp

    r173 r210  
    6363}
    6464
    65 uintptr_t VSeg::length() const
     65size_t VSeg::length() const
    6666{
    6767        return m_length;
     68}
     69
     70size_t VSeg::type() const
     71{
     72        return m_type;
    6873}
    6974
     
    152157}
    153158
    154 uintptr_t PSeg::length() const
     159size_t PSeg::length() const
    155160{
    156161        return m_length;
    157162}
    158163
     164size_t PSeg::type() const
     165{
     166        return m_type;
     167}
     168
    159169uintptr_t PSeg::nextLma() const
    160170{
     
    169179void PSeg::check() const
    170180{
     181
     182    if(this->m_type == PSEG_TYPE_PERI)
     183        return;
     184
     185    std::vector<VSeg>::const_iterator it;
    171186    size_t size = m_vsegs.size();
    172187    size_t used[size][2];//lma, lma+length
    173188    size_t i,j,error=0;
    174189   
    175     std::vector<VSeg>::const_iterator it;
    176190    for(it = m_vsegs.begin(), i= 0; it < m_vsegs.end(); it++, i++)
    177191    {
     
    179193        for(j=0; j< i; j++)
    180194        {
    181            if( 
    182                 (used[j][0] == (*it).lma() /*and (*it).length()?*/) ) //not the same lma ,
     195           if(  (used[j][0] == (*it).lma() /*and (*it).length()?*/) ) //not the same lma ,
    183196            {
    184197                error = 1;
    185198                std::cout << "ok \n";
    186199            }
    187            if( 
    188                 (used[j][1] == it_limit /*and (*it).legth()?*/))  // and not the same limit
     200           if(  (used[j][1] == it_limit /*and (*it).legth()?*/))  // and not the same limit
    189201            {
    190202                error = 2;
    191203            }
    192            if( 
    193                 ((used[j][0] < (*it).lma()) and ((*it).lma() < used[j][1] )) ) //lma  within the used slice
     204           if(  ((used[j][0] < (*it).lma()) and ((*it).lma() < used[j][1] )) ) //lma  within the used slice
    194205            {
    195206                error = 3;
    196207            }
    197            if( 
    198                 ((used[j][0] < it_limit) and (it_limit < used[j][1] )) )//limit not within the used slice
     208           if(  ((used[j][0] < it_limit) and (it_limit < used[j][1] )) )//limit not within the used slice
    199209            {
    200210                error = 4;
     211                std::cout << "base: " << std::hex << (*it).lma() << std::endl;
    201212                std::cout << "limit: " << std::hex << it_limit << std::endl;
    202213                std::cout << "used[j][0]: " << std::hex << used[j][0] << std::endl;
     
    362373
    363374PSeg::PSeg( const std::string &name,
    364                uintptr_t lma,
    365                 size_t length)
     375                uintptr_t lma,
     376                size_t length,
     377                size_t type)
    366378{
    367379    m_name = name;
    368380    m_length = length;
     381    m_type = type;
    369382
    370383    setLma(lma);
Note: See TracChangeset for help on using the changeset viewer.