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

Subversion Repositories theia_gpu

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 diegovalve
//This test will check the use of function parameters within functions
2
 
3
function main()
4
{
5
 
6
vector arg1 = (1,2,3), arg2 = (4,5,6), arg3 = (7,8,9), arg4 = (10,11,12);
7
 
8
//Call the function and provide the parameters
9
MyFunction1( arg1, arg2, arg3, arg4 );
10
 
11
 
12
R66 = 0xaced;
13
 
14
exit ;
15
}
16
 
17
//----------------------------------------------------
18
function MyFunction1(a,b,c,d)
19
{
20
//check to see if the paramters are what we expected
21
//fail otherwise
22
vector Expected_a = (1,2,3);
23
if (a.xyz != Expected_a.xyz )
24
{
25
        R66 = 0x01dead;
26
        exit ;
27
}
28
 
29
vector Expected_b = (4,5,6);
30
if (b.xyz != Expected_b.xyz )
31
{
32
        R66 = 0x02dead;
33
        exit ;
34
}
35
 
36
vector Expected_c = (7,8,9);
37
if (c.xyz != Expected_c.xyz )
38
{
39
        R66 = 0x03dead;
40
        exit ;
41
}
42
vector Expected_d = (10,11,12);
43
if (d.xyz != Expected_d.xyz )
44
{
45
        R66 = 0x04dead;
46
        exit ;
47
}
48
 
49
 
50
        return ;
51
}
52
//---------------------------------------------------

powered by: WebSVN 2.1.0

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