Ignore:
Timestamp:
Mar 10, 2015, 3:17:57 PM (10 years ago)
Author:
alain
Message:

Simplification in the mapping_info.h file:
The coproc and cp_port objects have been removed,
because the coprocessors are now described as peripherals.

The xml parser and driver have been modified accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_xml/xml_driver.c

    r511 r522  
    2424    {
    2525        "ELF",        // binary code generated by GCC
    26         "BLOB",       // binary code generated by GCC
     26        "BLOB",       // binary
    2727        "PTAB",       // page table
    2828        "PERI",       // hardware component
     
    5252    };
    5353
    54     // mnemonics defined in irq_handler.h
     54    // These mnemonics must be consistent with values in
     55    // irq_handler.h / irq_handler.c / mapping.py
    5556    const char * isr_type[] =
    5657    {
     
    6869        "ISR_DMA",
    6970        "ISR_SPI",
    70     };
    71 
    72     // mnemonics defined in mapping_info.h
     71        "ISR_MWR",
     72    };
     73
     74    const char * mwr_subtype[] =
     75    {
     76        "GCD",
     77        "DCT",
     78    };
     79
    7380    const char * periph_type[] =
    7481    {
     
    96103        "SPI",
    97104        "NONE",
    98     };
    99 
    100     const char * port_direction[] =
    101     {
    102         "TO_COPROC",
    103         "FROM_COPROC",
    104105    };
    105106
     
    131132    unsigned int proc_id;
    132133    unsigned int irq_id;
    133     unsigned int coproc_id;
    134     unsigned int port_id;
    135134    unsigned int periph_id;
    136135
     
    142141    mapping_proc_t * proc;
    143142    mapping_irq_t * irq;   
    144     mapping_coproc_t * coproc;
    145     mapping_cp_port_t * cp_port;
    146143    mapping_periph_t * periph;
    147144
     
    195192            MAPPING_PROC_SIZE * header->procs);
    196193
    197     // computes the base address for coprocs array
    198     coproc = (mapping_coproc_t *) ((char *) header +
     194    // computes the base address for periphs array
     195    periph = (mapping_periph_t *) ((char *) header +
    199196            MAPPING_HEADER_SIZE +
    200197            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
     
    205202            MAPPING_PROC_SIZE * header->procs +
    206203            MAPPING_IRQ_SIZE * header->irqs);
    207 
    208     // computes the base address for cp_ports array
    209     cp_port = (mapping_cp_port_t *) ((char *) header +
    210             MAPPING_HEADER_SIZE +
    211             MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    212             MAPPING_PSEG_SIZE * header->psegs +
    213             MAPPING_VSPACE_SIZE * header->vspaces +
    214             MAPPING_VSEG_SIZE * header->vsegs +
    215             MAPPING_TASK_SIZE * header->tasks +
    216             MAPPING_PROC_SIZE * header->procs +
    217             MAPPING_IRQ_SIZE * header->irqs +
    218             MAPPING_COPROC_SIZE * header->coprocs);
    219 
    220     // computes the base address for periphs array
    221     periph = (mapping_periph_t *) ((char *) header +
    222             MAPPING_HEADER_SIZE +
    223             MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
    224             MAPPING_PSEG_SIZE * header->psegs +
    225             MAPPING_VSPACE_SIZE * header->vspaces +
    226             MAPPING_VSEG_SIZE * header->vsegs +
    227             MAPPING_TASK_SIZE * header->tasks +
    228             MAPPING_PROC_SIZE * header->procs +
    229             MAPPING_IRQ_SIZE * header->irqs +
    230             MAPPING_COPROC_SIZE * header->coprocs +
    231             MAPPING_CP_PORT_SIZE * header->cp_ports);
    232204
    233205    ///////////////////////// header /////////////////////////////////////////////
     
    276248        }
    277249
    278         ///////////////////// coprocessors ///////////////////////////////////////////
    279 
    280         for (coproc_id = cluster[cluster_id].coproc_offset;
    281              coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs;
    282              coproc_id++)
    283         {
    284             fprintf(fpout, "            <coproc name=\"%s\"", coproc[coproc_id].name);
    285             fprintf(fpout, " psegname=\"%s\" >\n", pseg[coproc[coproc_id].psegid].name);
    286             for (port_id = coproc[coproc_id].port_offset;
    287                  port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports;
    288                  port_id++)
    289             {
    290                 unsigned int vseg_id = cp_port[port_id].mwmr_vseg_id;
    291                 fprintf(fpout, "             <port direction=\"%s\"", port_direction[cp_port[port_id].direction]);
    292                 fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name);
    293                 fprintf(fpout, " vsegname=\"%s\" />\n",  vseg[vseg_id].name);
    294             }
    295             fprintf(fpout, "            </coproc>\n" );
    296         }
    297 
    298250        ///////////////////// periphs  ///////////////////////////////////////////////
    299251
     
    307259                fprintf(fpout, " subtype=\"%s\"", ioc_subtype[periph[periph_id].subtype]);
    308260
     261            if (periph[periph_id].type == PERIPH_TYPE_MWR)
     262                fprintf(fpout, " subtype=\"%s\"", mwr_subtype[periph[periph_id].subtype]);
     263
    309264            fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name);
    310265            fprintf(fpout, " channels=\"%d\"",  periph[periph_id].channels);
    311             fprintf(fpout, " arg=\"%d\" >\n",  periph[periph_id].arg);
     266            fprintf(fpout, " arg0=\"%d\" >\n",  periph[periph_id].arg0);
     267            fprintf(fpout, " arg1=\"%d\" >\n",  periph[periph_id].arg1);
     268            fprintf(fpout, " arg2=\"%d\" >\n",  periph[periph_id].arg2);
     269            fprintf(fpout, " arg3=\"%d\" >\n",  periph[periph_id].arg3);
    312270            if ( (periph[periph_id].type == PERIPH_TYPE_PIC) ||
    313271                 (periph[periph_id].type == PERIPH_TYPE_XCU) )
Note: See TracChangeset for help on using the changeset viewer.