cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
milan_mian
Explorer
Explorer
10,404 Views
Registered: ‎11-21-2014

Port has no fanin or fanout and is left dangling.

Hi. I have simple code in C++. But on C synthesis, I get error:

 

Port has no fanin or fanout and is left dangling.

Please use C simulation to confirm this function argument can be read from or written to.

 

On C Simulation, there is no problem.

My code is :

 

Test.cpp

 

#include "top.h"
int main (int argc, char** argv) {

    test(10, 30);
    return 0;
}

 

Top.cpp

 

void test(int a, int b)
{
    loop:for(int i = 1; i < 101; i++)
    {
        b = (a + 10) * 95;
    }

}

 

Top.h

 

void test(int a, int b);

 

I am very confused where it went wrong.

0 Kudos
3 Replies
vijayak
Xilinx Employee
Xilinx Employee
10,396 Views
Registered: ‎10-24-2013

Hi,
Did you check this thread where similar issue is discussed?
http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/why-Port-has-no-fanin-or-fanout-and-is-left-dangling/td-p/492536
Thanks,Vijay
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
milan_mian
Explorer
Explorer
10,376 Views
Registered: ‎11-21-2014

hi. I did checked the link you posted before posting my question. As you can see in my code, there are no arbitrary data types I have used.
0 Kudos
ywu
Xilinx Employee
Xilinx Employee
10,310 Views
Registered: ‎11-28-2007

Your c code doesn't have output as b is not passed as a pointer or passed by reference.

 

When you write testbench, make sure you add some checking for expected results. If you did that, you would see that you C code wouldn't pass functional C simulation.

 


@milan_mian wrote:

Hi. I have simple code in C++. But on C synthesis, I get error:

 

Port has no fanin or fanout and is left dangling.

Please use C simulation to confirm this function argument can be read from or written to.

 

On C Simulation, there is no problem.

My code is :

 

Test.cpp

 

#include "top.h"
int main (int argc, char** argv) {

    test(10, 30);
    return 0;
}

 

Top.cpp

 

void test(int a, int b)
{
    loop:for(int i = 1; i < 101; i++)
    {
        b = (a + 10) * 95;
    }

}

 

Top.h

 

void test(int a, int b);

 

I am very confused where it went wrong.


 

Cheers,
Jim
0 Kudos