Changeset 210 for soft/giet_vm
- Timestamp:
- Aug 21, 2012, 9:30:46 AM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/boot/boot_init.c
r207 r210 795 795 } 796 796 797 // set the next_base field in vseg798 if ( vseg->ident == 0 )799 pseg->next_base = vseg->pbase + vseg->length;800 797 801 798 #if BOOT_DEBUG_PT … … 809 806 boot_puts("\n"); 810 807 #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; 811 812 812 813 } // end boot_vseg_map() -
soft/giet_vm/memo/Makefile
r197 r210 9 9 INCLUDES = -Iinclude/libelfpp -Iinclude/libelfpp/elfpp -Iinclude/ -I../xml 10 10 memo.x: $(SRCS) $(HDRS) 11 #g++ -Wall -g $(SRCS) $(INCLUDES) -o memo.x12 11 g++ -Wall -g -DDISTRIBUTED_SCHEDULERS $(SRCS) $(INCLUDES) -o memo.x 13 12 -
soft/giet_vm/memo/include/memo.h
r187 r210 25 25 * 26 26 */ 27 #ifndef SOCLIB_VLOADER_H_28 #define SOCLIB_VLOADER_H_27 #ifndef _MEMO_H_ 28 #define _MEMO_H_ 29 29 30 30 #include <stdlib.h> … … 50 50 51 51 #include "stdint.h" 52 #include "mapping_info.h" 52 53 #include "pseg_handler.h" 53 54 #include "path_handler.h" 54 55 55 56 56 … … 109 109 110 110 111 #endif /* SOCLIB_VLOADER_H_ */111 #endif /* _MEMO_H_ */ 112 112 113 113 // Local Variables: -
soft/giet_vm/memo/include/pseg.h
r163 r210 34 34 35 35 #include "stdint.h" 36 #include "mapping_info.h" 36 37 37 38 … … 49 50 uintptr_t m_lma; //Physical address to which we load the seg (getted from the associated PSeg), setted by PSeg::add/addIdent. 50 51 size_t m_length; 52 size_t m_type; 51 53 bool m_loadable; // wether this is a loadable vseg ( code, data...) 52 54 … … 59 61 uintptr_t lma() const; 60 62 size_t length() const; 63 size_t type() const; 61 64 //void add( VObj& vobj );//add a VObj 62 65 … … 83 86 uintptr_t m_lma; 84 87 size_t m_length; 88 size_t m_type; 85 89 86 90 uintptr_t m_pageLimit; //The end (m_lma + m_length) address of the segment pageSize aligned … … 97 101 uintptr_t lma() const; 98 102 size_t length() const; 103 size_t type() const; 99 104 uintptr_t limit() const; 100 105 uintptr_t nextLma() const; … … 132 137 PSeg( const std::string &name, 133 138 uintptr_t lma, 134 size_t length); 139 size_t length, 140 size_t type); 135 141 ~PSeg(); 136 142 }; -
soft/giet_vm/memo/src/memo.cpp
r195 r210 507 507 vSO->m_ident = vseg->ident; 508 508 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 } 515 518 if(!sect) 516 519 return; … … 559 562 //build pseg 560 563 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); 562 565 563 566 #ifdef DISTRIBUTED_SCHEDULERS … … 567 570 found = 1; 568 571 } 572 if(!found){/* we could imagine a cluster without proc, let the giet choose*/ } 569 573 #endif 570 574 m_psegh.m_pSegs.push_back(*ps); -
soft/giet_vm/memo/src/pseg.cpp
r173 r210 63 63 } 64 64 65 uintptr_t VSeg::length() const65 size_t VSeg::length() const 66 66 { 67 67 return m_length; 68 } 69 70 size_t VSeg::type() const 71 { 72 return m_type; 68 73 } 69 74 … … 152 157 } 153 158 154 uintptr_t PSeg::length() const159 size_t PSeg::length() const 155 160 { 156 161 return m_length; 157 162 } 158 163 164 size_t PSeg::type() const 165 { 166 return m_type; 167 } 168 159 169 uintptr_t PSeg::nextLma() const 160 170 { … … 169 179 void PSeg::check() const 170 180 { 181 182 if(this->m_type == PSEG_TYPE_PERI) 183 return; 184 185 std::vector<VSeg>::const_iterator it; 171 186 size_t size = m_vsegs.size(); 172 187 size_t used[size][2];//lma, lma+length 173 188 size_t i,j,error=0; 174 189 175 std::vector<VSeg>::const_iterator it;176 190 for(it = m_vsegs.begin(), i= 0; it < m_vsegs.end(); it++, i++) 177 191 { … … 179 193 for(j=0; j< i; j++) 180 194 { 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 , 183 196 { 184 197 error = 1; 185 198 std::cout << "ok \n"; 186 199 } 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 189 201 { 190 202 error = 2; 191 203 } 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 194 205 { 195 206 error = 3; 196 207 } 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 199 209 { 200 210 error = 4; 211 std::cout << "base: " << std::hex << (*it).lma() << std::endl; 201 212 std::cout << "limit: " << std::hex << it_limit << std::endl; 202 213 std::cout << "used[j][0]: " << std::hex << used[j][0] << std::endl; … … 362 373 363 374 PSeg::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) 366 378 { 367 379 m_name = name; 368 380 m_length = length; 381 m_type = type; 369 382 370 383 setLma(lma);
Note: See TracChangeset
for help on using the changeset viewer.