Changeset 281 for soft/giet_vm


Ignore:
Timestamp:
Jan 30, 2014, 5:32:13 PM (11 years ago)
Author:
cfuguet
Message:

Modifications in GIET_VM:

  • Supporting platforms with more than one IRQ per processor from the XICU.

When this is the case, the IRQ per processor can be signalled
by the XCU peripheric number of channels on the XML file.

The xml_parser will generate a constant on the hard_config.h
file, called IRQ_PER_PROCESSOR and this constant will be use
by the GIET_VM to create accordingly the irq masks on the
ICU

Location:
soft/giet_vm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/xcu_driver.c

    r275 r281  
    5454////////////////////////////////////////////////////////////////////////////////
    5555//     _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.
    5859// All '1' bits are set / all '0' bits are not modified.
    5960// Returns 0 if success, > 0 if error.
    6061////////////////////////////////////////////////////////////////////////////////
    6162unsigned int _xcu_set_mask( unsigned int cluster_xy,
    62                             unsigned int proc_id,
     63                            unsigned int irq_index,
    6364                            unsigned int value,
    6465                            unsigned int irq_type )
     
    6768    unsigned int x = cluster_xy >> Y_WIDTH;
    6869    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;
    7273
    7374#if USE_XICU
     
    8081    else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE;
    8182    else                               func = XICU_MSK_HWI_ENABLE;
    82     xcu_address[XICU_REG(func,proc_id)] = value;
     83    xcu_address[XICU_REG(func,irq_index)] = value;
    8384    return 0;
    8485#else
     
    9697// - active PTI (Timer Interrupt), or
    9798// - 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.
    99101// Returns 0 if success, > 0 if error.
    100102////////////////////////////////////////////////////////////////////////////////
    101103unsigned int _xcu_get_index( unsigned int cluster_xy,
    102                              unsigned int proc_id,
     104                             unsigned int irq_index,
    103105                             unsigned int * buffer)
    104106{
     
    106108    unsigned int x = cluster_xy >> Y_WIDTH;
    107109    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;
    111113
    112114#if USE_XICU
     
    115117        (cluster_xy * (unsigned int)&vseg_cluster_increment));
    116118
    117     unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];
     119    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO,irq_index)];
    118120    unsigned int pti_ok = (prio & 0x00000001);
    119121    unsigned int hwi_ok = (prio & 0x00000002);
     
    140142// It writes the "wdata" value in the mailbox defined by the cluster index
    141143// and the processor index.
     144// Giet-VM supports at most NB_PROCS_MAX mailboxes:
     145// (0 <= wti_index <= NB_PROCS_MAX-1)
    142146// Returns 0 if success, > 0 if error.
    143147////////////////////////////////////////////////////////////////////////////////
    144148unsigned int _xcu_send_ipi( unsigned int cluster_xy,
    145                             unsigned int proc_id,
     149                            unsigned int wti_index,
    146150                            unsigned int wdata )
    147151{
     
    149153    unsigned int x = cluster_xy >> Y_WIDTH;
    150154    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;
    154158
    155159#if USE_XICU
     
    158162        (cluster_xy * (unsigned int)&vseg_cluster_increment));
    159163
    160     xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;
     164    xcu_address[XICU_REG(XICU_WTI_REG,wti_index)] = wdata;
    161165    return 0;
    162166#else
  • soft/giet_vm/giet_drivers/xcu_driver.h

    r263 r281  
    4545
    4646extern unsigned int _xcu_get_index( unsigned int cluster_xy,
    47                                     unsigned int proc_id,
     47                                    unsigned int irq_index,
    4848                                    unsigned int * buffer );
    4949
    5050extern unsigned int _xcu_set_mask( unsigned int cluster_xy,
    51                                    unsigned int proc_id,
     51                                   unsigned int irq_index,
    5252                                   unsigned int mask,
    5353                                   unsigned int is_timer );
    5454
    5555extern unsigned int _xcu_send_ipi( unsigned int cluster_xy,
    56                                    unsigned int proc_id,
     56                                   unsigned int wti_index,
    5757                                   unsigned int wdata );
    5858
    5959extern unsigned int _xcu_timer_start( unsigned int cluster_xy,
    60                                       unsigned int proc_id,
     60                                      unsigned int pti_index,
    6161                                      unsigned int period );
    6262
    6363extern unsigned int _xcu_timer_stop( unsigned int cluster_xy,
    64                                      unsigned int proc_id );
     64                                     unsigned int pti_index );
    6565
    6666extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
    67                                           unsigned int proc_id );
     67                                          unsigned int pti_index );
    6868
    6969extern unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy,
    70                                           unsigned int proc_id );
     70                                          unsigned int pti_index );
    7171
    7272///////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/giet_kernel/irq_handler.c

    r279 r281  
    2121#include <ioc_driver.h>
    2222#include <dma_driver.h>
    23 #include<mapping_info.h>
     23#include <mapping_info.h>
    2424#include <utils.h>
    2525
     
    5959    // get the highest priority active IRQ index
    6060
     61    unsigned int icu_out_index = local_id * IRQ_PER_PROCESSOR;
     62
    6163#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 );
    6365#else
    64     ko = _icu_get_index( cluster_id, local_id, &irq_id );
     66    ko = _icu_get_index( cluster_id, icu_out_index, &irq_id );
    6567#endif
    6668
  • soft/giet_vm/giet_kernel/kernel_init.c

    r274 r281  
    261261#endif
    262262
    263     // GIET-VM consraint : only one IRQ type per irq_id
     263    // GIET-VM constraint : only one IRQ type per irq_id
    264264    if ( hwi_mask & swi_mask & pti_mask )
    265265    {
     
    268268    }
    269269
     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
    270275#if USE_XICU
    271     _xcu_set_mask(cluster_xy, local_pid, hwi_mask, IRQ_TYPE_HWI); // set HWI_MASK
    272     _xcu_set_mask(cluster_xy, local_pid, swi_mask, IRQ_TYPE_SWI); // set SWI_MASK
    273     _xcu_set_mask(cluster_xy, local_pid, pti_mask, IRQ_TYPE_PTI); // set PTI_MASK
     276    _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
    274279#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) );   
    276281#endif
    277282
  • soft/giet_vm/giet_xml/xml_parser.c

    r267 r281  
    115115unsigned int dma_channels     = 0; // max number of DMA channels (per cluster)
    116116
     117unsigned int icu_channels     = 0; // total number of IRQ per processor
    117118unsigned int tty_channels     = 0; // total number of terminals in TTY
    118119unsigned int hba_channels     = 0; // total number of channels  in HBA
     
    122123unsigned int use_iob          = 0; // using IOB component
    123124unsigned int use_xcu          = 0; // using XCU (not ICU)
    124 unsigned int use_hba          = 0; // using XCU (not IOC)
     125unsigned int use_hba          = 0; // using HBA
    125126
    126127
     
    14421443            if (found_icu || use_xcu)  error = 1;
    14431444            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            }
    14441457        }
    14451458        //////////////////////////////////
     
    14661479        {
    14671480            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;
    14691482            found_xcu    = 1;
    14701483            found_timer  = 1;
    14711484            tim_channels = 32;
    14721485            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            }
    14731498        }
    14741499        else
    14751500        {
    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);
    14781503            exit(1);
    14791504        }
     
    14811506        if (error)
    14821507        {
    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);
    14851510            exit(1);
    14861511        }
     
    25092534    sprintf(prol, "/* Generated from file %s.xml */\n\n",header->name);
    25102535
    2511     char * ifdef  = "#ifndef _HARD_CONFIG_H\n#define _HARDD_CONFIG_H\n\n";
     2536    char * ifdef  = "#ifndef _HARD_CONFIG_H\n#define _HARD_CONFIG_H\n\n";
    25122537    char * epil   = "\n#endif //_HARD_CONFIG_H";
    25132538
     
    25422567    def_int_write(fdout, "USE_IOB           ", use_iob);
    25432568    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);
    25442573
    25452574    file_write(fdout, epil);
  • soft/giet_vm/mappings/4c_1p_four.xml

    r277 r281  
    1313*** The physical address cluster increment is 0x10000000000 / NB_CLUSTERS
    1414
    15 *** This first section describes an instance of the "tsar_generic_iob" architecture
     15*** This first section describes an instance of the "tsar_generic_xbar" architecture
    1616*** with 4 clusters, 1 processor per cluster and 40 bits physical address.
    1717
     
    5050
    5151            <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"  />
    5353            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1"  />
    5454            <periph type = "IOC"  psegname = "PSEG_IOC"  channels = "1"  />
     
    7373
    7474            <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" />
    7676            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
    7777        </cluster>
     
    8989
    9090            <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" />
    9292            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
    9393        </cluster>
     
    105105
    106106            <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" />
    108108            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
    109109        </cluster>
Note: See TracChangeset for help on using the changeset viewer.