Altera_Forum
Honored Contributor
15 years agoC2H doesnt seem to function
Hi all,
I have been battling now for several weeks on a getting a simple Algorithm to work using C2H. The function is below:
void HWIntFunc(unsignedint* InData, unsignedint* OutData)
{
int i,j,k;
unsignedint AvgVal =0;
for (i=0; i < 100; i++)
{
for (j=0;j<100;j++)
{
for (k=0;k <100; k++)
{
AvgVal += *InData;
InData += 1;
}
//Set Avg data as ImgData
*OutData = AvgVal / 100;
OutData += 1;
AvgVal = 0;
}
}
}
Now the function above works in a Software only version. I am using the NEEK and have a simple design based on the "altera_avalon_checksum_de" layout with the Checksum HW blocks removed. Now after extensive trial and error i can use the CLI to get the C2H makefiles etc then can build. Although this generally doesnt work completely. I always have to re-generate and re-compile from SOPC builder and Quartus (with some connecting for new C2H component) Then i can re-generate the BSP and build and run. However at this point it never seems to actually run. Any ideas i could chase? Is there an issue in the routine above? As stated in Software the routine works correctly suggesting its the C2H side that is failing. Cheers Tim