source: soft/giet_vm/display/main_cma.c @ 296

Last change on this file since 296 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.5 KB
Line 
1#include "stdio.h"
2#include "hard_config.h"
3
4#define NBLOCKS 32
5
6unsigned char buf0[128*128] __attribute__((aligned(512)));
7unsigned char buf1[128*128] __attribute__((aligned(512)));
8
9__attribute__((constructor)) void main(void)
10{
11    int             fd;
12    unsigned int    blocks_to_skip = 0;
13    unsigned int    procid         = giet_procid();
14    unsigned int    cluster_xy     = procid/NB_PROCS_MAX;
15    unsigned int    lpid           = procid%NB_PROCS_MAX;
16    unsigned int    x              = cluster_xy >> Y_WIDTH;
17    unsigned int    y              = cluster_xy & ((1<<Y_WIDTH)-1);
18
19    giet_tty_printf( "*** Starting task display on processor[%d,%d,%d] at cycle %d\n\n", 
20                      x, y, lpid, giet_proctime() );
21
22    //////////////////////////////////////////
23    fd = giet_fat_open( "misc/images.raw", 0 );
24    if ( fd < 0 )
25    {
26        giet_tty_printf("\n*** echec giet_fat_open for misc/images.raw at cycle %d\n", 
27                        giet_proctime() );
28        giet_exit();
29    }
30    else
31    {
32        giet_tty_printf("\ngiet_fat_open completed for misc/images.raw at cycle %d\n", 
33                        giet_proctime() );
34    }
35
36    ////////////////////////////////////////
37    giet_fb_cma_init( buf0, buf1, 128*128 );
38
39    giet_tty_printf("\ngiet_cma_init completed at cycle %d\n", 
40                        giet_proctime() );
41 
42    while ( blocks_to_skip < 10 * NBLOCKS )
43    {
44        ///////////////////////////////////////////////////
45        giet_fat_read( fd, buf0, NBLOCKS, blocks_to_skip );
46
47        giet_tty_printf("\ngiet_fat_read to buf0 completed at cycle = %d\n",
48                            giet_proctime() );
49
50        ///////////////////////
51        giet_fb_cma_write( 0 );
52
53        giet_tty_printf("giet_cma_write for buf0 completed at cycle = %d\n",
54                            giet_proctime() );
55
56        blocks_to_skip = blocks_to_skip + NBLOCKS;
57
58        ///////////////////////////////////////////////////
59        giet_fat_read( fd, buf1, NBLOCKS, blocks_to_skip );
60
61        giet_tty_printf("giet_fat_read to buf1 completed at cycle = %d\n",
62                            giet_proctime() );
63
64        ///////////////////////
65        giet_fb_cma_write( 1 );
66       
67        giet_tty_printf("giet_cma_write for buf1 completed at cycle = %d\n",
68                            giet_proctime() );
69
70        blocks_to_skip = blocks_to_skip + NBLOCKS;
71    }
72
73    ///////////////////
74    giet_fb_cma_stop();
75
76    giet_tty_printf("\n*** Task display exit at cycle %d ***\n", giet_proctime());
77
78    giet_exit();
79}
Note: See TracBrowser for help on using the repository browser.