UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 54098

Vivado HLS 2012.4 : C Synthesis crashes due to inline function call: Global is external,​ but doesn't have external or dllimport

Description

Using Vivado 2012.4, C Synthesis crashes due to an inline function call:

@I [HLS-10] Checking synthesizability ...
Global is external, but doesn't have external or dllimport or weak linkage!


What can be done to resolve this?

 
An example of the code used is below:

void temp(ap_int<8> inout[2*2*100],
     bool sel)
{
    ap_int<8> buff[2*100];
    int i, j;
    if( sel == 0)
    {
        memcpy(&buff[0], &inout[0], sizeof(ap_int<8>) * 100);
        memcpy(&buff[100], &inout[100], sizeof(ap_int<8>) * 100);
    }
    else
    {
        memcpy(&buff[0], &inout[200], sizeof(ap_int<8>) * 100);
        memcpy(&buff[100], &inout[300], sizeof(ap_int<8>) * 100);
    }
    for(i = 0; i < 2; i++)
    {
        for(j = 0; j < 100; j++)
        {
            buff[i*100+j] += 5;
        }
    }
    if( sel == 0)
    {
        memcpy(&inout[200], &buff[0], sizeof(ap_int<8>) * 100);
        memcpy(&inout[300], &buff[100], sizeof(ap_int<8>) * 100);
    }
    else
    {
        memcpy(&inout[0], &buff[0], sizeof(ap_int<8>) * 100);
        memcpy(&inout[100], &buff[100], sizeof(ap_int<8>) * 100);
    }
}

 
void top(ap_int<8> inout[2*2*100],
    bool sel)
{
    ap_int<8> *ptrInOut = inout;

    temp(inout, sel);
}



Below is the error message received.

@I [HLS-10] Validating synthesis directives ...
@I [HLS-10] Checking synthesizability ...
Global is external, but doesn't have external or dllimport or weak linkage!
void ()* @temp20
invalid linkage type for function declaration
void ()* @temp20
Broken module found, compilation aborted!

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Solution

In 2012.4 , The function "top" calls the function "temp" which performs memory operations on the array provided as argument.

The error disappears if temp is set as the top module or if we avoid calling the function "temp" inside "top".

Resolution: This issue has been fixed in 2013.1

Workaround in 2012.4:

Use the directive set_directive_inline "temp" in directives.tcl file or use the pragma #pragma HLS INLINE
 

AR# 54098
Date Created 02/03/2013
Last Updated 07/10/2014
Status Active
Type Known Issues
Tools
  • Vivado Design Suite - 2012.4