Changeset 323


Ignore:
Timestamp:
Jun 10, 2014, 1:31:01 PM (10 years ago)
Author:
alain
Message:

ntroducing several modifs in the mapping_info data structure
to comply with the genmap tool.

Location:
soft/giet_vm/giet_xml
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_xml/mapping_info.h

    r306 r323  
    124124    PERIPH_SUBTYPE_HBA       = 1,
    125125    PERIPH_SUBTYPE_SPI       = 2,
    126 
    127     PERIPH_SUBTYPE_MAX_VALUE = 3,
     126    PERIPH_SUBTYPE_NONE      = 3,
    128127};
    129128
     
    138137typedef struct __attribute__((packed))  mapping_header_s
    139138{
    140     unsigned int signature;          // must contain MAPPING_SIGNATURE
     139    unsigned int signature;          // must contain IN_MAPPING_SIGNATURE
    141140    unsigned int x_size;             // actual number of clusters in a row
    142141    unsigned int y_size;             // actual number of clusters in a column
    143142    unsigned int x_width;            // number of bits to encode x coordinate
    144143    unsigned int y_width;            // number of bits to encode y coordinate
    145     unsigned int globals;            // number of vsegs mapped in all vspaces
    146     unsigned int vspaces;            // number of virtual spaces
    147144    unsigned int x_io;               // x coordinate for cluster_io_ext
    148145    unsigned int y_io;               // y coordinate for cluster_io_ext
    149146    unsigned int irq_per_proc;       // number of IRQ per processor
    150147    unsigned int use_ram_disk;       // does not use IOC peripheral if non zero
    151     unsigned int increment;          // vbase address increment (replicated peripherals)
    152 
     148    unsigned int globals;            // total number of global vsegs
     149    unsigned int vspaces;            // total number of virtual spaces
    153150    unsigned int psegs;              // total number of physical segments (for all clusters)
    154151    unsigned int vsegs;              // total number of virtual segments (for all vspaces)
     
    172169
    173170    unsigned int    psegs;           // number of psegs in cluster
    174     unsigned int    pseg_offset;     // index of first pseg in pseg set
     171    unsigned int    pseg_offset;     // global index of first pseg in psegs set
    175172
    176173    unsigned int    procs;           // number of processors in cluster
    177     unsigned int    proc_offset;     // index of first proc in proc set
     174    unsigned int    proc_offset;     // global index of first proc in procs set
    178175 
    179176    unsigned int    coprocs;         // number of coprocessors in cluster
    180     unsigned int    coproc_offset;   // index of first coproc in coproc set
     177    unsigned int    coproc_offset;   // global index of first coproc in coprocs set
    181178
    182179    unsigned int    periphs;         // number of peripherals in cluster
    183     unsigned int    periph_offset;   // index of first coproc in coproc set
     180    unsigned int    periph_offset;   // global index of first coproc in periphs set
    184181} mapping_cluster_t;
    185182
     
    189186{
    190187    char            name[32];        // virtual space name
    191     unsigned int    start_offset;    // offset of the vobj containing start vector
     188    unsigned int    start_vobj_id;   // global index for vobj containing start vector
    192189    unsigned int    vsegs;           // number of vsegs in vspace
    193190    unsigned int    vobjs;           // number of vobjs in vspace
    194191    unsigned int    tasks;           // number of tasks in vspace
    195     unsigned int    vseg_offset;     // index of first vseg in vspace
    196     unsigned int    vobj_offset;     // index of first vobjs in vspace
    197     unsigned int    task_offset;     // index of first task in vspace
     192    unsigned int    vseg_offset;     // global index of first vseg in vspace
     193    unsigned int    vobj_offset;     // global index of first vobj in vspace
     194    unsigned int    task_offset;     // global index of first task in vspace
    198195} mapping_vspace_t;
    199196
     
    209206    unsigned int    mode;            // C-X-W-U flags
    210207    unsigned int    vobjs;           // number of vobjs in vseg
    211     unsigned int    vobj_offset;     // index of first vobj in vseg
     208    unsigned int    vobj_offset;     // global index of first vobj in vseg
    212209    unsigned int    next_vseg;       // linked list of vsegs mapped on pseg
    213210    char            mapped;          // mapped if non zero
     
    225222    paddr_t         length;          // size (bytes)
    226223    unsigned int    type;            // RAM / PERI
    227     unsigned int    clusterid;       // linear index in array of clusters
     224    unsigned int    clusterid;       // global index in clusters set
    228225    unsigned int    next_vseg;       // linked list of vsegs mapped on pseg
    229226} mapping_pseg_t;
     
    234231{
    235232    char            name[32];        // task name (unique in vspace)
    236     unsigned int    clusterid;       // linear index in array of clusters
     233    unsigned int    clusterid;       // global index in clusters set
    237234    unsigned int    proclocid;       // processor local index (inside cluster)
    238235    unsigned int    trdid;           // thread index in vspace
    239     unsigned int    stack_vobjid;    // stack vobj index in vspace
    240     unsigned int    heap_vobjid;     // heap vobj index in vspace
     236    unsigned int    stack_vobj_id;   // global index for vobj containing stack
     237    unsigned int    heap_vobj_id;    // global index for vobj containing heap
    241238    unsigned int    startid;         // index in start_vector
    242239    unsigned int    use_tty;         // TTY channel required (global)
     
    272269typedef struct __attribute__((packed))  mapping_coproc_s
    273270{
    274     char            name[32];        // coprocessor name
     271    char            name[32];        // coprocessor name (probablement inutile AG)
    275272    unsigned int    psegid;          // global pseg index
    276273    unsigned int    ports;           // number of MWMR ports used by coprocessor
    277     unsigned int    port_offset;     // index of first MWMR port used by coprocessor
     274    unsigned int    port_offset;     // global index of first MWMR port
    278275} mapping_coproc_t;
    279276
     
    283280{
    284281    unsigned int    direction;       // TO_COPROC == 0 / FROM_COPROC == 1
    285     unsigned int    vspaceid;        // index of the vspace containing the MWMR channel
    286     unsigned int    mwmr_vobjid;     // local index of the vobj containing the MWMR channel
     282    unsigned int    vspaceid;        // index of the vspace containing MWMR channel
     283    unsigned int    mwmr_vobj_id;    // global index of vobj containing MWMR channel
    287284} mapping_cp_port_t;
    288285
     
    295292    unsigned int    psegid;          // pseg index in cluster
    296293    unsigned int    channels;        // number of channels
    297     unsigned int    irqs;            // number of input IRQs (for ICU, XCU or PIC)
    298     unsigned int    irq_offset;      // index of first IRQ (can be HWI/PTI/WTI)
     294    unsigned int    arg;             // argument depending on peripheral type
     295    unsigned int    irqs;            // number of input IRQs (for XCU or PIC)
     296    unsigned int    irq_offset;      // index of first IRQ
    299297} mapping_periph_t;
    300298
     
    304302{
    305303    unsigned int    srctype;         // source IRQ type (HWI / WTI / PTI)
    306     unsigned int    srcid;           // source IRQ index (for ICU/PIC component)
     304    unsigned int    srcid;           // source IRQ index (for XCU/PIC component)
    307305    unsigned int    isr;             // ISR type (defined in irq_handler.h)
    308     unsigned int    channel;         // channel index (for multi-channels peripherals)
    309     unsigned int    dstx;            // x coordinate of destination cluster
    310     unsigned int    dsty;            // y coordinate of destination cluster
    311     unsigned int    dstid;           // destination IRQ index (can be PROC or ICU)
     306    unsigned int    channel;         // channel index (for multi-channels ISR)
     307    unsigned int    dest_xy;         // destination cluster (set by GIET_VM)
     308    unsigned int    dest_id;         // destination port (set by GIET_VM)
    312309} mapping_irq_t;
    313310
  • soft/giet_vm/giet_xml/xml_driver.c

    r306 r323  
    6565        "ISR_NIC_TX",
    6666        "ISR_CMA",
     67        "ISR_MMC",
     68        "ISR_DMA",
     69        "ISR_SPI",
    6770    };
    6871
     
    9295        "HBA",
    9396        "SPI",
     97        "NONE",
    9498    };
    9599
     
    300304                 port_id++)
    301305            {
    302                 unsigned int vobj_id = cp_port[port_id].mwmr_vobjid + vspace[cp_port[port_id].vspaceid].vobj_offset;
    303                 fprintf(fpout, "             <port direction=\"%s\"",  port_direction[cp_port[port_id].direction]);
     306                unsigned int vobj_id = cp_port[port_id].mwmr_vobj_id;
     307                fprintf(fpout, "             <port direction=\"%s\"", port_direction[cp_port[port_id].direction]);
    304308                fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name);
    305309                fprintf(fpout, " vobjname=\"%s\" />\n",  vobj[vobj_id].name);
     
    320324
    321325            fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name);
    322             fprintf(fpout, " channels=\"%d\" >\n",  periph[periph_id].channels);
    323             if ( periph[periph_id].type == PERIPH_TYPE_PIC )
    324             {
    325                 for (irq_id = periph[periph_id].irq_offset;
    326                      irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs;
    327                      irq_id++)
    328                 {
    329                     fprintf(fpout, "                <irq srcid=\"%d\" ", irq[irq_id].srcid);
    330                     fprintf(fpout, " dstx=\"%d\"", irq[irq_id].dstx);
    331                     fprintf(fpout, " dsty=\"%d\"", irq[irq_id].dsty);
    332                     fprintf(fpout, " dstid=\"%d\" />\n", irq[irq_id].dstid);
    333                 }
    334             }
    335             if ( (periph[periph_id].type == PERIPH_TYPE_XCU ) ||
    336                  (periph[periph_id].type == PERIPH_TYPE_ICU ) )
     326            fprintf(fpout, " channels=\"%d\"",  periph[periph_id].channels);
     327            fprintf(fpout, " arg=\"%d\" >\n",  periph[periph_id].arg);
     328            if ( (periph[periph_id].type == PERIPH_TYPE_PIC) ||
     329                 (periph[periph_id].type == PERIPH_TYPE_XCU) ||
     330                 (periph[periph_id].type == PERIPH_TYPE_ICU) )
    337331            {
    338332                for (irq_id = periph[periph_id].irq_offset;
     
    343337                    fprintf(fpout, " srcid=\"%d\"", irq[irq_id].srcid);
    344338                    fprintf(fpout, " isr=\"%s\"", isr_type[irq[irq_id].isr]);
    345                     fprintf(fpout, " channel=\"%d\"", irq[irq_id].channel);
    346                     fprintf(fpout, " dstid=\"%d\" />\n", irq[irq_id].dstid);
     339                    fprintf(fpout, " channel=\"%d\" />\n", irq[irq_id].channel);
    347340                }
    348341            }
     
    396389    for (vspace_id = 0; vspace_id < header->vspaces; vspace_id++)
    397390    {
    398         unsigned int func_id = vspace[vspace_id].vobj_offset + vspace[vspace_id].start_offset;
     391        unsigned int vobj_id = vspace[vspace_id].start_vobj_id;
    399392        fprintf(fpout, "        <vspace name = \"%s\" ", vspace[vspace_id].name);
    400         fprintf(fpout, " startname = \"%s\" >\n", vobj[func_id].name);
     393        fprintf(fpout, " startname = \"%s\" >\n", vobj[vobj_id].name);
    401394
    402395        //////////////////// vsegs //////////////////////////////////////////////
     
    444437             task_id++)
    445438        {
    446             unsigned int stack_vobj_id = task[task_id].stack_vobjid + vspace[vspace_id].vobj_offset;
    447             unsigned int heap_vobj_id = task[task_id].heap_vobjid + vspace[vspace_id].vobj_offset;
    448             unsigned int cluster_id   = task[task_id].clusterid;
     439            unsigned int stack_vobj_id = task[task_id].stack_vobj_id;
     440            unsigned int heap_vobj_id  = task[task_id].heap_vobj_id;
     441            unsigned int cluster_id    = task[task_id].clusterid;
    449442
    450443            fprintf(fpout, "            <task name=\"%s\"", task[task_id].name);
  • soft/giet_vm/giet_xml/xml_parser.c

    r306 r323  
    294294//
    295295// - For replicated peripherals the virtual base address must be:
    296 //   vbase = seg_type_base & 0XFF000000 + (cluster_xy * increment) & 0x00FF0000
     296//   vbase = seg_type_base & 0XFF000000 + (cluster_xy * 0x00010000) & 0x00FF0000
    297297//
    298298// - For non-replicated peripherals, the cluster index must be cluster_io.
     
    307307    unsigned int type;         // peripheral type
    308308
    309     unsigned int type_mask    = 0xFF000000;
    310     unsigned int cluster_mask = 0x00FF0000;
     309    unsigned int type_mask      = 0xFF000000;
     310    unsigned int cluster_mask   = 0x00FF0000;
     311    unsigned int vseg_increment = 0x00010000;
    311312
    312313#if XML_PARSER_DEBUG
     
    348349
    349350                        if( (vseg[vseg_id]->vbase & cluster_mask) !=
    350                             (header->increment * cluster_xy) )
     351                            (vseg_increment * cluster_xy) )
    351352                        {
    352353                            printf("[XML ERROR] All replicated peripherals "
     
    444445}
    445446
    446 ///////////////////////////////////////////////////////////////////////////////////
    447 int getVobjLocId(unsigned int vspace_id, char * vobj_name, unsigned int vspace_max)
     447////////////////////////////////////////////////////////////////////////////////
     448int getVobjId(unsigned int vspace_id, char * vobj_name, unsigned int vspace_max)
    448449{
    449450    unsigned int vobj_id;
     
    453454    for (vobj_id = vobj_min; vobj_id < vobj_max; vobj_id++)
    454455    {
    455         if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return (vobj_id - vobj_min);
     456        if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return vobj_id;
    456457    }
    457458    return -1;
     
    649650    if (ok)
    650651    {
    651         int index = getVobjLocId(vspace_index, str , vobj_loc_index);
     652        int index = getVobjId(vspace_index, str , vobj_loc_index);
    652653        if (index >= 0)
    653654        {
    654655#if XML_PARSER_DEBUG
    655656printf("      stackname = %s\n", str);
    656 printf("      stackid   = %d\n", index);
    657 #endif
    658             task[task_index]->stack_vobjid = index;
     657printf("      stack_id  = %d\n", index);
     658#endif
     659            task[task_index]->stack_vobj_id = index;
    659660        }
    660661        else
     
    676677    if (ok)
    677678    {
    678         int index = getVobjLocId(vspace_index, str, vobj_loc_index);
     679        int index = getVobjId(vspace_index, str, vobj_loc_index);
    679680        if (index >= 0)
    680681        {
    681682#if XML_PARSER_DEBUG
    682683printf("      heapname  = %s\n", str);
    683 printf("      heapid    = %d\n", index);
    684 #endif
    685             task[task_index]->heap_vobjid = index;
     684printf("      heap_id   = %d\n", index );
     685#endif
     686            task[task_index]->heap_vobj_id = index;
    686687        }
    687688        else
     
    694695    else
    695696    {
    696         task[task_index]->heap_vobjid = -1;
     697        task[task_index]->heap_vobj_id = -1;
    697698    }
    698699
     
    11291130    ////////// get startname attribute
    11301131    str = getStringValue(reader, "startname", &ok);
    1131     if (ok) {
     1132    if (ok)
     1133    {
    11321134        //used after parsing the vobjs
    11331135    }
     
    11621164
    11631165            // get index of the vobj containing the start vector
    1164             int index = getVobjLocId(vspace_index, str , vobj_loc_index);
     1166            int index = getVobjId(vspace_index, str , vobj_loc_index);
    11651167            if (index == -1)
    11661168            {
     
    11711173            else
    11721174            {
    1173                 vspace[vspace_index]->start_offset = index;
     1175                vspace[vspace_index]->start_vobj_id = index;
    11741176#if XML_PARSER_DEBUG
    11751177                printf("      startname = %s\n", str);
    1176                 printf("      startid   = %d\n", index);
     1178                printf("      start_id  = %d\n", index);
    11771179                printf("  end vspace %d\n\n", vspace_index);
    11781180#endif
    11791181            }
    11801182
    1181             // checking startid values for all tasks in vspace
     1183            // checking for all tasks that the startid
     1184            // is smaller than the number of tasks in vspace
    11821185            int task_id;
    11831186            int task_min = vspace[vspace_index]->task_offset;
    11841187            int task_max = task_min + vspace[vspace_index]->tasks;
    1185             for (task_id = task_min; task_id < task_max; task_id++) {
     1188            for (task_id = task_min; task_id < task_max; task_id++)
     1189            {
    11861190                if (task[task_id]->startid >= vspace[vspace_index]->tasks)
    11871191                {
     
    12121216    char * str;
    12131217
    1214     unsigned int is_pic = (periph[periph_index]->type == PERIPH_TYPE_PIC);
    1215     unsigned int is_icu = (periph[periph_index]->type == PERIPH_TYPE_ICU) ||
    1216                           (periph[periph_index]->type == PERIPH_TYPE_XCU);
    1217 
    12181218    if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;
    12191219
     
    12511251    }
    12521252
    1253     ///////// get srctype attribute ... if ICU or XCU
    1254     if ( is_icu )
    1255     {
    1256         str = getStringValue(reader, "srctype", &ok);
    1257         if (ok)
    1258         {
     1253    ///////// get srctype attribute
     1254    str = getStringValue(reader, "srctype", &ok);
     1255    if (ok)
     1256    {
    12591257#if XML_PARSER_DEBUG
    12601258printf("        srctype = %s\n", str);
    12611259#endif
    1262             if      ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI;
    1263             else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI;
    1264             else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI;
    1265             else   
    1266             {
    1267                 printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n",
    1268                        cluster_index, periph_loc_index);
    1269                 exit(1);
    1270             }
    1271         }
    1272         else
    1273         {
    1274             printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n",
     1260        if      ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI;
     1261        else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI;
     1262        else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI;
     1263        else   
     1264        {
     1265            printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n",
    12751266                   cluster_index, periph_loc_index);
    12761267            exit(1);
    12771268        }
    12781269    }
    1279 
    1280     ///////// get isr attribute ... if ICU or XCU
    1281     if ( is_icu )
    1282     {
    1283         str = getStringValue(reader, "isr", &ok);
    1284         if (ok)
    1285         {
     1270    else
     1271    {
     1272        printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n",
     1273               cluster_index, periph_loc_index);
     1274        exit(1);
     1275    }
     1276
     1277    ///////// get isr attribute
     1278    str = getStringValue(reader, "isr", &ok);
     1279    if (ok)
     1280    {
    12861281#if XML_PARSER_DEBUG
    12871282printf("        isr     = %s\n", str);
    12881283#endif
    1289             if      (strcmp(str, "ISR_TICK"   ) == 0)  irq[irq_index]->isr = ISR_TICK;
    1290             else if (strcmp(str, "ISR_BDV"    ) == 0)  irq[irq_index]->isr = ISR_BDV;
    1291             else if (strcmp(str, "ISR_CMA"    ) == 0)  irq[irq_index]->isr = ISR_CMA;
    1292             else if (strcmp(str, "ISR_TTY_RX" ) == 0)  irq[irq_index]->isr = ISR_TTY_RX;
    1293             else if (strcmp(str, "ISR_TTY_TX" ) == 0)  irq[irq_index]->isr = ISR_TTY_TX;
    1294             else if (strcmp(str, "ISR_TIMER"  ) == 0)  irq[irq_index]->isr = ISR_TIMER;
    1295             else if (strcmp(str, "ISR_WAKUP"  ) == 0)  irq[irq_index]->isr = ISR_WAKUP;
    1296             else if (strcmp(str, "ISR_NIC_RX" ) == 0)  irq[irq_index]->isr = ISR_NIC_RX;
    1297             else if (strcmp(str, "ISR_NIC_TX" ) == 0)  irq[irq_index]->isr = ISR_NIC_TX;
    1298             else if (strcmp(str, "ISR_MMC"    ) == 0)  irq[irq_index]->isr = ISR_MMC;
    1299             else if (strcmp(str, "ISR_DEFAULT") == 0)  irq[irq_index]->isr = ISR_DEFAULT;
    1300             else
    1301             {
    1302                 printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n",
    1303                        periph_loc_index, cluster_index );
    1304                 exit(1);
    1305             }
    1306         } 
     1284        if      (strcmp(str, "ISR_TICK"   ) == 0)  irq[irq_index]->isr = ISR_TICK;
     1285        else if (strcmp(str, "ISR_BDV"    ) == 0)  irq[irq_index]->isr = ISR_BDV;
     1286        else if (strcmp(str, "ISR_CMA"    ) == 0)  irq[irq_index]->isr = ISR_CMA;
     1287        else if (strcmp(str, "ISR_TTY_RX" ) == 0)  irq[irq_index]->isr = ISR_TTY_RX;
     1288        else if (strcmp(str, "ISR_TTY_TX" ) == 0)  irq[irq_index]->isr = ISR_TTY_TX;
     1289        else if (strcmp(str, "ISR_TIMER"  ) == 0)  irq[irq_index]->isr = ISR_TIMER;
     1290        else if (strcmp(str, "ISR_WAKUP"  ) == 0)  irq[irq_index]->isr = ISR_WAKUP;
     1291        else if (strcmp(str, "ISR_NIC_RX" ) == 0)  irq[irq_index]->isr = ISR_NIC_RX;
     1292        else if (strcmp(str, "ISR_NIC_TX" ) == 0)  irq[irq_index]->isr = ISR_NIC_TX;
     1293        else if (strcmp(str, "ISR_MMC"    ) == 0)  irq[irq_index]->isr = ISR_MMC;
     1294        else if (strcmp(str, "ISR_DMA"    ) == 0)  irq[irq_index]->isr = ISR_DMA;
     1295        else if (strcmp(str, "ISR_SPI"    ) == 0)  irq[irq_index]->isr = ISR_SPI;
     1296        else if (strcmp(str, "ISR_DEFAULT") == 0)  irq[irq_index]->isr = ISR_DEFAULT;
    13071297        else
    13081298        {
    1309             printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",
    1310                     cluster_index, periph_loc_index);
     1299            printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n",
     1300                   periph_loc_index, cluster_index );
    13111301            exit(1);
    13121302        }
     1303    } 
     1304    else
     1305    {
     1306        printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",
     1307                cluster_index, periph_loc_index);
     1308        exit(1);
    13131309    }
    13141310
     
    13251321    {
    13261322        irq[irq_index]->channel = 0;
    1327     }
    1328 
    1329     ///////// get dstx attribute ... if PIC
    1330     if ( is_pic )
    1331     {
    1332         value = getIntValue(reader, "dstx", &ok);
    1333         if (ok)
    1334         {
    1335 #if XML_PARSER_DEBUG
    1336 printf("        dstx    = %d\n", value);
    1337 #endif
    1338 
    1339             if ( value < header->x_size )
    1340             {
    1341                 irq[irq_index]->dstx = value;
    1342             }
    1343             else
    1344             {
    1345                 printf("[XML ERROR] IRQ <dstx> too large for periph %d in cluster %d\n",
    1346                        cluster_index, periph_loc_index);
    1347                 exit(1);
    1348             }
    1349         }
    1350         else
    1351         {
    1352             printf("[XML ERROR] missing IRQ <dstx> for periph %d in cluster %d\n",
    1353                    cluster_index, periph_loc_index);
    1354             exit(1);
    1355         }
    1356     }
    1357 
    1358     ///////// get dsty attribute ... if PIC
    1359     if ( is_pic )
    1360     {
    1361         value = getIntValue(reader, "dsty", &ok);
    1362         if (ok)
    1363         {
    1364 #if XML_PARSER_DEBUG
    1365 printf("        dsty    = %d\n", value);
    1366 #endif
    1367 
    1368             if ( value < header->y_size )
    1369             {
    1370                 irq[irq_index]->dsty = value;
    1371             }
    1372             else
    1373             {
    1374                 printf("[XML ERROR] IRQ <dsty> too large for periph %d in cluster %d\n",
    1375                        cluster_index, periph_loc_index);
    1376                 exit(1);
    1377             }
    1378         }
    1379         else
    1380         {
    1381             printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n",
    1382                     cluster_index, periph_loc_index);
    1383             exit(1);
    1384         }
    1385     }
    1386 
    1387     ///////// get dstid attribute
    1388     value = getIntValue(reader, "dstid", &ok);
    1389     if (ok)
    1390     {
    1391 #if XML_PARSER_DEBUG
    1392 printf("        dstid   = %d\n", value);
    1393 #endif
    1394         irq[irq_index]->dstid = value;
    1395         if (value >= 32)
    1396         {
    1397             printf("[XML ERROR] IRQ <dstid> too large for periph %d in cluster %d\n",
    1398                     cluster_index, periph_loc_index);
    1399             exit(1);
    1400         }
    1401     }
    1402     else
    1403     {
    1404         printf("[XML ERROR] missing IRQ <dstid> for periph %d in cluster %d\n",
    1405                 cluster_index, periph_loc_index);
    1406         exit(1);
    14071323    }
    14081324
     
    15351451    {
    15361452        periph[periph_index]->channels = 1;
     1453    }
     1454
     1455    ///////// get arg attribute (optionnal : 0 if missing)
     1456    value = getIntValue(reader, "arg", &ok);
     1457    if (ok)
     1458    {
     1459#if XML_PARSER_DEBUG
     1460printf("      arg         = %d\n", value);
     1461#endif
     1462        periph[periph_index]->arg = value;
     1463    }
     1464    else
     1465    {
     1466        periph[periph_index]->arg = 1;
    15371467    }
    15381468
     
    24732403
    24742404    ///////// set other header fields
    2475     header->increment = 0x10000;
    24762405    header->globals   = 0;
    24772406    header->vspaces   = 0;
     
    26192548
    26202549
    2621 ///////////////////////////////////////////////////////////////////////
    2622 // this function set the value the vobj_id fiels of all cp_ports
    2623 ///////////////////////////////////////////////////////////////////////
     2550///////////////////////////////////////////////////////////////////////////////////
     2551// this function set the values of vspace_id and vobj_id fields for all cp_ports
     2552///////////////////////////////////////////////////////////////////////////////////
    26242553void prepareBuild()
    26252554{
    26262555    unsigned int i;
    2627     //asign for all cp_ports the correct vspaceid and vobjid
    2628     for (i = 0; i < cp_port_index; i++) {
     2556   
     2557    for (i = 0; i < cp_port_index; i++)
     2558    {
    26292559        int vspace_id = getVspaceId(cp_port_vobj_ref[i]->vspace_name);
    2630         if (vspace_id < 0) {
     2560        if (vspace_id < 0)
     2561        {
    26312562            printf("[XML ERROR] illegal  <vspacename> for cp_port %d,\n", i);
    26322563            exit(1);
     
    26342565        cp_port[i]->vspaceid = vspace_id;
    26352566
    2636         int vobj_id = getVobjLocId(vspace_id, cp_port_vobj_ref[i]->vobj_name, vspace[vspace_id]->vobjs);
    2637         if (vobj_id >= 0) {
     2567        int vobj_id = getVobjId( vspace_id,
     2568                                 cp_port_vobj_ref[i]->vobj_name,
     2569                                 vspace[vspace_id]->vobjs );
     2570        if (vobj_id >= 0)
     2571        {
    26382572
    26392573#if XML_PARSER_DEBUG
     
    26432577            printf("      vobj_index   = %d\n", vobj_id);
    26442578#endif
    2645             cp_port[i]->mwmr_vobjid = vobj_id;
    2646 
    2647             assert((vobj[ vspace[vspace_id]->vobj_offset + vobj_id]->type == VOBJ_TYPE_MWMR)
    2648                     && "coproc ports have to refer to a vobj of type MWMR");
    2649         }
    2650         else {
    2651             printf("[XML ERROR] illegal  <vobjname> for cp_port %d,\n", i);
     2579            cp_port[i]->mwmr_vobj_id = vobj_id;
     2580
     2581            assert((vobj[vspace[vspace_id]->vobj_offset + vobj_id]->type == VOBJ_TYPE_MWMR)
     2582                    && "coproc ports must refer a vobj of type MWMR");
     2583        }
     2584        else
     2585        {
     2586            printf("[XML ERROR]  <vobjname> not found for cp_port %d,\n", i);
    26522587            exit(1);
    26532588        }
     
    29252860    file_write(fdout, "\n");
    29262861
    2927     ld_write(fdout, "vseg_cluster_increment  ",   header->increment);
     2862    ld_write(fdout, "vseg_cluster_increment  ",   0x00010000);
    29282863
    29292864    close(fdout);
Note: See TracChangeset for help on using the changeset viewer.