source: soft/giet_vm/display/main.c @ 295

Last change on this file since 295 was 295, checked in by alain, 10 years ago

Introducing a major release, to suppoort the tsar_generic_leti platform
and the various (external or internal) peripherals configurations.
The map.xml format has been modified, in order to support the new
vci_iopic componentand a new policy for peripherals initialisation.
The IRQs are nom described in the XICU and IOPIC components
(and not anymore in the processors).
To enforce this major change, the map.xml file signature changed:
The signature value must be: 0xDACE2014

This new release has been tested on the tsar_generic_leti platform
for the following mappings:

  • 4c_4p_sort_leti
  • 4c_4p_sort_leti_ext
  • 4c_4p_transpose_leti
  • 4c_4p_transpose_leti_ext
  • 4c_1p_four_leti_ext
File size: 2.3 KB
Line 
1#include "stdio.h"
2#include "hard_config.h"
3
4#define NBLOCKS 32   // (128 * 128) / 512
5
6unsigned char buf[128*128] __attribute__((aligned(512)));
7
8__attribute__((constructor)) void main()
9{ 
10    int             fd;
11    int             blocks;
12    unsigned int    ko;
13    unsigned int    blocks_to_skip = 8*NBLOCKS;
14
15    unsigned int    procid     = giet_procid();
16    unsigned int    cluster_xy = procid/NB_PROCS_MAX;
17    unsigned int    lpid       = procid%NB_PROCS_MAX;
18    unsigned int    x          = cluster_xy >> Y_WIDTH;
19    unsigned int    y          = cluster_xy & ((1<<Y_WIDTH)-1);
20
21    giet_tty_printf( "*** Starting task display on processor[%d,%d,%d] at cycle %d\n\n", 
22                      x, y, lpid, giet_proctime() );
23
24    ///////////////////////////////////////////
25    fd = giet_fat_open( "misc/images.raw", 0 );
26    if ( fd < 0 )
27    {
28        giet_tty_printf("\n*** echec giet_fat_open for misc/images.raw at cycle %d\n", 
29                        giet_proctime() );
30        giet_exit();
31    }
32    else
33    {
34        giet_tty_printf("\ngiet_fat_open completed for misc/images.raw at cycle %d\n", 
35                        giet_proctime() );
36    }
37
38    /////////////////////////////////////////
39    while ( blocks_to_skip < (10 * NBLOCKS) )
40    {
41        // lecture image sur le disque
42        blocks = giet_fat_read( fd, buf, NBLOCKS, blocks_to_skip );
43        if ( blocks != NBLOCKS )
44        {
45            giet_tty_printf("\n*** echec giet_fat_read at cycle %d\n", 
46                            giet_proctime() );
47            giet_exit();
48        }
49        else
50        {
51            giet_tty_printf("\ngiet_fat_read for image %d completed at cycle %d \n", 
52                            (blocks_to_skip>>5), giet_proctime());
53        }
54
55        // transfert vers le frame buffer 
56        ko = giet_fb_sync_write( 0, buf, 128 * 128 );
57        if ( ko )
58        {
59            giet_tty_printf("\n*** echec giet_fb_sync_write at cycle %d\n", 
60                            giet_proctime() );
61            giet_exit();
62        }
63        else
64        {
65            giet_tty_printf("\ndisplay completed for image %d at cycle %d \n", 
66                            (blocks_to_skip>>5), giet_proctime());
67        }
68
69        blocks_to_skip = blocks_to_skip + NBLOCKS;
70    }
71
72    giet_tty_printf("\n*** Tak display exit at cycle %d ***\n", giet_proctime());
73    giet_exit();
74}
Note: See TracBrowser for help on using the repository browser.