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_bitwise_operations.vp] - Rev 218

Compare with Previous | Blame | View Log



//-------------------------------------------------------------
function main()
{
        vector result, foo, bar, expected_result;
        foo = 0b10101010;
        bar = 0b1111;
        expected_result = 0b1010;

        //Test the AND  
        result = foo & bar;
        if (result != expected_result)
        { 
                R66 = 0xdead;
                exit ;
        } 

        foo = 0b1111;
        bar = 0b0000;
        result = foo & bar;
        if (result != 0 )
        {
                R66 = 0xdead;
                exit ;
        }

        //Test the OR
        result = foo | bar;
        expected_result = 0b1111;
        if (result != expected_result)
        {
                R66 = 0xdead;
                exit ;
        }

        vector goo;
        foo = 0xa;
        bar = 0x3;
        goo = 0xc;

        result = (foo & (foo | bar) | bar) & goo;
        expected_result = 8;
        if (result != expected_result)
        {
                R66 = 0xdead;
                exit ;
        }
        
        r66 = 0xaced;
        exit ;
}
//-------------------------------------------------------------

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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