Changeset 200
- Timestamp:
- Aug 12, 2012, 1:35:34 PM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/boot/boot_init.c
r199 r200 1059 1059 boot_puts(" ******\n"); 1060 1060 #endif 1061 // We must set the PTPR depending on the vspace, because the addresses1062 // of mwmmr channels, barriers and locks are defined in virtual space.1063 boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[vspace_id] >> 13 );1064 1061 1065 1062 unsigned int ptab_found = 0; … … 1074 1071 case VOBJ_TYPE_MWMR: // storage capacity is (vobj.length/4 - 5) words 1075 1072 { 1076 mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id]. vaddr);1073 mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr); 1077 1074 mwmr->ptw = 0; 1078 1075 mwmr->ptr = 0; … … 1116 1113 case VOBJ_TYPE_BARRIER: // init is the number of participants 1117 1114 { 1118 giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id]. vaddr);1115 giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].paddr); 1119 1116 barrier->count = 0; 1120 1117 barrier->init = vobj[vobj_id].init; … … 1130 1127 case VOBJ_TYPE_LOCK: // init is "not taken" 1131 1128 { 1132 unsigned int* lock = (unsigned int*)(vobj[vobj_id]. vaddr);1129 unsigned int* lock = (unsigned int*)(vobj[vobj_id].paddr); 1133 1130 *lock = 0; 1134 1131 #if BOOT_DEBUG_VOBJS … … 1181 1178 } // end loop on vspaces 1182 1179 } // end boot_vobjs_init() 1180 1181 void 1182 mwmr_hw_init( void *coproc, enum mwmrPortDirection way, 1183 unsigned int no, const mwmr_channel_t *pmwmr) 1184 { 1185 volatile unsigned int *cbase = (unsigned int*) coproc; 1186 1187 1188 cbase[MWMR_CONFIG_FIFO_WAY] = way ; 1189 cbase[MWMR_CONFIG_FIFO_NO] = no ; 1190 cbase[MWMR_CONFIG_STATUS_ADDR] = (unsigned int)pmwmr ; 1191 cbase[MWMR_CONFIG_WIDTH] = pmwmr->width ; 1192 cbase[MWMR_CONFIG_DEPTH] = pmwmr->depth; 1193 cbase[MWMR_CONFIG_BUFFER_ADDR] = (unsigned int)&pmwmr->data; 1194 cbase[MWMR_CONFIG_RUNNING] = 1 ; 1195 } 1196 1183 1197 1184 1198 //////////////////////////////////////////////////////////////////////////////// … … 1194 1208 mapping_periph_t* periph = boot_get_periph_base( header ); 1195 1209 mapping_pseg_t* pseg = boot_get_pseg_base( header ); 1210 mapping_vobj_t* vobj = boot_get_vobj_base( header ); 1211 mapping_vspace_t* vspace = boot_get_vspace_base( header ); 1212 mapping_coproc_t* coproc = boot_get_coproc_base( header ); 1213 mapping_cp_port_t* cp_port = boot_get_cp_port_base( header ); 1196 1214 1197 1215 unsigned int cluster_id; 1198 1216 unsigned int periph_id; 1199 1217 unsigned int coproc_id; 1218 unsigned int cp_port_id; 1200 1219 unsigned int channel_id; 1201 1220 … … 1292 1311 coproc_id++ ) 1293 1312 { 1294 // TODO 1313 unsigned no_fifo_to = 0; //FIXME: should it be the map.xml who define the order? 1314 unsigned no_fifo_from = 0; 1315 unsigned int cpseg = pseg[coproc[coproc_id].psegid].base; 1316 1317 #if BOOT_DEBUG_PERI 1318 boot_puts("[BOOT] mwmr coproc initialisation of "); 1319 boot_putw((unsigned int) coproc[coproc_id].name); 1320 boot_puts(", nb ports"); 1321 boot_putw((unsigned int)coproc[coproc_id].ports); 1322 boot_puts("\n"); 1323 #endif 1324 1325 for ( cp_port_id = coproc[coproc_id].port_offset ; 1326 cp_port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports ; 1327 cp_port_id++ ) 1328 { 1329 //FIXME: should the same for all ports: put it in the coproc 1330 unsigned int vspace_id = cp_port[cp_port_id].vspaceid; 1331 unsigned int vobj_id = cp_port[cp_port_id].vobjlocid + vspace[vspace_id].vobj_offset; 1332 1333 mwmr_channel_t *pmwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr); 1334 1335 if( cp_port[cp_port_id].direction == PORT_TO_COPROC) 1336 { 1337 1338 #if BOOT_DEBUG_PERI 1339 boot_puts(" port direction: PORT_TO_COPROC"); 1340 #endif 1341 mwmr_hw_init((void*)cpseg, PORT_TO_COPROC, no_fifo_to, pmwmr ); 1342 no_fifo_to++; 1343 } 1344 else 1345 { 1346 #if BOOT_DEBUG_PERI 1347 boot_puts(" port direction: PORT_FROM_COPROC"); 1348 #endif 1349 mwmr_hw_init((void*)cpseg, PORT_FROM_COPROC, no_fifo_from, pmwmr ); 1350 no_fifo_from++; 1351 } 1352 #if BOOT_DEBUG_PERI 1353 boot_puts(", with mwmr: "); 1354 boot_puts(vobj[vobj_id].name); 1355 boot_puts(" of vspace: "); 1356 boot_puts(vspace[vspace_id].name); 1357 #endif 1358 } 1295 1359 } // end for coprocs 1296 1360 … … 1680 1744 boot_puts("\n"); 1681 1745 1746 // page table building 1747 boot_pt_init(); 1748 1749 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 1750 boot_putw( boot_proctime() ); 1751 boot_puts("\n"); 1752 1753 // vobjs initialisation 1754 boot_vobjs_init(); 1755 1756 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : "); 1757 boot_putw( boot_proctime() ); 1758 boot_puts("\n"); 1759 1682 1760 // peripherals initialisation 1683 1761 boot_peripherals_init(); … … 1687 1765 boot_puts("\n"); 1688 1766 1689 // page table building1690 boot_pt_init();1691 1692 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");1693 boot_putw( boot_proctime() );1694 boot_puts("\n");1695 1696 1767 // mmu activation 1697 1768 boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[0] >> 13 ); … … 1699 1770 1700 1771 boot_puts("\n[BOOT] MMU activation completed at cycle "); 1701 boot_putw( boot_proctime() );1702 boot_puts("\n");1703 1704 // vobjs initialisation1705 boot_vobjs_init();1706 1707 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");1708 1772 boot_putw( boot_proctime() ); 1709 1773 boot_puts("\n"); -
soft/giet_vm/libs/mwmr_channel.c
r195 r200 196 196 for ( x = 0 ; x < nwords ; x++ ) 197 197 { 198 buffer[x] = mwmr->data[ mwmr->ptr];198 buffer[x] = mwmr->data[ptr]; 199 199 if ( (ptr + 1) == depth ) ptr = 0; 200 200 else ptr = ptr + 1; -
soft/giet_vm/libs/mwmr_channel.h
r189 r200 19 19 unsigned int ptw; // index of the first empty slot 20 20 unsigned int sts; // number of words available 21 unsigned int lock; // exclusive access lock 21 22 unsigned int depth; // max number of words in the channel 22 23 unsigned int width; // number of words in an item 23 unsigned int lock; // exclusive access lock24 24 unsigned int data[1018]; // circular buffer 25 25 } mwmr_channel_t; -
soft/giet_vm/libs/srl.h
r189 r200 7 7 @short SRL Api main header 8 8 */ 9 10 #include "mapping_info.h" 11 #include "stdio.h" 12 #include "utils.h" 9 13 10 14 #include "libsrl/srl_public_types.h" … … 19 23 #include "libsrl/srl_hw_helpers.h" 20 24 25 #include "libsrl/srl_args.h" 26 21 27 //kernel use! 22 28 //#include "libsrl/srl_mwmr_sys.h" 23 29 24 /* port, APP_NAME, TASK */25 # define GET_MWMR(port) \26 ({ \27 srl_mwmr_t _mwmr; \28 if( vobj_get_vbase( APP_NAME , #port, MWMR, (unsigned int*)&_mwmr ) ) \29 { \30 srl_log_printf( NONE, "\n[ERROR] in "TASK" task :\n"); \31 srl_log_printf( NONE, " undefined <"#port"> channel: %d\n", _mwmr); \32 srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr ); \33 exit();/*srl?*/ \34 }else \35 srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", __FILE__, __LINE__, APP_NAME, TASK,#port, (unsigned int)_mwmr ); \36 _mwmr;\37 })38 30 39 31 #endif -
soft/giet_vm/libs/utils.h
r189 r200 13 13 unsigned int size ); 14 14 15 void* memcpy( void* dst,16 int c,17 unsigned int size );18 19 15 #endif 20 16 -
soft/giet_vm/sys/hwr_mapping.h
r166 r200 99 99 }; 100 100 101 /* MWMR */ 102 enum SoclibMwmrRegisters { 103 MWMR_IOREG_MAX = 16, 104 MWMR_RESET = MWMR_IOREG_MAX, 105 MWMR_CONFIG_FIFO_WAY, 106 MWMR_CONFIG_FIFO_NO, 107 MWMR_CONFIG_STATUS_ADDR, 108 MWMR_CONFIG_DEPTH, 109 MWMR_CONFIG_BUFFER_ADDR, 110 MWMR_CONFIG_LOCK_ADDR, 111 MWMR_CONFIG_RUNNING, 112 MWMR_CONFIG_WIDTH, 113 MWMR_FIFO_FILL_STATUS, 114 }; 115 116 enum SoclibMwmrWay { 117 MWMR_TO_COPROC, 118 MWMR_FROM_COPROC, 119 }; 120 101 121 #endif 102 122 -
soft/giet_vm/xml/mapping_info.h
r189 r200 50 50 #define OUT_MAPPING_SIGNATURE 0xBABEF00D 51 51 52 enum 52 enum vobjType 53 53 { 54 54 VOBJ_TYPE_ELF = 0, // loadable code/data object of elf files … … 62 62 }; 63 63 64 enum 64 enum psegType 65 65 { 66 66 PSEG_TYPE_RAM = 0, … … 69 69 }; 70 70 71 enum 71 enum periphType 72 72 { 73 73 PERIPH_TYPE_IOC = 0, … … 80 80 }; 81 81 82 enum 82 enum mwmrPortDirection 83 83 { 84 84 PORT_TO_COPROC = 0, // status register … … 214 214 { 215 215 char name[32]; // coprocessor name 216 unsigned int psegid; // pseg index in cluster216 unsigned int psegid; // global pseg index 217 217 unsigned int ports; // number of MWMR ports used by coprocessor 218 218 unsigned int port_offset; // index of first MWMR port used by coprocessor -
soft/giet_vm/xml/xml_parser.c
r189 r200 250 250 printf(" direction = %s\n", str); 251 251 #endif 252 if ( strcmp(str, "TO_COPROC") ) cp_port[cp_port_index]->direction = PORT_TO_COPROC;253 else if ( strcmp(str, "FROM_COPROC") ) cp_port[cp_port_index]->direction = PORT_FROM_COPROC;252 if ( strcmp(str, "TO_COPROC") == 0 ) cp_port[cp_port_index]->direction = PORT_TO_COPROC; 253 else if ( strcmp(str, "FROM_COPROC") == 0 ) cp_port[cp_port_index]->direction = PORT_FROM_COPROC; 254 254 else 255 255 { … … 1874 1874 { 1875 1875 unsigned int i; 1876 //asign for all cp_ports the correct vspaceid and vobjid 1876 1877 for(i=0; i< cp_port_index; i++) 1877 1878 {
Note: See TracChangeset
for help on using the changeset viewer.