Forum Discussion
Altera_Forum
Honored Contributor
16 years agoWhat does the c2h do?
Does the c2h actually convert a C code ,supposed to run on NiosII, into a VHDL code? If not, is there a way it can be done?
Altera_Forum
Honored Contributor
16 years agoThat's correct, by default the function you accelerate will become blocking when called as to not break sequential code. There are pragmas you can add to the function to instruct the compiler to generate a non-blocking wrapper which you would then either implement polling or use an interrupt to let your application know when the accelerated function is complete.
What C2H does is generate a wrapper file that gets linked in, instead of the actual C code. This wrapper file optionally flushes the data cache, it writes the parameters of the function to the hardware accelerator, and by default polls the accelerator waiting for it to complete. Once the polling is done the wrapper exits and you continue running the application on the CPU.