UIUC-ChenLab / scalehls

A scalable High-Level Synthesis framework on MLIR
Other
228 stars 47 forks source link

Error when creating temporary values within kernel functions #73

Open shanhx2000 opened 1 year ago

shanhx2000 commented 1 year ago

Dear developers,

As a beginner with HLS, I am trying to use ScaleHLS to optimize a large integer modular multiplication program. Unfortunately, I met some difficulties.

First, I found that ap_fixed library provided by Vitis cannot be used. ap_fixed library needs template in it, requiring to be C++ code. I kind of curious if there's a way to support taking in C++ code with ScaleHLS?

Second, I got "Stack dump" for llvm compiler when there are temporary array claimed within the kernel function. Here's an easy example that crashes. Do you have any comments about it?

`typedef float uint64_t; void multiply256(uint64_t a[NUM_INTS], uint64_t b[NUM_INTS], uint64_t result[NUM_INTS*2]) {

pragma scop

uint64_t temp[NUM_INTS * 2] = {0};
for (int i = 0; i < NUM_INTS*2; i++) {
    result[i] = temp[i];
}
#pragma endscop

}`

Thanks.