Ignore:
Timestamp:
Dec 4, 2013, 7:48:04 PM (11 years ago)
Author:
alain
Message:

This is a major release, including a deep restructuration of code.
The main evolutions are

  • use of the Tsar preloader to load the GIET boot-loader from disk
  • introduction of a FAT32 file system library,
  • use of this fat32 library by the boot-loader to load the map.bin data structure, and the various .elf files
  • reorganisation of drivers (one file per peripheral).
  • introduction of drivers for new peripherals: vci_chbuf_dma and vci_multi_ahci.
  • introduction of a new physical memory allocator in the boot code.

This release has been tested on the tsar_generic_iob architecture,
for the two following mappings: 4c_1p_iob_four.xml and 4c_1p_iob_sort.xml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/display/main.c

    r254 r258  
    11#include <stdio.h>
    22
    3 #define NBLOCKS 32   // number of blocks per image (128 * 128) / 512
     3#define NBLOCKS 32   // (128 * 128) / 512
    44
    5 unsigned char buf0[128*128] __attribute__((aligned(64)));
    6 unsigned char buf1[128*128] __attribute__((aligned(64)));
     5unsigned char buf[128*128] __attribute__((aligned(512)));
    76
    8 __attribute__((constructor)) int main(void)
    9 {
    10     unsigned int  x;
    11     unsigned int  base = 0;
     7__attribute__((constructor)) void main()
     8
     9    int           fd;
     10    int           blocks;
     11    unsigned int  ko;
     12    unsigned int  blocks_to_skip = 8*NBLOCKS;
    1213
    13     /* initialise CDMA transfert (double buffer) */
     14    giet_tty_printf("\nStarting task DISPLAY on processor %d at cycle %d\n",
     15                    giet_procid(), giet_proctime() );
    1416
    15     giet_tty_printf( "*** Starting task DISPLAY_CMA on processor %d at cycle %d\n",
    16                      giet_procid(), giet_proctime() );
    17     giet_tty_printf( "  - buf0 address (LSB) = %x\n", (unsigned int)buf0 );
    18     giet_tty_printf( "  - buf1 address (LSB) = %x\n", (unsigned int)buf1 );
     17    ///////////////////////////////////////////
     18    fd = giet_fat_open( "misc/images.raw", 0 );
     19    if ( fd < 0 )
     20    {
     21        giet_tty_printf("\n*** echec giet_fat_open for misc/images.raw at cycle %d\n",
     22                        giet_proctime() );
     23        giet_exit();
     24    }
     25    else
     26    {
     27        giet_tty_printf("\ngiet_fat_open completed for misc/images.raw at cycle %d\n",
     28                        giet_proctime() );
     29    }
    1930
    20     x = giet_fb_cma_init( buf0,       // buf0 base address
    21                           buf1,       // buf1 base address
    22                           128*128 );  // buffer size (bytes)
    23     giet_assert( (x==0), "echec giet_fb_cdma_init" );
     31    /////////////////////////////////////////
     32    while ( blocks_to_skip < (10 * NBLOCKS) )
     33    {
     34        // lecture image sur le disque
     35        blocks = giet_fat_read( fd, buf, NBLOCKS, blocks_to_skip );
     36        if ( blocks != NBLOCKS )
     37        {
     38            giet_tty_printf("\n*** echec giet_fat_read at cycle %d\n",
     39                            giet_proctime() );
     40            giet_exit();
     41        }
     42        else
     43        {
     44            giet_tty_printf("\ngiet_fat_read for image %d completed at cycle %d \n",
     45                            (blocks_to_skip>>5), giet_proctime());
     46        }
    2447
    25     while (base < 10 * NBLOCKS)
    26     {
    27         /* Phase 1 : transfer one image from disk to buf0 and display  */
     48        // transfert vers le frame buffer 
     49        ko = giet_fb_sync_write( 0, buf, 128 * 128 );
     50        if ( ko )
     51        {
     52            giet_tty_printf("\n*** echec giet_fb_sync_write at cycle %d\n",
     53                            giet_proctime() );
     54            giet_exit();
     55        }
     56        else
     57        {
     58            giet_tty_printf("\ndisplay completed for image %d at cycle %d \n",
     59                            (blocks_to_skip>>5), giet_proctime());
     60        }
    2861
    29         giet_tty_printf( "\n *** image %d *** at date = %d \n",
    30                          (base/NBLOCKS), giet_proctime() );
     62        blocks_to_skip = blocks_to_skip + NBLOCKS;
     63    }
    3164
    32         x = giet_ioc_read( base,            // lba on disk
    33                            buf0,            // user buffer address
    34                            NBLOCKS );       // number of blocks
    35         giet_assert( (x==0) , "echec giet_ioc_read for buf0" );
    36 
    37         x = giet_ioc_completed();
    38         giet_assert( (x==0) , "echec giet_ioc_completed for buf0" );
    39 
    40         giet_tty_printf( "ioc_read buf0 completed at date = %d \n", giet_proctime() );
    41 
    42         x = giet_fb_cma_write( 0 );         // buf0
    43         giet_assert( (x==0) , "echec giet_fb_cma_write for buf0" );
    44        
    45         base = base + NBLOCKS;
    46 
    47         /* Phase 2 : transfer one image from disk to buf1 and display  */
    48 
    49         giet_tty_printf( "\n *** image %d *** at date = %d \n",
    50                          (base/NBLOCKS), giet_proctime() );
    51 
    52         x = giet_ioc_read( base,            // lba on disk
    53                            buf1,            // user buffer address
    54                            NBLOCKS );       // number of locks
    55         giet_assert( (x==0) , "echec giet_ioc_read for buf1");
    56 
    57         x = giet_ioc_completed();
    58         giet_assert( (x==0) , "echec giet_ioc_completed for buf1");
    59 
    60         giet_tty_printf( "ioc_read buf1 completed at date = %d \n", giet_proctime() );
    61 
    62         x = giet_fb_cma_write( 1 );         // buf1
    63         giet_assert( (x==0) , "echec giet_fb_cma_write for buf1" );
    64        
    65         base = base + NBLOCKS;
    66     } // end while
    67 
    68     giet_fb_cma_stop();
     65    giet_tty_printf("\n*** Tak display exit at cycle %d ***\n", giet_proctime());
    6966    giet_exit();
    70     return 0;
    7167}
Note: See TracChangeset for help on using the changeset viewer.