Changeset 627


Ignore:
Timestamp:
Jul 18, 2015, 2:48:16 PM (9 years ago)
Author:
alain
Message:

Add the "ltid" field in the mapping_task_t structure,
To support the giet_kill_application() and giet_exec_application() system calls.

Location:
soft/giet_vm/giet_xml
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_xml/Makefile

    r262 r627  
    33
    44bin2xml: xml_driver.c mapping_info.h
    5         gcc -Wall -I. -I../sys xml_driver.c -o bin2xml
     5        gcc -Wall -I. -I.. xml_driver.c -o bin2xml
    66
    7 xml2bin: xml_parser.c mapping_info.h
    8         gcc -Wall -I. -I../giet_kernel -I/usr/include/libxml2 xml_parser.c -o xml2bin -lxml2
     7xml2bin: xml_parser.c mapping_info.h 
     8        gcc -Wall -I. -I.. -I../giet_kernel -I/usr/include/libxml2 xml_parser.c -o xml2bin -lxml2
    99
    1010test:
  • soft/giet_vm/giet_xml/mapping_info.h

    r566 r627  
    229229    unsigned int    heap_vseg_id;    // global index for vseg containing heap
    230230    unsigned int    startid;         // index in start_vector
     231    unsigned int    ltid;            // task index in scheduler (dynamically defined)
    231232} mapping_task_t;
    232233
  • soft/giet_vm/giet_xml/xml_driver.c

    r567 r627  
    136136    mapping_vseg_t * vseg;
    137137    mapping_task_t * task;
    138     mapping_proc_t * proc;
    139138    mapping_irq_t * irq;   
    140139    mapping_periph_t * periph;
     
    169168            MAPPING_VSPACE_SIZE * header->vspaces +
    170169            MAPPING_VSEG_SIZE * header->vsegs);
    171 
    172     // computes the base address for procs array
    173     proc = (mapping_proc_t *) ((char *) header +
    174             MAPPING_HEADER_SIZE +
    175             MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    176             MAPPING_PSEG_SIZE * header->psegs +
    177             MAPPING_VSPACE_SIZE * header->vspaces +
    178             MAPPING_VSEG_SIZE * header->vsegs +
    179             MAPPING_TASK_SIZE * header->tasks);
    180170
    181171    // computes the base address for irqs array
     
    261251            fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name);
    262252            fprintf(fpout, " channels=\"%d\"",  periph[periph_id].channels);
    263             fprintf(fpout, " arg0=\"%d\" >\n",  periph[periph_id].arg0);
    264             fprintf(fpout, " arg1=\"%d\" >\n",  periph[periph_id].arg1);
    265             fprintf(fpout, " arg2=\"%d\" >\n",  periph[periph_id].arg2);
     253            fprintf(fpout, " arg0=\"%d\"",  periph[periph_id].arg0);
     254            fprintf(fpout, " arg1=\"%d\"",  periph[periph_id].arg1);
     255            fprintf(fpout, " arg2=\"%d\"",  periph[periph_id].arg2);
    266256            fprintf(fpout, " arg3=\"%d\" >\n",  periph[periph_id].arg3);
    267257            if ( (periph[periph_id].type == PERIPH_TYPE_PIC) ||
  • soft/giet_vm/giet_xml/xml_parser.c

    r567 r627  
    2626#include  <mapping_info.h>
    2727#include  <irq_handler.h>
     28#include  <giet_config.h>
    2829
    2930#define MAX_CLUSTERS   1024
     
    313314
    314315    ///////// get trdid attribute (optional)
    315     task[task_index]->trdid = getIntValue(reader, "trdid", &ok);
    316 #if XML_PARSER_DEBUG
    317 printf("      trdid     = %d\n", x);
    318 #endif
    319     if ( !ok )
    320     {
    321         task[task_index]->trdid = task_loc_index;
    322     } 
     316    value = getIntValue(reader, "trdid", &ok);
     317#if XML_PARSER_DEBUG
     318printf("      trdid     = %d\n", value );
     319#endif
     320    if ( ok ) task[task_index]->trdid = value;
     321    else      task[task_index]->trdid = task_loc_index;
    323322
    324323    ///////// get x coordinate
     
    996995    if (ok == 0)
    997996    {
    998         printf("[XML ERROR] illegal or missing <psegname> for coproc %d in cluster %d\n",
    999                 coproc_index, cluster_index);
     997        printf("[XML ERROR] illegal or missing <psegname> for periph %d in cluster %d\n",
     998                periph_index, cluster_index);
    1000999        exit(1);
    10011000    }
     
    12321231#endif
    12331232    if      (ok && (strcmp(str, "RAM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_RAM; }
    1234     else if (ok && (strcmp(str, "ROM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_ROM; }
    1235     else if (ok && (strcmp(str, "DROM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_ROM; }
    12361233    else if (ok && (strcmp(str, "PERI") == 0)) { pseg[pseg_index]->type = PSEG_TYPE_PERI; }
    12371234    else
     
    12951292    cluster[cluster_index]->psegs = 0;
    12961293    cluster[cluster_index]->procs = 0;
    1297     cluster[cluster_index]->coprocs = 0;
    12981294    cluster[cluster_index]->periphs = 0;
    12991295
    13001296    //initialise global variables
    13011297    proc_loc_index = 0;
    1302     coproc_loc_index = 0;
    13031298    periph_loc_index = 0;
    13041299
     
    13441339    cluster[cluster_index]->pseg_offset = pseg_index;
    13451340    cluster[cluster_index]->proc_offset = proc_index;
    1346     cluster[cluster_index]->coproc_offset = coproc_index;
    13471341    cluster[cluster_index]->periph_offset = periph_index;
    13481342
     
    13501344printf("    pseg_offset   = %d\n", pseg_index);
    13511345printf("    proc_offset   = %d\n", proc_index);
    1352 printf("    coproc_offset = %d\n", coproc_index);
    1353 printf("    periph_offset = %d\n", coproc_index);
    1354 #endif
    1355 
    1356     ////////// get psegs, procs, coprocs and periphs
     1346printf("    periph_offset = %d\n", periph_index);
     1347#endif
     1348
     1349    ////////// get psegs, procs, and periphs
    13571350    int status = xmlTextReaderRead(reader);
    13581351
     
    13631356        if      (strcmp(tag, "pseg")     == 0) psegNode(reader);
    13641357        else if (strcmp(tag, "proc")     == 0) procNode(reader);
    1365         else if (strcmp(tag, "coproc")   == 0) coprocNode(reader);
    13661358        else if (strcmp(tag, "periph")   == 0) periphNode(reader);
    13671359        else if (strcmp(tag, "#text")    == 0) { }
     
    13731365printf("    psegs   = %d\n", cluster[cluster_index]->psegs);
    13741366printf("    procs   = %d\n", cluster[cluster_index]->procs);
    1375 printf("    coprocs = %d\n", cluster[cluster_index]->coprocs);
    13761367printf("    periphs = %d\n", cluster[cluster_index]->periphs);
    13771368printf("    end cluster %d\n", cluster_index);
     
    14141405            printf("  end cluster set\n\n");
    14151406#endif
    1416             header->psegs = pseg_index;
    1417             header->procs = proc_index;
    1418             header->irqs = irq_index;
    1419             header->coprocs = coproc_index;
     1407            header->psegs   = pseg_index;
     1408            header->procs   = proc_index;
     1409            header->irqs    = irq_index;
    14201410            header->periphs = periph_index;
    14211411            return;
     
    16761666    header->procs     = 0;
    16771667    header->irqs      = 0;
    1678     header->coprocs   = 0;
    16791668    header->periphs   = 0;
    1680 
    16811669
    16821670    int status = xmlTextReaderRead(reader);
     
    17751763printf("procs     = %d\n", header->procs);
    17761764printf("irqs      = %d\n", header->irqs);
    1777 printf("coprocs   = %d\n", header->coprocs);
    17781765printf("periphs   = %d\n", header->periphs);
    17791766#endif
     
    18011788    //building irqs array
    18021789    BuildTable(fdout, "irq", irq_index, sizeof(mapping_irq_t), (char **) irq);
    1803     //building coprocs array
    1804     BuildTable(fdout, "coproc", coproc_index, sizeof(mapping_coproc_t), (char **) coproc);
    18051790    //building periphs array
    18061791    BuildTable(fdout, "periph", periph_index, sizeof(mapping_periph_t), (char **) periph);
Note: See TracChangeset for help on using the changeset viewer.