Changeset 306 for soft


Ignore:
Timestamp:
Apr 21, 2014, 5:14:17 AM (10 years ago)
Author:
alain
Message:

Few modifications in XML format to support the PYTHON interface.

Location:
soft/giet_vm/giet_xml
Files:
3 edited

Legend:

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

    r295 r306  
    7979    VOBJ_TYPE_MEMSPACE = 9,  // Memspace (descriptor must be initialised)
    8080    VOBJ_TYPE_SCHED    = 10, // Array of schedulers (one per cluster)
    81     VOBJ_TYPE_BOOT     = 11, // loader by the preloader
    8281};
    8382
     
    149148    unsigned int y_io;               // y coordinate for cluster_io_ext
    150149    unsigned int irq_per_proc;       // number of IRQ per processor
    151     unsigned int use_ramdisk;        // does not use IOC peripheral if non zero
     150    unsigned int use_ram_disk;       // does not use IOC peripheral if non zero
    152151    unsigned int increment;          // vbase address increment (replicated peripherals)
    153152
  • soft/giet_vm/giet_xml/xml_driver.c

    r295 r306  
    254254    fprintf(fpout, "              y_width      = \"%d\"   \n" , header->y_width);
    255255    fprintf(fpout, "              irq_per_proc = \"%d\"   \n" , header->irq_per_proc);
    256     fprintf(fpout, "              use_ramdisk  = \"%d\"   \n" , header->use_ramdisk);
     256    fprintf(fpout, "              use_ram_disk = \"%d\"   \n" , header->use_ram_disk);
    257257    fprintf(fpout, "              x_io         = \"%d\"   \n" , header->x_io);
    258258    fprintf(fpout, "              y_io         = \"%d\" >\n\n", header->y_io);
     
    263263    for (cluster_id = 0; cluster_id < (header->x_size * header->y_size); cluster_id++)
    264264    {
    265         fprintf(fpout, "        <cluster x = \"%d\" y = \"%d\" >\n",
     265        fprintf(fpout, "        <cluster x=\"%d\" y=\"%d\" >\n",
    266266                cluster[cluster_id].x, cluster[cluster_id].y );
    267267
     
    272272             pseg_id++)
    273273        {
    274             fprintf(fpout, "            <pseg name = \"%s\" ", pseg[pseg_id].name);
    275             fprintf(fpout, "type = \"%s\" ", pseg_type[pseg[pseg_id].type]);
    276             fprintf(fpout, "base = \"0x%llx\" ", pseg[pseg_id].base);
    277             fprintf(fpout, "length = \"0x%llx\" />\n",  pseg[pseg_id].length);
     274            fprintf(fpout, "            <pseg name=\"%s\"", pseg[pseg_id].name);
     275            fprintf(fpout, " type=\"%s\"", pseg_type[pseg[pseg_id].type]);
     276            fprintf(fpout, " base=\"0x%llx\"", pseg[pseg_id].base);
     277            fprintf(fpout, " length=\"0x%llx\" />\n", pseg[pseg_id].length);
    278278        }
    279279
     
    285285             proc_id++, proc_index++)
    286286        {
    287             fprintf(fpout, "            <proc index = \"%d\" />\n", proc_index);
     287            fprintf(fpout, "            <proc index=\"%d\" />\n", proc_index);
    288288        }
    289289
     
    294294             coproc_id++)
    295295        {
    296             fprintf(fpout, "            <coproc name = \"%s\" ", coproc[coproc_id].name);
    297             fprintf(fpout, " psegname = \"%s\" >\n", pseg[coproc[coproc_id].psegid].name);
     296            fprintf(fpout, "            <coproc name=\"%s\"", coproc[coproc_id].name);
     297            fprintf(fpout, " psegname=\"%s\" >\n", pseg[coproc[coproc_id].psegid].name);
    298298            for (port_id = coproc[coproc_id].port_offset;
    299299                 port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports;
     
    301301            {
    302302                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]);
    304                 fprintf(fpout, " vspacename = \"%s\" ", vspace[cp_port[port_id].vspaceid].name);
    305                 fprintf(fpout, " vobjname = \"%s\" />\n",  vobj[vobj_id].name);
     303                fprintf(fpout, "             <port direction=\"%s\"",  port_direction[cp_port[port_id].direction]);
     304                fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name);
     305                fprintf(fpout, " vobjname=\"%s\" />\n",  vobj[vobj_id].name);
    306306            }
    307307            fprintf(fpout, "            </coproc>\n" );
     
    314314             periph_id++)
    315315        {
    316             fprintf(fpout, "            <periph type = \"%s\" ", periph_type[periph[periph_id].type]);
    317 
    318             if (periph[periph_id].subtype < PERIPH_SUBTYPE_MAX_VALUE)
    319                 fprintf(fpout, " subtype = \"%s\" ", ioc_subtype[periph[periph_id].subtype]);
    320 
    321             fprintf(fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name);
    322             fprintf(fpout, " channels = \"%d\" >\n",  periph[periph_id].channels);
    323             for (irq_id = periph[periph_id].irq_offset;
    324                  irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs;
    325                  irq_id++)
     316            fprintf(fpout, "            <periph type=\"%s\"", periph_type[periph[periph_id].type]);
     317
     318            if (periph[periph_id].type == PERIPH_TYPE_IOC)
     319                fprintf(fpout, " subtype=\"%s\"", ioc_subtype[periph[periph_id].subtype]);
     320
     321            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 )
    326324            {
    327                 fprintf(fpout, "                <irq srctype = \"%s\" ", irq_type[irq[irq_id].srctype]);
    328                 fprintf(fpout, " srcid = \"%d\" ", irq[irq_id].srcid);
    329                 fprintf(fpout, " isr = \"%s\" ", isr_type[irq[irq_id].isr]);
    330                 fprintf(fpout, " channel = \"%d\" ", irq[irq_id].channel);
    331                 fprintf(fpout, " dstx = \"%d\" ", irq[irq_id].dstx);
    332                 fprintf(fpout, " dsty = \"%d\" ", irq[irq_id].dsty);
    333                 fprintf(fpout, " dstid = \"%d\" />\n", irq[irq_id].dstid);
     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 ) )
     337            {
     338                for (irq_id = periph[periph_id].irq_offset;
     339                     irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs;
     340                     irq_id++)
     341                {
     342                    fprintf(fpout, "                <irq srctype=\"%s\"", irq_type[irq[irq_id].srctype]);
     343                    fprintf(fpout, " srcid=\"%d\"", irq[irq_id].srcid);
     344                    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);
     347                }
    334348            }
    335349            fprintf(fpout, "            </periph>\n");
     
    344358    for (vseg_id = 0; vseg_id < header->globals; vseg_id++)
    345359    {
    346         unsigned int pseg_id = vseg[vseg_id].psegid;
    347 
    348         fprintf(fpout, "        <vseg name = \"%s\" ", vseg[vseg_id].name);
    349         fprintf(fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase);
    350         fprintf(fpout, "mode  = \"%s\" ", mode_str[vseg[vseg_id].mode]);
    351         fprintf(fpout, "clusterid = \"%d\" ", pseg[pseg_id].clusterid);
    352         fprintf(fpout, "psegname = \"%s\" ", pseg[pseg_id].name);
    353         fprintf(fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident);
     360        unsigned int pseg_id    = vseg[vseg_id].psegid;
     361        unsigned int cluster_id = pseg[pseg_id].clusterid;
     362
     363        fprintf(fpout, "        <vseg name=\"%s\"", vseg[vseg_id].name);
     364        fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase);
     365        fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]);
     366        fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x);
     367        fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y);
     368        fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name);
     369        if( vseg[vseg_id].ident ) fprintf(fpout, " ident=\"1\"");
     370        fprintf(fpout, " >\n");
     371
    354372        for (vobj_id = vseg[vseg_id].vobj_offset;
    355373             vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs);
    356374             vobj_id++)
    357375        {
    358             fprintf(fpout, "            <vobj name = \"%s\" ", vobj[vobj_id].name);
    359             fprintf(fpout, "type = \"%s\" ", vobj_type[vobj[vobj_id].type]);
    360             fprintf(fpout, "length = \"0x%x\" ", vobj[vobj_id].length);
    361             fprintf(fpout, "align = \"%d\" ", vobj[vobj_id].align);
    362             fprintf(fpout, "init = \"%d\" ", vobj[vobj_id].init);
    363             fprintf(fpout, "binpath = \"%s\" />\n", vobj[vobj_id].binpath);
     376            fprintf(fpout, "            <vobj name=\"%s\"", vobj[vobj_id].name);
     377            fprintf(fpout, " type=\"%s\"", vobj_type[vobj[vobj_id].type]);
     378            fprintf(fpout, " length=\"0x%x\"", vobj[vobj_id].length);
     379            if( vobj[vobj_id].align )
     380                fprintf(fpout, " align=\"%d\"", vobj[vobj_id].align);
     381            if( vobj[vobj_id].binpath[0] != 0 )
     382                fprintf(fpout, " binpath=\"%s\"", vobj[vobj_id].binpath);
     383            if( (vobj[vobj_id].type == VOBJ_TYPE_BARRIER) ||
     384                (vobj[vobj_id].type == VOBJ_TYPE_MWMR   ) ||
     385                (vobj[vobj_id].type == VOBJ_TYPE_CONST  ) )
     386                fprintf(fpout, " init=\"%d\"", vobj[vobj_id].init);
     387            fprintf(fpout, " />\n");
    364388        }
    365389        fprintf(fpout, "        </vseg>\n");
     
    384408            unsigned int pseg_id    = vseg[vseg_id].psegid;
    385409            unsigned int cluster_id = pseg[pseg_id].clusterid;
    386             unsigned int x          = cluster_id >> header->y_width;
    387             unsigned int y          = cluster_id & ((1<<header->y_width)-1);
    388 
    389             fprintf(fpout, "            <vseg name = \"%s\" ", vseg[vseg_id].name);
    390             fprintf(fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase);
    391             fprintf(fpout, "mode = \"%s\" ", mode_str[vseg[vseg_id].mode]);
    392             fprintf(fpout, "x = \"%d\" ", x);
    393             fprintf(fpout, "y = \"%d\" ", y);
    394             fprintf(fpout, "psegname = \"%s\" ", pseg[pseg_id].name);
    395             fprintf(fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident);
     410
     411            fprintf(fpout, "            <vseg name=\"%s\"", vseg[vseg_id].name);
     412            fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase);
     413            fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]);
     414            fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x);
     415            fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y);
     416            fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name);
     417            if( vseg[vseg_id].ident ) fprintf(fpout, " ident=\"1\"");
     418            fprintf(fpout, " >\n");
    396419
    397420            for (vobj_id = vseg[vseg_id].vobj_offset;
     
    399422                 vobj_id++)
    400423            {
    401                 fprintf(fpout, "             <vobj name = \"%s\" ", vobj[vobj_id].name);
    402                 fprintf(fpout, "type = \"%s\" ", vobj_type[vobj[vobj_id].type]);
    403                 fprintf(fpout, "length = \"0x%x\" ", vobj[vobj_id].length);
    404                 fprintf(fpout, "align = \"%d\" ", vobj[vobj_id].align);
    405                 fprintf(fpout, "init = \"%d\" ", vobj[vobj_id].init);
    406                 fprintf(fpout, "binpath = \"%s\" />\n", vobj[vobj_id].binpath);
     424                fprintf(fpout, "             <vobj name=\"%s\"", vobj[vobj_id].name);
     425                fprintf(fpout, " type=\"%s\"", vobj_type[vobj[vobj_id].type]);
     426                fprintf(fpout, " length=\"0x%x\"", vobj[vobj_id].length);
     427                if( vobj[vobj_id].align )
     428                    fprintf(fpout, " align=\"%d\"", vobj[vobj_id].align);
     429                if( vobj[vobj_id].binpath[0] != 0 )
     430                    fprintf(fpout, " binpath=\"%s\"", vobj[vobj_id].binpath);
     431                if( (vobj[vobj_id].type == VOBJ_TYPE_BARRIER) ||
     432                    (vobj[vobj_id].type == VOBJ_TYPE_MWMR   ) ||
     433                    (vobj[vobj_id].type == VOBJ_TYPE_CONST  ) )
     434                    fprintf(fpout, " init=\"%d\"", vobj[vobj_id].init);
     435                fprintf(fpout, " />\n");
    407436            }
    408437            fprintf(fpout, "            </vseg>\n\n");
     
    418447            unsigned int heap_vobj_id = task[task_id].heap_vobjid + vspace[vspace_id].vobj_offset;
    419448            unsigned int cluster_id   = task[task_id].clusterid;
    420             unsigned int x            = cluster_id >> header->y_width;
    421             unsigned int y            = cluster_id & ((1<<header->y_width)-1);
    422 
    423             fprintf(fpout, "            <task name = \"%s\" ", task[task_id].name);
    424             fprintf(fpout, "x = \"%d\" ", x);
    425             fprintf(fpout, "y = \"%d\" ", y);
    426             fprintf(fpout, "proclocid = \"%d\" ", task[task_id].proclocid);
    427             fprintf(fpout, "stackname = \"%s\" ", vobj[stack_vobj_id].name);
     449
     450            fprintf(fpout, "            <task name=\"%s\"", task[task_id].name);
     451            fprintf(fpout, " trdid=\"%d\"", task[task_id].trdid);
     452            fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x);
     453            fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y);
     454            fprintf(fpout, " p=\"%d\"", task[task_id].proclocid);
     455            fprintf(fpout, " stackname=\"%s\"", vobj[stack_vobj_id].name);
    428456            if (heap_vobj_id != -1)
    429457            {
    430                 fprintf(fpout, "heapname = \"%s\" ", vobj[heap_vobj_id].name);
     458                fprintf(fpout, " heapname=\"%s\"", vobj[heap_vobj_id].name);
    431459            }
    432             fprintf(fpout, "startid = \"%d\" ", task[task_id].startid);
    433             fprintf(fpout, "usetty = \"%d\" ", task[task_id].use_tty);
    434             fprintf(fpout, "usenic = \"%d\" ", task[task_id].use_nic);
    435             fprintf(fpout, "usecma = \"%d\" ", task[task_id].use_cma);
    436             fprintf(fpout, "usetim = \"%d\" ", task[task_id].use_tim);
    437             fprintf(fpout, "usehba = \"%d\" />\n", task[task_id].use_hba);
     460            fprintf(fpout, " startid = \"%d\"", task[task_id].startid);
     461            if( task[task_id].use_tty ) fprintf(fpout, " usetty=\"1\"");
     462            if( task[task_id].use_nic ) fprintf(fpout, " usenic=\"1\"");
     463            if( task[task_id].use_cma ) fprintf(fpout, " usecma=\"1\"");
     464            if( task[task_id].use_tim ) fprintf(fpout, " usetim=\"1\"");
     465            if( task[task_id].use_hba ) fprintf(fpout, " usehba=\"1\"");
     466            fprintf(fpout, " />\n");
    438467        }
    439468        fprintf(fpout, "        </vspace>\n\n");
     
    445474
    446475/////////////////////////////////////
    447 int main(int argc, char * argv[]) {
    448     if (argc < 2) {
     476int main(int argc, char * argv[])
     477{
     478    if (argc < 2)
     479    {
    449480        printf("Usage: bin2xml <input_file_path> <output_file_path>\n");
    450481        return 1;
     
    454485
    455486    int fdin = open(argv[1], O_RDONLY);
    456     if (fdin < 0) {
     487    if (fdin < 0)
     488    {
    457489        perror("open");
    458490        exit(1);
     
    460492
    461493    FILE * fpout = fopen( argv[2], "w");
    462     if (fpout == NULL) {
     494    if (fpout == NULL)
     495    {
    463496        perror("open");
    464497        exit(1);
     
    467500    unsigned int length = read(fdin, bin, 0x40000);
    468501
    469     if (length <= 0) {
     502    if (length <= 0)
     503    {
    470504        perror("read");
    471505        exit(1);
    472506    }
    473507
    474     if (bin[0] == IN_MAPPING_SIGNATURE) {
     508    if (bin[0] == IN_MAPPING_SIGNATURE)
     509    {
    475510        buildXml((mapping_header_t *) bin, fpout);
    476511    }
    477     else {
     512    else
     513    {
    478514        printf("[ERROR] Wrong file format\n");
    479515        exit(1);
  • soft/giet_vm/giet_xml/xml_parser.c

    r299 r306  
    1 ///////////////////////////////////////////////////////////////////////////////////////
     1//////////////////////////////////////////////////////////////////////////////////////
    22// File     : xml_parser.c
    33// Date     : 14/04/2012
     
    124124unsigned int use_pic          = 0; // using PIC component
    125125unsigned int use_xcu          = 0; // using XCU (not ICU)
     126unsigned int use_fbf          = 0; // using Frame Buffer
    126127
    127128// These variables define the IOC peripheral subtype
     
    622623    }
    623624
    624     ////////// get proclocid attribute
    625     value = getIntValue(reader, "proclocid", &ok);
     625    ////////// get p attribute
     626    value = getIntValue(reader, "p", &ok);
    626627    if (ok)
    627628    {
     
    639640    else
    640641    {
    641         printf("[XML ERROR] illegal or missing <locprocid> attribute for task (%d,%d)\n",
     642        printf("[XML ERROR] illegal or missing <p> attribute for task (%d,%d)\n",
    642643                vspace_index, task_loc_index);
    643644        exit(1);
     
    805806    else if (ok && (strcmp(str, "MEMSPACE") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_MEMSPACE; }
    806807    else if (ok && (strcmp(str, "SCHED")    == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_SCHED;    }
    807     else if (ok && (strcmp(str, "BOOT")     == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_BOOT;    }
    808808    else
    809809    {
     
    850850    }
    851851
    852     ////////// get binpath attribute (optional : '\0' if missing)
     852    ////////// get binpath attribute (optional : "" if missing)
    853853    str = getStringValue(reader, "binpath", &ok);
    854854    if (ok)
     
    859859        strncpy(vobj[vobj_index]->binpath, str, 63);
    860860    } 
    861     else {
    862         vobj[vobj_index]->binpath[0] = '\0';
    863     }
    864 
    865     ////////// get init attribute (mandatory for mwmr and barrier)
     861    else
     862    {
     863        vobj[vobj_index]->binpath[0] = 0;
     864    }
     865
     866    ////////// get init attribute (optional, mandatory for mwmr and barrier)
    866867    value = getIntValue(reader, "init", &ok);
    867868    if (ok)
     
    915916    vseg[vseg_index] = (mapping_vseg_t *) malloc(sizeof(mapping_vseg_t));
    916917
    917     ////////// set vobj_offset attributes
     918    ////////// set vobj_offset attribute
    918919    vseg[vseg_index]->vobj_offset = vobj_index;
    919920
     
    10151016printf("      psegid      = %d\n", psegid);
    10161017#endif
    1017     if (index >= 0)
     1018    if (psegid >= 0)
    10181019    {
    10191020        vseg[vseg_index]->psegid = psegid;
     
    12111212    char * str;
    12121213
     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
    12131218    if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;
    12141219
     
    12231228
    12241229    irq[irq_index] = (mapping_irq_t *) malloc(sizeof(mapping_irq_t));
    1225 
    1226     ///////// get srctype attribute
    1227     str = getStringValue(reader, "srctype", &ok);
    1228     if (ok)
    1229     {
    1230 #if XML_PARSER_DEBUG
    1231 printf("        srctype = %s\n", str);
    1232 #endif
    1233         if      ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI;
    1234         else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI;
    1235         else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI;
    1236         else   
    1237         {
    1238             printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n",
    1239                     cluster_index, periph_loc_index);
    1240             exit(1);
    1241         }
    1242     }
    1243     else
    1244     {
    1245         printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n",
    1246                 cluster_index, periph_loc_index);
    1247         exit(1);
    1248     }
    12491230
    12501231    ///////// get srcid attribute
     
    12651246    else
    12661247    {
    1267         printf("[XML ERROR] missing IRQ <icuid> for periph %d in cluster %d\n",
     1248        printf("[XML ERROR] missing IRQ <srcid> for periph %d in cluster %d\n",
    12681249                cluster_index, periph_loc_index);
    12691250        exit(1);
    12701251    }
    12711252
    1272     ///////// get isr attribute
    1273     str = getStringValue(reader, "isr", &ok);
    1274     if (ok)
    1275     {
     1253    ///////// get srctype attribute ... if ICU or XCU
     1254    if ( is_icu )
     1255    {
     1256        str = getStringValue(reader, "srctype", &ok);
     1257        if (ok)
     1258        {
     1259#if XML_PARSER_DEBUG
     1260printf("        srctype = %s\n", str);
     1261#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",
     1275                   cluster_index, periph_loc_index);
     1276            exit(1);
     1277        }
     1278    }
     1279
     1280    ///////// get isr attribute ... if ICU or XCU
     1281    if ( is_icu )
     1282    {
     1283        str = getStringValue(reader, "isr", &ok);
     1284        if (ok)
     1285        {
    12761286#if XML_PARSER_DEBUG
    12771287printf("        isr     = %s\n", str);
    12781288#endif
    1279         if      (strcmp(str, "ISR_TICK"   ) == 0)  irq[irq_index]->isr = ISR_TICK;
    1280         else if (strcmp(str, "ISR_BDV"    ) == 0)  irq[irq_index]->isr = ISR_BDV;
    1281         else if (strcmp(str, "ISR_CMA"    ) == 0)  irq[irq_index]->isr = ISR_CMA;
    1282         else if (strcmp(str, "ISR_TTY_RX" ) == 0)  irq[irq_index]->isr = ISR_TTY_RX;
    1283         else if (strcmp(str, "ISR_TTY_TX" ) == 0)  irq[irq_index]->isr = ISR_TTY_TX;
    1284         else if (strcmp(str, "ISR_TIMER"  ) == 0)  irq[irq_index]->isr = ISR_TIMER;
    1285         else if (strcmp(str, "ISR_WAKUP"  ) == 0)  irq[irq_index]->isr = ISR_WAKUP;
    1286         else if (strcmp(str, "ISR_NIC_RX" ) == 0)  irq[irq_index]->isr = ISR_NIC_RX;
    1287         else if (strcmp(str, "ISR_NIC_TX" ) == 0)  irq[irq_index]->isr = ISR_NIC_TX;
    1288         else if (strcmp(str, "ISR_MMC"    ) == 0)  irq[irq_index]->isr = ISR_MMC;
    1289         else if (strcmp(str, "ISR_DEFAULT") == 0)  irq[irq_index]->isr = ISR_DEFAULT;
     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        } 
    12901307        else
    12911308        {
    1292             printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n",
    1293                     periph_loc_index, cluster_index );
     1309            printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",
     1310                    cluster_index, periph_loc_index);
    12941311            exit(1);
    12951312        }
    1296     } 
    1297     else
    1298     {
    1299         printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",
    1300                 cluster_index, periph_loc_index);
    1301         exit(1);
    13021313    }
    13031314
     
    13161327    }
    13171328
    1318     ///////// get dstx attribute
    1319     value = getIntValue(reader, "dstx", &ok);
    1320     if (ok)
    1321     {
     1329    ///////// get dstx attribute ... if PIC
     1330    if ( is_pic )
     1331    {
     1332        value = getIntValue(reader, "dstx", &ok);
     1333        if (ok)
     1334        {
    13221335#if XML_PARSER_DEBUG
    13231336printf("        dstx    = %d\n", value);
    13241337#endif
    13251338
    1326         if ( value < header->x_size )
    1327         {
    1328             irq[irq_index]->dstx = value;
    1329         }
    1330         else
    1331         {
    1332             printf("[XML ERROR] IRQ <dstx> too large for periph %d in cluster %d\n",
     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
     1365printf("        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",
    13331382                    cluster_index, periph_loc_index);
    13341383            exit(1);
    13351384        }
    1336     }
    1337     else
    1338     {
    1339         printf("[XML ERROR] missing IRQ <dstx> for periph %d in cluster %d\n",
    1340                 cluster_index, periph_loc_index);
    1341         exit(1);
    1342     }
    1343 
    1344     ///////// get dsty attribute
    1345     value = getIntValue(reader, "dsty", &ok);
    1346     if (ok)
    1347     {
    1348 #if XML_PARSER_DEBUG
    1349 printf("        dsty    = %d\n", value);
    1350 #endif
    1351 
    1352         if ( value < header->y_size )
    1353         {
    1354             irq[irq_index]->dsty = value;
    1355         }
    1356         else
    1357         {
    1358             printf("[XML ERROR] IRQ <dsty> too large for periph %d in cluster %d\n",
    1359                     cluster_index, periph_loc_index);
    1360             exit(1);
    1361         }
    1362     }
    1363     else
    1364     {
    1365         printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n",
    1366                 cluster_index, periph_loc_index);
    1367         exit(1);
    13681385    }
    13691386
     
    15751592        {
    15761593            periph[periph_index]->type = PERIPH_TYPE_FBF;
     1594            use_fbf = 1;
    15771595        }
    15781596        /////////////////////////////////
     
    15971615                periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV;
    15981616                ioc_channels = 1;
    1599                 if ( header->use_ramdisk == 0 ) use_bdv = 1;
     1617                if ( header->use_ram_disk == 0 ) use_bdv = 1;
    16001618            }
    16011619            else if ( strcmp(subtype, "HBA") == 0 )
     
    16041622                periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA;
    16051623                ioc_channels = periph[periph_index]->channels;
    1606                 if ( header->use_ramdisk == 0 ) use_hba = 1;
     1624                if ( header->use_ram_disk == 0 ) use_hba = 1;
    16071625            }
    16081626            else if ( strcmp(subtype, "SPI") == 0 )
     
    16111629                periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI;
    16121630                ioc_channels = periph[periph_index]->channels;
    1613                 if ( header->use_ramdisk == 0 ) use_spi = 1;
     1631                if ( header->use_ram_disk == 0 ) use_spi = 1;
    16141632            }
    16151633            else
     
    19241942    if (ok && (value != proc_loc_index))
    19251943    {
    1926         printf("[XML ERROR] wrong proc index / expected value is %d",
     1944        printf("[XML ERROR] wrong local proc index / expected value is %d",
    19271945                proc_loc_index);
    19281946        exit(1);
     
    21242142        {
    21252143            ///////// TIMER and ICU peripheral are mandatory when nprocs != 0
     2144
    21262145            unsigned int procs = cluster[cluster_index]->procs;
    21272146            if ( procs && !found_timer && !found_xcu)
     
    24392458    }
    24402459
    2441     ///////// get use_ramdisk attribute (default = 0)
    2442     value = getIntValue(reader, "use_ramdisk", &ok);
    2443     if (ok)
    2444     {
    2445 #if XML_PARSER_DEBUG
    2446         printf("  use_ramdisk = %d\n", value);
    2447 #endif
    2448         header->use_ramdisk = value;
    2449     }
    2450     else
    2451     {
    2452         header->use_ramdisk = 0;
     2460    ///////// get use_ram_disk attribute (default = 0)
     2461    value = getIntValue(reader, "use_ram_disk", &ok);
     2462    if (ok)
     2463    {
     2464#if XML_PARSER_DEBUG
     2465        printf("  use_ram_disk = %d\n", value);
     2466#endif
     2467        header->use_ram_disk = value;
     2468    }
     2469    else
     2470    {
     2471        header->use_ram_disk = 0;
    24532472    }
    24542473
     
    27072726    def_int_write(fdout, "USE_IOB           ", use_iob);
    27082727    def_int_write(fdout, "USE_PIC           ", use_pic);
     2728    def_int_write(fdout, "USE_FBF           ", use_fbf);
    27092729
    27102730    file_write(fdout, "\n");
    27112731
    2712     def_int_write(fdout, "USE_IOC_RDK       ", header->use_ramdisk);
     2732    def_int_write(fdout, "USE_IOC_RDK       ", header->use_ram_disk);
    27132733    def_int_write(fdout, "USE_IOC_HBA       ", use_hba);
    27142734    def_int_write(fdout, "USE_IOC_BDV       ", use_bdv);
Note: See TracChangeset for help on using the changeset viewer.