Changeset 281 for soft/giet_vm
- Timestamp:
- Jan 30, 2014, 5:32:13 PM (11 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/xcu_driver.c
r275 r281 54 54 //////////////////////////////////////////////////////////////////////////////// 55 55 // _xcu_set_mask() 56 // This function set the mask register for the XICU channel identified 57 // by the cluster index and the processor index. 56 // This function set the mask register for the XICU channel identified by the 57 // cluster index and the processor index multiplied by the number of IRQ per 58 // processor. 58 59 // All '1' bits are set / all '0' bits are not modified. 59 60 // Returns 0 if success, > 0 if error. 60 61 //////////////////////////////////////////////////////////////////////////////// 61 62 unsigned int _xcu_set_mask( unsigned int cluster_xy, 62 unsigned int proc_id,63 unsigned int irq_index, 63 64 unsigned int value, 64 65 unsigned int irq_type ) … … 67 68 unsigned int x = cluster_xy >> Y_WIDTH; 68 69 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 69 if (x >= X_SIZE) return 1;70 if (y >= Y_SIZE) return 1;71 if ( proc_id >= NB_PROCS_MAX) return 1;70 if (x >= X_SIZE) return 1; 71 if (y >= Y_SIZE) return 1; 72 if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 72 73 73 74 #if USE_XICU … … 80 81 else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE; 81 82 else func = XICU_MSK_HWI_ENABLE; 82 xcu_address[XICU_REG(func, proc_id)] = value;83 xcu_address[XICU_REG(func,irq_index)] = value; 83 84 return 0; 84 85 #else … … 96 97 // - active PTI (Timer Interrupt), or 97 98 // - active SWI (Software Interrupt). 98 // The ICU channel is identified by the cluster index and the processor index. 99 // The ICU channel is identified by the cluster index and the processor index 100 // multiplied by the number of IRQ per processor. 99 101 // Returns 0 if success, > 0 if error. 100 102 //////////////////////////////////////////////////////////////////////////////// 101 103 unsigned int _xcu_get_index( unsigned int cluster_xy, 102 unsigned int proc_id,104 unsigned int irq_index, 103 105 unsigned int * buffer) 104 106 { … … 106 108 unsigned int x = cluster_xy >> Y_WIDTH; 107 109 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 108 if (x >= X_SIZE) return 1;109 if (y >= Y_SIZE) return 1;110 if ( proc_id >= NB_PROCS_MAX) return 1;110 if (x >= X_SIZE) return 1; 111 if (y >= Y_SIZE) return 1; 112 if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 111 113 112 114 #if USE_XICU … … 115 117 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 116 118 117 unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];119 unsigned int prio = xcu_address[XICU_REG(XICU_PRIO,irq_index)]; 118 120 unsigned int pti_ok = (prio & 0x00000001); 119 121 unsigned int hwi_ok = (prio & 0x00000002); … … 140 142 // It writes the "wdata" value in the mailbox defined by the cluster index 141 143 // and the processor index. 144 // Giet-VM supports at most NB_PROCS_MAX mailboxes: 145 // (0 <= wti_index <= NB_PROCS_MAX-1) 142 146 // Returns 0 if success, > 0 if error. 143 147 //////////////////////////////////////////////////////////////////////////////// 144 148 unsigned int _xcu_send_ipi( unsigned int cluster_xy, 145 unsigned int proc_id,149 unsigned int wti_index, 146 150 unsigned int wdata ) 147 151 { … … 149 153 unsigned int x = cluster_xy >> Y_WIDTH; 150 154 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 151 if (x >= X_SIZE) return 1;152 if (y >= Y_SIZE) return 1;153 if ( proc_id>= NB_PROCS_MAX) return 1;155 if (x >= X_SIZE) return 1; 156 if (y >= Y_SIZE) return 1; 157 if (wti_index >= NB_PROCS_MAX) return 1; 154 158 155 159 #if USE_XICU … … 158 162 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 159 163 160 xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;164 xcu_address[XICU_REG(XICU_WTI_REG,wti_index)] = wdata; 161 165 return 0; 162 166 #else -
soft/giet_vm/giet_drivers/xcu_driver.h
r263 r281 45 45 46 46 extern unsigned int _xcu_get_index( unsigned int cluster_xy, 47 unsigned int proc_id,47 unsigned int irq_index, 48 48 unsigned int * buffer ); 49 49 50 50 extern unsigned int _xcu_set_mask( unsigned int cluster_xy, 51 unsigned int proc_id,51 unsigned int irq_index, 52 52 unsigned int mask, 53 53 unsigned int is_timer ); 54 54 55 55 extern unsigned int _xcu_send_ipi( unsigned int cluster_xy, 56 unsigned int proc_id,56 unsigned int wti_index, 57 57 unsigned int wdata ); 58 58 59 59 extern unsigned int _xcu_timer_start( unsigned int cluster_xy, 60 unsigned int p roc_id,60 unsigned int pti_index, 61 61 unsigned int period ); 62 62 63 63 extern unsigned int _xcu_timer_stop( unsigned int cluster_xy, 64 unsigned int p roc_id);64 unsigned int pti_index ); 65 65 66 66 extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy, 67 unsigned int p roc_id);67 unsigned int pti_index ); 68 68 69 69 extern unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy, 70 unsigned int p roc_id);70 unsigned int pti_index ); 71 71 72 72 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_kernel/irq_handler.c
r279 r281 21 21 #include <ioc_driver.h> 22 22 #include <dma_driver.h> 23 #include <mapping_info.h>23 #include <mapping_info.h> 24 24 #include <utils.h> 25 25 … … 59 59 // get the highest priority active IRQ index 60 60 61 unsigned int icu_out_index = local_id * IRQ_PER_PROCESSOR; 62 61 63 #if USE_XICU 62 ko = _xcu_get_index( cluster_id, local_id, &irq_id );64 ko = _xcu_get_index( cluster_id, icu_out_index, &irq_id ); 63 65 #else 64 ko = _icu_get_index( cluster_id, local_id, &irq_id );66 ko = _icu_get_index( cluster_id, icu_out_index, &irq_id ); 65 67 #endif 66 68 -
soft/giet_vm/giet_kernel/kernel_init.c
r274 r281 261 261 #endif 262 262 263 // GIET-VM cons raint : only one IRQ type per irq_id263 // GIET-VM constraint : only one IRQ type per irq_id 264 264 if ( hwi_mask & swi_mask & pti_mask ) 265 265 { … … 268 268 } 269 269 270 271 // The ICU output index is computed as the local processor id multiplied by 272 // the number of ICU outputs connected to each processor. 273 int icu_out_index = local_pid * IRQ_PER_PROCESSOR; 274 270 275 #if USE_XICU 271 _xcu_set_mask(cluster_xy, local_pid, hwi_mask, IRQ_TYPE_HWI); // set HWI_MASK272 _xcu_set_mask(cluster_xy, local_pid, swi_mask, IRQ_TYPE_SWI); // set SWI_MASK273 _xcu_set_mask(cluster_xy, local_pid, pti_mask, IRQ_TYPE_PTI); // set PTI_MASK276 _xcu_set_mask(cluster_xy, icu_out_index, hwi_mask, IRQ_TYPE_HWI); // set HWI_MASK 277 _xcu_set_mask(cluster_xy, icu_out_index, swi_mask, IRQ_TYPE_SWI); // set SWI_MASK 278 _xcu_set_mask(cluster_xy, icu_out_index, pti_mask, IRQ_TYPE_PTI); // set PTI_MASK 274 279 #else 275 _icu_set_mask(cluster_xy, local_pid, (hwi_mask | pti_mask | swi_mask) );280 _icu_set_mask(cluster_xy, icu_out_index, (hwi_mask | pti_mask | swi_mask) ); 276 281 #endif 277 282 -
soft/giet_vm/giet_xml/xml_parser.c
r267 r281 115 115 unsigned int dma_channels = 0; // max number of DMA channels (per cluster) 116 116 117 unsigned int icu_channels = 0; // total number of IRQ per processor 117 118 unsigned int tty_channels = 0; // total number of terminals in TTY 118 119 unsigned int hba_channels = 0; // total number of channels in HBA … … 122 123 unsigned int use_iob = 0; // using IOB component 123 124 unsigned int use_xcu = 0; // using XCU (not ICU) 124 unsigned int use_hba = 0; // using XCU (not IOC)125 unsigned int use_hba = 0; // using HBA 125 126 126 127 … … 1442 1443 if (found_icu || use_xcu) error = 1; 1443 1444 found_icu = 1; 1445 1446 if (icu_channels > 0) 1447 { 1448 assert( (periph[periph_index]->channels == icu_channels) && 1449 "[XML ERROR] the number of interruptions per processor " 1450 "from the ICU (icu channels) must be the same on all " 1451 "clusters"); 1452 } 1453 else 1454 { 1455 icu_channels = periph[periph_index]->channels; 1456 } 1444 1457 } 1445 1458 ////////////////////////////////// … … 1466 1479 { 1467 1480 periph[periph_index]->type = PERIPH_TYPE_XCU; 1468 if (found_ icu || found_timer) error = 1;1481 if (found_xcu || found_icu || found_timer) error = 1; 1469 1482 found_xcu = 1; 1470 1483 found_timer = 1; 1471 1484 tim_channels = 32; 1472 1485 use_xcu = 1; 1486 1487 if (icu_channels > 0) 1488 { 1489 assert( (periph[periph_index]->channels == icu_channels) && 1490 "[XML ERROR] the number of interruptions per processor " 1491 "from the ICU (icu channels) must be the same on all " 1492 "clusters"); 1493 } 1494 else 1495 { 1496 icu_channels = periph[periph_index]->channels; 1497 } 1473 1498 } 1474 1499 else 1475 1500 { 1476 printf("[XML ERROR] illegal <type> for peripheral %d in cluster %d\n",1477 periph_loc_index, cluster_index);1501 printf("[XML ERROR] illegal <type>: %s for peripheral %d in cluster %d\n", 1502 str, periph_loc_index, cluster_index); 1478 1503 exit(1); 1479 1504 } … … 1481 1506 if (error) 1482 1507 { 1483 printf("[XML ERROR] illegal <type> for peripheral %d in cluster %d\n",1484 periph_loc_index, cluster_index);1508 printf("[XML ERROR] illegal <type>: %s for peripheral %d in cluster %d\n", 1509 str, periph_loc_index, cluster_index); 1485 1510 exit(1); 1486 1511 } … … 2509 2534 sprintf(prol, "/* Generated from file %s.xml */\n\n",header->name); 2510 2535 2511 char * ifdef = "#ifndef _HARD_CONFIG_H\n#define _HARD D_CONFIG_H\n\n";2536 char * ifdef = "#ifndef _HARD_CONFIG_H\n#define _HARD_CONFIG_H\n\n"; 2512 2537 char * epil = "\n#endif //_HARD_CONFIG_H"; 2513 2538 … … 2542 2567 def_int_write(fdout, "USE_IOB ", use_iob); 2543 2568 def_int_write(fdout, "USE_HBA ", use_hba); 2569 2570 file_write(fdout, "\n"); 2571 2572 def_int_write(fdout, "IRQ_PER_PROCESSOR ", icu_channels); 2544 2573 2545 2574 file_write(fdout, epil); -
soft/giet_vm/mappings/4c_1p_four.xml
r277 r281 13 13 *** The physical address cluster increment is 0x10000000000 / NB_CLUSTERS 14 14 15 *** This first section describes an instance of the "tsar_generic_ iob" architecture15 *** This first section describes an instance of the "tsar_generic_xbar" architecture 16 16 *** with 4 clusters, 1 processor per cluster and 40 bits physical address. 17 17 … … 50 50 51 51 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 52 <periph type = "XCU" psegname = "PSEG_XCU" channels = " 1" />52 <periph type = "XCU" psegname = "PSEG_XCU" channels = "6" /> 53 53 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 54 54 <periph type = "IOC" psegname = "PSEG_IOC" channels = "1" /> … … 73 73 74 74 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 75 <periph type = "XCU" psegname = "PSEG_XCU" channels = " 1" />75 <periph type = "XCU" psegname = "PSEG_XCU" channels = "6" /> 76 76 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 77 77 </cluster> … … 89 89 90 90 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 91 <periph type = "XCU" psegname = "PSEG_XCU" channels = " 1" />91 <periph type = "XCU" psegname = "PSEG_XCU" channels = "6" /> 92 92 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 93 93 </cluster> … … 105 105 106 106 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 107 <periph type = "XCU" psegname = "PSEG_XCU" channels = " 1" />107 <periph type = "XCU" psegname = "PSEG_XCU" channels = "6" /> 108 108 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 109 109 </cluster>
Note: See TracChangeset
for help on using the changeset viewer.