Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

C2H questions, need help

Hi!

i've tried to implement an example to evaluate C2H. i've accelerated a function

named testalg. c2h compiles it, in the sopc builder everything is fine, the quartus flow doesn't report any errors, nor the C2H Register build log at Nios II IDE says anything. it looks everything fine, but

the result is always -1

here's the whole code

# include <stdio.h>

int testalg(int a, int b )

{

return a*a + b*b;

}

int main()

{

int sum = 0;

printf("sum before = %d\n",sum);

sum = testalg(5,5);

printf("sum after = %d\n",sum);

printf("should be 50\n");

return 0;

}

P.S. can i avoid the c2h compiler to restart the whole quartus flow, when i just

change something in the software project, and not in the acceleration function?

Thanks 4 reading

and it would be good, if someone can help me out

greetz Andreas

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi!

    i&#39;ve solved the problem.

    just in case someone else has the same problem in the future.

    the problem was, that i was not sure if the c2h compiler, which starts the flow, also downloads the sof file.

    and i also didn&#39;t recognise that i have to download the time limited sof file and not the standard sof file (i just have an evaluation license at the moment)

    so far

    merry xmas

    Andreas