Changeset 263 for soft/giet_vm


Ignore:
Timestamp:
Dec 19, 2013, 9:36:48 AM (11 years ago)
Author:
alain
Message:

Introducing support for TSAR fixed format cluster index (cluster_xy)
We have now 4 parameters defined in map.xml:

  • X_WIDTH, Y_WIDTH define the fixed format (typically X_WIDTH = 4 / Y_WIDTH = 4)
  • X_SIZE, Y_SIZE define the actual TSAR 2D mesh variable size (from 1 to 16)
Location:
soft/giet_vm
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/gameoflife/main.c

    r251 r263  
    125125
    126126
    127 /////////////
     127////////////////////////////////////////
    128128__attribute__((constructor)) void main()
    129129{
    130    unsigned int proc_id          = giet_procid();                  // processor id
    131    unsigned int nlocal_procs     = (unsigned int) NB_PROCS_MAX;    // number of processors per cluster
    132    unsigned int nclusters        = (unsigned int) NB_CLUSTERS;     // number of clusters
    133    unsigned int local_id         = proc_id % nlocal_procs;         // local processor id
    134    unsigned int cluster_id       = proc_id / nlocal_procs;         // cluster id
    135    unsigned int nglobal_procs    = nclusters * nlocal_procs;       // number of tasks
     130   unsigned int proc_id       = giet_procid();              // processor id
     131   unsigned int nlocal_procs  = NB_PROCS_MAX;               // processors per cluster
     132   unsigned int nclusters     = X_SIZE*Y_SIZE;              // number of clusters
     133   unsigned int local_id      = proc_id % nlocal_procs;     // local processor id
     134   unsigned int cluster_id    = proc_id / nlocal_procs;     // cluster id
     135   unsigned int nglobal_procs = nclusters * nlocal_procs;   // number of tasks
    136136   size_t i;
    137137
    138    size_t       nb_line          = HEIGHT / nglobal_procs;
    139    size_t       base_line        = nb_line * proc_id;
     138   size_t       nb_line       = HEIGHT / nglobal_procs;
     139   size_t       base_line     = nb_line * proc_id;
    140140   
    141141   PRINTF("*** Starting init at cycle %d ***\n", giet_proctime());
  • soft/giet_vm/giet_boot/boot.c

    r262 r263  
    1111// physicals addresses can have up to 40 bits, and use the  (unsigned long long) type.
    1212// It natively supports clusterised shared mmemory multi-processors architectures,
    13 // where each processor is identified by a composite index (cluster_id, local_id),
     13// where each processor is identified by a composite index (cluster_xy, local_id),
    1414// and where there is one physical memory bank per cluster.
    1515//
     
    6161//    Each PT2 contains 512 PTE2 of 8bytes => 4K bytes.
    6262//    The total size of a page table is finally = 8K + (GIET_NB_PT2_MAX)*4K bytes.
    63 ////////////////////////////////////////////////////////////////////////////////////
     63///////////////////////////////////////////////////////////////////////////////////////
     64// Implementation Notes:
     65//
     66// 1) The cluster_id variable is a linear index in the mapping_info array of clusters.
     67//    We use the cluster_xy variable for the tological index = x << Y_WIDTH + y
     68///////////////////////////////////////////////////////////////////////////////////////
    6469
    6570// for vobjs initialisation
     71#include <giet_config.h>
    6672#include <mwmr_channel.h>
    6773#include <barrier.h>
     
    8793#include <stdarg.h>
    8894
    89 #if !defined(NB_CLUSTERS)
    90 # error The NB_CLUSTERS value must be defined in the 'giet_config.h' file !
     95#if !defined(X_SIZE)
     96# error The X_SIZE value must be defined in the 'hard_config.h' file !
     97#endif
     98
     99#if !defined(Y_SIZE)
     100# error The Y_SIZE value must be defined in the 'hard_config.h' file !
     101#endif
     102
     103#if !defined(X_WIDTH)
     104# error The X_WIDTH value must be defined in the 'hard_config.h' file !
     105#endif
     106
     107#if !defined(Y_WIDTH)
     108# error The Y_WIDTH value must be defined in the 'hard_config.h' file !
    91109#endif
    92110
    93111#if !defined(NB_PROCS_MAX)
    94 # error The NB_PROCS_MAX value must be defined in the 'giet_config.h' file !
     112# error The NB_PROCS_MAX value must be defined in the 'hard_config.h' file !
    95113#endif
    96114
     
    116134unsigned int _ptabs_vaddr[GIET_NB_VSPACE_MAX];
    117135
    118 // Scheduler pointers array (virtual addresses)
    119 __attribute__((section (".bootdata")))
    120 static_scheduler_t* _schedulers[NB_CLUSTERS * NB_PROCS_MAX];
    121 
    122136// Next free PT2 index array
    123137__attribute__((section (".bootdata")))
     
    129143unsigned int _max_pt2[GIET_NB_VSPACE_MAX] =
    130144{ [0 ... GIET_NB_VSPACE_MAX - 1] = 0 };
     145
     146// Scheduler pointers array (virtual addresses)
     147// indexed by (x,y,lpid) : ((x << Y_WIDTH) + y)*NB_PROCS_MAX + lpid
     148__attribute__((section (".bootdata")))
     149static_scheduler_t* _schedulers[NB_PROCS_MAX<<(X_WIDTH+Y_WIDTH)];
    131150
    132151
     
    147166        _exit();
    148167    }
     168
    149169    // checking number of clusters
    150     if (header->clusters != NB_CLUSTERS)
    151     {
    152         _puts("\n[BOOT ERROR] Incoherent NB_CLUSTERS");
    153         _puts("\n             - In giet_config,  value = ");
    154         _putd(NB_CLUSTERS);
    155         _puts("\n             - In mapping_info, value = ");
    156         _putd(header->clusters);
     170    if ( (header->x_size  != X_SIZE)  ||
     171         (header->y_size  != Y_SIZE)  ||
     172         (header->x_width != X_WIDTH) ||
     173         (header->y_width != Y_WIDTH) )
     174    {
     175        _puts("\n[BOOT ERROR] Incoherent X_SIZE or Y_SIZE ");
     176        _puts("\n             - In hard_config:  X_SIZE = ");
     177        _putd( X_SIZE );
     178        _puts(" / Y_SIZE = ");
     179        _putd( Y_SIZE );
     180        _puts(" / X_WIDTH = ");
     181        _putd( X_WIDTH );
     182        _puts(" / Y_WIDTH = ");
     183        _putd( Y_WIDTH );
     184        _puts("\n             - In mapping_info: x_size = ");
     185        _putd( header->x_size );
     186        _puts(" / y_size = ");
     187        _putd( header->y_size );
     188        _puts(" / x_width = ");
     189        _putd( header->x_width );
     190        _puts(" / y_width = ");
     191        _putd( header->y_width );
    157192        _puts("\n");
    158193        _exit();
     
    167202
    168203#if BOOT_DEBUG_MAPPING
    169 _puts("\n - clusters  = ");
    170 _putd( header->clusters );
     204_puts("\n - x_size    = ");
     205_putd( header->x_size );
     206_puts("\n - y_size    = ");
     207_putd( header->y_size );
    171208_puts("\n - procs     = ");
    172209_putd( header->procs );
     
    196233_puts("\n");
    197234
    198 unsigned int        cluster_id;
     235unsigned int cluster_id;
    199236mapping_cluster_t * cluster = _get_cluster_base(header);
    200 for (cluster_id = 0; cluster_id < NB_CLUSTERS; cluster_id++)
     237for( cluster_id = 0; cluster_id < X_SIZE*Y_SIZE ; cluster_id++)
    201238{
    202 _puts("\n cluster = ");
    203 _putd( cluster_id );
    204 _puts("\n procs   = ");
    205 _putd( cluster[cluster_id].procs );
    206 _puts("\n psegs   = ");
    207 _putd( cluster[cluster_id].psegs );
    208 _puts("\n periphs = ");
    209 _putd( cluster[cluster_id].periphs );
    210 _puts("\n");
     239    _puts("\n - cluster[");
     240    _putd( cluster[cluster_id].x );
     241    _puts(",");
     242    _putd( cluster[cluster_id].y );
     243    _puts("]\n   procs   = ");
     244    _putd( cluster[cluster_id].procs );
     245    _puts("\n   psegs   = ");
     246    _putd( cluster[cluster_id].psegs );
     247    _puts("\n   periphs = ");
     248    _putd( cluster[cluster_id].periphs );
     249    _puts("\n");
    211250}
    212251#endif
     
    10691108    {
    10701109        if ( (vobj[vseg[vseg_id].vobj_offset].type == VOBJ_TYPE_SCHED) &&
    1071              (pseg[vseg[vseg_id].psegid].cluster == cluster_id ) )
     1110             (pseg[vseg[vseg_id].psegid].clusterid == cluster_id ) )
    10721111        {
    10731112            *vbase  = vseg[vseg_id].vbase;
     
    10781117    if ( found == 0 )
    10791118    {
    1080         _puts("\n[BOOT ERROR] No vobj of type SCHED in cluster ");
    1081         _putd(cluster_id);
    1082         _puts("\n");
     1119        mapping_cluster_t* cluster = _get_cluster_base(header);
     1120        _puts("\n[BOOT ERROR] No vobj of type SCHED in cluster [");
     1121        _putd( cluster[cluster_id].x );
     1122        _puts(",");
     1123        _putd( cluster[cluster_id].y );
     1124        _puts("]\n");
    10831125        _exit();
    10841126    }
     
    11191161    unsigned int alloc_cma_channel = 0;            // CMA channel allocator
    11201162    unsigned int alloc_hba_channel = 0;            // IOC channel allocator
    1121     unsigned int alloc_tim_channel[NB_CLUSTERS];  // user TIMER allocators
     1163    unsigned int alloc_tim_channel[X_SIZE*Y_SIZE]; // user TIMER allocators
    11221164
    11231165    /////////////////////////////////////////////////////////////////////////
     
    11291171    // and lpid to access the schedulers array.
    11301172    // - the _schedulers[] array of pointers can contain "holes", because
    1131     //   it is indexed by the global pid = cluster_id*NB_PROCS_MAX + lpid
     1173    //   it is indexed by the global pid = cluster_xy*NB_PROCS_MAX + lpid
    11321174    // - the mapping info array of processors is contiguous, it is indexed
    11331175    //   by proc_id, and use an offset specific in each cluster.
    11341176
    1135     for (cluster_id = 0; cluster_id < header->clusters; cluster_id++)
    1136     {
     1177    for (cluster_id = 0 ; cluster_id < X_SIZE*Y_SIZE ; cluster_id++)
     1178    {
     1179        unsigned int x          = cluster[cluster_id].x;
     1180        unsigned int y          = cluster[cluster_id].y;
     1181        unsigned int cluster_xy = (x<<Y_WIDTH) + y;
    11371182
    11381183#if BOOT_DEBUG_SCHED
    1139 _puts("\n[BOOT DEBUG] Initialise schedulers in cluster ");
    1140 _putd(cluster_id);
    1141 _puts("\n");
    1142 #endif
    1143 
     1184_puts("\n[BOOT DEBUG] Initialise schedulers in cluster[");
     1185_putd( x );
     1186_puts(",");
     1187_putd( y );
     1188_puts("]\n");
     1189#endif
    11441190        alloc_tim_channel[cluster_id] = NB_PROCS_MAX;
    11451191
     
    11541200        if ( nprocs > NB_PROCS_MAX )
    11551201        {
    1156             _puts("\n[BOOT ERROR] Too much processors in cluster ");
    1157             _putd(cluster_id);
    1158             _puts("\n");
     1202            _puts("\n[BOOT ERROR] Too much processors in cluster[");
     1203            _putd( x );
     1204            _puts(",");
     1205            _putd( y );
     1206            _puts("]\n");
    11591207            _exit();
    11601208        }
     
    11661214        if ( sched_length < (nprocs<<12) )
    11671215        {
    1168             _puts("\n[BOOT ERROR] Schedulers segment too small in cluster ");
    1169             _putd(cluster_id);
    1170             _puts("\n");
     1216            _puts("\n[BOOT ERROR] Schedulers segment too small in cluster[");
     1217            _putd( x );
     1218            _puts(",");
     1219            _putd( y );
     1220            _puts("]\n");
    11711221            _exit();
    11721222        }
     
    11771227              proc_id++, lpid++ )
    11781228        {
     1229            // current processor scheduler pointer : psched
     1230            static_scheduler_t* psched = (static_scheduler_t*)(sched_vbase+(lpid<<12));
     1231
    11791232            // set the schedulers pointers array
    1180             _schedulers[cluster_id * NB_PROCS_MAX + lpid] =
    1181                (static_scheduler_t*)( sched_vbase + (lpid<<12) );
     1233            _schedulers[cluster_xy * NB_PROCS_MAX + lpid] = psched;
    11821234
    11831235#if BOOT_DEBUG_SCHED
    11841236_puts("\nProc_");
    1185 _putd(lpid);
     1237_putd( x );
    11861238_puts("_");
    1187 _putd(cluster_id);
     1239_putd( y );
     1240_puts("_");
     1241_putd( lpid );
    11881242_puts(" : scheduler virtual base address = ");
    11891243_putx( sched_vbase + (lpid<<12) );
    11901244_puts("\n");
    11911245#endif
    1192             // current processor scheduler pointer : psched
    1193             static_scheduler_t* psched = (static_scheduler_t*)(sched_vbase+(lpid<<12));
    11941246
    11951247            // initialise the "tasks" variable : default value is 0
     
    12691321        {
    12701322
     1323            // compute the cluster coordinates
     1324            unsigned int x          = cluster[task[task_id].clusterid].x;
     1325            unsigned int y          = cluster[task[task_id].clusterid].y;
     1326            unsigned int cluster_xy = (x<<Y_WIDTH) + y;
     1327
    12711328#if BOOT_DEBUG_SCHED
    12721329_puts("\n[BOOT DEBUG] Initialise context for task ");
     
    12741331_puts(" in vspace ");
    12751332_puts( vspace[vspace_id].name );
    1276 _puts("\n");
     1333_puts(" running on cluster[");
     1334_putd( x );
     1335_puts(",");
     1336_putd( y );
     1337_puts("]\n");
    12771338#endif
    12781339            // compute gpid (global processor index) and scheduler base address
    1279             unsigned int gpid = task[task_id].clusterid * NB_PROCS_MAX +
    1280                                 task[task_id].proclocid;
     1340            unsigned int gpid = cluster_xy * NB_PROCS_MAX + task[task_id].proclocid;
    12811341            static_scheduler_t* psched = _schedulers[gpid];
    12821342
     
    18271887    unsigned int channel_id;
    18281888
    1829     for (cluster_id = 0; cluster_id < header->clusters; cluster_id++)
    1830     {
     1889    // loop on all physical clusters
     1890    for (cluster_id = 0; cluster_id < X_SIZE*Y_SIZE; cluster_id++)
     1891    {
     1892        // computes cluster coordinates
     1893        unsigned int x          = cluster[cluster_id].x;
     1894        unsigned int y          = cluster[cluster_id].y;
     1895        unsigned int cluster_xy = (x<<Y_WIDTH) + y;
    18311896
    18321897#if BOOT_DEBUG_PERI
    1833 _puts("\n[BOOT DEBUG] ****** peripherals initialisation in cluster ");
    1834 _putd(cluster_id);
    1835 _puts(" ******\n");
    1836 #endif
    1837 
     1898_puts("\n[BOOT DEBUG] ****** peripherals initialisation in cluster[");
     1899_putd( x );
     1900_puts(",");
     1901_putd( y );
     1902_puts("] ******\n");
     1903#endif
     1904
     1905        // loop on peripherals
    18381906        for (periph_id = cluster[cluster_id].periph_offset;
    18391907             periph_id < cluster[cluster_id].periph_offset +
     
    18431911            unsigned int channels   = periph[periph_id].channels;
    18441912
    1845 #if BOOT_DEBUG_PERI
    1846 _puts("- peripheral type : ");
    1847 _putd(type);
    1848 _puts(" / channels = ");
    1849 _putd(channels);
    1850 _puts("\n");
    1851 #endif
    18521913            switch (type)
    18531914            {
     
    18561917                    _ioc_init();
    18571918#if BOOT_DEBUG_PERI
    1858 _puts("- IOC initialised\n");
     1919_puts("- IOC / channels = ");
     1920_putd(channels);
     1921_puts("\n");
    18591922#endif
    18601923                    break;
     
    18641927                    for (channel_id = 0; channel_id < channels; channel_id++)
    18651928                    {
    1866                         _dma_init( cluster_id, channel_id );
     1929                        _dma_init( cluster_xy, channel_id );
    18671930                    }
    18681931#if BOOT_DEBUG_PERI
    1869 _puts("- DMA initialised\n");
     1932_puts("- DMA / channels = ");
     1933_putd(channels);
     1934_puts("\n");
    18701935#endif
    18711936                    break;
    18721937                }
    1873                 case PERIPH_TYPE_NIC:    // vci_multi_nic component
     1938                case PERIPH_TYPE_FBF:    // vci_block_device component
     1939                {
     1940                    // nothing to do
     1941#if BOOT_DEBUG_PERI
     1942_puts("- FBF / channels = ");
     1943_putd(channels);
     1944_puts("\n");
     1945#endif
     1946                    break;
     1947                }
     1948                case PERIPH_TYPE_HBA:    // vci_multi_ahci component
    18741949                {
    18751950                    for (channel_id = 0; channel_id < channels; channel_id++)
     
    18781953                    }
    18791954#if BOOT_DEBUG_PERI
    1880 _puts("- NIC initialised\n");
     1955_puts("- HBA / channels = ");
     1956_putd(channels);
     1957_puts("\n");
    18811958#endif
    18821959                    break;
    18831960                }
     1961                case PERIPH_TYPE_CMA:    // vci_chbuf_dma component
     1962                {
     1963                    for (channel_id = 0; channel_id < channels; channel_id++)
     1964                    {
     1965                        // TODO
     1966                    }
     1967#if BOOT_DEBUG_PERI
     1968_puts("- CMA / channels = ");
     1969_putd(channels);
     1970_puts("\n");
     1971#endif
     1972                    break;
     1973                }
     1974                case PERIPH_TYPE_NIC:    // vci_multi_nic component
     1975                {
     1976                    for (channel_id = 0; channel_id < channels; channel_id++)
     1977                    {
     1978                        // TODO
     1979                    }
     1980#if BOOT_DEBUG_PERI
     1981_puts("- NIC / channels = ");
     1982_putd(channels);
     1983_puts("\n");
     1984#endif
     1985                    break;
     1986                }
     1987                case PERIPH_TYPE_XCU:    // vci_xicu component
     1988                {
     1989                    // nothing to do
     1990#if BOOT_DEBUG_PERI
     1991_puts("- XCU / channels = ");
     1992_putd(channels);
     1993_puts("\n");
     1994#endif
     1995                    break;
     1996                }
     1997                case PERIPH_TYPE_MMC:    // vci_memcache config
     1998                {
     1999                    // nothing to do
     2000#if BOOT_DEBUG_PERI
     2001_puts("- MMC / channels = ");
     2002_putd(channels);
     2003_puts("\n");
     2004#endif
     2005                    break;
     2006                }
    18842007                case PERIPH_TYPE_TTY:    // vci_multi_tty component
    18852008                {
    18862009#if BOOT_DEBUG_PERI
    1887 _puts("- TTY initialised\n");
     2010_puts("- TTY / channels = ");
     2011_putd(channels);
     2012_puts("\n");
    18882013#endif
    18892014                    break;
     
    19022027                    }
    19032028#if BOOT_DEBUG_PERI
    1904 _puts("- IOB initialised\n");
     2029_puts("- IOB / channels = ");
     2030_putd(channels);
     2031_puts("\n");
    19052032#endif
    19062033                    break;
     
    19102037
    19112038#if BOOT_DEBUG_PERI
    1912 _puts("\n[BOOT DEBUG] ****** coprocessors initialisation in cluster ");
    1913 _putd(cluster_id);
    1914 _puts(" ******\n");
    1915 #endif
    1916 
     2039_puts("\n[BOOT DEBUG] ****** coprocessors initialisation in cluster[");
     2040_putd( x );
     2041_puts(",");
     2042_putd( y );
     2043_puts("] ******\n");
     2044#endif
     2045
     2046        // loop on coprocessors
    19172047        for ( coproc_id = cluster[cluster_id].coproc_offset;
    19182048              coproc_id < cluster[cluster_id].coproc_offset +
     
    19392069                paddr_t mwmr_channel_pbase = vobj[vobj_id].paddr;
    19402070
    1941                 _mwmr_hw_init( cluster_id,
    1942                                cp_port_id,
    1943                                cp_port[cp_port_id].direction,
    1944                                mwmr_channel_pbase );
     2071                _mwr_hw_init( cluster_xy,
     2072                              cp_port_id,
     2073                              cp_port[cp_port_id].direction,
     2074                              mwmr_channel_pbase );
    19452075#if BOOT_DEBUG_PERI
    19462076_puts("     port direction: ");
     
    19592089} // end boot_peripherals_init()
    19602090
    1961 
    1962 //////////////////////////////////////////////////////////////////////////////
    1963 // This function is executed by all processors to jump into kernel:
    1964 // - Each processor initialises its CP0_SCHED register from the value
    1965 //   contained in the _schedulers[] array (previously initialised
    1966 //   by proc0 in the _schedulers_init() function).
    1967 // - Each processor (but proc 0) initialise the CP2_PTPR register with
    1968 //   the default value (i.e. PTPR corresponding to vspace_0 page table),
    1969 //   and write into CP2 MODE register to activate their MMU.
    1970 // - All processors jump to the kernel entry point (seg_kernel_init_base).
    1971 //////////////////////////////////////////////////////////////////////////////
    1972 void boot_to_kernel()
    1973 {
    1974     // CP0 SCHED register initialisation
    1975     unsigned int procid = _get_procid();
    1976     _set_sched( (unsigned int)_schedulers[procid] );
    1977 
    1978     // MMU Activation
    1979     if ( procid != 0 )
    1980     {
    1981         _set_mmu_ptpr( (unsigned int)(_ptabs_paddr[0]>>13) );
    1982         _set_mmu_mode( 0xF );
    1983 
    1984         _tty_get_lock( 0 );
    1985         _puts("\n[BOOT] Proc ");
    1986         _putd( procid );
    1987         _puts(" MMU activation at cycle ");
    1988         _putd(_get_proctime());
    1989         _puts("\n");
    1990         _tty_release_lock( 0 );
    1991 
    1992     }
    1993 
    1994     // jump to kernel_init
    1995     unsigned int kernel_entry = (unsigned int)&seg_kernel_init_base;
    1996 
    1997     _tty_get_lock( 0 );
    1998     _puts("\n[BOOT] Processor ");
    1999     _putd( procid );
    2000     _puts(" jumps to kernel (");
    2001     _putx( kernel_entry );
    2002     _puts(") at cycle ");
    2003     _putd( _get_proctime() );
    2004     _puts("\n");
    2005     _tty_release_lock( 0 );
    2006 
    2007     asm volatile( "jr   %0" ::"r"(kernel_entry) );
    2008 }
    2009 
    20102091/////////////////////////////////////////////////////////////////////////
    20112092// This function is the entry point of the boot code for all processors.
     
    20142095void boot_init()
    20152096{
    2016     mapping_header_t* header = (mapping_header_t *) & seg_boot_mapping_base;
    2017     unsigned int      procid = _get_procid();
     2097    mapping_header_t* header     = (mapping_header_t *) & seg_boot_mapping_base;
     2098    unsigned int      gpid       = _get_procid();
     2099    unsigned int      cluster_xy = gpid / NB_PROCS_MAX;
     2100    unsigned int      lpid       = gpid % NB_PROCS_MAX;
    20182101 
    2019     if ( procid == 0 )    // only Processor 0 does it
     2102    if ( gpid == 0 )    // only Processor 0 does it
    20202103    {
    20212104        _puts("\n[BOOT] boot_init start at cycle ");
     
    20432126        _set_mmu_mode( 0xF );
    20442127
    2045         _puts("\n[BOOT] Processor 0 MMU activation at cycle ");
     2128        _puts("\n[BOOT] Processor[0,0,0] : MMU activation at cycle ");
    20462129        _putd(_get_proctime());
    20472130        _puts("\n");
     
    20642147        _set_sched( (unsigned int)_schedulers[0] );
    20652148
    2066         _puts("\n[BOOT] Proc 0 CPO_SCHED register initialised at cycle ");
    2067         _putd(_get_proctime());
    2068         _puts("\n");
    2069 
    2070         // Initializing external peripherals
     2149        // Initializing peripherals
    20712150        boot_peripherals_init();
    20722151
    2073         _puts("\n[BOOT] External peripherals initialised at cycle ");
     2152        _puts("\n[BOOT] All peripherals initialised at cycle ");
    20742153        _putd(_get_proctime());
    20752154        _puts("\n");
     
    20832162
    20842163        // P0 starts all other processors
    2085         unsigned int cluster_id;
    2086         unsigned int local_id;
    2087         for (cluster_id = 0; cluster_id < NB_CLUSTERS; cluster_id++)
    2088         {
    2089             for(local_id = 0; local_id < NB_PROCS_MAX; local_id++)
     2164        unsigned int x,y,p;
     2165        for (x = 0 ; x < X_SIZE ; x++)
     2166        {
     2167            for (y = 0 ; y < Y_SIZE ; y++)
    20902168            {
    2091                 if ((cluster_id != 0) || (local_id != 0))
    2092                 {
    2093                     _xcu_send_ipi( cluster_id,
    2094                                    local_id,
    2095                                    (unsigned int)boot_init );
     2169                for(p = 0; p < NB_PROCS_MAX; p++)
     2170                {
     2171                    if ( (x != 0) || (y != 0) || (p != 0) )
     2172                    {
     2173                        _xcu_send_ipi( (x<<Y_WIDTH) + y,
     2174                                       p,
     2175                                       (unsigned int)boot_init );
     2176                    }
    20962177                }
    20972178            }
     
    21042185
    21052186    // all processor initialise SCHED register
    2106     _set_sched( (unsigned int)_schedulers[procid] );
     2187    _set_sched( (unsigned int)_schedulers[gpid] );
    21072188
    21082189    // all processors (but Proc 0) activate MMU
    2109     if ( procid != 0 )
     2190    if ( gpid != 0 )
    21102191    {
    21112192        _set_mmu_ptpr( (unsigned int)(_ptabs_paddr[0]>>13) );
     
    21132194
    21142195        _tty_get_lock( 0 );
    2115         _puts("\n[BOOT] Processor ");
    2116         _putd( procid );
    2117         _puts(" MMU activation at cycle ");
     2196        _puts("\n[BOOT] Processor[");
     2197        _putd( cluster_xy >> Y_WIDTH );
     2198        _puts(",");
     2199        _putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     2200        _puts(",");
     2201        _putd( lpid );
     2202        _puts("] : MMU activation at cycle ");
    21182203        _putd(_get_proctime());
    21192204        _puts("\n");
    21202205        _tty_release_lock( 0 );
    2121 
    21222206    }
    21232207
     
    21262210
    21272211    _tty_get_lock( 0 );
    2128     _puts("\n[BOOT] Processor ");
    2129     _putd( procid );
    2130     _puts(" enters kernel at cycle ");
     2212    _puts("\n[BOOT] Processor[");
     2213    _putd( cluster_xy >> Y_WIDTH );
     2214    _puts(",");
     2215    _putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     2216    _puts(",");
     2217    _putd( lpid );
     2218    _puts("] enters kernel at cycle ");
    21312219    _putd( _get_proctime() );
    21322220    _puts(" / kernel entry = ");
  • soft/giet_vm/giet_common/utils.c

    r262 r263  
    1919
    2020// This global variable is allocated in the boot.c file or in kernel_init.c file
    21 extern static_scheduler_t* _schedulers[NB_CLUSTERS * NB_PROCS_MAX];
     21extern static_scheduler_t* _schedulers[X_SIZE * Y_SIZE * NB_PROCS_MAX];
    2222
    2323///////////////////////////////////////////////////////////////////////////////////
     
    565565    return (mapping_pseg_t *) ((char *) header +
    566566            MAPPING_HEADER_SIZE +
    567             MAPPING_CLUSTER_SIZE * header->clusters);
     567            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE);
    568568}
    569569/////////////////////////////////////////////////////////////////////////////
     
    572572    return (mapping_vspace_t *)  ((char *) header +
    573573            MAPPING_HEADER_SIZE +
    574             MAPPING_CLUSTER_SIZE * header->clusters +
     574            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    575575            MAPPING_PSEG_SIZE * header->psegs);
    576576}
     
    580580    return (mapping_vseg_t *) ((char *) header +
    581581            MAPPING_HEADER_SIZE +
    582             MAPPING_CLUSTER_SIZE * header->clusters +
     582            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    583583            MAPPING_PSEG_SIZE * header->psegs +
    584584            MAPPING_VSPACE_SIZE * header->vspaces);
     
    589589    return (mapping_vobj_t *) ((char *) header +
    590590            MAPPING_HEADER_SIZE +
    591             MAPPING_CLUSTER_SIZE * header->clusters +
     591            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    592592            MAPPING_PSEG_SIZE * header->psegs +
    593593            MAPPING_VSPACE_SIZE * header->vspaces +
     
    599599    return (mapping_task_t *) ((char *) header +
    600600            MAPPING_HEADER_SIZE +
    601             MAPPING_CLUSTER_SIZE * header->clusters +
     601            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    602602            MAPPING_PSEG_SIZE * header->psegs +
    603603            MAPPING_VSPACE_SIZE * header->vspaces +
     
    610610    return (mapping_proc_t *) ((char *) header +
    611611            MAPPING_HEADER_SIZE +
    612             MAPPING_CLUSTER_SIZE * header->clusters +
     612            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    613613            MAPPING_PSEG_SIZE * header->psegs +
    614614            MAPPING_VSPACE_SIZE * header->vspaces +
     
    622622    return (mapping_irq_t *) ((char *) header +
    623623            MAPPING_HEADER_SIZE +
    624             MAPPING_CLUSTER_SIZE * header->clusters +
     624            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    625625            MAPPING_PSEG_SIZE * header->psegs +
    626626            MAPPING_VSPACE_SIZE * header->vspaces +
     
    635635    return (mapping_coproc_t *) ((char *) header +
    636636            MAPPING_HEADER_SIZE +
    637             MAPPING_CLUSTER_SIZE * header->clusters +
     637            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    638638            MAPPING_PSEG_SIZE * header->psegs +
    639639            MAPPING_VSPACE_SIZE * header->vspaces +
     
    649649    return (mapping_cp_port_t *) ((char *) header +
    650650            MAPPING_HEADER_SIZE +
    651             MAPPING_CLUSTER_SIZE * header->clusters +
     651            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    652652            MAPPING_PSEG_SIZE * header->psegs +
    653653            MAPPING_VSPACE_SIZE * header->vspaces +
     
    664664    return (mapping_periph_t *) ((char *) header +
    665665            MAPPING_HEADER_SIZE +
    666             MAPPING_CLUSTER_SIZE * header->clusters +
     666            MAPPING_CLUSTER_SIZE * X_SIZE * Y_SIZE +
    667667            MAPPING_PSEG_SIZE * header->psegs +
    668668            MAPPING_VSPACE_SIZE * header->vspaces +
  • soft/giet_vm/giet_config.h

    r258 r263  
    2323
    2424#define GIET_DEBUG_INIT              0                  /* trace parallel kernel initialisation */
     25
    2526#define GIET_DEBUG_FAT           0          /* trace fat accesses */
    2627#define GIET_DEBUG_SWITCH            0                  /* trace context switchs  */
    2728#define GIET_DEBUG_IOC_DRIVER    0          /* trace IOC accesses */
    2829#define GIET_DEBUG_DMA_DRIVER    0          /* trace DMA accesses */
     30#define GIET_DEBUG_FBF_DRIVER    1          /* trace FBF accesses */
    2931
    3032#define CONFIG_SRL_VERBOSITY TRACE
  • soft/giet_vm/giet_drivers/dma_driver.c

    r258 r263  
    1212//
    1313// There is  (NB_CLUSTERS * NB_DMA_CHANNELS) channels, indexed by a global index:
    14 //        dma_id = cluster_id * NB_DMA_CHANNELS + loc_id
     14//        dma_id = cluster_xy * NB_DMA_CHANNELS + loc_id
    1515//
    1616// A DMA channel is a private ressource allocated to a given processor.
     
    2222// The virtual base address of the segment associated to a channel is:
    2323//
    24 //    seg_dma_base + cluster_id * vseg_cluster_increment + DMA_SPAN * channel_id
     24//    seg_dma_base + cluster_xy * vseg_cluster_increment + DMA_SPAN * channel_id
    2525//
    2626////////////////////////////////////////////////////////////////////////////////////
     
    3232#include <vmem.h>
    3333
    34 #if !defined(NB_CLUSTERS)
    35 # error: You must define NB_CLUSTERS in the hard_config.h file
    36 #endif
    37 
    38 #if (NB_CLUSTERS > 256)
    39 # error: NB_CLUSTERS cannot be larger than 256!
    40 #endif
    41 
    42 #if !defined(NB_PROCS_MAX)
    43 # error: You must define NB_PROCS_MAX in the hard_config.h file
    44 #endif
    45 
    46 #if (NB_PROCS_MAX > 8)
    47 # error: NB_PROCS_MAX cannot be larger than 8!
    48 #endif
    49 
    50 #if (NB_DMA_CHANNELS > 8)
    51 # error: NB_DMA_CHANNELS cannot be larger than 8!
     34#if !defined(X_SIZE)
     35# error: You must define X_SIZE in the hard_config.h file
     36#endif
     37
     38#if !defined(Y_SIZE)
     39# error: You must define X_SIZE in the hard_config.h file
     40#endif
     41
     42#if !defined(X_WIDTH)
     43# error: You must define X_WIDTH in the hard_config.h file
     44#endif
     45
     46#if !defined(Y_WIDTH)
     47# error: You must define X_WIDTH in the hard_config.h file
     48#endif
     49
     50#if !defined(NB_DMA_CHANNELS)
     51# error: You must define NB_DMA_CHANNELS in the hard_config.h file
    5252#endif
    5353
     
    6060// Returns 0 if success, returns > 0 if error.
    6161//////////////////////////////////////////////////////////////////////////////////
    62 unsigned int _dma_init( unsigned int cluster_id,
     62unsigned int _dma_init( unsigned int cluster_xy,
    6363                        unsigned int channel_id )
    6464{
    6565#if NB_DMA_CHANNELS > 0
     66
    6667    // parameters checking
    67     if (cluster_id >= NB_CLUSTERS)      return 1;
     68    unsigned int x = cluster_xy >> Y_WIDTH;
     69    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     70    if (x >= X_SIZE)                    return 1;
     71    if (y >= Y_SIZE)                    return 1;
    6872    if (channel_id >= NB_DMA_CHANNELS)  return 1;
    6973
    7074    // compute DMA base address
    7175    unsigned int* dma_address = (unsigned int*) ((unsigned int)&seg_dma_base +
    72                                 (cluster_id * (unsigned int)&vseg_cluster_increment));
     76                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
    7377
    7478    // disable interrupt for selected channel
     
    8488// completion. It actually forces the channel to return in iDLE state.
    8589//////////////////////////////////////////////////////////////////////////////////
    86 unsigned int _dma_reset( unsigned int cluster_id,
     90unsigned int _dma_reset( unsigned int cluster_xy,
    8791                         unsigned int channel_id )
    8892{
    8993#if NB_DMA_CHANNELS > 0
     94
    9095    // parameters checking
    91     if (cluster_id >= NB_CLUSTERS)      return 1;
     96    unsigned int x = cluster_xy >> Y_WIDTH;
     97    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     98    if (x >= X_SIZE)                    return 1;
     99    if (y >= Y_SIZE)                    return 1;
    92100    if (channel_id >= NB_DMA_CHANNELS)  return 1;
    93101
    94102    // compute DMA base address
    95103    unsigned int* dma_address = (unsigned int*) ((unsigned int)&seg_dma_base +
    96                                 (cluster_id * (unsigned int)&vseg_cluster_increment));
     104                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
    97105
    98106    // reset selected channel
     
    107115// This function returns the status of a DMA channel in a given cluster
    108116//////////////////////////////////////////////////////////////////////////////////
    109 unsigned int _dma_get_status( unsigned int cluster_id,
     117unsigned int _dma_get_status( unsigned int cluster_xy,
    110118                              unsigned int channel_id )
    111119{
    112120#if NB_DMA_CHANNELS > 0
     121
    113122    // parameters checking
    114     if (cluster_id >= NB_CLUSTERS)      return 1;
     123    unsigned int x = cluster_xy >> Y_WIDTH;
     124    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     125    if (x >= X_SIZE)                    return 1;
     126    if (y >= Y_SIZE)                    return 1;
    115127    if (channel_id >= NB_DMA_CHANNELS)  return 1;
    116128
    117129    // compute DMA base address
    118130    unsigned int * dma_address = (unsigned int *) ((unsigned int)&seg_dma_base +
    119                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     131                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    120132
    121133    // get selected channel status
     
    131143// and sets the transfer size to lauch the transfer.
    132144//////////////////////////////////////////////////////////////////////////////////
    133 unsigned int _dma_start_transfer( unsigned int       cluster_id,
     145unsigned int _dma_start_transfer( unsigned int       cluster_xy,
    134146                                  unsigned int       channel_id,
    135147                                  unsigned long long dst_paddr,   // physical address
     
    138150{
    139151#if NB_DMA_CHANNELS > 0
     152
    140153    // parameters checking
    141     if (cluster_id >= NB_CLUSTERS)      return 1;
     154    unsigned int x = cluster_xy >> Y_WIDTH;
     155    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     156    if (x >= X_SIZE)                    return 1;
     157    if (y >= Y_SIZE)                    return 1;
    142158    if (channel_id >= NB_DMA_CHANNELS)  return 1;
    143159
    144160    // compute DMA base address
    145161    unsigned int * dma_address = (unsigned int *) ((unsigned int)&seg_dma_base +
    146                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     162                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    147163
    148164    // selected channel configuration and lauching
     
    179195
    180196    unsigned int procid    = _get_procid();
    181     unsigned int cluster_id = procid/NB_PROCS_MAX;
     197    unsigned int cluster_xy = procid/NB_PROCS_MAX;
    182198    unsigned int channel_id = procid%NB_PROCS_MAX;
    183199
     
    192208_puts("\n - vspace_id  = ");
    193209_putx( vspace_id );
    194 _puts("\n - cluster_id = ");
    195 _putx( cluster_id );
     210_puts("\n - cluster_xy = ");
     211_putx( cluster_xy );
    196212_puts("\n - channel_id = ");
    197213_putx( channel_id );
     
    263279
    264280    // dma channel configuration & lauching
    265     ko = _dma_start_transfer(  cluster_id, channel_id, dst_paddr, src_paddr, size );
     281    ko = _dma_start_transfer(  cluster_xy, channel_id, dst_paddr, src_paddr, size );
    266282    if ( ko )
    267283    {
     
    273289
    274290    // scan dma channel status
    275     unsigned int status = _dma_get_status( cluster_id, channel_id );
     291    unsigned int status = _dma_get_status( cluster_xy, channel_id );
    276292    while( (status != DMA_SUCCESS) &&
    277293           (status != DMA_READ_ERROR) &&
    278294           (status != DMA_WRITE_ERROR) )
    279295    {
    280         status = _dma_get_status( cluster_id, channel_id );
     296        status = _dma_get_status( cluster_xy, channel_id );
    281297
    282298#if GIET_DEBUG_DMA_DRIVER
     
    299315    }
    300316    // reset dma channel
    301     _dma_reset( cluster_id, channel_id );
     317    _dma_reset( cluster_xy, channel_id );
    302318
    303319#if GIET_DEBUG_DMA_DRIVER
  • soft/giet_vm/giet_drivers/dma_driver.h

    r258 r263  
    4242
    4343// low level access functions
    44 extern unsigned int _dma_init( unsigned int cluster_id,
     44extern unsigned int _dma_init( unsigned int cluster_xy,
    4545                               unsigned int channel_id );
    4646
    47 extern unsigned int _dma_reset( unsigned int  cluster_id,
     47extern unsigned int _dma_reset( unsigned int  cluster_xy,
    4848                                unsigned int  channel_id );
    4949
    50 extern unsigned int _dma_get_status( unsigned int  cluster_id,
     50extern unsigned int _dma_get_status( unsigned int  cluster_xy,
    5151                                     unsigned int  channel_id );
    5252
    53 extern unsigned int _dma_start_transfer( unsigned int       cluster_id,
     53extern unsigned int _dma_start_transfer( unsigned int       cluster_xy,
    5454                                         unsigned int       channel_id,
    5555                                         unsigned long long dst_paddr,
  • soft/giet_vm/giet_drivers/fbf_driver.c

    r258 r263  
    9696} fb_cma_channel_t;
    9797
     98// array of FB_CMA channels descriptors (32 bytes per entry)
     99// each entry contains one SRC and one DST chbuf descriptors.
    98100in_unckdata volatile fb_cma_channel_t
    99101_fb_cma_channel[NB_CMA_CHANNELS] __attribute__((aligned(64)));
    100102
     103// array of physical addresses for the FB_CMA channels descriptors
    101104in_unckdata volatile paddr_t         
    102105_fb_cma_desc_paddr[NB_CMA_CHANNELS];
     
    105108// _fb_cma_init()
    106109// This function uses the _fb_cma_channel[] and _fb_cma_desc_paddr[] arrays,
    107 // that are both indexed by the channel index.
    108 // where each entry contains one fb_cma_channel structure (defining two
    109 // SRC and DST chbuf descriptors), and does four things:
     110// (that are both indexed by the channel index), and does four things:
    110111//
    111112// 1) computes the physical addresses for the two source user buffers, for
    112113//    the destination frame buffer. It initialises the channel descriptor
    113114//    _fb_cma_channel[i], containing the SRC chbuf descriptor (two buffers),
    114 //    the DST chbuf descriptor (one single frame buffer), and the buffer length.
     115//    the DST chbuf descriptor (one single buffer), and the buffer length.
    115116//
    116117// 2) computes the physical address for the channel descriptor and register it
     
    138139    unsigned int  flags;               // protection flags
    139140    unsigned int  ppn;                 // physical page number
    140     paddr_t       channel_pbase;       // physical address of channel descriptor
     141    paddr_t       desc_paddr;          // physical address of channel descriptor
    141142
    142143    // get CMA channel index
     
    255256        return 1;
    256257    }
    257     channel_pbase = (((paddr_t)ppn) << 12) | (vaddr & 0x00000FFF);
    258     _fb_cma_desc_paddr[channel_id] = channel_pbase;
    259 
    260 #if GIET_DEBUG_CMA_DRIVER
     258    _fb_cma_desc_paddr[channel_id] = (((paddr_t)ppn) << 12) | (vaddr & 0x00000FFF);
     259
     260    desc_paddr                     = (((paddr_t)ppn) << 12) | (vaddr & 0x00000FFF);
     261   
     262
     263#if GIET_DEBUG_FBF_DRIVER
     264_tty_get_lock( 0 );
     265_puts("\n[CMA DEBUG] fb_cma_init()");
     266_puts("\n - fbf       pbase = ");
     267_putl( _fb_cma_channel[channel_id].fbf );
     268_puts("\n - buf0      pbase = ");
     269_putl( _fb_cma_channel[channel_id].buf0 );
     270_puts("\n - buf1      pbase = ");
     271_putl( _fb_cma_channel[channel_id].buf1 );
     272_puts("\n - channel   pbase = ");
     273_putl( _fb_cma_desc_paddr[channel_id] );
    261274_puts("\n");
    262 _puts("- fbf       pbase = ");
    263 _putl( _fb_cma_channel[channel_id].fbf );
    264 _puts("\n");
    265 _puts("- buf0      pbase = ");
    266 _putl( _fb_cma_channel[channel_id].buf0 );
    267 _puts("\n");
    268 _puts("- buf1      pbase = ");
    269 _putl( _fb_cma_channel[channel_id].buf1 );
    270 _puts("\n");
    271 _puts("- channel   pbase = ");
    272 _putl( channel_pbase );
    273 _puts("\n");
     275_tty_release_lock( 0 );
    274276#endif
    275277
    276278    // SYNC request for channel descriptor
    277     _memc_sync( channel_pbase, 32 );
     279    _memc_sync( desc_paddr, 32 );
    278280
    279281    // CMA channel activation
    280282    unsigned int* cma_vbase = (unsigned int *)&seg_cma_base;
    281     unsigned int  offset     = channel_id * CHBUF_CHANNEL_SPAN;
    282 
    283     cma_vbase[offset + CHBUF_SRC_DESC]  = (unsigned int)(channel_pbase & 0xFFFFFFFF);
    284     cma_vbase[offset + CHBUF_SRC_EXT]   = (unsigned int)(channel_pbase >> 32);
     283    unsigned int  offset    = channel_id * CHBUF_CHANNEL_SPAN;
     284
     285    cma_vbase[offset + CHBUF_SRC_DESC]  = (unsigned int)(desc_paddr & 0xFFFFFFFF);
     286    cma_vbase[offset + CHBUF_SRC_EXT]   = (unsigned int)(desc_paddr >> 32);
    285287    cma_vbase[offset + CHBUF_SRC_NBUFS] = 2;
    286     cma_vbase[offset + CHBUF_DST_DESC]  = (unsigned int)(channel_pbase & 0xFFFFFFFF) + 16;
    287     cma_vbase[offset + CHBUF_DST_EXT]   = (unsigned int)(channel_pbase >> 32);
     288    cma_vbase[offset + CHBUF_DST_DESC]  = (unsigned int)(desc_paddr & 0xFFFFFFFF) + 16;
     289    cma_vbase[offset + CHBUF_DST_EXT]   = (unsigned int)(desc_paddr >> 32);
    288290    cma_vbase[offset + CHBUF_DST_NBUFS] = 1;
    289291    cma_vbase[offset + CHBUF_BUF_SIZE]  = length;
     
    302304#endif
    303305}
    304 //////////////////////////////////////////////////////////////////////////////////
     306////////////////////////////////////////////////////////////////////////////////////
    305307// _fb_cma_write()
    306 // This function makes a SYNC request for the source user buffer.
    307 // Then it updates the status of the SRC and DST chbuf descriptors, to allow
    308 // the CMA component to transfer the source user buffer buffer to the destination
    309 // frame buffer, and makes a SYNC request for the channel descriptor.
    310 //
    311 // - buffer_id : user buffer index (0 => buf0 / not 0 => buf1)
     308//
     309// It updates the status of the SRC and DST chbuf descriptors, to allow the CMA
     310// component to transfer the source user buffer to the frame buffer.
     311//
     312// If the IO Bridge component is used:
     313// 1) it makes an INVAL request for the channel descriptor, before testing the
     314//    source buffer status, because it is modified in XRAM by the CMA component.
     315// 2) it makes a SYNC request for the source user buffer before activating the CMA
     316//    transfer, because the data will be read from XRAM by the CMA component.
     317// 3) it makes a SYNC request for the channel descriptor after modification
     318//    of the SRC and DST status, because these descriptors will be read from XRAM
     319//    by the CMA component.
     320//
     321// The buffer_id argument is the user buffer index (0 => buf0 / not 0 => buf1)
    312322// Returns 0 if success, > 0 if error
    313 //////////////////////////////////////////////////////////////////////////////////
     323////////////////////////////////////////////////////////////////////////////////////
    314324unsigned int _fb_cma_write( unsigned int buffer_id )
    315325{
    316326#if NB_CMA_CHANNELS > 0
    317327
    318     paddr_t         buf_paddr;
    319     unsigned int    buf_length;
     328    volatile paddr_t buf_paddr;
     329    unsigned int     buf_length;
     330    unsigned int     full = 1;
     331
     332    unsigned int     count = 0;
    320333
    321334    // get CMA channel index
    322335    unsigned int channel_id = _get_context_slot(CTX_CMA_ID);
    323336
    324     // SYNC request for the source user buffer
    325     if ( buffer_id == 0 )  buf_paddr = _fb_cma_channel[channel_id].buf0;
    326     else                   buf_paddr = _fb_cma_channel[channel_id].buf1;
    327     buf_length = _fb_cma_channel[channel_id].length;
    328     _memc_sync( buf_paddr, buf_length );
     337#if GIET_DEBUG_FBF_DRIVER
     338_tty_get_lock( 0 );
     339_puts("\n[CMA DEBUG] fb_cma_write() for CMA channel ");
     340_putd( channel_id );
     341_puts(" / buf_id = ");
     342_putd( buffer_id );
     343_puts("\n");
     344_tty_release_lock( 0 );
     345#endif
     346
     347    // waiting buffer empty
     348    while ( full )
     349    { 
     350        if ( USE_IOB )
     351        {
     352            // INVAL L2 cache for the channel descriptor,
     353            _memc_inval( _fb_cma_desc_paddr[channel_id], 32 );
     354
     355            // INVAL L1 cache for the channel descriptor,
     356            _dcache_buf_invalidate( &_fb_cma_channel[channel_id], 32 );
     357        }
     358
     359        // read SRC buffer descriptor
     360        if ( buffer_id == 0 ) buf_paddr = _fb_cma_channel[channel_id].buf0;
     361        else                  buf_paddr = _fb_cma_channel[channel_id].buf1;
     362        full = ( (unsigned int)(buf_paddr>>63) );
     363
     364        count++;
     365        if ( count == 10 ) _exit();
     366
     367#if GIET_DEBUG_FBF_DRIVER
     368_tty_get_lock( 0 );
     369_puts(" - buffer descriptor = ");
     370_putl( buf_paddr );
     371_puts(" at cycle ");
     372_putd( _get_proctime() );
     373_puts("\n");
     374_tty_release_lock( 0 );
     375#endif
     376
     377    }
     378
     379    if ( USE_IOB )
     380    {
     381        // SYNC request for the user buffer because
     382        // this buffer will be read from XRAM by the CMA component
     383        _memc_sync( buf_paddr, _fb_cma_channel[channel_id].length );
     384    }
    329385
    330386    // set SRC full
     
    338394                                       & 0x7FFFFFFFFFFFFFFFULL;
    339395
    340     // SYNC request for the channel descriptor
    341     buf_paddr  = _fb_cma_desc_paddr[channel_id];
    342     buf_length = 32;
    343     _memc_sync( buf_paddr, buf_length );
     396    if ( USE_IOB )
     397    {
     398        // SYNC request for the channel descriptor, because
     399        // it will be read in XRAM by the CMA component
     400        _memc_sync( _fb_cma_desc_paddr[channel_id], 32 );
     401    }
    344402
    345403    return 0;
  • soft/giet_vm/giet_drivers/icu_driver.c

    r258 r263  
    1616// The virtual base address of the segment associated to the component is:
    1717//
    18 //      seg_icu_base + cluster_id * vseg_cluster_increment
     18//      seg_icu_base + cluster_xy * vseg_cluster_increment
    1919//
    2020// The seg_icu_base and vseg_cluster_increment values must be defined
     
    2424#include <giet_config.h>
    2525#include <icu_driver.h>
     26#include <tty_driver.h>
    2627#include <utils.h>
    2728
    28 #if !defined(NB_CLUSTERS)
    29 # error: You must define NB_CLUSTERS in the hard_config.h file
     29#if !defined(X_SIZE)
     30# error: You must define X_SIZE in the hard_config.h file
    3031#endif
    3132
    32 #if (NB_CLUSTERS > 256)
    33 # error: NB_CLUSTERS cannot be larger than 256!
     33#if !defined(Y_SIZE)
     34# error: You must define X_SIZE in the hard_config.h file
     35#endif
     36
     37#if !defined(X_WIDTH)
     38# error: You must define X_WIDTH in the hard_config.h file
     39#endif
     40
     41#if !defined(Y_WIDTH)
     42# error: You must define X_WIDTH in the hard_config.h file
    3443#endif
    3544
    3645#if !defined(NB_PROCS_MAX)
    3746# error: You must define NB_PROCS_MAX in the hard_config.h file
    38 #endif
    39 
    40 #if (NB_PROCS_MAX > 8)
    41 # error: NB_PROCS_MAX cannot be larger than 8!
    4247#endif
    4348
     
    5358// Returns 0 if success, > 0 if error.
    5459////////////////////////////////////////////////////////////////////////////////
    55 unsigned int _icu_set_mask( unsigned int cluster_id,
     60unsigned int _icu_set_mask( unsigned int cluster_xy,
    5661                            unsigned int proc_id,
    5762                            unsigned int value )
    5863{
    5964    // parameters checking
    60     if (cluster_id >= NB_CLUSTERS) return 1;
    61     if (proc_id >= NB_PROCS_MAX)   return 1;
     65    unsigned int x = cluster_xy >> Y_WIDTH;
     66    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     67    if (x >= X_SIZE)             return 1;
     68    if (y >= Y_SIZE)             return 1;
     69    if (proc_id >= NB_PROCS_MAX) return 1;
    6270
    6371#if USE_XICU
    64     _puts("[GIET ERROR] _icu_set_mask should not be used if USE_XICU is set\n");
     72    _puts("[GIET ERROR] _icu_set_mask() should not be used if USE_XICU is set\n");
    6573    return 1;
    6674#else
    6775    unsigned int * icu_address = (unsigned int *) ((unsigned int)&seg_icu_base +
    68                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     76                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    6977    icu_address[proc_id * ICU_SPAN + ICU_MASK_SET] = value;
    7078    return 0;
     
    7886// Returns 0 if success, > 0 if error.
    7987////////////////////////////////////////////////////////////////////////////////
    80 unsigned int _icu_get_index( unsigned int cluster_id,
     88unsigned int _icu_get_index( unsigned int cluster_xy,
    8189                             unsigned int proc_id,
    8290                             unsigned int * buffer)
    8391{
    8492    // parameters checking
    85     if (cluster_id >= NB_CLUSTERS)  return 1;
    86     if (proc_id >= NB_PROCS_MAX)    return 1;
     93    unsigned int x = cluster_xy >> Y_WIDTH;
     94    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     95    if (x >= X_SIZE)             return 1;
     96    if (y >= Y_SIZE)             return 1;
     97    if (proc_id >= NB_PROCS_MAX) return 1;
    8798
    8899#if USE_XICU
    89     _puts("[GIET ERROR] _icu_get_index should not be used if USE_XICU is set\n");
     100    _puts("[GIET ERROR] _icu_get_index() should not be used if USE_XICU is set\n");
    90101    return 1;
    91102#else
    92103    unsigned int* icu_address = (unsigned int *) ((unsigned int)&seg_icu_base +
    93                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     104                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    94105    *buffer = icu_address[proc_id * ICU_SPAN + ICU_IT_VECTOR];
    95106    return 0;
  • soft/giet_vm/giet_drivers/icu_driver.h

    r258 r263  
    2929///////////////////////////////////////////////////////////////////////////////////
    3030
    31 extern unsigned int _icu_get_index( unsigned int cluster_id,
     31extern unsigned int _icu_get_index( unsigned int cluster_xy,
    3232                                    unsigned int proc_id,
    3333                                    unsigned int * buffer );
    3434
    35 extern unsigned int _icu_set_mask( unsigned int cluster_id,
     35extern unsigned int _icu_set_mask( unsigned int cluster_xy,
    3636                                   unsigned int proc_id,
    3737                                   unsigned int value );
  • soft/giet_vm/giet_drivers/ioc_driver.c

    r258 r263  
    285285_puts("\n");
    286286_puts(" - lba       = ");
    287 _putd( lba );
     287_putx( lba );
    288288_puts("\n");
    289289_tty_release_lock( 0 );
     
    379379_puts(" for processor ");
    380380_putd( _get_procid() );
     381_puts(" : error = ");
     382_putd( (unsigned int)error );
    381383_puts("\n");
    382384_tty_release_lock( 0 );
  • soft/giet_vm/giet_drivers/mmc_driver.c

    r258 r263  
    2121#include <giet_config.h>
    2222#include <mmc_driver.h>
     23#include <tty_driver.h>
    2324#include <utils.h>
    2425
    25 #if !defined(NB_CLUSTERS)
    26 # error: You must define NB_CLUSTERS in the hard_config.h file
     26#if !defined(X_SIZE)
     27# error: You must define X_SIZE in the hard_config.h file
    2728#endif
    2829
    29 #if (NB_CLUSTERS > 256)
    30 # error: NB_CLUSTERS cannot be larger than 256!
     30#if !defined(Y_SIZE)
     31# error: You must define X_SIZE in the hard_config.h file
     32#endif
     33
     34#if !defined(X_WIDTH)
     35# error: You must define X_WIDTH in the hard_config.h file
     36#endif
     37
     38#if !defined(Y_WIDTH)
     39# error: You must define X_WIDTH in the hard_config.h file
    3140#endif
    3241
     
    4049                  unsigned int buf_length )
    4150{
    42     unsigned int cluster_id    = (unsigned int)((buf_paddr>>32)/(256/NB_CLUSTERS));
     51    // compute cluster coordinates
     52    unsigned int cluster_xy = (unsigned int)(buf_paddr>>(40-X_WIDTH-Y_WIDTH));
     53    unsigned int x          = cluster_xy >> Y_WIDTH;
     54    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
     55
     56    // parameters checking
     57    if ( (x >= X_SIZE) || (y >= Y_SIZE) )
     58    {
     59        _puts("\n[GIET ERROR] in _memc_inval() : illegal cluster index[");
     60        _putd( x );
     61        _puts(",");
     62        _putd( y );
     63        _puts("]\n");
     64        _puts("   - paddr      = ");
     65        _putl( buf_paddr );
     66        _puts("\n   - cluster_xy = ");
     67        _putx( cluster_xy );
     68        _puts("\n");
     69        _exit();
     70    }
    4371
    4472    unsigned int* mmc_address = (unsigned int*)((unsigned int)&seg_mmc_base +
    45                                 (cluster_id * (unsigned int)&vseg_cluster_increment));
     73                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
    4674
    4775    // get the hard lock protecting exclusive access to MEMC
     
    6694                 unsigned int buf_length )
    6795{
    68     unsigned int cluster_id    = (unsigned int)((buf_paddr>>32)/(256/NB_CLUSTERS));
     96    // compute cluster coordinates
     97    unsigned int cluster_xy = (unsigned int)(buf_paddr>>(40-X_WIDTH-Y_WIDTH));
     98    unsigned int x          = cluster_xy >> Y_WIDTH;
     99    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
     100
     101    // parameters checking
     102    if ( (x >= X_SIZE) || (y >= Y_SIZE) )
     103    {
     104        _puts("\n[GIET ERROR] in _memc_sync() : illegal cluster index[");
     105        _putd( x );
     106        _puts(",");
     107        _putd( y );
     108        _puts("]\n");
     109        _puts("   - paddr      = ");
     110        _putl( buf_paddr );
     111        _puts("\n   - cluster_xy = ");
     112        _putx( cluster_xy );
     113        _puts("\n");
     114        _exit();
     115    }
    69116
    70117    unsigned int * mmc_address = (unsigned int *) ((unsigned int)&seg_mmc_base +
    71                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     118                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    72119
    73120    // get the hard lock protecting exclusive access to MEMC
  • soft/giet_vm/giet_drivers/mwr_driver.c

    r258 r263  
    1212// The (virtual) base address of the associated segment is:
    1313//
    14 //       seg_mwr_base + cluster_id * vseg_cluster_increment
     14//       seg_mwr_base + cluster_xy * vseg_cluster_increment
    1515//
    1616// The seg_mwr_base and vseg_cluster_increment values must be defined
     
    2222#include <utils.h>
    2323
    24 #if !defined(NB_CLUSTERS)
    25 # error: You must define NB_CLUSTERS in the hard_config.h file
     24#if !defined(X_SIZE)
     25# error: You must define X_SIZE in the hard_config.h file
    2626#endif
    2727
    28 #if (NB_CLUSTERS > 256)
    29 # error: NB_CLUSTERS cannot be larger than 256!
     28#if !defined(Y_SIZE)
     29# error: You must define X_SIZE in the hard_config.h file
     30#endif
     31
     32#if !defined(X_WIDTH)
     33# error: You must define X_WIDTH in the hard_config.h file
     34#endif
     35
     36#if !defined(Y_WIDTH)
     37# error: You must define X_WIDTH in the hard_config.h file
    3038#endif
    3139
    3240//////////////////////////////////////////////////////////////////////////////////
    33 //    _mwmr_hw_init()
     41//    _mwr_hw_init()
    3442// This function initializes one MWMR controller channel (i.e. one coprocessor
    3543// port) in a given cluster.
    36 // - cluster_id    : cluster index
     44// - cluster_xy    : cluster index
    3745// _ port_id       : port index
    3846// - way           : direction (to_coproc/from_coproc)
     
    4048// TODO : The MWMR controler should be modified to support 40 bits addresses...
    4149//        Introduce a MWMR_CONFIG_PADDR_EXT register in the MWMR coprocessor
    42 //        To support addresses > 32 bits and remove this limitation...
    4350//////////////////////////////////////////////////////////////////////////////////
    4451// Returns 0 if success, returns > 0 if error.
    4552//////////////////////////////////////////////////////////////////////////////////
    46 unsigned int _mwmr_hw_init( unsigned int           cluster_id,
    47                             unsigned int           port_id,
    48                             unsigned int           from_coproc,
    49                             paddr_t                channel_pbase )
     53unsigned int _mwr_hw_init( unsigned int           cluster_xy,
     54                           unsigned int           port_id,
     55                           unsigned int           from_coproc,
     56                           paddr_t                channel_pbase )
    5057{
    51     _puts(" [GIET_ERROR] _mwmr_hw_init() function not implemented yet\n");
     58    _puts(" [GIET_ERROR] _mwr_hw_init() function not supported yet\n");
    5259    _exit();
    5360
    5461/*
    5562    // parameters checking
    56     if (cluster_id >= NB_CLUSTERS)      return 1;
     63    unsigned int x = cluster_xy >> Y_WIDTH;
     64    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     65    if (x >= X_SIZE)                    return 1;
     66    if (y >= Y_SIZE)                    return 1;
    5767
    58     // compute MWMR base address
    59     unsigned int* mwmr_address = (unsigned int*) ((unsigned int)&seg_mwmr_base +
    60                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     68    // compute base address
     69    unsigned int* mwr_address = (unsigned int*) ((unsigned int)&seg_mwr_base +
     70                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    6171
    6272    unsigned int lsb = (unsigned int)channel_pbase;
     
    6878
    6979    // initializes and launches mwmr controler
    70     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_WAY]  = from_coproc;
    71     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_NO]   = port_id;
    72     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_WIDTH]     = width;
    73     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DEPTH]     = depth;
    74     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_STATUS]    = lsb;
    75     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DATA]      = lsb + 24;
    76     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_EXT]       = msb;
    77     mwmr_address[port_id * MWMR_SPAN + MWMR_CONFIG_RUNNING]   = 1;
     80    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_WAY]  = from_coproc;
     81    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_FIFO_NO]   = port_id;
     82    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_WIDTH]     = width;
     83    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DEPTH]     = depth;
     84    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_STATUS]    = lsb;
     85    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_DATA]      = lsb + 24;
     86    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_EXT]       = msb;
     87    mwr_address[port_id * MWMR_SPAN + MWMR_CONFIG_RUNNING]   = 1;
    7888*/
    7989    return 0;
  • soft/giet_vm/giet_drivers/mwr_driver.h

    r258 r263  
    1919    MWMR_CONFIG_FIFO_WAY,
    2020    MWMR_CONFIG_FIFO_NO,
    21     MWMR_CONFIG_STATUS_ADDR,
     21    MWMR_CONFIG_STATUS,
    2222    MWMR_CONFIG_DEPTH,
    2323    MWMR_CONFIG_BUFFER_ADDR,
    2424    MWMR_CONFIG_RUNNING,
    2525    MWMR_CONFIG_WIDTH,
    26     MWMR_FIFO_FILL_STATUS,
     26    MWMR_CONFIG_DATA,
     27    MWMR_CONFIG_EXT,
     28    /***/
     29    MWMR_SPAN,
    2730};
    2831
     
    3740///////////////////////////////////////////////////////////////////////////////////
    3841
    39 extern unsigned int _mwmr_hw_init( unsigned int           cluster_id,
    40                                    unsigned int           port_id,
    41                                    unsigned int           from_coproc,
    42                                    unsigned long long     channel_pbase);
     42extern unsigned int _mwr_hw_init( unsigned int           cluster_xy,
     43                                  unsigned int           port_id,
     44                                  unsigned int           from_coproc,
     45                                  unsigned long long     channel_pbase);
    4346
    4447///////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/giet_drivers/tim_driver.c

    r258 r263  
    1616// - "user" timers : requested by the task in the mapping_info data structure.
    1717//   For each user timer, the timer_id is stored in the context of the task.
    18 // The global index is cluster_id * (NB_PROCS_MAX + NB_TIM_CHANNELS) + local_id
     18// The global index is cluster_xy * (NB_PROCS_MAX + NB_TIM_CHANNELS) + local_id
    1919//
    2020// The NB_PROCS_MAX and NB_TIM_CHANNELS values must be defined in the
     
    2525// The virtual base address of the segment associated to a channel is:
    2626//
    27 //     seg_tim_base + cluster_id * vseg_cluster_increment + TIMER_SPAN * timer_id
     27//     seg_tim_base + cluster_xy * vseg_cluster_increment + TIMER_SPAN * timer_id
    2828//
    2929// The seg_tim_base and vseg_cluster_increment values must be defined
     
    3535#include <utils.h>
    3636
    37 #if !defined(NB_CLUSTERS)
    38 # error: You must define NB_CLUSTERS in the hard_config.h file
     37#if !defined(X_SIZE)
     38# error: You must define X_SIZE in the hard_config.h file
    3939#endif
    4040
    41 #if (NB_CLUSTERS > 256)
    42 # error: NB_CLUSTERS cannot be larger than 256!
     41#if !defined(Y_SIZE)
     42# error: You must define X_SIZE in the hard_config.h file
     43#endif
     44
     45#if !defined(X_WIDTH)
     46# error: You must define X_WIDTH in the hard_config.h file
     47#endif
     48
     49#if !defined(Y_WIDTH)
     50# error: You must define X_WIDTH in the hard_config.h file
    4351#endif
    4452
    4553#if !defined(NB_PROCS_MAX)
    4654# error: You must define NB_PROCS_MAX in the hard_config.h file
    47 #endif
    48 
    49 #if (NB_PROCS_MAX > 8)
    50 # error: NB_PROCS_MAX cannot be larger than 8!
    5155#endif
    5256
     
    5963#endif
    6064
    61 #if !defined( USE_XICU )
    62 # error: You must define USE_XICU in the hard_config.h file
    63 #endif
    64 
    6565///////////////////  Timer global variables ////////////////////////////////////////
    6666
     
    6868
    6969#if (NB_TIM_CHANNELS > 0)
    70 in_unckdata volatile unsigned char _user_timer_event[NB_CLUSTERS * NB_TIM_CHANNELS]
    71                             = { [0 ... ((NB_CLUSTERS * NB_TIM_CHANNELS) - 1)] = 0 };
     70in_unckdata volatile unsigned char _user_timer_event[X_SIZE*Y_SIZE*NB_TIM_CHANNELS]
     71                            = { [0 ... ((X_SIZE*Y_SIZE*NB_TIM_CHANNELS) - 1)] = 0 };
    7272#endif
    7373
     
    8080// Returns 0 if success, > 0 if error.
    8181//////////////////////////////////////////////////////////////////////////////
    82 unsigned int _timer_start( unsigned int cluster_id,
     82unsigned int _timer_start( unsigned int cluster_xy,
    8383                           unsigned int local_id,
    8484                           unsigned int period)
    8585{
    8686    // parameters checking
    87     if (cluster_id >= NB_CLUSTERS)    return 1;
     87    unsigned int x = cluster_xy >> Y_WIDTH;
     88    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     89    if (x >= X_SIZE)                  return 1;
     90    if (y >= Y_SIZE)                  return 1;
    8891    if (local_id >= NB_TIM_CHANNELS)  return 1;
    8992
    9093    unsigned int* timer_address = (unsigned int *) ((unsigned int)&seg_tim_base +
    91                                   (cluster_id * (unsigned int)&vseg_cluster_increment));
     94                                  (cluster_xy * (unsigned int)&vseg_cluster_increment));
    9295
    9396    timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = period;
     
    102105// Returns 0 if success, > 0 if error.
    103106//////////////////////////////////////////////////////////////////////////////
    104 unsigned int _timer_stop( unsigned int cluster_id,
     107unsigned int _timer_stop( unsigned int cluster_xy,
    105108                          unsigned int local_id)
    106109{
    107110    // parameters checking
    108     if (cluster_id >= NB_CLUSTERS)    return 1;
     111    unsigned int x = cluster_xy >> Y_WIDTH;
     112    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     113    if (x >= X_SIZE)                  return 1;
     114    if (y >= Y_SIZE)                  return 1;
    109115    if (local_id >= NB_TIM_CHANNELS)  return 1;
    110116
    111117    unsigned int* timer_address = (unsigned int *) ((unsigned int)&seg_tim_base +
    112                                   (cluster_id * (unsigned int)&vseg_cluster_increment));
     118                                  (cluster_xy * (unsigned int)&vseg_cluster_increment));
    113119
    114120    timer_address[local_id * TIMER_SPAN + TIMER_MODE] = 0;
     
    124130// Returns 0 if success, > 0 if error.
    125131//////////////////////////////////////////////////////////////////////////////
    126 unsigned int _timer_reset_irq( unsigned int cluster_id,
     132unsigned int _timer_reset_irq( unsigned int cluster_xy,
    127133                               unsigned int local_id )
    128134{
    129135    // parameters checking
    130     if (cluster_id >= NB_CLUSTERS)    return 1;
     136    unsigned int x = cluster_xy >> Y_WIDTH;
     137    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     138    if (x >= X_SIZE)                  return 1;
     139    if (y >= Y_SIZE)                  return 1;
    131140    if (local_id >= NB_TIM_CHANNELS)  return 1;
    132141
    133142    unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_tim_base +
    134                                    (cluster_id * (unsigned int)&vseg_cluster_increment));
     143                                   (cluster_xy * (unsigned int)&vseg_cluster_increment));
    135144
    136145    timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 0;
     
    147156// This function is called during a context switch (user or preemptive)
    148157//////////////////////////////////////////////////////////////////////i//////
    149 unsigned int _timer_reset_cpt( unsigned int cluster_id,
     158unsigned int _timer_reset_cpt( unsigned int cluster_xy,
    150159                               unsigned int local_id)
    151160{
    152161    // parameters checking
    153     if (cluster_id >= NB_CLUSTERS)    return 1;
     162    unsigned int x = cluster_xy >> Y_WIDTH;
     163    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     164    if (x >= X_SIZE)                  return 1;
     165    if (y >= Y_SIZE)                  return 1;
    154166    if (local_id >= NB_TIM_CHANNELS)  return 1;
    155167
    156168    // We suppose that the TIMER_MODE register value is 0x3
    157169    unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_tim_base +
    158                                    (cluster_id * (unsigned int)&vseg_cluster_increment));
     170                                   (cluster_xy * (unsigned int)&vseg_cluster_increment));
    159171
    160172    unsigned int period = timer_address[local_id * TIMER_SPAN + TIMER_PERIOD];
  • soft/giet_vm/giet_drivers/tim_driver.h

    r258 r263  
    2929extern volatile unsigned char _timer_event[];
    3030
    31 extern unsigned int _timer_start( unsigned int cluster_id,
     31extern unsigned int _timer_start( unsigned int cluster_xy,
    3232                                  unsigned int local_id,
    3333                                  unsigned int period );
    3434
    35 extern unsigned int _timer_stop( unsigned int cluster_id,
     35extern unsigned int _timer_stop( unsigned int cluster_xy,
    3636                                 unsigned int local_id );
    3737
    38 extern unsigned int _timer_reset_irq( unsigned int cluster_id,
     38extern unsigned int _timer_reset_irq( unsigned int cluster_xy,
    3939                                      unsigned int local_id );
    4040
    41 extern unsigned int _timer_reset_cpt( unsigned int cluster_id,
     41extern unsigned int _timer_reset_cpt( unsigned int cluster_xy,
    4242                                      unsigned int local_id);
    4343
  • soft/giet_vm/giet_drivers/xcu_driver.c

    r258 r263  
    1616// The virtual base address of the segment associated to the component is:
    1717//
    18 //      seg_xcu_base + cluster_id * vseg_cluster_increment
     18//      seg_xcu_base + cluster_xy * vseg_cluster_increment
    1919//
    2020// The seg_xcu_base and vseg_cluster_increment values must be defined
     
    2424#include <giet_config.h>
    2525#include <xcu_driver.h>
     26#include <tty_driver.h>
     27#include <mapping_info.h>
    2628#include <utils.h>
    2729
    28 #if !defined(NB_CLUSTERS)
    29 # error: You must define NB_CLUSTERS in the hard_config.h file
    30 #endif
    31 
    32 #if (NB_CLUSTERS > 256)
    33 # error: NB_CLUSTERS cannot be larger than 256!
     30#if !defined(X_SIZE)
     31# error: You must define X_SIZE in the hard_config.h file
     32#endif
     33
     34#if !defined(Y_SIZE)
     35# error: You must define X_SIZE in the hard_config.h file
     36#endif
     37
     38#if !defined(X_WIDTH)
     39# error: You must define X_WIDTH in the hard_config.h file
     40#endif
     41
     42#if !defined(Y_WIDTH)
     43# error: You must define X_WIDTH in the hard_config.h file
    3444#endif
    3545
    3646#if !defined(NB_PROCS_MAX)
    3747# error: You must define NB_PROCS_MAX in the hard_config.h file
    38 #endif
    39 
    40 #if (NB_PROCS_MAX > 8)
    41 # error: NB_PROCS_MAX cannot be larger than 8!
    4248#endif
    4349
     
    5359// Returns 0 if success, > 0 if error.
    5460////////////////////////////////////////////////////////////////////////////////
    55 unsigned int _xcu_set_mask( unsigned int cluster_id, unsigned int proc_id,
     61unsigned int _xcu_set_mask( unsigned int cluster_xy,
     62                            unsigned int proc_id,
    5663                            unsigned int value,
    57                             unsigned int is_PTI)
    58 {
    59     // parameters checking
    60     if (cluster_id >= NB_CLUSTERS) return 1;
    61     if (proc_id >= NB_PROCS_MAX)   return 1;
     64                            unsigned int irq_type )
     65{
     66    // parameters checking
     67    unsigned int x = cluster_xy >> Y_WIDTH;
     68    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;
    6272
    6373#if USE_XICU
    6474    unsigned int* xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    65                                 (cluster_id * (unsigned int)&vseg_cluster_increment));
    66     if (is_PTI)
    67         xcu_address[XICU_REG(XICU_MSK_PTI_ENABLE, proc_id)] = value;
    68     else
    69         xcu_address[XICU_REG(XICU_MSK_HWI_ENABLE, proc_id)] = value;
     75                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
     76    unsigned int func;
     77    if      (irq_type == IRQ_TYPE_PTI) func = XICU_MSK_PTI_ENABLE;
     78    else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE;
     79    else                               func = XICU_MSK_HWI_ENABLE;
     80    xcu_address[XICU_REG(func,proc_id)] = value;
    7081    return 0;
    7182#else
     
    8697// Returns 0 if success, > 0 if error.
    8798////////////////////////////////////////////////////////////////////////////////
    88 unsigned int _xcu_get_index( unsigned int cluster_id,
     99unsigned int _xcu_get_index( unsigned int cluster_xy,
    89100                             unsigned int proc_id,
    90101                             unsigned int * buffer)
    91102{
    92103    // parameters checking
    93     if (cluster_id >= NB_CLUSTERS)  return 1;
    94     if (proc_id >= NB_PROCS_MAX)    return 1;
     104    unsigned int x = cluster_xy >> Y_WIDTH;
     105    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     106    if (x >= X_SIZE)             return 1;
     107    if (y >= Y_SIZE)             return 1;
     108    if (proc_id >= NB_PROCS_MAX) return 1;
    95109
    96110#if USE_XICU
    97111    unsigned int* xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    98                                 (cluster_id * (unsigned int)&vseg_cluster_increment));
     112                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
    99113
    100114    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];
     
    125139// Returns 0 if success, > 0 if error.
    126140////////////////////////////////////////////////////////////////////////////////
    127 unsigned int _xcu_send_ipi( unsigned int cluster_id,
     141unsigned int _xcu_send_ipi( unsigned int cluster_xy,
    128142                            unsigned int proc_id,
    129143                            unsigned int wdata )
    130144{
    131145    // parameters checking
    132     if (cluster_id >= NB_CLUSTERS)  return 1;
    133     if (proc_id >= NB_PROCS_MAX)    return 1;
     146    unsigned int x = cluster_xy >> Y_WIDTH;
     147    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     148    if (x >= X_SIZE)             return 1;
     149    if (y >= Y_SIZE)             return 1;
     150    if (proc_id >= NB_PROCS_MAX) return 1;
    134151
    135152#if USE_XICU
    136153    unsigned int* xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    137                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
     154                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    138155    xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;
    139156    return 0;
     
    152169// Returns 0 if success, > 0 if error.
    153170////////////////////////////////////////////////////////////////////////////////
    154 unsigned int _xcu_timer_start( unsigned int cluster_id,
    155                                unsigned int local_id,
     171unsigned int _xcu_timer_start( unsigned int cluster_xy,
     172                               unsigned int proc_id,
    156173                               unsigned int period )
    157174{
    158175    // parameters checking
    159     if (cluster_id >= NB_CLUSTERS)    return 1;
    160     if (local_id >= NB_TIM_CHANNELS)  return 1;
     176    unsigned int x = cluster_xy >> Y_WIDTH;
     177    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     178    if (x >= X_SIZE)             return 1;
     179    if (y >= Y_SIZE)             return 1;
     180    if (proc_id >= NB_PROCS_MAX) return 1;
    161181
    162182#if USE_XICU
    163183    unsigned int* xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    164                                 (cluster_id * (unsigned int)&vseg_cluster_increment));
    165     xcu_address[XICU_REG(XICU_PTI_PER, local_id)] = period;
     184                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
     185    xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = period;
    166186    return 0;
    167187#else
     
    179199// Returns 0 if success, > 0 if error.
    180200//////////////////////////////////////////////////////////////////////////////
    181 unsigned int _xcu_timer_stop( unsigned int cluster_id,
    182                               unsigned int local_id)
    183 {
    184     // parameters checking
    185     if (cluster_id >= NB_CLUSTERS)    return 1;
    186     if (local_id >= NB_TIM_CHANNELS)  return 1;
     201unsigned int _xcu_timer_stop( unsigned int cluster_xy,
     202                              unsigned int proc_id)
     203{
     204    // parameters checking
     205    unsigned int x = cluster_xy >> Y_WIDTH;
     206    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     207    if (x >= X_SIZE)             return 1;
     208    if (y >= Y_SIZE)             return 1;
     209    if (proc_id >= NB_PROCS_MAX) return 1;
    187210
    188211#if USE_XICU
    189212    unsigned int * xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    190                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
    191     xcu_address[XICU_REG(XICU_PTI_PER, local_id)] = 0;
     213                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
     214    xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = 0;
    192215    return 0;
    193216#else
     
    207230// Returns 0 if success, > 0 if error.
    208231//////////////////////////////////////////////////////////////////////////////
    209 unsigned int _xcu_timer_reset_irq( unsigned int cluster_id,
    210                                    unsigned int local_id )
    211 {
    212     // parameters checking
    213     if (cluster_id >= NB_CLUSTERS)    return 1;
    214     if (local_id >= NB_TIM_CHANNELS)  return 1;
     232unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
     233                                   unsigned int proc_id )
     234{
     235    // parameters checking
     236    unsigned int x = cluster_xy >> Y_WIDTH;
     237    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     238    if (x >= X_SIZE)             return 1;
     239    if (y >= Y_SIZE)             return 1;
     240    if (proc_id >= NB_PROCS_MAX) return 1;
    215241
    216242#if USE_XICU
    217243    unsigned int * xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    218                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
    219 
    220     unsigned int bloup = xcu_address[XICU_REG(XICU_PTI_ACK, local_id)];
     244                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
     245
     246    unsigned int bloup = xcu_address[XICU_REG(XICU_PTI_ACK, proc_id)];
    221247    bloup++; // to avoid a warning
    222248    return 0;
     
    238264// This function is called during a context switch (user or preemptive)
    239265/////////////////////////////////////////////////////////////////////////////
    240 unsigned int _xcu_timer_reset_cpt( unsigned int cluster_id,
    241                                    unsigned int local_id )
    242 {
    243     // parameters checking
    244     if (cluster_id >= NB_CLUSTERS)   return 1;
    245     if (local_id >= NB_TIM_CHANNELS) return 1;
     266unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy,
     267                                   unsigned int proc_id )
     268{
     269    // parameters checking
     270    unsigned int x = cluster_xy >> Y_WIDTH;
     271    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     272    if (x >= X_SIZE)             return 1;
     273    if (y >= Y_SIZE)             return 1;
     274    if (proc_id >= NB_PROCS_MAX) return 1;
    246275
    247276#if USE_XICU
    248277    unsigned int * xcu_address = (unsigned int *) ((unsigned int) &seg_xcu_base +
    249                                  (cluster_id * (unsigned int)&vseg_cluster_increment));
    250 
    251     unsigned int period = xcu_address[XICU_REG(XICU_PTI_PER, local_id)];
     278                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
     279
     280    unsigned int period = xcu_address[XICU_REG(XICU_PTI_PER, proc_id)];
    252281
    253282    // we write 0 first because if the timer is currently running,
    254283    // the corresponding timer counter is not reset
    255     xcu_address[XICU_REG(XICU_PTI_PER, local_id)] = 0;
    256     xcu_address[XICU_REG(XICU_PTI_PER, local_id)] = period;
     284    xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = 0;
     285    xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = period;
    257286    return 0;
    258287#else
  • soft/giet_vm/giet_drivers/xcu_driver.h

    r258 r263  
    3939
    4040#define XICU_REG(func, index) (((func)<<5)|(index))
    41 
     41 
    4242///////////////////////////////////////////////////////////////////////////////////
    4343// XICU access functions
    4444///////////////////////////////////////////////////////////////////////////////////
    4545
    46 extern unsigned int _xcu_get_index( unsigned int cluster_id,
     46extern unsigned int _xcu_get_index( unsigned int cluster_xy,
    4747                                    unsigned int proc_id,
    4848                                    unsigned int * buffer );
    4949
    50 extern unsigned int _xcu_set_mask( unsigned int cluster_id,
     50extern unsigned int _xcu_set_mask( unsigned int cluster_xy,
    5151                                   unsigned int proc_id,
    5252                                   unsigned int mask,
    5353                                   unsigned int is_timer );
    5454
    55 extern unsigned int _xcu_send_ipi( unsigned int cluster_id,
     55extern unsigned int _xcu_send_ipi( unsigned int cluster_xy,
    5656                                   unsigned int proc_id,
    5757                                   unsigned int wdata );
    5858
    59 extern unsigned int _xcu_timer_start( unsigned int cluster_id,
    60                                       unsigned int local_id,
     59extern unsigned int _xcu_timer_start( unsigned int cluster_xy,
     60                                      unsigned int proc_id,
    6161                                      unsigned int period );
    6262
    63 extern unsigned int _xcu_timer_stop( unsigned int cluster_id,
    64                                      unsigned int local_id );
     63extern unsigned int _xcu_timer_stop( unsigned int cluster_xy,
     64                                     unsigned int proc_id );
    6565
    66 extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_id,
    67                                           unsigned int local_id );
     66extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
     67                                          unsigned int proc_id );
    6868
    69 extern unsigned int _xcu_timer_reset_cpt( unsigned int cluster_id,
    70                                           unsigned int local_id );
     69extern unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy,
     70                                          unsigned int proc_id );
    7171
    7272///////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/giet_fat32/fat32.c

    r260 r263  
    497497    fat.cache_lba = lba;
    498498
    499 //  #if GIET_DEBUG_FAT
    500 //  display_fat_cache();
    501 //  #endif
     499    #if GIET_DEBUG_FAT
     500    display_fat_cache();
     501    #endif
    502502
    503503    // in this loop we scan all names in directory identified by cluster:
     
    714714    if ( _ioc_read( mode,             // mode for IOC driver
    715715                    0,                // sector index
    716                     fat.fat_cache,   // buffer address
     716                    fat.fat_cache,    // buffer address
    717717                    1 ) )             // one sector
    718718    {
     
    760760#if GIET_DEBUG_FAT
    761761_tty_get_lock( 0 );
    762 _puts("\n[FAT DEBUG] First Partition Sector Loaded\n");
     762_puts("\n[FAT DEBUG] Partition First Sector Loaded\n");
    763763_tty_release_lock( 0 );
    764764#endif
     
    839839///////////////////////////////////////////////////////////////////////////////
    840840// This function checks that the kernel FAT structure has been initialised,
    841 // and makes the FAT initialisation if required (first user _fat_open request).
     841// and makes the FAT initialisation if it is the first user open request.
    842842// This function searches a file identified by the "pathname" argument.
    843843// It starts from root (cluster 2) to scan successively each subdirectory.
     
    871871    if( fat.initialised != FAT_INITIALISED )
    872872    {
    873         _fat_init( IOC_KERNEL_MODE );  // we use KERNEL_MODE, because
    874                                        // we need to write into FAT cache
     873        _fat_init( IOC_BOOT_VA_MODE );
    875874    }
    876875 
    877     // Scan the sub-directories, starting from the root directory (cluster 2)
     876    // Scan the directories, starting from the root directory (cluster 2)
    878877    // - The get_name_from_path() function extracts (successively)
    879878    //   each directory name from the pathname, and store it in name[] buffer
  • soft/giet_vm/giet_kernel/irq_handler.c

    r258 r263  
    2929
    3030#if NB_TIM_CHANNELS
    31 extern volatile unsigned char _user_timer_event[NB_CLUSTERS * NB_TIM_CHANNELS] ;
     31extern volatile unsigned char _user_timer_event[X_SIZE*Y_SIZE*NB_TIM_CHANNELS] ;
    3232#endif
    3333
  • soft/giet_vm/giet_kernel/kernel_init.c

    r258 r263  
    1111// physicals addresses can have up to 40 bits, and use the  (unsigned long long) type.
    1212// It natively supports clusterised shared mmemory multi-processors architectures,
    13 // where each processor is identified by a composite index (cluster_id, local_id),
     13// where each processor is identified by a composite index (cluster_xy, local_id),
    1414// and where there is one physical memory bank per cluster.
    1515//
     
    6161
    6262__attribute__((section (".kdata")))
    63 static_scheduler_t* _schedulers[NB_CLUSTERS * NB_PROCS_MAX];   // virtual addresses
     63static_scheduler_t* _schedulers[X_SIZE*Y_SIZE * NB_PROCS_MAX];   // virtual addresses
    6464
    6565////////////////////////////////////////////////////////////////////////////////////
     
    6868
    6969__attribute__((section (".kdata")))
    70 unsigned int _idle_stack[NB_CLUSTERS * NB_PROCS_MAX * 128];
     70unsigned int _idle_stack[X_SIZE*Y_SIZE * NB_PROCS_MAX * 128];
    7171
    7272////////////////////////////////////////////////////////////////////////////////////
     
    108108{
    109109    unsigned int global_pid = _get_procid();
     110    unsigned int cluster_xy = global_pid / NB_PROCS_MAX;
     111    unsigned int local_pid  = global_pid % NB_PROCS_MAX;
    110112
    111113#if 0
    112 // Debug feature : we can kill all processors but one
    113 if ( global_pid != 1 )
     114////////////// Debug : we can kill all processors but one
     115if ( global_pid != 0 )
    114116{
    115117    _tty_get_lock( 0 );
    116     _puts("\n[GIET] Processor ");
    117     _putd( global_pid );
    118     _puts(" suicide...\n");
     118    _puts("\n[GIET] Processor[");
     119    _putd( cluster_xy >> Y_WIDTH );
     120    _puts(",");
     121    _putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     122    _puts(",");
     123    _putd( local_pid );
     124    _puts("] suicide...\n");
    119125    _tty_release_lock( 0 );
    120126    _exit();
     
    125131    //          and contribute to initialise the _schedulers[] array
    126132
    127     unsigned int        cluster_id = global_pid / NB_PROCS_MAX;
    128     unsigned int        proc_id    = global_pid % NB_PROCS_MAX;
    129133    static_scheduler_t* psched     = (static_scheduler_t*)_get_sched();
    130134    unsigned int        tasks      = psched->tasks;
     
    134138#if GIET_DEBUG_INIT
    135139_tty_get_lock( 0 );
    136 _puts("\n[GIET DEBUG] Parallel init : step 1 for processor ");
    137 _putd(global_pid);
    138 _puts("\n - scheduler vbase = ");
     140_puts("\n[GIET DEBUG] Parallel init : step 1 for processor[");
     141_putd( cluster_xy >> Y_WIDTH );
     142_puts(",");
     143_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     144_puts(",");
     145_putd( local_pid );
     146_puts("]\n - scheduler vbase = ");
    139147_putx((unsigned int) psched);
    140148_puts("\n - tasks           = ");
     
    173181#if GIET_DEBUG_INIT
    174182_tty_get_lock( 0 );
    175 _puts("\n[GIET DEBUG] Parallel init : step 2 for processor ");
    176 _putd( global_pid );
    177 _puts(" / task ");
     183_puts("\n[GIET DEBUG] Parallel init : step 2 for processor[");
     184_putd( cluster_xy >> Y_WIDTH );
     185_puts(",");
     186_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     187_puts(",");
     188_putd( local_pid );
     189_puts("] / task ");
    178190_putd( ltid );
    179191_puts("\n - ctx_vsid  = ");
     
    202214    //          there is at most 32 interrupts per processor
    203215
    204     unsigned int isr_switch_channel = 0xFFFFFFFF;
     216    unsigned int isr_switch_index = 0xFFFFFFFF;
    205217    unsigned int irq_id;            // IN_IRQ index
    206218    unsigned int hwi_mask = 0;
     
    228240            _exit();
    229241        }
    230         if (isr == ISR_SWITCH) isr_switch_channel = irq_id;
     242        if (isr == ISR_SWITCH) isr_switch_index = irq_id;
    231243    }
    232244
    233245#if GIET_DEBUG_INIT
    234246_tty_get_lock( 0 );
    235 _puts("\n[GIET DEBUG] Parallel init : step 3 for processor ");
    236 _putd(global_pid);
    237 _puts("\n - ICU HWI_MASK = ");
     247_puts("\n[GIET DEBUG] Parallel init : step 3 for processor[");
     248_putd( cluster_xy >> Y_WIDTH );
     249_puts(",");
     250_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     251_puts(",");
     252_putd( local_pid );
     253_puts("]\n - ICU HWI_MASK = ");
    238254_putx(hwi_mask);
    239255_puts("\n - ICU SWI_MASK = ");
     
    253269
    254270#if USE_XICU
    255     _xcu_set_mask(cluster_id, proc_id, hwi_mask, IRQ_TYPE_HWI); // set HWI_MASK
    256     _xcu_set_mask(cluster_id, proc_id, swi_mask, IRQ_TYPE_SWI); // set SWI_MASK
    257     _xcu_set_mask(cluster_id, proc_id, pti_mask, IRQ_TYPE_PTI); // set PTI_MASK
     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
    258274#else
    259     _icu_set_mask(cluster_id, proc_id, (hwi_mask | pti_mask | swi_mask) );   
     275    _icu_set_mask(cluster_xy, local_pid, (hwi_mask | pti_mask | swi_mask) );   
    260276#endif
    261277
     
    264280    {
    265281        // one ISR_SWITCH must be defined for each proc
    266         if (isr_switch_channel == 0xFFFFFFFF)
     282        if (isr_switch_index == 0xFFFFFFFF)
    267283        {
    268284            _tty_get_lock( 0 );
    269             _puts("\n[GIET ERROR] ISR_SWITCH not found on proc ");
    270             _putd(proc_id);
     285            _puts("\n[GIET ERROR] ISR_SWITCH not found for processor ");
     286            _putx(global_pid);
    271287            _puts("\n");
    272288            _tty_release_lock( 0 );
     
    277293        unsigned int ko;
    278294#if USE_XICU
    279         ko = _xcu_timer_start( cluster_id, isr_switch_channel, GIET_TICK_VALUE );
     295        ko = _xcu_timer_start( cluster_xy, local_pid, GIET_TICK_VALUE );
    280296#else
    281         ko = _timer_start( cluster_id, isr_switch_channel, GIET_TICK_VALUE );
     297        ko = _timer_start( cluster_xy, local_pid, GIET_TICK_VALUE );
    282298#endif
    283299        if ( ko )
    284300        {
    285301            _tty_get_lock( 0 );
    286             _puts("\n[GIET ERROR] ISR_SWITCH start error for processor ");
    287             _putd(proc_id);
     302            _puts("\n[GIET ERROR] cannot start timer for processor ");
     303            _putd(local_pid);
    288304            _puts("\n");
    289305            _tty_release_lock( 0 );
     
    294310#if GIET_DEBUG_INIT
    295311_tty_get_lock( 0 );
    296 _puts("\n[GIET DEBUG] Parallel init : step 4 for processor ");
    297 _putd(global_pid);
     312_puts("\n[GIET DEBUG] Parallel init : step 4 for processor[");
     313_putd( cluster_xy >> Y_WIDTH );
     314_puts(",");
     315_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     316_puts(",");
     317_putd( local_pid );
     318_puts("]");
    298319if ( tasks > 1 ) _puts("\n  context switch activated\n");
    299320else             _puts("\n  context switch  not activated\n");
     
    315336#if GIET_DEBUG_INIT
    316337_tty_get_lock( 0 );
    317 _puts("\n[GIET DEBUG] Parallel init : step 5 for processor ");
    318 _putd(global_pid);
    319 _puts("\n  idle task context set\n");
     338_puts("\n[GIET DEBUG] Parallel init : step 5 for processor[");
     339_putd( cluster_xy >> Y_WIDTH );
     340_puts(",");
     341_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     342_puts(",");
     343_putd( local_pid );
     344_puts("] : idle task context set\n");
    320345_tty_release_lock( 0 );
    321346#endif
     
    333358        _tty_get_lock( 0 );
    334359        _puts("\n[GIET WARNING] No task allocated to processor ");
    335         _putd(global_pid);
     360        _putx(global_pid);
    336361        _puts(" => idle\n");
    337362        _tty_release_lock ( 0 );
     
    345370#if GIET_DEBUG_INIT
    346371_tty_get_lock( 0 );
    347 _puts("\n[GIET DEBUG] Parallel init : step 6 for processor ");
    348 _putd(global_pid);
    349 _puts("\n - sp   = ");
     372_puts("\n[GIET DEBUG] Parallel init : step 6 for processor[");
     373_putd( cluster_xy >> Y_WIDTH );
     374_puts(",");
     375_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     376_puts(",");
     377_putd( local_pid );
     378_puts("]\n - sp   = ");
    350379_putx(sp_value);
    351380_puts("\n - sr   = ");
     
    360389
    361390_tty_get_lock( 0 );
    362 _puts("\n[GIET] Processor ");
    363 _putd( global_pid );
    364 _puts(" completes kernel init at cycle ");
     391_puts("\n[GIET] Processor[");
     392_putd( cluster_xy >> Y_WIDTH );
     393_puts(",");
     394_putd( cluster_xy & ((1<<Y_WIDTH)-1) );
     395_puts(",");
     396_putd( local_pid );
     397_puts("] completes kernel init at cycle ");
    365398_putd( _get_proctime() );
    366399_puts(" / task_entry_point = ");
  • soft/giet_vm/giet_kernel/switch.s

    r258 r263  
    22* This function receives two arguments that are the current task context
    33* (virtual) addresses and the next task context (virtual) address.
     4*
     5* TODO (AG) Il semble possible de limiter le nombre de registres à sauver:
     6* - s0 à s8 ($16 à $23 + $30)
     7* - sp ($29)
     8* - ra ($31)
     9* - hi et lo
     10* - sr
     11* - epc
     12* - ptpr
    413******************************************************************************/
    514
  • soft/giet_vm/giet_kernel/sys_handler.c

    r260 r263  
    153153    mapping_cluster_t * cluster = _get_cluster_base(header);
    154154
    155     if (cluster_id < header->clusters) {
     155    if ( cluster_id < X_SIZE * Y_SIZE )
     156    {
    156157        *buffer = cluster[cluster_id].procs;
    157158        return 0;
    158159    }
    159     else {
     160    else
     161    {
    160162        return 1;
    161163    }
  • soft/giet_vm/giet_xml/mapping_info.h

    r258 r263  
    132132{
    133133    unsigned int signature;          // must contain MAPPING_SIGNATURE
    134     unsigned int clusters;           // number of clusters
    135     unsigned int cluster_x;          // number of cluster in a row
    136     unsigned int cluster_y;          // number of cluster in a column
     134    unsigned int x_size;             // actual number of clusters in a row
     135    unsigned int y_size;             // actual number of clusters in a column
     136    unsigned int x_width;            // number of bits to encode x coordinate
     137    unsigned int y_width;            // number of bits to encode y coordinate
    137138    unsigned int globals;            // number of vsegs mapped in all vspaces
    138139    unsigned int vspaces;            // number of virtual spaces
     
    183184typedef struct __attribute__((packed))  mapping_cluster_s
    184185{
     186    unsigned int    x;               // x coordinate
     187    unsigned int    y;               // y coordinate
     188
    185189    unsigned int    psegs;           // number of psegs in cluster
    186190    unsigned int    pseg_offset;     // index of first pseg in pseg set
     
    237241    paddr_t         length;          // size (bytes)
    238242    unsigned int    type;            // RAM / PERI
    239     unsigned int    cluster;         // index of cluster containing pseg
     243    unsigned int    clusterid;       // linear index in array of clusters
    240244    unsigned int    next_vseg;       // linked list of vsegs mapped on pseg
    241245} mapping_pseg_t;
     
    246250{
    247251    char            name[32];        // task name (unique in vspace)
    248     unsigned int    clusterid;       // physical cluster index
     252    unsigned int    clusterid;       // linear index in array of clusters
    249253    unsigned int    proclocid;       // processor local index (inside cluster)
    250254    unsigned int    stack_vobjid;    // stack vobj index in vspace
  • soft/giet_vm/giet_xml/xml_driver.c

    r258 r263  
    133133    pseg = (mapping_pseg_t *) ((char *) header +
    134134            MAPPING_HEADER_SIZE +
    135             MAPPING_CLUSTER_SIZE * header->clusters);
     135            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size);
    136136
    137137    // computes the base adresss for vspaces array,
    138138    vspace = (mapping_vspace_t *) ((char *) header +
    139139            MAPPING_HEADER_SIZE +
    140             MAPPING_CLUSTER_SIZE * header->clusters +
     140            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    141141            MAPPING_PSEG_SIZE * header->psegs);
    142142
     
    144144    vseg = (mapping_vseg_t *) ((char *) header +
    145145            MAPPING_HEADER_SIZE +
    146             MAPPING_CLUSTER_SIZE * header->clusters +
     146            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    147147            MAPPING_PSEG_SIZE * header->psegs +
    148148            MAPPING_VSPACE_SIZE * header->vspaces);
     
    151151    vobj = (mapping_vobj_t *) ((char *) header +
    152152            MAPPING_HEADER_SIZE +
    153             MAPPING_CLUSTER_SIZE * header->clusters +
     153            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    154154            MAPPING_PSEG_SIZE * header->psegs +
    155155            MAPPING_VSPACE_SIZE * header->vspaces +
     
    159159    task = (mapping_task_t *) ((char *) header +
    160160            MAPPING_HEADER_SIZE +
    161             MAPPING_CLUSTER_SIZE * header->clusters +
     161            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    162162            MAPPING_PSEG_SIZE * header->psegs +
    163163            MAPPING_VSPACE_SIZE * header->vspaces +
     
    168168    proc = (mapping_proc_t *) ((char *) header +
    169169            MAPPING_HEADER_SIZE +
    170             MAPPING_CLUSTER_SIZE * header->clusters +
     170            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    171171            MAPPING_PSEG_SIZE * header->psegs +
    172172            MAPPING_VSPACE_SIZE * header->vspaces +
     
    178178    irq = (mapping_irq_t *) ((char *) header +
    179179            MAPPING_HEADER_SIZE +
    180             MAPPING_CLUSTER_SIZE * header->clusters +
     180            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    181181            MAPPING_PSEG_SIZE * header->psegs +
    182182            MAPPING_VSPACE_SIZE * header->vspaces +
     
    189189    coproc = (mapping_coproc_t *) ((char *) header +
    190190            MAPPING_HEADER_SIZE +
    191             MAPPING_CLUSTER_SIZE * header->clusters +
     191            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    192192            MAPPING_PSEG_SIZE * header->psegs +
    193193            MAPPING_VSPACE_SIZE * header->vspaces +
     
    201201    cp_port = (mapping_cp_port_t *) ((char *) header +
    202202            MAPPING_HEADER_SIZE +
    203             MAPPING_CLUSTER_SIZE * header->clusters +
     203            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    204204            MAPPING_PSEG_SIZE * header->psegs +
    205205            MAPPING_VSPACE_SIZE * header->vspaces +
     
    214214    periph = (mapping_periph_t *) ((char *) header +
    215215            MAPPING_HEADER_SIZE +
    216             MAPPING_CLUSTER_SIZE * header->clusters +
     216            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    217217            MAPPING_PSEG_SIZE * header->psegs +
    218218            MAPPING_VSPACE_SIZE * header->vspaces +
     
    229229    fprintf(fpout, "<?xml version = \"1.0\"?>\n\n");
    230230
    231     fprintf(fpout, "<mapping_info signature = \"0x%x\" ", header->signature);
    232     fprintf(fpout, " name = \"%s\" ", header->name);
    233     fprintf(fpout, " cluster_x = \"%d\" ", header->cluster_x);
    234     fprintf(fpout, " cluster_y = \"%d\" ", header->cluster_y);
    235     fprintf(fpout, " vspaces = \"%d\" >\n\n", header->vspaces);
     231    fprintf(fpout, "<mapping_info signature = \"0x%x\" \n", header->signature);
     232    fprintf(fpout, "              name      = \"%s\"   \n", header->name);
     233    fprintf(fpout, "              x_size    = \"%d\"   \n", header->x_size);
     234    fprintf(fpout, "              y_size    = \"%d\"   \n", header->y_size);
     235    fprintf(fpout, "              x_width   = \"%d\"   \n", header->x_width);
     236    fprintf(fpout, "              y_width   = \"%d\"   \n", header->y_width);
     237    fprintf(fpout, "              vspaces   = \"%d\"   \n", header->vspaces);
     238    fprintf(fpout, "              increment = \"%d\" >\n\n", header->vspaces);
    236239
    237240    ///////////////////// clusters ///////////////////////////////////////////////
    238241
    239242    fprintf( fpout, "    <clusterset>\n");
    240     for (cluster_id = 0; cluster_id < header->clusters; cluster_id++)
    241     {
    242         fprintf(fpout, "        <cluster index  = \"%d\" >\n", cluster_id);
     243    for (cluster_id = 0; cluster_id < (header->x_size * header->y_size); cluster_id++)
     244    {
     245        fprintf(fpout, "        <cluster x = \"%d\" y = \"%d\" >\n",
     246                cluster[cluster_id].x, cluster[cluster_id].y );
     247
     248        ///////////////////// psegs   ////////////////////////////////////////////////
     249
    243250        for (pseg_id = cluster[cluster_id].pseg_offset;
    244251             pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs;
     
    246253        {
    247254            fprintf(fpout, "            <pseg name = \"%s\" ", pseg[pseg_id].name);
    248             fprintf(fpout, " type = \"%s\" ", pseg_type[pseg[pseg_id].type]);
    249             fprintf(fpout, " base = \"0x%llx\" ", pseg[pseg_id].base);
    250             fprintf(fpout, " length = \"0x%llx\" />\n",   pseg[pseg_id].length);
     255            fprintf(fpout, "type = \"%s\" ", pseg_type[pseg[pseg_id].type]);
     256            fprintf(fpout, "base = \"0x%llx\" ", pseg[pseg_id].base);
     257            fprintf(fpout, "length = \"0x%llx\" />\n",   pseg[pseg_id].length);
    251258        }
    252259
     
    316323        fprintf(fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase);
    317324        fprintf(fpout, "mode  = \"%s\" ", mode_str[vseg[vseg_id].mode]);
    318         fprintf(fpout, "clusterid = \"%d\" ", pseg[pseg_id].cluster);
     325        fprintf(fpout, "clusterid = \"%d\" ", pseg[pseg_id].clusterid);
    319326        fprintf(fpout, "psegname = \"%s\" ", pseg[pseg_id].name);
    320327        fprintf(fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident);
     
    343350        fprintf(fpout, " startname = \"%s\" >\n", vobj[func_id].name);
    344351
     352        //////////////////// vsegs //////////////////////////////////////////////
     353
    345354        for (vseg_id = vspace[vspace_id].vseg_offset;
    346355             vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs);
    347356             vseg_id++)
    348357        {
    349             unsigned int pseg_id = vseg[vseg_id].psegid;
     358            unsigned int pseg_id    = vseg[vseg_id].psegid;
     359            unsigned int cluster_id = pseg[pseg_id].clusterid;
     360            unsigned int x          = cluster_id >> header->y_width;
     361            unsigned int y          = cluster_id & ((1<<header->y_width)-1);
    350362
    351363            fprintf(fpout, "            <vseg name = \"%s\" ", vseg[vseg_id].name);
    352364            fprintf(fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase);
    353             fprintf(fpout, "mode  = \"%s\" ", mode_str[vseg[vseg_id].mode]);
    354             fprintf(fpout, "clusterid = \"%d\" ", pseg[pseg_id].cluster);
     365            fprintf(fpout, "mode = \"%s\" ", mode_str[vseg[vseg_id].mode]);
     366            fprintf(fpout, "x = \"%d\" ", x);
     367            fprintf(fpout, "y = \"%d\" ", y);
    355368            fprintf(fpout, "psegname = \"%s\" ", pseg[pseg_id].name);
    356369            fprintf(fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident);
     
    369382            fprintf(fpout, "            </vseg>\n\n");
    370383        }
     384
     385        //////////////////// tasks //////////////////////////////////////////////
     386
    371387        for (task_id = vspace[vspace_id].task_offset;
    372388             task_id < (vspace[vspace_id].task_offset + vspace[vspace_id].tasks);
     
    375391            unsigned int stack_vobj_id = task[task_id].stack_vobjid + vspace[vspace_id].vobj_offset;
    376392            unsigned int heap_vobj_id = task[task_id].heap_vobjid + vspace[vspace_id].vobj_offset;
     393            unsigned int cluster_id   = task[task_id].clusterid;
     394            unsigned int x            = cluster_id >> header->y_width;
     395            unsigned int y            = cluster_id & ((1<<header->y_width)-1);
    377396
    378397            fprintf(fpout, "            <task name = \"%s\" ", task[task_id].name);
    379             fprintf(fpout, "clusterid = \"%d\" ", task[task_id].clusterid);
     398            fprintf(fpout, "x = \"%d\" ", x);
     399            fprintf(fpout, "y = \"%d\" ", y);
    380400            fprintf(fpout, "proclocid = \"%d\" ", task[task_id].proclocid);
    381401            fprintf(fpout, "stackname = \"%s\" ", vobj[stack_vobj_id].name);
  • soft/giet_vm/giet_xml/xml_parser.c

    r262 r263  
    109109////////////////////////////////////////////////////////////////////
    110110
    111 unsigned int cluster_y        = 0; // number of clusters in a column
    112 unsigned int cluster_x        = 0; // number of clusters in a row
    113111unsigned int nb_proc_max      = 0; // max number of processors per cluster
    114 unsigned int nb_tasks_max     = 0; // max number of tasks (for all vspaces)
     112unsigned int nb_tasks_max     = 0; // max number of tasks (in all vspaces)
    115113
    116114unsigned int tim_channels     = 0; // max number of user timers (per cluster)
     
    132130
    133131unsigned int periph_vbase_array[PERIPH_TYPE_MAX_VALUE]
    134          = { [0 ... (PERIPH_TYPE_MAX_VALUE - 1)] = 0xFFF00000 };
     132         = { [0 ... (PERIPH_TYPE_MAX_VALUE - 1)] = 0xFFFFFFFF };
    135133
    136134//////////////////////////////////////////////////////////////////////
     
    283281// This function set the vbase address for all peripheral types.
    284282// For replicated peripherals with the same type the virtual base address must be:
    285 //   vbase = seg_type_base & 0XFFF00000 +
    286 //          (cluster_id * vbase_cluster_increment) & 0x000FFFFF
     283//   vbase = seg_type_base & 0XFF000000 +
     284//          (cluster_id * vbase_cluster_increment) & 0x00FF0000
    287285///////////////////////////////////////////////////////////////////////////////////
    288286void set_periph_vbase_array()
     
    291289    unsigned int periph_id;    // periph global index
    292290    unsigned int pseg_id;      // pseg global index
    293     unsigned int cluster_id;   // cluster global index
     291    unsigned int cluster_id;   // cluster linear index
     292    unsigned int cluster_xy;   // cluster topological index
    294293    unsigned int type;         // peripheral type
    295294
    296     unsigned int msb_mask = 0xFFF00000;
    297     unsigned int lsb_mask = 0x000FFFFF;
    298 
    299     // We are looking for any vseg matching a peripheral
    300     // (i.e. they are associated to the same pseg)
     295    unsigned int type_mask    = 0xFF000000;
     296    unsigned int cluster_mask = 0x00FF0000;
     297
     298    // We are analysing all vsegs corresponding to a peripheral
    301299
    302300    // scan all vsegs
     
    306304        if ( vobj[vseg[vseg_id]->vobj_offset]->type == VOBJ_TYPE_PERI )
    307305        {
    308             pseg_id = vseg[vseg_id]->psegid;
    309             cluster_id = pseg[pseg_id]->cluster;
    310 
    311             // scan all periphs
     306            pseg_id    = vseg[vseg_id]->psegid;
     307
     308            // scan all periphs to retrieve peripheral type (same psegid)
    312309            for ( periph_id = 0 ; periph_id < header->periphs ; periph_id++)
    313310            {
     
    315312                {
    316313                    type = periph[periph_id]->type;
    317                     if ( periph_vbase_array[type] == 0xFFF00000 )  // vbase not set
     314                    if ( periph_vbase_array[type] == 0xFFFFFFFF )  // vbase not set
    318315                    {
    319                         periph_vbase_array[type] = vseg[vseg_id]->vbase;   
     316                        periph_vbase_array[type] = vseg[vseg_id]->vbase & type_mask;   
    320317                    }
    321318                    else                                 // vbase already set
    322319                    {
    323                         // checking 12 MSB bits for replicated peripherals
    324                         if( (vseg[vseg_id]->vbase & msb_mask) !=
    325                             (periph_vbase_array[type] & msb_mask) )
     320                        // checking mask bits
     321                        if( (vseg[vseg_id]->vbase & type_mask) !=
     322                            (periph_vbase_array[type]) )
    326323                        {
    327324                            printf("[XML ERROR] All peripherals with same type ");
    328                             printf(" should share the same 12 MSB for vbase address\n");
    329                             printf("periph index = %d / periph type = %d / vbase = %x\n",
    330                                     periph_id, type, vseg[vseg_id]->vbase);
    331                             exit(1);
    332                         }
    333                         // checking 20 LSB bits for replicated peripherals
    334                         if( (vseg[vseg_id]->vbase & lsb_mask) !=
    335                             (header->increment * cluster_id) )
    336                         {
    337                             printf("[XML ERROR] All peripherals with same type ");
    338                             printf(" must have the 20 LSB bits = cluster_id * increment");
     325                            printf(" should share the same 8 MSB bits in base address\n");
    339326                            printf("periph index = %d / periph type = %d / vbase = %x\n",
    340327                                    periph_id, type, vseg[vseg_id]->vbase);
     
    342329                        }
    343330                    }
     331   
     332                    // checking cluster bits for all replicated peripherals
     333                    if ( (type == PERIPH_TYPE_DMA) ||
     334                         (type == PERIPH_TYPE_MMC) ||
     335                         (type == PERIPH_TYPE_ICU) ||
     336                         (type == PERIPH_TYPE_XCU) ||
     337                         (type == PERIPH_TYPE_TIM) )
     338                    {
     339                        cluster_id = pseg[pseg_id]->clusterid;
     340                        cluster_xy = (cluster[cluster_id]->x << header->y_width) +
     341                                      cluster[cluster_id]->y;
     342
     343                        if( (vseg[vseg_id]->vbase & cluster_mask) !=
     344                            (header->increment * cluster_xy) )
     345                        {
     346                            printf("[XML ERROR] All replicated peripherals ");
     347                            printf("must have cluster bits = cluster_id * increment");
     348                            printf("periph index = %d / periph type = %d / vbase = %x\n",
     349                                    periph_id, type, vseg[vseg_id]->vbase);
     350                            exit(1);
     351                        }
     352                    }
    344353                }
    345354            }
     
    348357}  // end set_periph_vbase_array()
    349358
    350 ////////////////////////////////////////////////////////
    351 int getPsegId(unsigned int cluster_id, char * pseg_name)
    352 {
     359///////////////////////////////////////////////////////////////
     360int getClusterId( unsigned int x, unsigned int y )
     361{
     362    // associative search of cluster index
     363    unsigned int cluster_id;
     364
     365    for( cluster_id = 0 ; cluster_id < (header->x_size * header->y_size) ; cluster_id++ )
     366    {
     367        if( (cluster[cluster_id]->x == x) && (cluster[cluster_id]->y == y) )
     368        {
     369            return cluster_id;
     370        }
     371    }
     372    return -1;
     373}  // end getClusterId()
     374
     375///////////////////////////////////////////////////////////////
     376int getPsegId(unsigned int x, unsigned int y, char * pseg_name)
     377{
     378    int cluster_id = getClusterId( x, y );
     379
     380    if ( cluster_id == -1 ) return -1;
     381
     382    // associative search for pseg index
    353383    unsigned int pseg_id;
    354384    unsigned int pseg_min = cluster[cluster_id]->pseg_offset;
     
    363393    }
    364394    return -1;
    365 }
     395}  // end getPsegId()
    366396
    367397///////////////////////////////////
     
    399429    unsigned int ok;
    400430    unsigned int value;
     431    unsigned int x,y;
    401432    char * str;
    402433
     
    420451    {
    421452#if XML_PARSER_DEBUG
    422 printf("      name = %s\n", str);
     453printf("      name      = %s\n", str);
    423454#endif
    424455        strncpy( task[task_index]->name, str, 31 );
     
    431462    }
    432463
    433     ///////// get clusterid attribute
    434     value = getIntValue(reader, "clusterid", &ok);
    435     if (ok)
    436     {
    437 #if XML_PARSER_DEBUG
    438 printf("      clusterid = %x\n", value);
    439 #endif
    440         if (value >= header->clusters)
    441         {
    442             printf("[XML ERROR] <clusterid> too large for task (%d,%d)\n",
    443                     vspace_index, task_loc_index);
    444             exit(1);
    445         }
    446         task[task_index]->clusterid = value;
     464    ///////// get x coordinate
     465     x = getIntValue(reader, "x", &ok);
     466#if XML_PARSER_DEBUG
     467printf("      x         = %d\n", x);
     468#endif
     469    if ( !(ok && (x < header->x_size)) )
     470    {
     471        printf("[XML ERROR] illegal or missing < x > attribute for task (%d,%d)\n",
     472                vspace_index, task_loc_index);
     473        exit(1);
    447474    } 
    448     else
    449     {
    450         printf("[XML ERROR] illegal or missing <clusterid> attribute for task (%d,%d)\n",
     475
     476    ///////// get y coordinate
     477     y = getIntValue(reader, "y", &ok);
     478#if XML_PARSER_DEBUG
     479printf("      y         = %d\n", y);
     480#endif
     481    if ( !(ok && (y < header->y_size)) )
     482    {
     483        printf("[XML ERROR] illegal or missing < y > attribute for task (%d,%d)\n",
     484                vspace_index, task_loc_index);
     485        exit(1);
     486    } 
     487
     488    ///////// set clusterid attribute
     489    int index = getClusterId( x, y );
     490#if XML_PARSER_DEBUG
     491printf("      clusterid = %d\n", index);
     492#endif
     493    if( index >= 0 )
     494    {
     495        task[task_index]->clusterid = index;
     496    }
     497    else
     498    {
     499        printf("[XML ERROR] <clusterid> not found for task (%d,%d)\n",
    451500                vspace_index, task_loc_index);
    452501        exit(1);
     
    510559        {
    511560#if XML_PARSER_DEBUG
    512 printf("      heapname = %s\n", str);
    513 printf("      heapid   = %d\n", index);
     561printf("      heapname  = %s\n", str);
     562printf("      heapid    = %d\n", index);
    514563#endif
    515564            task[task_index]->heap_vobjid = index;
     
    527576    }
    528577
    529 
    530578    ////////// get startid  attribute
    531579    value = getIntValue(reader, "startid", &ok);
     
    533581    {
    534582#if XML_PARSER_DEBUG
    535 printf("      startid = %x\n", value);
     583printf("      startid   = %x\n", value);
    536584#endif
    537585        task[task_index]->startid = value;
     
    724772    unsigned int ok;
    725773    unsigned int value;
     774    unsigned int x,y;
    726775    char * str;
    727776
     
    760809    {
    761810#if XML_PARSER_DEBUG
    762 printf("      name = %s\n", str);
     811printf("      name        = %s\n", str);
    763812#endif
    764813        strncpy( vseg[vseg_index]->name, str, 31);
     
    776825    {
    777826#if XML_PARSER_DEBUG
    778 printf("      ident = %d\n", value);
     827printf("      ident       = %d\n", value);
    779828#endif
    780829        vseg[vseg_index]->ident = value;
     
    790839    {
    791840#if XML_PARSER_DEBUG
    792 printf("      vbase = 0x%x\n", value);
     841printf("      vbase       = 0x%x\n", value);
    793842#endif
    794843        vseg[vseg_index]->vbase = value;
     
    801850    }
    802851
    803     ////////// get clusterid and psegname attributes
    804     value = getIntValue(reader, "clusterid", &ok);
    805     if (ok == 0)
    806     {
    807         printf("[XML ERROR] illegal or missing <clusterid> for vseg %d\n",
     852    ////////// get x coordinate
     853    x = getIntValue(reader, "x", &ok);
     854#if XML_PARSER_DEBUG
     855printf("      x           = %d\n", x);
     856#endif
     857    if ( !(ok && (x < header->x_size)) )
     858    {
     859        printf("[XML ERROR] illegal or missing < x > attribute for vseg %d\n",
    808860                vseg_loc_index);
    809861        exit(1);
    810862    }
     863
     864    ////////// get y coordinate
     865    y = getIntValue(reader, "y", &ok);
     866#if XML_PARSER_DEBUG
     867printf("      y           = %d\n", y);
     868#endif
     869    if ( !(ok && (y < header->y_size)) )
     870    {
     871        printf("[XML ERROR] illegal or missing < y > attribute for vseg %d\n",
     872                vseg_loc_index);
     873        exit(1);
     874    }
     875
     876    ///////// get psegname attribute
    811877    str = getStringValue(reader, "psegname", &ok);
     878#if XML_PARSER_DEBUG
     879printf("      psegname    = %s\n", str);
     880#endif
    812881    if (ok == 0)
    813882    {
     
    818887
    819888    /////////// set psegid field
    820     int index = getPsegId(value, str);
     889    int psegid = getPsegId( x, y, str );
     890#if XML_PARSER_DEBUG
     891printf("      psegid      = %d\n", psegid);
     892#endif
    821893    if (index >= 0)
    822894    {
    823 #if XML_PARSER_DEBUG
    824 printf("      clusterid = %d\n", value);
    825 printf("      psegname  = %s\n", str);
    826 printf("      psegid    = %d\n", index);
    827 #endif
    828         vseg[vseg_index]->psegid = index;
    829     }
    830     else
    831     {
    832         printf("[XML ERROR] pseg not found for vseg %d / clusterid = %d / psegname = %s\n",
    833                 vseg_loc_index, value, str );
     895        vseg[vseg_index]->psegid = psegid;
     896    }
     897    else
     898    {
     899        printf("[XML ERROR] pseg not found for vseg %d / x = %d / y = %d / psegname = %s\n",
     900                vseg_loc_index, x, y, str );
    834901        exit(1);
    835902    } 
     
    838905    str = getStringValue(reader, "mode", &ok);
    839906#if XML_PARSER_DEBUG
    840 printf("      mode = %s\n", str);
     907printf("      mode        = %s\n", str);
    841908#endif
    842909    if      (ok && (strcmp(str, "CXWU") == 0)) { vseg[vseg_index]->mode = 0xF; }
     
    9551022        const char * tag = (const char *) xmlTextReaderConstName(reader);
    9561023
    957         if (strcmp(tag, "vseg") == 0) {
     1024        if (strcmp(tag, "vseg") == 0)
     1025        {
    9581026            vsegNode(reader);
    9591027        }
    960         else if (strcmp(tag, "task") == 0) {
     1028        else if (strcmp(tag, "task") == 0)
     1029        {
    9611030            taskNode(reader);
    9621031            nb_task_vspace++;
     
    11441213
    11451214    /////////// set psegid attribute
    1146     int index = getPsegId(cluster_index, str);
     1215    int index = getPsegId( cluster[cluster_index]->x, cluster[cluster_index]->y, str);
    11471216    if (index >= 0)
    11481217    {
     
    14651534
    14661535    /////////// set psegid attribute
    1467     int index = getPsegId(cluster_index, str);
     1536    int index = getPsegId( cluster[cluster_index]->x, cluster[cluster_index]->y, str);
    14681537    if (index >= 0)
    14691538    {
     
    17861855
    17871856    //////// set cluster attribute
    1788     pseg[pseg_index]->cluster = cluster_index;
     1857    pseg[pseg_index]->clusterid = cluster_index;
    17891858
    17901859    //////// set next_vseg attribute
     
    18041873    cluster[cluster_index] = (mapping_cluster_t *) malloc(sizeof(mapping_cluster_t));
    18051874
    1806     //initialise all variables
    1807     //they will be incremented by *Node() functions
    1808     //FIXME: calloc?
     1875    //initialise variables that will be incremented by *Node() functions
    18091876    cluster[cluster_index]->psegs = 0;
    18101877    cluster[cluster_index]->procs = 0;
     
    18121879    cluster[cluster_index]->periphs = 0;
    18131880
    1814 
    18151881    //initialise global variables
    1816     //TODO: delete those three
    18171882    proc_loc_index = 0;
    18181883    coproc_loc_index = 0;
     
    18301895    }
    18311896
    1832     // checking source file consistency
    1833     if (cluster_index >= header->clusters)
    1834     {
    1835         printf("[XML ERROR] The cluster index is too large : %d\n", cluster_index);
    1836         exit(1);
    1837     }
    1838 
    1839 #if XML_PARSER_DEBUG
    1840     printf("  cluster %d\n", cluster_index);
    1841 #endif
    1842 
    1843 
    1844     /////////// check cluster index attribute (optional)
    1845     value = getIntValue(reader, "index", &ok);
    1846     if (ok && (value != cluster_index))
    1847     {
    1848         printf("[XML ERROR] wrong cluster index / expected value is %d",
     1897#if XML_PARSER_DEBUG
     1898printf("\n  cluster %d\n", cluster_index);
     1899#endif
     1900
     1901    /////////// get x coordinate
     1902    value = getIntValue(reader, "x", &ok);
     1903#if XML_PARSER_DEBUG
     1904printf("    x             = %d\n", value);
     1905#endif
     1906    if (ok && (value < header->x_size) )
     1907    {
     1908        cluster[cluster_index]->x = value;
     1909    }
     1910    else
     1911    {
     1912        printf("[XML ERROR] Illegal or missing < x > attribute for cluster %d",
     1913                cluster_index);
     1914        exit(1);
     1915    }
     1916
     1917    /////////// get y coordinate
     1918    value = getIntValue(reader, "y", &ok);
     1919#if XML_PARSER_DEBUG
     1920printf("    y             = %d\n", value);
     1921#endif
     1922    if (ok && (value < header->y_size) )
     1923    {
     1924        cluster[cluster_index]->y = value;
     1925    }
     1926    else
     1927    {
     1928        printf("[XML ERROR] Illegal or missing < y > attribute for cluster %d",
    18491929                cluster_index);
    18501930        exit(1);
     
    18581938
    18591939#if XML_PARSER_DEBUG
    1860     printf("    pseg_offset   = %d\n", pseg_index);
    1861     printf("    proc_offset   = %d\n", proc_index);
    1862     printf("    coproc_offset = %d\n", coproc_index);
    1863     printf("    periph_offset = %d\n", coproc_index);
     1940printf("    pseg_offset   = %d\n", pseg_index);
     1941printf("    proc_offset   = %d\n", proc_index);
     1942printf("    coproc_offset = %d\n", coproc_index);
     1943printf("    periph_offset = %d\n", coproc_index);
    18641944#endif
    18651945
     
    18991979
    19001980#if XML_PARSER_DEBUG
    1901             printf("    psegs   = %d\n", cluster[cluster_index]->psegs);
    1902             printf("    procs   = %d\n", cluster[cluster_index]->procs);
    1903             printf("    coprocs = %d\n", cluster[cluster_index]->coprocs);
    1904             printf("    periphs = %d\n", cluster[cluster_index]->periphs);
    1905             printf("    end cluster %d\n", cluster_index);
     1981printf("    psegs   = %d\n", cluster[cluster_index]->psegs);
     1982printf("    procs   = %d\n", cluster[cluster_index]->procs);
     1983printf("    coprocs = %d\n", cluster[cluster_index]->coprocs);
     1984printf("    periphs = %d\n", cluster[cluster_index]->periphs);
     1985printf("    end cluster %d\n", cluster_index);
    19061986#endif
    19071987            cluster_index++;
     
    19191999
    19202000#if XML_PARSER_DEBUG
    1921     printf("\n  clusters set\n");
     2001printf("\n  clusters set\n");
    19222002#endif
    19232003
     
    19332013        {
    19342014            // checking source file consistency
    1935             if (cluster_index != header->clusters)
     2015            if ( cluster_index != (header->x_size * header->y_size) )
    19362016            {
    19372017                printf("[XML ERROR] Wrong number of clusters\n");
     
    20792159    }
    20802160
    2081     /////////// get cluster_x attribute
    2082     cluster_x = getIntValue(reader, "cluster_x", &ok);
    2083     if (ok)
    2084     {
    2085 #if XML_PARSER_DEBUG
    2086         printf("  cluster_x = %d\n", cluster_x);
    2087 #endif
    2088         header->cluster_x = cluster_x;
    2089     }
    2090     else
    2091     {
    2092         printf("[XML ERROR] illegal or missing <cluster_x> attribute in header\n");
    2093         exit(1);
    2094     }
    2095 
    2096     /////////// get cluster_y attribute
    2097     cluster_y = getIntValue(reader, "cluster_y", &ok);
    2098     if (ok)
    2099     {
    2100 #if XML_PARSER_DEBUG
    2101         printf("  cluster_y = %d\n", cluster_y);
    2102 #endif
    2103         header->cluster_y = cluster_y;
    2104     }
    2105     else
    2106     {
    2107         printf("[XML ERROR] illegal or missing <cluster_y> attribute in header\n");
     2161    /////////// get x_width attribute
     2162    value = getIntValue(reader, "x_width", &ok);
     2163    if (ok)
     2164    {
     2165#if XML_PARSER_DEBUG
     2166        printf("  x_width = %d\n", value);
     2167#endif
     2168        header->x_width = value;
     2169    }
     2170
     2171    /////////// get y_width attribute
     2172    value = getIntValue(reader, "y_width", &ok);
     2173    if (ok)
     2174    {
     2175#if XML_PARSER_DEBUG
     2176        printf("  y_width = %d\n", value);
     2177#endif
     2178        header->y_width = value;
     2179    }
     2180
     2181    /////////// get x_size attribute
     2182    unsigned int x_size = getIntValue(reader, "x_size", &ok);
     2183    if (ok)
     2184    {
     2185#if XML_PARSER_DEBUG
     2186        printf("  x_size  = %d\n", x_size);
     2187#endif
     2188        header->x_size = x_size;
     2189    }
     2190    else
     2191    {
     2192        printf("[XML ERROR] illegal or missing <x_size> attribute in header\n");
     2193        exit(1);
     2194    }
     2195
     2196    /////////// get y_size attribute
     2197    unsigned int y_size = getIntValue(reader, "y_size", &ok);
     2198    if (ok)
     2199    {
     2200#if XML_PARSER_DEBUG
     2201        printf("  y_size  = %d\n", y_size);
     2202#endif
     2203        header->y_size = y_size;
     2204    }
     2205    else
     2206    {
     2207        printf("[XML ERROR] illegal or missing <y_size> attribute in header\n");
    21082208        exit(1);
    21092209    }
    21102210
    21112211    //check the number of cluster
    2112     value = cluster_x * cluster_y;
    2113     if (value >= MAX_CLUSTERS)
    2114     {
    2115         printf("[XML ERROR] The number of clusters is larger than %d\n", MAX_CLUSTERS);
    2116         exit(1);
    2117     }
    2118 
    2119     header->clusters  = value;
    2120 
    2121 #if XML_PARSER_DEBUG
    2122     printf("  clusters = %d\n", value);
    2123 #endif
     2212    if ( (x_size * y_size) >= MAX_CLUSTERS )
     2213    {
     2214        printf("[XML ERROR] Number of clusters cannot be larger than %d\n", MAX_CLUSTERS);
     2215        exit(1);
     2216    }
    21242217
    21252218    ///////// get vspaces attribute
     
    22812374printf("Building map.bin for %s\n", header->name);
    22822375printf("signature = %x\n", header->signature);
    2283 printf("clusters  = %d\n", header->clusters);
     2376printf("x_size    = %d\n", header->x_size);
     2377printf("y_size    = %d\n", header->y_size);
     2378printf("x_width   = %d\n", header->x_width);
     2379printf("y_width   = %d\n", header->y_width);
    22842380printf("vspaces   = %d\n", header->vspaces);
    22852381printf("psegs     = %d\n", header->psegs);
     
    24062502    file_write(fdout, ifdef);
    24072503
    2408     def_int_write(fdout, "CLUSTER_X         ", cluster_x);
    2409     def_int_write(fdout, "CLUSTER_Y         ", cluster_y);
    2410     def_int_write(fdout, "NB_CLUSTERS       ", cluster_index);
     2504    def_int_write(fdout, "X_SIZE            ", header->x_size);
     2505    def_int_write(fdout, "Y_SIZE            ", header->y_size);
     2506    def_int_write(fdout, "X_WIDTH           ", header->x_width);
     2507    def_int_write(fdout, "Y_WIDTH           ", header->y_width);
     2508
     2509    file_write(fdout, "\n");
     2510
    24112511    def_int_write(fdout, "NB_PROCS_MAX      ", nb_proc_max);
    24122512    def_int_write(fdout, "NB_TASKS_MAX      ", nb_tasks_max);
  • soft/giet_vm/mappings/4c_1p_iob_four.xml

    r258 r263  
    33<mapping_info signature    = "0xdeadbeef"
    44              name         = "4c_1p_iob_four"
    5               cluster_x    = "2"
    6               cluster_y    = "2"
     5              x_size       = "2"
     6              y_size       = "2"
     7              x_width      = "4"
     8              y_width      = "4"
    79              vspaces      = "4"
    810              increment    = "0x10000" >
     
    1618    <clusterset>
    1719
    18         <cluster index = "0" >
     20        <cluster x = "0" y = "0" >
    1921            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0000000000" length = "0x0010000000" />
    2022            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x00B0000000" length = "0x0000002000" />
     
    7981        </cluster>
    8082
    81         <cluster index = "1" >
    82             <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x4000000000" length = "0x0010000000" />
    83             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x40B0000000" length = "0x0000002000" />
    84             <pseg name = "PSEG_DMA"  type = "PERI" base = "0x40B1000000" length = "0x0000008000" />
    85             <pseg name = "PSEG_MMC"  type = "PERI" base = "0x40B2000000" length = "0x0000001000" />
     83        <cluster x = "0" y = "1" >
     84            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0100000000" length = "0x0010000000" />
     85            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x01B0000000" length = "0x0000002000" />
     86            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x10B1000000" length = "0x0000008000" />
     87            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x01B2000000" length = "0x0000001000" />
    8688
    8789            <proc index = "0" >
     
    9597        </cluster>
    9698
    97         <cluster index = "2" >
    98             <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x8000000000" length = "0x0010000000" />
    99             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x80B0000000" length = "0x0000002000" />
    100             <pseg name = "PSEG_DMA"  type = "PERI" base = "0x80B1000000" length = "0x0000008000" />
    101             <pseg name = "PSEG_MMC"  type = "PERI" base = "0x80B2000000" length = "0x0000001000" />
     99        <cluster x = "1" y = "0" >
     100            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1000000000" length = "0x0010000000" />
     101            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x10B0000000" length = "0x0000002000" />
     102            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x10B1000000" length = "0x0000008000" />
     103            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x10B2000000" length = "0x0000001000" />
    102104
    103105            <proc index = "0" >
     
    111113        </cluster>
    112114
    113         <cluster index = "3" >
    114             <pseg name = "PSEG_RAM"  type = "RAM"  base = "0xC000000000" length = "0x0010000000" />
    115             <pseg name = "PSEG_XCU"  type = "PERI" base = "0xC0B0000000" length = "0x0000002000" />
    116             <pseg name = "PSEG_DMA"  type = "PERI" base = "0xC0B1000000" length = "0x0000008000" />
    117             <pseg name = "PSEG_MMC"  type = "PERI" base = "0xC0B2000000" length = "0x0000001000" />
     115        <cluster x = "1" y = "1" >
     116            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1100000000" length = "0x0010000000" />
     117            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x11B0000000" length = "0x0000002000" />
     118            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x11B1000000" length = "0x0000008000" />
     119            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x11B2000000" length = "0x0000001000" />
    118120
    119121            <proc index = "0" >
     
    136138- seg_boot_buffer is used by the boot-loader. It can contain a complete .elf file. The content is not reused by the kernel.
    137139
    138         <vseg name = "seg_boot_mapping"   vbase = "0x00000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
     140        <vseg name = "seg_boot_mapping"   vbase = "0x00000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
    139141            <vobj name = "boot_mapping"   type = "BLOB"   length = "0x00010000" binpath = "map.bin" />
    140142        </vseg>
    141         <vseg name = "seg_boot_code"      vbase = "0x00010000" mode = "CXW_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
     143        <vseg name = "seg_boot_code"      vbase = "0x00010000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
    142144            <vobj name = "boot_code"      type = "BUFFER" length = "0x00020000" />
    143145        </vseg>
    144         <vseg name = "seg_boot_data"      vbase = "0x00030000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
     146        <vseg name = "seg_boot_data"      vbase = "0x00030000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
    145147            <vobj name = "boot_data"      type = "BUFFER" length = "0x00010000" />
    146148        </vseg>
    147         <vseg name = "seg_boot_buffer"    vbase = "0x00040000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
     149        <vseg name = "seg_boot_buffer"    vbase = "0x00040000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
    148150            <vobj name = "boot_buffer"    type = "BUFFER" length = "0x00020000" />
    149151        </vseg>
    150         <vseg name = "seg_boot_stack"     vbase = "0x00060000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
     152        <vseg name = "seg_boot_stack"     vbase = "0x00060000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
    151153            <vobj name = "boot_stack"     type = "BUFFER" length = "0x00090000" />
    152154        </vseg>
     
    154156*** Segments used by the kernel / A[31:28] = 0x8
    155157 
    156         <vseg name = "seg_kernel_code"    vbase = "0x80000000" mode = "CXW_" clusterid = "0" psegname = "PSEG_RAM" >
     158        <vseg name = "seg_kernel_code"    vbase = "0x80000000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" >
    157159            <vobj name = "kernel_code"    type = "ELF" length = "0x00020000" binpath = "build/kernel/kernel.elf" />
    158160        </vseg>
    159         <vseg name = "seg_kernel_data"    vbase = "0x80020000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" >
     161        <vseg name = "seg_kernel_data"    vbase = "0x80020000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" >
    160162            <vobj name = "kernel_data"    type = "ELF" length = "0x00060000" binpath = "build/kernel/kernel.elf" />
    161163                </vseg>
    162         <vseg name = "seg_kernel_uncdata" vbase = "0x80080000" mode = "__W_" clusterid = "0" psegname = "PSEG_RAM" >
     164        <vseg name = "seg_kernel_uncdata" vbase = "0x80080000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_RAM" >
    163165            <vobj name = "kernel_uncdata" type = "ELF" length = "0x00040000" binpath = "build/kernel/kernel.elf" />
    164166        </vseg>
    165         <vseg name = "seg_kernel_init"    vbase = "0x800C0000" mode = "CXW_" clusterid = "0" psegname = "PSEG_RAM" >
     167        <vseg name = "seg_kernel_init"    vbase = "0x800C0000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" >
    166168            <vobj name = "kernel_init"    type = "ELF" length = "0x00010000" binpath = "build/kernel/kernel.elf" />
    167169        </vseg>
    168170
    169171*** Segments for non replicated peripherals / A[31:28] = 0xB / Identity mapping
    170 
    171         <vseg name = "seg_iob"            vbase = "0xBE000000" mode = "__W_" clusterid = "0" psegname = "PSEG_IOB" ident = "1" >
     172*** The peripheral type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
     173
     174        <vseg name = "seg_iob"            vbase = "0xBE000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_IOB" ident = "1" >
    172175            <vobj name = "iob"            type = "PERI" length  = "0x00001000" />
    173176        </vseg>
    174         <vseg name = "seg_ioc"            vbase = "0xB3000000" mode = "__W_" clusterid = "0" psegname = "PSEG_IOC" ident = "1" >
     177        <vseg name = "seg_ioc"            vbase = "0xB3000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_IOC" ident = "1" >
    175178            <vobj name = "ioc"            type = "PERI" length  = "0x00001000" />
    176179        </vseg>
    177         <vseg name = "seg_tty"            vbase = "0xB4000000" mode = "__W_" clusterid = "0" psegname = "PSEG_TTY" ident = "1" >
     180        <vseg name = "seg_tty"            vbase = "0xB4000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_TTY" ident = "1" >
    178181                        <vobj name = "tty"            type = "PERI" length  = "0x00001000" />
    179182        </vseg>
    180         <vseg name = "seg_nic"            vbase = "0xB5000000" mode = "__W_" clusterid = "0" psegname = "PSEG_NIC" ident = "1" >
     183        <vseg name = "seg_nic"            vbase = "0xB5000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_NIC" ident = "1" >
    181184            <vobj name = "nic"            type = "PERI" length  = "0x00080000" />
    182185        </vseg>
    183         <vseg name = "seg_cma"            vbase = "0xB6000000" mode = "__W_" clusterid = "0" psegname = "PSEG_CMA" ident = "1" >
     186        <vseg name = "seg_cma"            vbase = "0xB6000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_CMA" ident = "1" >
    184187            <vobj name = "cma"            type = "PERI" length  = "0x00008000" />
    185188        </vseg>
    186         <vseg name = "seg_fbf"            vbase = "0xB7000000" mode = "__W_" clusterid = "0" psegname = "PSEG_FBF" ident = "1" >
     189        <vseg name = "seg_fbf"            vbase = "0xB7000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_FBF" ident = "1" >
    187190            <vobj name = "fbf"            type = "PERI" length  = "0x00004000" />
    188191        </vseg>
    189         <vseg name = "seg_rom"            vbase = "0xBFC00000" mode = "CXW_" clusterid = "0" psegname = "PSEG_ROM" ident = "1" >
     192        <vseg name = "seg_rom"            vbase = "0xBFC00000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_ROM" ident = "1" >
    190193            <vobj name = "rom"            type = "PERI" length  = "0x00004000" />
    191194        </vseg>
    192195
    193196*** Segments for replicated ICUS / A[31:24] = 0xB0 / Increment = 0x10000 / Identity mapping in cluster 0           
    194 
    195         <vseg name = "seg_icu_0"          vbase = "0xB0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" ident = "1" >
     197*** The peripheral type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
     198*** The cluster id must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
     199
     200        <vseg name = "seg_icu_0"          vbase = "0xB0000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_XCU" ident = "1" >
    196201            <vobj name = "icu_0"          type = "PERI" length  = "0x00001000" />
    197202        </vseg>
    198         <vseg name = "seg_icu_1"          vbase = "0xB0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_XCU" >
     203        <vseg name = "seg_icu_1"          vbase = "0xB0010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_XCU" >
    199204            <vobj name = "icu_1"          type = "PERI" length  = "0x00001000" />
    200205        </vseg>
    201         <vseg name = "seg_icu_2"          vbase = "0xB0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_XCU" >
     206        <vseg name = "seg_icu_2"          vbase = "0xB0100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_XCU" >
    202207            <vobj name = "icu_2"          type = "PERI" length  = "0x00001000" />
    203208        </vseg>
    204         <vseg name = "seg_icu_3"          vbase = "0xB0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_XCU" >
     209        <vseg name = "seg_icu_3"          vbase = "0xB0110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_XCU" >
    205210            <vobj name = "icu_3"          type = "PERI" length  = "0x00001000" />
    206211        </vseg>
    207212
    208213*** segments for replicated DMAs / A[31:24] = 0xB1 / Increment = 0x10000 / Tdentity mapping in cluster 0
    209 
    210         <vseg name = "seg_dma_0"          vbase = "0xB1000000" mode = "__W_" clusterid = "0" psegname = "PSEG_DMA" ident = "1" >
     214*** The peripheral type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
     215*** The cluster id must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
     216
     217        <vseg name = "seg_dma_0"          vbase = "0xB1000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_DMA" ident = "1" >
    211218            <vobj name = "dma_0"          type = "PERI" length  = "0x00008000" />
    212219        </vseg>
    213         <vseg name = "seg_dma_1"          vbase = "0xB1010000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" >
     220        <vseg name = "seg_dma_1"          vbase = "0xB1010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_DMA" >
    214221            <vobj name = "dma_1"          type = "PERI" length  = "0x00008000" />
    215222        </vseg>
    216         <vseg name = "seg_dma_2"          vbase = "0xB1020000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" >
     223        <vseg name = "seg_dma_2"          vbase = "0xB1100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_DMA" >
    217224            <vobj name = "dma_2"          type = "PERI" length  = "0x00008000" />
    218225        </vseg>
    219         <vseg name = "seg_dma_3"          vbase = "0xB1030000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" >
     226        <vseg name = "seg_dma_3"          vbase = "0xB1110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_DMA" >
    220227            <vobj name = "dma_3"          type = "PERI" length  = "0x00008000" />
    221228        </vseg>
    222229
    223230*** segments for replicated MMC / A[31:24] = 0xB2 / Increment = 0x10000 / Identity mapping in cluster 0
    224 
    225         <vseg name = "seg_memc_0"         vbase = "0xB2000000" mode = "__W_" clusterid = "0" psegname = "PSEG_MMC" ident = "1" >
     231*** The peripheral type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
     232*** The cluster id must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
     233
     234        <vseg name = "seg_memc_0"         vbase = "0xB2000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_MMC" ident = "1" >
    226235            <vobj name = "memc_0"         type = "PERI" length  = "0x00001000" />
    227236        </vseg>
    228         <vseg name = "seg_memc_1"         vbase = "0xB2010000" mode = "__W_" clusterid = "1" psegname = "PSEG_MMC" >
     237        <vseg name = "seg_memc_1"         vbase = "0xB2010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_MMC" >
    229238            <vobj name = "memc_1"         type = "PERI" length  = "0x00001000" />
    230239        </vseg>
    231         <vseg name = "seg_memc_2"         vbase = "0xB2020000" mode = "__W_" clusterid = "2" psegname = "PSEG_MMC" >
     240        <vseg name = "seg_memc_2"         vbase = "0xB2100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_MMC" >
    232241            <vobj name = "memc_2"         type = "PERI" length  = "0x00001000" />
    233242        </vseg>
    234         <vseg name = "seg_memc_3"         vbase = "0xB2030000" mode = "__W_" clusterid = "3" psegname = "PSEG_MMC" >
     243        <vseg name = "seg_memc_3"         vbase = "0xB2110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_MMC" >
    235244            <vobj name = "memc_3"         type = "PERI" length  = "0x00001000" />
    236245        </vseg>
    237246
    238247*** segments for replicated schedulers / A[31:28] = 0xF / Increment = 0x10000
    239 
    240         <vseg name = "seg_sched_0"        vbase = "0xF0000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" >
     248*** The type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
     249*** The cluster id must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
     250
     251        <vseg name = "seg_sched_0"        vbase = "0xF0000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" >
    241252            <vobj name = "sched_0"        type = "SCHED" length  = "0x00008000" />
    242253        </vseg>
    243         <vseg name = "seg_sched_1"        vbase = "0xF0010000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" >
     254        <vseg name = "seg_sched_1"        vbase = "0xF0010000" mode = "C_W_" x = "0" y = "1" psegname = "PSEG_RAM" >
    244255            <vobj name = "sched_1"        type = "SCHED" length  = "0x00008000" />
    245256        </vseg>
    246         <vseg name = "seg_sched_2"        vbase = "0xF0020000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" >
     257        <vseg name = "seg_sched_2"        vbase = "0xF0100000" mode = "C_W_" x = "1" y = "0" psegname = "PSEG_RAM" >
    247258            <vobj name = "sched_2"        type = "SCHED" length  = "0x00008000" />
    248259        </vseg>
    249         <vseg name = "seg_sched_3"        vbase = "0xF0030000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" >
     260        <vseg name = "seg_sched_3"        vbase = "0xF0110000" mode = "C_W_" x = "1" y = "1" psegname = "PSEG_RAM" >
    250261            <vobj name = "sched_3"        type = "SCHED" length  = "0x00008000" />
    251262        </vseg>
    252 ***
     263
    253264    </globalset>
    254265
     
    257268*** For each vspace, the startname field is the name of the vobj containing the start_vector (entry point array)
    258269*** For each task, the startid field define the task entry point as an index in the start_vector
    259 *** For each task, the clusterid and proclocid arguments define the task static placement
     270*** For each task, the x = "0" y and proclocid arguments define the task static placement
    260271*** For each task, the stackname field is the name of the vobj containing the task stack
    261272*** For each task, the heapname field is the name of the vobj containing the task heap
    262273
    263274        <vspace name = "router" startname = "router_data" >
    264             <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" clusterid = "0" psegname = "PSEG_RAM" >
     275            <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" x = "0" y = "0" psegname = "PSEG_RAM" >
    265276                <vobj name = "router_code" type  = "ELF" length = "0x00010000" binpath = "build/router/router.elf" />
    266277            </vseg>
    267             <vseg name = "seg_data"        vbase = "0x00500000" mode = "__WU" clusterid = "0" psegname = "PSEG_RAM" >
     278            <vseg name = "seg_data"        vbase = "0x00500000" mode = "__WU" x = "0" y = "0" psegname = "PSEG_RAM" >
    268279                <vobj name = "router_data" type  = "ELF" length = "0x00010000" binpath = "build/router/router.elf" />
    269280            </vseg>
    270             <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" >
     281            <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" >
    271282                <vobj name = "ptab"        type  = "PTAB" length  = "0x00020000" align   = "13" />
    272283            </vseg>
    273             <vseg name = "seg_stack_prod"  vbase = "0x00700000" mode = "C_WU" clusterid = "0" psegname = "PSEG_RAM" >
     284            <vseg name = "seg_stack_prod"  vbase = "0x00700000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
    274285                <vobj name = "stack_prod"  type  = "BUFFER" length = "0x00010000" />
    275286                <vobj name = "heap_prod"   type  = "BUFFER" length = "0x00010000" />
    276287            </vseg>
    277             <vseg name = "seg_stack_cons"  vbase = "0x00800000" mode = "C_WU" clusterid = "1" psegname = "PSEG_RAM" >
     288            <vseg name = "seg_stack_cons"  vbase = "0x00800000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
    278289                <vobj name = "stack_cons"  type  = "BUFFER" length = "0x00010000" />
    279290                <vobj name = "heap_cons"   type  = "BUFFER" length = "0x00010000" />
    280291            </vseg>
    281             <vseg name = "seg_stack_routA" vbase = "0x00900000" mode = "C_WU" clusterid = "2" psegname = "PSEG_RAM" >
     292            <vseg name = "seg_stack_routA" vbase = "0x00900000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
    282293                <vobj name = "stack_routA" type  = "BUFFER" length = "0x00010000" />
    283294                <vobj name = "heap_routA"  type  = "BUFFER" length = "0x00010000" />
    284295            </vseg>
    285             <vseg name = "seg_stack_routB" vbase = "0x00A00000" mode = "C_WU" clusterid = "3" psegname = "PSEG_RAM" >
     296            <vseg name = "seg_stack_routB" vbase = "0x00A00000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
    286297                <vobj name = "stack_routB" type  = "BUFFER" length = "0x00010000" />
    287298                <vobj name = "heap_routB"  type  = "BUFFER" length = "0x00010000" />
    288299            </vseg>
    289             <vseg name = "seg_mwmrs"       vbase = "0x00B00000" mode = "__WU" clusterid = "0" psegname = "PSEG_RAM" >
     300            <vseg name = "seg_mwmrs"       vbase = "0x00B00000" mode = "__WU" x = "0" y = "0" psegname = "PSEG_RAM" >
    290301                <vobj name = "mwmr_in"     type  = "MWMR" length = "0x00000020" init = "1" />
    291302                <vobj name = "mwmr_out"    type  = "MWMR" length = "0x00000020" init = "1" />
    292303                    </vseg>
    293304
    294             <task name = "producer" clusterid = "0" proclocid = "0" stackname = "stack_prod"  heapname = "heap_prod"  startid = "0" usetty = "1" />
    295             <task name = "consumer" clusterid = "1" proclocid = "0" stackname = "stack_cons"  heapname = "heap_cons"  startid = "1" usetty = "1" />
    296             <task name = "router_A" clusterid = "2" proclocid = "0" stackname = "stack_routA" heapname = "heap_routA" startid = "2" usetty = "1" />
    297             <task name = "router_B" clusterid = "3" proclocid = "0" stackname = "stack_routB" heapname = "heap_routB" startid = "2" usetty = "1" />
     305            <task name = "producer" x = "0" y = "0" proclocid = "0" stackname = "stack_prod"  heapname = "heap_prod"  startid = "0" usetty = "1" />
     306            <task name = "consumer" x = "0" y = "1" proclocid = "0" stackname = "stack_cons"  heapname = "heap_cons"  startid = "1" usetty = "1" />
     307            <task name = "router_A" x = "1" y = "0" proclocid = "0" stackname = "stack_routA" heapname = "heap_routA" startid = "2" usetty = "1" />
     308            <task name = "router_B" x = "1" y = "1" proclocid = "0" stackname = "stack_routB" heapname = "heap_routB" startid = "2" usetty = "1" />
    298309        </vspace>
    299310
    300311        <vspace name = "hello" startname = "hello_data" >
    301             <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" clusterid = "1" psegname = "PSEG_RAM" >
     312            <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" x = "0" y = "1" psegname = "PSEG_RAM" >
    302313                <vobj name = "hello_code"  type  = "ELF" length = "0x00010000" binpath = "build/hello/hello.elf" />
    303314            </vseg>
    304             <vseg name = "seg_data"        vbase = "0x00500000" mode = "C_WU" clusterid = "1" psegname = "PSEG_RAM" >
     315            <vseg name = "seg_data"        vbase = "0x00500000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
    305316                <vobj name = "hello_data"  type  = "ELF" length = "0x00010000" binpath = "build/hello/hello.elf" />
    306317            </vseg>
    307             <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" >
     318            <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" x = "0" y = "1" psegname = "PSEG_RAM" >
    308319                <vobj name = "ptab"        type  = "PTAB" length = "0x00020000" align = "13" />
    309320            </vseg>
    310             <vseg name = "seg_stack"       vbase = "0x00700000" mode = "C_WU" clusterid = "1" psegname = "PSEG_RAM" >
     321            <vseg name = "seg_stack"       vbase = "0x00700000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
    311322                <vobj name = "stack"       type  = "BUFFER" length = "0x00010000" />
    312323                <vobj name = "heap"        type  = "BUFFER" length = "0x00010000" />
    313324            </vseg>
    314325
    315             <task name = "main_hello" clusterid = "1" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" />
     326            <task name = "main_hello" x = "0" y = "1" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" />
    316327        </vspace>
    317328
    318329        <vspace name = "pgcd" startname = "pgcd_data" >
    319             <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" clusterid = "2" psegname = "PSEG_RAM" >
     330            <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" x = "1" y = "0" psegname = "PSEG_RAM" >
    320331                <vobj name = "pgcd_code"   type  = "ELF" length = "0x00010000" binpath = "build/pgcd/pgcd.elf" />
    321332            </vseg>
    322             <vseg name = "seg_data"        vbase = "0x00500000" mode = "C_WU" clusterid = "2" psegname = "PSEG_RAM" >
     333            <vseg name = "seg_data"        vbase = "0x00500000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
    323334                <vobj name      = "pgcd_data"  type      = "ELF" length = "0x00010000" binpath = "build/pgcd/pgcd.elf" />
    324335            </vseg>
    325             <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" >
     336            <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" x = "1" y = "0" psegname = "PSEG_RAM" >
    326337                <vobj name = "ptab"        type  = "PTAB" length = "0x00020000" align = "13" />
    327338            </vseg>
    328             <vseg name = "seg_stack"       vbase = "0x00700000" mode = "C_WU" clusterid = "2" psegname = "PSEG_RAM" >
     339            <vseg name = "seg_stack"       vbase = "0x00700000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
    329340                <vobj name = "stack"       type  = "BUFFER" length = "0x00010000" />
    330341                <vobj name = "heap"        type  = "BUFFER" length = "0x00010000" />
    331342            </vseg>
    332343
    333             <task name = "main_pgcd" clusterid = "2" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" />
     344            <task name = "main_pgcd" x = "1" y = "0" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" />
    334345        </vspace>
    335346
    336347        <vspace name = "display" startname = "disp_data" >
    337             <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" clusterid = "3" psegname = "PSEG_RAM" >
     348            <vseg name = "seg_code"        vbase = "0x00400000" mode = "CXWU" x = "1" y = "1" psegname = "PSEG_RAM" >
    338349                <vobj name = "disp_code"   type  = "ELF" length = "0x00010000" binpath = "build/display/display.elf" />
    339350            </vseg>
    340             <vseg name = "seg_data"        vbase = "0x00500000" mode = "C_WU" clusterid = "3" psegname = "PSEG_RAM" >
     351            <vseg name = "seg_data"        vbase = "0x00500000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
    341352                <vobj name = "disp_data"   type  = "ELF" length = "0x00010000" binpath = "build/display/display.elf" />
    342353                        </vseg>
    343             <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" >
     354            <vseg name = "seg_ptab"        vbase = "0x00600000" mode = "C_W_" x = "1" y = "1" psegname = "PSEG_RAM" >
    344355                <vobj name = "ptab"        type  = "PTAB" length  = "0x00020000" align   = "13" />
    345356            </vseg>
    346             <vseg name = "seg_stack"       vbase = "0x00700000" mode = "C_WU" clusterid = "3" psegname = "PSEG_RAM" >
     357            <vseg name = "seg_stack"       vbase = "0x00700000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
    347358                <vobj name = "stack"       type  = "BUFFER" length = "0x00010000" />
    348359                <vobj name = "heap"        type  = "BUFFER" length = "0x00010000" />
    349360            </vseg>
    350361
    351             <task name = "main_display" clusterid = "3" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" usecma = "1" />
     362            <task name = "main_display" x = "1" y = "1" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" usecma = "1" />
    352363        </vspace>
    353364    </vspaceset>
Note: See TracChangeset for help on using the changeset viewer.