Changeset 477
- Timestamp:
- Jan 1, 2015, 6:46:46 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_boot/boot.c
r464 r477 172 172 __attribute__((section (".bootdata"))) 173 173 unsigned int _tty_rx_full[NB_TTY_CHANNELS]; 174 #if BOOT_DEBUG_MAPPING 175 unsigned int word; 176 unsigned int line; 177 unsigned int* pointer = (unsigned int*)SEG_BOOT_MAPPING_BASE; 178 _puts("\n[BOOT] First block of mapping"); 179 for ( line = 0 ; line < 8 ; line++ ) 180 { 181 for ( word = 0 ; word < 8 ; word++ ) 182 { 183 _puts(" | "); 184 _putx( *(pointer + word) ); 185 } 186 _puts(" |\n"); 187 pointer = pointer + 8; 188 } 189 #endif 174 190 175 191 __attribute__((section (".bootdata"))) … … 178 194 179 195 180 /////////////////////////////////////////////////////////////////////181 // This function checks consistence beween the mapping_info data182 // structure (soft), and the giet_config file (hard).183 /////////////////////////////////////////////////////////////////////184 void boot_mapping_check()185 {186 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;187 188 // checking mapping availability189 if (header->signature != IN_MAPPING_SIGNATURE)190 {191 _puts("\n[BOOT ERROR] Illegal mapping signature: ");192 _putx(header->signature);193 _puts("\n");194 _exit();195 }196 197 // checking number of clusters198 if ( (header->x_size != X_SIZE) ||199 (header->y_size != Y_SIZE) ||200 (header->x_width != X_WIDTH) ||201 (header->y_width != Y_WIDTH) )202 {203 _puts("\n[BOOT ERROR] Incoherent X_SIZE or Y_SIZE ");204 _puts("\n - In hard_config: X_SIZE = ");205 _putd( X_SIZE );206 _puts(" / Y_SIZE = ");207 _putd( Y_SIZE );208 _puts(" / X_WIDTH = ");209 _putd( X_WIDTH );210 _puts(" / Y_WIDTH = ");211 _putd( Y_WIDTH );212 _puts("\n - In mapping_info: x_size = ");213 _putd( header->x_size );214 _puts(" / y_size = ");215 _putd( header->y_size );216 _puts(" / x_width = ");217 _putd( header->x_width );218 _puts(" / y_width = ");219 _putd( header->y_width );220 _puts("\n");221 _exit();222 }223 // checking number of virtual spaces224 if (header->vspaces > GIET_NB_VSPACE_MAX)225 {226 _puts("\n[BOOT ERROR] : number of vspaces > GIET_NB_VSPACE_MAX\n");227 _puts("\n");228 _exit();229 }230 231 #if BOOT_DEBUG_MAPPING232 _puts("\n - x_size = ");233 _putd( header->x_size );234 _puts("\n - y_size = ");235 _putd( header->y_size );236 _puts("\n - procs = ");237 _putd( header->procs );238 _puts("\n - periphs = ");239 _putd( header->periphs );240 _puts("\n - vspaces = ");241 _putd( header->vspaces );242 _puts("\n - tasks = ");243 _putd( header->tasks );244 _puts("\n");245 _puts("\n - size of header = ");246 _putd( MAPPING_HEADER_SIZE );247 _puts("\n - size of cluster = ");248 _putd( MAPPING_CLUSTER_SIZE );249 _puts("\n - size of pseg = ");250 _putd( MAPPING_PSEG_SIZE );251 _puts("\n - size of proc = ");252 _putd( MAPPING_PROC_SIZE );253 _puts("\n - size of vspace = ");254 _putd( MAPPING_VSPACE_SIZE );255 _puts("\n - size of vseg = ");256 _putd( MAPPING_VSEG_SIZE );257 _puts("\n - size of vobj = ");258 _putd( MAPPING_VOBJ_SIZE );259 _puts("\n - size of task = ");260 _putd( MAPPING_TASK_SIZE );261 _puts("\n");262 263 unsigned int cluster_id;264 mapping_cluster_t * cluster = _get_cluster_base(header);265 for( cluster_id = 0; cluster_id < X_SIZE*Y_SIZE ; cluster_id++)266 {267 _puts("\n - cluster[");268 _putd( cluster[cluster_id].x );269 _puts(",");270 _putd( cluster[cluster_id].y );271 _puts("]\n procs = ");272 _putd( cluster[cluster_id].procs );273 _puts("\n psegs = ");274 _putd( cluster[cluster_id].psegs );275 _puts("\n periphs = ");276 _putd( cluster[cluster_id].periphs );277 _puts("\n");278 }279 #endif280 281 } // end boot_mapping_check()282 196 283 197 ////////////////////////////////////////////////////////////////////////////// … … 1618 1532 } 1619 1533 1534 #if BOOT_DEBUG_MAPPING 1535 _puts("\n[BOOT] map.bin buffer pbase = "); 1536 _putx( SEG_BOOT_MAPPING_BASE ); 1537 _puts(" / buffer size = "); 1538 _putx( SEG_BOOT_MAPPING_SIZE ); 1539 _puts(" / file size = "); 1540 _putx( size ); 1541 _puts("\n"); 1542 #endif 1543 1620 1544 // load "map.bin" file into buffer 1621 1545 unsigned int nblocks = size >> 9; … … 1633 1557 _exit(); 1634 1558 } 1559 1560 #if BOOT_DEBUG_MAPPING 1561 _puts("\n[BOOT] map.bin file successfully loaded at cycle "); 1562 _putd(_get_proctime()); 1563 _puts("\n"); 1564 #endif 1565 1566 // check mapping signature, number of clusters, number of vspaces 1567 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 1568 if ( (header->signature != IN_MAPPING_SIGNATURE) || 1569 (header->x_size != X_SIZE) || 1570 (header->y_size != Y_SIZE) || 1571 (header->vspaces > GIET_NB_VSPACE_MAX) ) 1572 { 1573 1574 #if BOOT_DEBUG_MAPPING 1575 unsigned int word; 1576 unsigned int line; 1577 unsigned int* pointer = (unsigned int*)SEG_BOOT_MAPPING_BASE; 1578 _puts("\n[BOOT] First block of mapping\n"); 1579 for ( line = 0 ; line < 8 ; line++ ) 1580 { 1581 for ( word = 0 ; word < 8 ; word++ ) 1582 { 1583 _puts(" | "); 1584 _putx( *(pointer + word) ); 1585 } 1586 _puts(" |\n"); 1587 pointer = pointer + 8; 1588 } 1589 #endif 1590 _puts("\n[BOOT ERROR] Illegal mapping signature: "); 1591 _putx(header->signature); 1592 _puts("\n"); 1593 _exit(); 1594 } 1595 1596 #if BOOT_DEBUG_MAPPING 1597 _puts("\n[BOOT] map.bin file checked at cycle "); 1598 _putd(_get_proctime()); 1599 _puts("\n"); 1600 #endif 1601 1602 // close file "map.bin" 1635 1603 _fat_close( fd_id ); 1636 1604 1637 // close file "map.bin"1638 boot_mapping_check();1639 1640 1605 } // end boot_mapping_init() 1641 1606
Note: See TracChangeset
for help on using the changeset viewer.