HLS错误记录(1)ERROR: [HLS 214-126] Parameter ‘led‘ is a C language arbitrary-precision integer type

在这里插入图片描述
官网解决方案:
在这里插入图片描述
在这里插入图片描述
建议都是用C++语言来进行HLS的开发

将代码换成C++语言风格后,此错误得到解决,

#include <ap_int.h>

#define DELAY 50000000

void led_twinkle(ap_int<2> *led){
    
    

	int i = 0;

	for(i = 0; i < DELAY; i++){
    
    
		if(i < DELAY/2)
			*led = 1;
		else
			*led = 2 ;
	}
}

原在C综合是报错的代码:

#include <ap_cint.h>

#define DELAY 50000000

void led_twinkle(uint2 *led){
    
    
#pragma HLS INTERFACE ap_none port=led
#pragma HLS INTERFACE ap_ctrl_none port=return
	int i = 0;

	for(i = 0; i < DELAY; i++){
    
    
		if(i < DELAY/2)
			*led = 1;
		else
			*led = 2 ;
	}
}

猜你喜欢

转载自blog.csdn.net/YSA_SFPSDPGY/article/details/132359716