Ignore:
Timestamp:
Jul 21, 2012, 10:20:47 AM (12 years ago)
Author:
karaoui
Message:

+ Adding the init attribute to the mwmr to specify the width of the mwmr channel
+ Fixing bugs in kernels_init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/xml/xml_parser.c

    r174 r175  
    364364
    365365    //////// get type attribute
    366     str = getStringValue(reader, "type", &ok);
    367 #if XML_PARSER_DEBUG
    368 printf("        type = %s\n", str);
    369 #endif
    370     if (ok && (strcmp(str, "ELF") == 0))
     366    char *type_str = getStringValue(reader, "type", &ok);
     367#if XML_PARSER_DEBUG
     368printf("        type = %s\n", type_str);
     369#endif
     370    if (ok && (strcmp(type_str, "ELF") == 0))
    371371    {
    372372        vobj[vobj_index]->type = VOBJ_TYPE_ELF;
     
    380380        }
    381381    }
    382     else if (ok && (strcmp(str, "BLOB")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BLOB;
    383     else if (ok && (strcmp(str, "PTAB")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PTAB;
    384     else if (ok && (strcmp(str, "PERI")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PERI;
    385     else if (ok && (strcmp(str, "MWMR")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_MWMR;
    386     else if (ok && (strcmp(str, "LOCK")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_LOCK;
    387     else if (ok && (strcmp(str, "BUFFER")  == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BUFFER;
    388     else if (ok && (strcmp(str, "BARRIER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BARRIER;
     382    else if (ok && (strcmp(type_str, "BLOB")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BLOB;
     383    else if (ok && (strcmp(type_str, "PTAB")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PTAB;
     384    else if (ok && (strcmp(type_str, "PERI")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PERI;
     385    else if (ok && (strcmp(type_str, "MWMR")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_MWMR;
     386    else if (ok && (strcmp(type_str, "LOCK")    == 0)) vobj[vobj_index]->type = VOBJ_TYPE_LOCK;
     387    else if (ok && (strcmp(type_str, "BUFFER")  == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BUFFER;
     388    else if (ok && (strcmp(type_str, "BARRIER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BARRIER;
    389389    else
    390390    {
     
    438438    }
    439439   
    440     ////////// get init attribute (optional : 0 if missing)
     440    ////////// get init attribute (mandatory for mwmr and barrier)
    441441    value = getIntValue(reader,"init", &ok);
    442442    if ( ok )
     
    449449    else
    450450    {
    451         vobj[vobj_index]->init = 0;
     451        if(vobj[vobj_index]->type == VOBJ_TYPE_MWMR || vobj[vobj_index]->type == VOBJ_TYPE_BARRIER )
     452        {
     453            printf("[XML ERROR] illegal or missing <value> attribute for vobj (%d,%d), of type: %s\n",
     454                    vspace_index, vobj_loc_index, type_str);
     455            exit(1);
     456        }
     457        else
     458            vobj[vobj_index]->init = 0;
    452459    }
    453460
Note: See TracChangeset for help on using the changeset viewer.