Hi,
I am new to Intel Altera.
I am trying to list the resource utilization for the nested functions.
Lets consider the following example:
int foo(int a) {
...
}
//Kernel function
void my_kernel_function( // Input and output matrices
__global int *axi,
// Widths of matrices.
int A_width)
{
int a;
a = foo(axi[0]);
....
}
When I generate the report after running the aoc compiler, I am not a getting detailed report containing utilization from "foo" function but, only from my_kernel function. I believe this is because of compiler inlining the functions.
How can make changes in the program to adapt and find the necessary resources for the same?
Link Copied
Hi,
May I have the full design code and I would like to compile at my side for further investigate?
Also, may I know the information as below:
Thanks
Hi,
My code is a test code not a real project more like a helloworld program for testing nested functions. I have attached the source code as a zip along with this post.
You can run the cl file after unzipping it with the following compiler options:
aoc -rtl -report -v -board=pac_s10_dc -fp-relaxed -fpc test_nesed_functions.cl
Thanks
What "report" are you looking at? The HTML report includes detailed line-by-line and block-by-block area utilization. There is no function call on FPGAs and all functions are inlined/flattened without exception; a function call does not represent anything meaningful in an FPGA kernel after synthesis.
Hi,
For the foo function with an empty body, the compiler will optimize it away and could not find the utilization for the foo function.
For the foo function without an empty body, the compiler will inline the function.
However, you should still see the area usage for that function in the reports. It will first point to the call in my_kernel_function and then foo function.
Thanks
For more complete information about compiler optimizations, see our Optimization Notice.