Changeset 187 for soft/giet_vm/memo


Ignore:
Timestamp:
Jul 30, 2012, 6:14:22 PM (12 years ago)
Author:
alain
Message:

Introducing support for distributed schedulers in the "memo" tool.

Location:
soft/giet_vm/memo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/memo/Makefile

    r173 r187  
    99INCLUDES = -Iinclude/libelfpp -Iinclude/libelfpp/elfpp -Iinclude/ -I../xml
    1010memo.x: $(SRCS) $(HDRS)
    11         g++ -Wall -g  $(SRCS) $(INCLUDES) -o memo.x
     11        #g++ -Wall -g  $(SRCS) $(INCLUDES) -o memo.x
     12        g++ -Wall -g -DDISTRIBUTED_SCHEDULERS   $(SRCS) $(INCLUDES) -o memo.x
    1213
    1314debug: $(SRCS) $(HDRS)
  • soft/giet_vm/memo/include/memo.h

    r173 r187  
    9696
    9797    //The following functions handle the map.bin structure
    98     //inspired from the boot_handler.c of the GIET
     98    //inspired from the boot_init.c of the GIET
     99    mapping_cluster_t* get_cluster_base( mapping_header_t* header );
    99100    mapping_pseg_t* get_pseg_base( mapping_header_t* header );
    100101    mapping_vspace_t* get_vspace_base( mapping_header_t* header );
     
    102103    mapping_vobj_t* get_vobj_base( mapping_header_t* header );
    103104    void print_mapping_info(void* desc);
    104     void pseg_map( mapping_pseg_t* pseg);
    105105    void vseg_map( mapping_vseg_t* vseg);
    106106    void buildMap(void* desc);
  • soft/giet_vm/memo/src/memo.cpp

    r173 r187  
    3939#include "memo.h"
    4040
    41 //#define MOVER_DEBUG
     41//#define MOVER_DEBUG 
    4242
    4343MeMo::MeMo( const std::string &filename,
     
    203203// various mapping_info data structure access functions
    204204/////////////////////////////////////////////////////////////////////////////
    205 
     205mapping_cluster_t* MeMo::get_cluster_base( mapping_header_t* header )
     206{
     207    return   (mapping_cluster_t*) ((char*)header +
     208                                  MAPPING_HEADER_SIZE);
     209}
    206210/////////////////////////////////////////////////////////////////////////////
    207211mapping_pseg_t* MeMo::get_pseg_base( mapping_header_t* header )
     
    332336} // end print_mapping_info()
    333337
    334 //////////////////////////////////////////
    335 void MeMo::pseg_map( mapping_pseg_t* pseg)
    336 {
    337     std::string name(pseg->name);
    338     m_psegh.m_pSegs.push_back(PSeg(name, pseg->base, pseg->length));
    339 }
    340 
    341338
    342339//////////////////////////////////////////
     
    536533    mapping_header_t*   header = (mapping_header_t*)desc; 
    537534
     535    mapping_cluster_t*  cluster = get_cluster_base( header );     
    538536    mapping_vspace_t*   vspace = get_vspace_base( header );     
    539537    mapping_pseg_t*     pseg   = get_pseg_base( header );
     
    546544#endif
    547545
    548     for ( size_t pseg_id = 0 ; pseg_id < header->psegs ; pseg_id++ )
    549     {
    550         pseg_map( &pseg[pseg_id]);
     546#ifdef DISTRIBUTED_SCHEDULERS
     547    char found;
     548#endif
     549
     550    for ( size_t cluster_id = 0 ; cluster_id < header->clusters ; cluster_id++ )
     551    {
     552
     553#ifdef DISTRIBUTED_SCHEDULERS
     554        found    = 0;
     555#endif
     556
     557        for ( size_t pseg_id = cluster[cluster_id].pseg_offset ;
     558              pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs ;
     559              pseg_id++ )
     560        {
     561            //build pseg
     562            std::string name(pseg[pseg_id].name);
     563            PSeg *ps = new PSeg(name, pseg[pseg_id].base, pseg[pseg_id].length);
     564
     565#ifdef DISTRIBUTED_SCHEDULERS
     566            if ( (pseg[pseg_id].type == PSEG_TYPE_RAM) && (found == 0) )
     567            {
     568                ps->incNextLma( (cluster[cluster_id].procs << 12) );
     569                found  = 1;
     570            }
     571#endif
     572            m_psegh.m_pSegs.push_back(*ps);
     573
     574        }
    551575    }
    552576
Note: See TracChangeset for help on using the changeset viewer.