Changeset 200


Ignore:
Timestamp:
Aug 12, 2012, 1:35:34 PM (12 years ago)
Author:
karaoui
Message:

+ removing some bugs from:

  • xml_parser.c: check that strcmp == 0 for coproc direction
  • mwmr_channel.c: mwmr->ptr to ptr.
  • utils.h double definition of memcpy fonction.

+ mapping_info.h : naming the enums
+ boot_init.c: changing the order of initialisation in order

to initialise the coproc with the mwmr channel values( depth, width...).
Note that the vobjs are now physically initialised.

+ mwmr_channel.h: changing the order argument definition to suit vci_mwmr_channel Soclib componnent.
+ hwr_mapping.h: adding the register description of the vci_mwmr_controller .

Location:
soft/giet_vm
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/boot/boot_init.c

    r199 r200  
    10591059boot_puts(" ******\n");
    10601060#endif
    1061         // We must set the PTPR depending on the vspace, because the addresses
    1062         // of mwmmr channels, barriers and locks are defined in virtual space.
    1063         boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[vspace_id] >> 13 );
    10641061
    10651062        unsigned int ptab_found = 0;
     
    10741071                case VOBJ_TYPE_MWMR:    // storage capacity is (vobj.length/4 - 5) words
    10751072                        {
    1076                     mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].vaddr);
     1073                    mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr);
    10771074                    mwmr->ptw   = 0;
    10781075                    mwmr->ptr   = 0;
     
    11161113                case VOBJ_TYPE_BARRIER: // init is the number of participants
    11171114                {
    1118                     giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].vaddr);
     1115                    giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].paddr);
    11191116                    barrier->count = 0;
    11201117                    barrier->init  = vobj[vobj_id].init;
     
    11301127                case VOBJ_TYPE_LOCK:    // init is "not taken"
    11311128                {
    1132                     unsigned int* lock = (unsigned int*)(vobj[vobj_id].vaddr);
     1129                    unsigned int* lock = (unsigned int*)(vobj[vobj_id].paddr);
    11331130                    *lock = 0;
    11341131#if BOOT_DEBUG_VOBJS
     
    11811178    } // end loop on vspaces
    11821179} // end boot_vobjs_init()
     1180
     1181void
     1182mwmr_hw_init( void *coproc, enum mwmrPortDirection way,
     1183              unsigned int no, const mwmr_channel_t *pmwmr)
     1184{
     1185    volatile unsigned int *cbase = (unsigned int*) coproc;
     1186   
     1187
     1188    cbase[MWMR_CONFIG_FIFO_WAY] = way ;
     1189    cbase[MWMR_CONFIG_FIFO_NO] = no ;
     1190    cbase[MWMR_CONFIG_STATUS_ADDR] = (unsigned int)pmwmr ;
     1191    cbase[MWMR_CONFIG_WIDTH] = pmwmr->width ;
     1192    cbase[MWMR_CONFIG_DEPTH] = pmwmr->depth;
     1193    cbase[MWMR_CONFIG_BUFFER_ADDR] = (unsigned int)&pmwmr->data;
     1194    cbase[MWMR_CONFIG_RUNNING] = 1 ;
     1195}
     1196
    11831197
    11841198////////////////////////////////////////////////////////////////////////////////
     
    11941208    mapping_periph_t*   periph  = boot_get_periph_base( header );
    11951209    mapping_pseg_t*     pseg    = boot_get_pseg_base( header );
     1210    mapping_vobj_t*     vobj    = boot_get_vobj_base( header );
     1211    mapping_vspace_t*   vspace  = boot_get_vspace_base( header );     
     1212    mapping_coproc_t*   coproc  = boot_get_coproc_base( header );
     1213    mapping_cp_port_t*  cp_port = boot_get_cp_port_base( header );
    11961214
    11971215    unsigned int        cluster_id;
    11981216    unsigned int        periph_id; 
    11991217    unsigned int        coproc_id; 
     1218    unsigned int        cp_port_id; 
    12001219    unsigned int        channel_id;
    12011220
     
    12921311              coproc_id++ )
    12931312        {
    1294             // TODO
     1313            unsigned no_fifo_to  = 0;       //FIXME: should it be the map.xml who define the order?
     1314            unsigned no_fifo_from = 0;
     1315            unsigned int cpseg = pseg[coproc[coproc_id].psegid].base;
     1316
     1317#if BOOT_DEBUG_PERI
     1318boot_puts("[BOOT] mwmr coproc initialisation of ");
     1319boot_putw((unsigned int) coproc[coproc_id].name);
     1320boot_puts(", nb ports");
     1321boot_putw((unsigned int)coproc[coproc_id].ports);
     1322boot_puts("\n");
     1323#endif
     1324
     1325            for ( cp_port_id = coproc[coproc_id].port_offset ;
     1326                  cp_port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports ;
     1327                  cp_port_id++ )
     1328            {
     1329                //FIXME: should the same for all ports: put it in the coproc
     1330                unsigned int vspace_id  = cp_port[cp_port_id].vspaceid;
     1331                unsigned int vobj_id    = cp_port[cp_port_id].vobjlocid + vspace[vspace_id].vobj_offset;
     1332
     1333                mwmr_channel_t *pmwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr);
     1334
     1335                if( cp_port[cp_port_id].direction == PORT_TO_COPROC)
     1336                {
     1337
     1338#if BOOT_DEBUG_PERI
     1339boot_puts("     port direction: PORT_TO_COPROC");
     1340#endif
     1341                    mwmr_hw_init((void*)cpseg, PORT_TO_COPROC, no_fifo_to, pmwmr );
     1342                    no_fifo_to++;
     1343                }
     1344                else
     1345                {
     1346#if BOOT_DEBUG_PERI
     1347boot_puts("     port direction: PORT_FROM_COPROC");
     1348#endif
     1349                    mwmr_hw_init((void*)cpseg, PORT_FROM_COPROC, no_fifo_from, pmwmr );
     1350                    no_fifo_from++;
     1351                }
     1352#if BOOT_DEBUG_PERI
     1353boot_puts(", with mwmr: ");
     1354boot_puts(vobj[vobj_id].name);
     1355boot_puts(" of vspace: ");
     1356boot_puts(vspace[vspace_id].name);
     1357#endif
     1358            }
    12951359        } // end for coprocs
    12961360
     
    16801744    boot_puts("\n");
    16811745
     1746    // page table building
     1747    boot_pt_init();
     1748
     1749    boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");
     1750    boot_putw( boot_proctime() );
     1751    boot_puts("\n");
     1752
     1753    // vobjs initialisation
     1754    boot_vobjs_init();
     1755
     1756    boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");
     1757    boot_putw( boot_proctime() );
     1758    boot_puts("\n");
     1759
    16821760    // peripherals initialisation
    16831761    boot_peripherals_init();
     
    16871765    boot_puts("\n");
    16881766
    1689     // page table building
    1690     boot_pt_init();
    1691 
    1692     boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");
    1693     boot_putw( boot_proctime() );
    1694     boot_puts("\n");
    1695 
    16961767    // mmu activation
    16971768    boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[0] >> 13 );
     
    16991770
    17001771    boot_puts("\n[BOOT] MMU activation completed at cycle ");
    1701     boot_putw( boot_proctime() );
    1702     boot_puts("\n");
    1703 
    1704     // vobjs initialisation
    1705     boot_vobjs_init();
    1706 
    1707     boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");
    17081772    boot_putw( boot_proctime() );
    17091773    boot_puts("\n");
  • soft/giet_vm/libs/mwmr_channel.c

    r195 r200  
    196196            for ( x = 0 ; x < nwords ; x++ ) 
    197197            {
    198                 buffer[x] = mwmr->data[mwmr->ptr];
     198                buffer[x] = mwmr->data[ptr];
    199199                if ( (ptr + 1) == depth ) ptr = 0;
    200200                else                      ptr = ptr + 1;
  • soft/giet_vm/libs/mwmr_channel.h

    r189 r200  
    1919    unsigned int        ptw;                    // index of the first empty slot
    2020    unsigned int        sts;                    // number of words available
     21    unsigned int        lock;                   // exclusive access lock
    2122    unsigned int        depth;                  // max number of words in the channel
    2223    unsigned int        width;                  // number of words in an item   
    23     unsigned int        lock;                   // exclusive access lock
    2424    unsigned int        data[1018];             // circular buffer
    2525} mwmr_channel_t;
  • soft/giet_vm/libs/srl.h

    r189 r200  
    77   @short SRL Api main header
    88 */
     9
     10#include "mapping_info.h"
     11#include "stdio.h"
     12#include "utils.h"
    913
    1014#include "libsrl/srl_public_types.h"
     
    1923#include "libsrl/srl_hw_helpers.h"
    2024
     25#include "libsrl/srl_args.h"
     26
    2127//kernel use!
    2228//#include "libsrl/srl_mwmr_sys.h"
    2329
    24 /* port, APP_NAME, TASK */
    25 # define GET_MWMR(port)                                                                       \
    26 ({                                                                                            \
    27     srl_mwmr_t  _mwmr;                                                                      \
    28     if( vobj_get_vbase( APP_NAME , #port, MWMR, (unsigned int*)&_mwmr ) )                   \
    29     {                                                                                         \
    30         srl_log_printf( NONE, "\n[ERROR] in "TASK" task :\n");                              \
    31         srl_log_printf( NONE, "          undefined <"#port"> channel: %d\n", _mwmr);           \
    32         srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr );                 \
    33         exit();/*srl?*/                                                                     \
    34     }else                                                                                         \
    35         srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", __FILE__, __LINE__, APP_NAME, TASK,#port, (unsigned int)_mwmr ); \
    36     _mwmr;\
    37 })
    3830
    3931#endif
  • soft/giet_vm/libs/utils.h

    r189 r200  
    1313                unsigned int    size );
    1414
    15 void*   memcpy( void*                   dst,
    16                 int                             c,
    17                 unsigned int    size );
    18  
    1915#endif
    2016
  • soft/giet_vm/sys/hwr_mapping.h

    r166 r200  
    9999};
    100100
     101/* MWMR */
     102enum SoclibMwmrRegisters {
     103    MWMR_IOREG_MAX = 16,
     104    MWMR_RESET = MWMR_IOREG_MAX,
     105    MWMR_CONFIG_FIFO_WAY,
     106    MWMR_CONFIG_FIFO_NO,
     107    MWMR_CONFIG_STATUS_ADDR,
     108    MWMR_CONFIG_DEPTH,
     109    MWMR_CONFIG_BUFFER_ADDR,
     110    MWMR_CONFIG_LOCK_ADDR,
     111    MWMR_CONFIG_RUNNING,
     112    MWMR_CONFIG_WIDTH,
     113    MWMR_FIFO_FILL_STATUS,
     114};
     115
     116enum SoclibMwmrWay {
     117    MWMR_TO_COPROC,
     118    MWMR_FROM_COPROC,
     119};
     120
    101121#endif
    102122
  • soft/giet_vm/xml/mapping_info.h

    r189 r200  
    5050#define OUT_MAPPING_SIGNATURE   0xBABEF00D
    5151
    52 enum
     52enum vobjType
    5353{
    5454    VOBJ_TYPE_ELF     = 0,     // loadable code/data object of elf files
     
    6262};
    6363
    64 enum
     64enum psegType
    6565{
    6666    PSEG_TYPE_RAM     = 0,
     
    6969};
    7070
    71 enum
     71enum periphType
    7272{
    7373    PERIPH_TYPE_IOC   = 0,
     
    8080};
    8181
    82 enum
     82enum mwmrPortDirection
    8383{
    8484    PORT_TO_COPROC    = 0,          // status register
     
    214214{
    215215    char            name[32];       // coprocessor name
    216     unsigned int    psegid;         // pseg index in cluster
     216    unsigned int    psegid;         // global pseg index
    217217    unsigned int    ports;          // number of MWMR ports used by coprocessor
    218218    unsigned int    port_offset;    // index of first MWMR port used by coprocessor
  • soft/giet_vm/xml/xml_parser.c

    r189 r200  
    250250printf("      direction = %s\n", str);
    251251#endif
    252         if      ( strcmp(str, "TO_COPROC")   ) cp_port[cp_port_index]->direction = PORT_TO_COPROC;
    253         else if ( strcmp(str, "FROM_COPROC") ) cp_port[cp_port_index]->direction = PORT_FROM_COPROC;
     252        if      ( strcmp(str, "TO_COPROC")   ==  0 ) cp_port[cp_port_index]->direction = PORT_TO_COPROC;
     253        else if ( strcmp(str, "FROM_COPROC") ==  0 ) cp_port[cp_port_index]->direction = PORT_FROM_COPROC;
    254254        else
    255255        {
     
    18741874{
    18751875    unsigned int i;
     1876    //asign for all cp_ports the correct vspaceid and vobjid
    18761877    for(i=0; i< cp_port_index; i++)
    18771878    {
Note: See TracChangeset for help on using the changeset viewer.