Changeset 309 for soft


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

Reducing the number of log messages in parallel mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_boot/boot.c

    r299 r309  
    3131//    - The structure of the various multi-threaded software applications:
    3232//      number of tasks, communication channels.
    33 //    - The mapping: placement of virtual objects (vobj) in the virtual segments (vseg),
     33//    - The mapping: grouping of virtual objects (vobj) in the virtual segments (vseg),
    3434//      placement of virtual segments (vseg) in the physical segments (pseg), placement
    3535//      of software tasks on the processors,
     
    857857
    858858#if BOOT_DEBUG_PT
    859 mapping_vseg_t* curr;
    860 mapping_pseg_t* pseg = _get_pseg_base(header);
    861 unsigned int    pseg_id;
     859mapping_vseg_t*    curr;
     860mapping_pseg_t*    pseg    = _get_pseg_base(header);
     861mapping_cluster_t* cluster = _get_cluster_base(header);
     862unsigned int       pseg_id;
    862863for( pseg_id = 0 ; pseg_id < header->psegs ; pseg_id++ )
    863864{
     865    unsigned int cluster_id = pseg[pseg_id].clusterid;
    864866    _puts("\n[BOOT DEBUG] ****** vsegs mapped on pseg ");
    865867    _puts( pseg[pseg_id].name );
    866     _putd( pseg[pseg_id].clusterid);
    867     _puts(" ******\n");
     868    _puts(" in cluster[");
     869    _putd( cluster[cluster_id].x );
     870    _puts(",");
     871    _putd( cluster[cluster_id].y );
     872    _puts("] ******\n");
    868873    for( curr = (mapping_vseg_t*)pseg[pseg_id].next_vseg ;
    869874         curr != 0 ;
     
    951956                case VOBJ_TYPE_MWMR:    // storage capacity is (vobj.length/4 - 5) words
    952957                {
     958#if BOOT_DEBUG_VOBJS
     959_puts("MWMR    : ");
     960_puts(vobj[vobj_id].name);
     961_puts(" / vaddr = ");
     962_putx(vobj[vobj_id].vaddr);
     963_puts(" / paddr = ");
     964_putl(vobj[vobj_id].paddr);
     965_puts(" / length = ");
     966_putx(vobj[vobj_id].length);
     967_puts("\n");
     968#endif
    953969                    mwmr_channel_t* mwmr = (mwmr_channel_t *) (vobj[vobj_id].vaddr);
    954970                    mwmr->ptw = 0;
     
    959975                    mwmr->lock = 0;
    960976#if BOOT_DEBUG_VOBJS
    961 _puts("MWMR    : ");
    962 _puts(vobj[vobj_id].name);
    963 _puts(" / depth = ");
     977_puts("          fifo depth = ");
    964978_putd(mwmr->depth);
    965979_puts(" / width = ");
     
    974988_puts("ELF     : ");
    975989_puts(vobj[vobj_id].name);
     990_puts(" / vaddr = ");
     991_putx(vobj[vobj_id].vaddr);
     992_puts(" / paddr = ");
     993_putl(vobj[vobj_id].paddr);
    976994_puts(" / length = ");
    977995_putx(vobj[vobj_id].length);
     
    9831001                {
    9841002#if BOOT_DEBUG_VOBJS
    985 _puts("BLOB     : ");
     1003_puts("BLOB    : ");
    9861004_puts(vobj[vobj_id].name);
     1005_puts(" / vaddr = ");
     1006_putx(vobj[vobj_id].vaddr);
     1007_puts(" / paddr = ");
     1008_putl(vobj[vobj_id].paddr);
    9871009_puts(" / length = ");
    9881010_putx(vobj[vobj_id].length);
     
    9931015                case VOBJ_TYPE_BARRIER:    // init is the number of participants
    9941016                {
     1017#if BOOT_DEBUG_VOBJS
     1018_puts("BARRIER : ");
     1019_puts(vobj[vobj_id].name);
     1020_puts(" / vaddr = ");
     1021_putx(vobj[vobj_id].vaddr);
     1022_puts(" / paddr = ");
     1023_putl(vobj[vobj_id].paddr);
     1024_puts(" / length = ");
     1025_putx(vobj[vobj_id].length);
     1026_puts("\n");
     1027#endif
    9951028                    giet_barrier_t* barrier = (giet_barrier_t *) (vobj[vobj_id].vaddr);
    9961029                    barrier->count = vobj[vobj_id].init;
    9971030                    barrier->init = vobj[vobj_id].init;
    9981031#if BOOT_DEBUG_VOBJS
    999 _puts("BARRIER : ");
    1000 _puts(vobj[vobj_id].name);
    1001 _puts(" / init_value = ");
     1032_puts("          init_value = ");
    10021033_putd(barrier->init);
    10031034_puts("\n");
     
    10071038                case VOBJ_TYPE_LOCK:    // init value is "not taken"
    10081039                {
    1009                     unsigned int* lock = (unsigned int *) (vobj[vobj_id].vaddr);
    1010                     *lock = 0;
    10111040#if BOOT_DEBUG_VOBJS
    10121041_puts("LOCK    : ");
    10131042_puts(vobj[vobj_id].name);
    1014 _puts("\n");
    1015 #endif
    1016                     break;
    1017                 }
    1018                 case VOBJ_TYPE_BUFFER:    // nothing to initialise
    1019                 {
    1020 #if BOOT_DEBUG_VOBJS
    1021 _puts("BUFFER  : ");
    1022 _puts(vobj[vobj_id].name);
     1043_puts(" / vaddr = ");
     1044_putx(vobj[vobj_id].vaddr);
    10231045_puts(" / paddr = ");
    10241046_putl(vobj[vobj_id].paddr);
     
    10271049_puts("\n");
    10281050#endif
     1051                    unsigned int* lock = (unsigned int *) (vobj[vobj_id].vaddr);
     1052                    *lock = 0;
    10291053                    break;
    10301054                }
     1055                case VOBJ_TYPE_BUFFER:    // nothing to initialise
     1056                {
     1057#if BOOT_DEBUG_VOBJS
     1058_puts("BUFFER  : ");
     1059_puts(vobj[vobj_id].name);
     1060_puts(" / vaddr = ");
     1061_putx(vobj[vobj_id].vaddr);
     1062_puts(" / paddr = ");
     1063_putl(vobj[vobj_id].paddr);
     1064_puts(" / length = ");
     1065_putx(vobj[vobj_id].length);
     1066_puts("\n");
     1067#endif
     1068                    break;
     1069                }
    10311070                case VOBJ_TYPE_MEMSPACE:
    10321071                {
    1033                     giet_memspace_t* memspace = (giet_memspace_t *) vobj[vobj_id].vaddr;
    1034                     memspace->buffer = (void *) vobj[vobj_id].vaddr + 8;
    1035                     memspace->size = vobj[vobj_id].length - 8;
    10361072#if BOOT_DEBUG_VOBJS
    10371073_puts("MEMSPACE  : ");
     
    10391075_puts(" / vaddr = ");
    10401076_putx(vobj[vobj_id].vaddr);
     1077_puts(" / paddr = ");
     1078_putl(vobj[vobj_id].paddr);
    10411079_puts(" / length = ");
    10421080_putx(vobj[vobj_id].length);
    1043 _puts(" / buffer = ");
     1081_puts("\n");
     1082#endif
     1083                    giet_memspace_t* memspace = (giet_memspace_t *) vobj[vobj_id].vaddr;
     1084                    memspace->buffer = (void *) vobj[vobj_id].vaddr + 8;
     1085                    memspace->size = vobj[vobj_id].length - 8;
     1086#if BOOT_DEBUG_VOBJS
     1087_puts("          buffer vbase = ");
    10441088_putx((unsigned int)memspace->buffer);
    10451089_puts(" / size = ");
     
    10511095                case VOBJ_TYPE_PTAB:    // nothing to initialize
    10521096                {
    1053                     ptab_found = 1;
    10541097#if BOOT_DEBUG_VOBJS
    10551098_puts("PTAB    : ");
    10561099_puts(vobj[vobj_id].name);
     1100_puts(" / vaddr = ");
     1101_putx(vobj[vobj_id].vaddr);
     1102_puts(" / paddr = ");
     1103_putl(vobj[vobj_id].paddr);
    10571104_puts(" / length = ");
    10581105_putx(vobj[vobj_id].length);
    10591106_puts("\n");
    10601107#endif
     1108                    ptab_found = 1;
    10611109                    break;
    10621110                }
    10631111                case VOBJ_TYPE_CONST:
    10641112                {
    1065                     unsigned int* addr = (unsigned int *) vobj[vobj_id].vaddr;
    1066                     *addr = vobj[vobj_id].init;
    10671113#if BOOT_DEBUG_VOBJS
    10681114_puts("CONST   : ");
    10691115_puts(vobj[vobj_id].name);
    1070 _puts(" / Paddr :");
     1116_puts(" / vaddr = ");
     1117_putx(vobj[vobj_id].vaddr);
     1118_puts(" / paddr = ");
    10711119_putl(vobj[vobj_id].paddr);
     1120_puts(" / length = ");
     1121_putx(vobj[vobj_id].length);
    10721122_puts(" / init = ");
     1123_putx(vobj[vobj_id].init);
     1124_puts("\n");
     1125#endif
     1126                    unsigned int* addr = (unsigned int *) vobj[vobj_id].vaddr;
     1127                    *addr = vobj[vobj_id].init;
     1128
     1129#if BOOT_DEBUG_VOBJS
     1130_puts("          init = ");
    10731131_putx(*addr);
    10741132_puts("\n");
     
    12131271        if ( cluster[cluster_id].procs > 0 )
    12141272        {
    1215             // get scheduler array virtual base address and length
     1273            // get scheduler array virtual base address and length from mapping
    12161274            unsigned int        sched_vbase;   // schedulers segment virtual base address
    12171275            unsigned int        sched_length;  // schedulers segment length
     
    13031361
    13041362           
    1305             // loop on irqs for actual HWI / PTI / WTI vectors initialisation     
     1363            // loop on irqs in ICU for actual HWI / PTI / WTI vectors initialisation     
    13061364            for ( irq_id = periph[periph_id].irq_offset ;
    13071365                  irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs ;
     
    13091367            {
    13101368                unsigned int lpid    = irq[irq_id].dstid;
    1311                 unsigned int dstx    = irq[irq_id].dstx;
    1312                 unsigned int dsty    = irq[irq_id].dsty;
    1313                 if ( (dstx != x) || (dsty != y) )
    1314                 {
    1315                     _puts("\n[BOOT ERROR] Bad IRQ cluster coordinates in cluster[");
    1316                     _putd( x );
    1317                     _puts(",");
    1318                     _putd( y );
    1319                     _puts("]\n - dstx  = ");
    1320                     _putd( dstx );
    1321                     _puts("\n - dsty  = ");
    1322                     _putd( dsty );
    1323                     _puts("\n - x     = ");
    1324                     _putd( x );
    1325                     _puts("\n - y     = ");
    1326                     _putd( y );
    1327                     _puts("\n");
    1328                     _exit();
    1329                 }
    13301369                if ( lpid >= cluster[cluster_id].procs )
    13311370                {
     
    13921431_puts(" in vspace ");
    13931432_puts( vspace[vspace_id].name );
    1394 _puts(" running on cluster[");
    1395 _putd( x );
    1396 _puts(",");
    1397 _putd( y );
    1398 _puts("]\n");
     1433_puts("\n");
    13991434#endif
    14001435            // compute gpid (global processor index) and scheduler base address
     
    15621597_putd( task_id );
    15631598_puts(" allocated to processor[");
    1564 _putd( x )
     1599_putd( x );
    15651600_puts(",");
    1566 _putd( y )
     1601_putd( y );
    15671602_puts(",");
    1568 _putd( lpid )
     1603_putd( lpid );
    15691604_puts("]\n  - ctx[LTID]   = ");
    15701605_putd( psched->context[ltid][CTX_LTID_ID] );
     
    19702005                    }
    19712006#if BOOT_DEBUG_PERI
    1972 _puts("- IOC / channels = ");
     2007_puts("- IOC : channels = ");
    19732008_putd(channels);
    19742009_puts("\n");
     
    19832018                    }
    19842019#if BOOT_DEBUG_PERI
    1985 _puts("- CMA / channels = ");
     2020_puts("- CMA : channels = ");
    19862021_putd(channels);
    19872022_puts("\n");
     
    19962031                    }
    19972032#if BOOT_DEBUG_PERI
    1998 _puts("- NIC / channels = ");
     2033_puts("- NIC : channels = ");
    19992034_putd(channels);
    20002035_puts("\n");
     
    20062041                    // nothing to do
    20072042#if BOOT_DEBUG_PERI
    2008 _puts("- TTY / channels = ");
     2043_puts("- TTY : channels = ");
    20092044_putd(channels);
    20102045_puts("\n");
     
    20182053
    20192054#if BOOT_DEBUG_PERI
    2020 _puts("- IOB / channels = ");
     2055_puts("- IOB : channels = ");
    20212056_putd(channels);
    20222057_puts(" / XICU_BASE = ");
     
    20332068                        // TODO
    20342069                        // get the iommu page table physical address
    2035                         // define IPI address mapping the IOC interrupt
    20362070                        // set IOMMU page table address
    20372071                        // pseg_base[IOB_IOMMU_PTPR] = ptab_pbase;   
     
    20452079                         
    20462080#if BOOT_DEBUG_PERI
    2047 _puts("- PIC / channels = ");
     2081_puts("- PIC : channels = ");
    20482082_putd(channels);
    2049 _puts("\n");
    2050 #endif
    2051                     // scan all HWI IRQs defined in mapping for PIC component,
     2083_puts(" at cycle ");
     2084_putd(_get_proctime());
     2085_puts("\n");
     2086#endif
     2087                    // scan all IRQs defined in mapping for PIC component,
    20522088                    // and initialises addresses for WTI IRQs
    20532089                    for ( channel_id = periph[periph_id].irq_offset ;
     
    20552091                          channel_id++ )
    20562092                    {
    2057                         unsigned int hwi_id  = irq[channel_id].srcid;  // HWI index in PIC
    2058                         unsigned int wti_id  = irq[channel_id].dstid;  // WTI index in XCU
    2059                         unsigned int x       = irq[channel_id].dstx;   // XCU X coordinate
    2060                         unsigned int y       = irq[channel_id].dsty;   // XCU Y coordinate
    2061                         unsigned int cluster = (x<<Y_WIDTH) + y;       // XCU cluster
     2093                        unsigned int hwi_id     = irq[channel_id].srcid;  // HWI index in PIC
     2094                        unsigned int wti_id     = irq[channel_id].dstid;  // WTI index in XCU
     2095                        unsigned int x          = irq[channel_id].dstx;   // XCU X coordinate
     2096                        unsigned int y          = irq[channel_id].dsty;   // XCU Y coordinate
     2097                        unsigned int cluster_xy = (x<<Y_WIDTH) + y;       // XCU cluster
    20622098                        unsigned int vaddr;
    20632099
    20642100                        _xcu_get_wti_address( wti_id, &vaddr );
    20652101
    2066                         _pic_init( hwi_id, vaddr, cluster );
     2102                        _pic_init( hwi_id, vaddr, cluster_xy );
    20672103#if BOOT_DEBUG_PERI
    20682104_puts("    hwi_index = ");
Note: See TracChangeset for help on using the changeset viewer.