Unsupported C Constructs(HLS可综合化 )
UG902 page326
虽然HLS支持大部分C语言原型,但是有部分还是不能支持,总的来说可综合化有下面几点要求:
To be synthesized:
• The C function must contain the entire functionality of the design.
• None of the functionality can be performed by system calls to the operating system.
不能系统调用操作系统
• The C constructs must be of a fixed or bounded size.
C的构造中必须是定长或者有边界的
• The implementation of those constructs must be unambiguous
必须是明确的构造
不支持以下操作
System Calls
不能在函数实现中调用系统函数,类似与printf、getc、time、等等,可以用宏 SYNTHESIS 来处理可综合与不可综合的代码。列入以下程序
include hier_func4.h
int sumsub_func(din_t *in1, din_t *in2, dint_t *outSum, dint_t *outSub)
{
*outSum = *in1 + *in2;
*outSub = *in1 - *in2;
}
int shift_func(dint_t *in1, dint_t *in2, dout_t *outA, dout_t *outB)
{
*outA = *in1 >> 1;
*outB = *in2 >> 2;
}
void hier_func4(din_t A, din_t B, dout_t *C, dout_t *D)
{
dint_t apb, amb;
sumsub_func(&A,&B,&apb,&amb);
#ifndef __SYNTHESIS__