OpenCores
URL https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [regressions/] [single_core/] [test_multihtread1.vp] - Blame information for rev 218

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 218 diegovalve
#define RESULT R66
2
 
3
 
4
//Turn on multithreading
5
 
6
 
7
 
8
//Main thread
9
 
10
//-------------------------------------------------------
11
function main()
12
{
13
        //Start the second thread
14
        //compiler does this CONTROL_REGISTER = 1;
15
        //Also set the thread data offset and code offset
16
        StartThread();
17
 
18
        vector a,b = (1,2,3),i,expected_result = (10,11,12);
19
 
20
        i = 0;
21
        while (i.xxx < 10)
22
        {
23
                a = b + i;
24
                i++;
25
        }
26
 
27
         if (a != expected_result)
28
         {
29
                 RESULT = 0xdead;
30
         } else {
31
                 RESULT = 0xaced;
32
         }
33
 
34
        exit ;
35
}
36
//-------------------------------------------------------
37
 
38
//-------------------------------------------------------
39
//Threads can not take input arguments
40
thread MyThread()
41
{
42
        vector a = (1,2,3),b,i,expected_result = (10,11,12);
43
        i = 0;
44
        while ( i.xxx < 10)
45
        {
46
                b = a + i;
47
                i++;
48
        }
49
        if (b != expected_result)
50
         {
51
                 r67 = 0xdead;
52
         } else {
53
                 r67 = 0xaced;
54
         }
55
}
56
//-------------------------------------------------------
57
function StartThread()
58
{
59
        start MyThread();
60
        return ;
61
}
62
//-------------------------------------------------------

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.