doonny / PipeCNN

An OpenCL-based FPGA Accelerator for Convolutional Neural Networks
Apache License 2.0
1.22k stars 370 forks source link

RTL module compile error #67

Closed aazz44ss closed 6 years ago

aazz44ss commented 6 years ago

Is mult_add_fix8bx4 module takes 8 char type input and get an int type output? and is there any restriction to use this RTL module? like it only fit on PipeCNN? I have compiled PipeCNN correctly. and I try to use mult_add_fix8bx4 module is my code, the result in emulator is correct, however the compiler failed to compiled it.

error message=>

aoc -v --report --profile -I device/RTL -L device/RTL -l rtl_lib.aoclib -g device/CNN.cl -o CNN.aocx Resolving library filenames to full paths lib_path = device/RTL lib_file = rtl_lib.aoclib Resolved rtl_lib.aoclib to /home/CNN/device/RTL/rtl_lib.aoclib lib_path = . aoc: Environment checks are completed successfully. You are now compiling the full flow!! aoc: Selected default target board pac_a10 aoc: Running OpenCL parser.... aoc: OpenCL parser completed successfully. aoc: Compiling....

Error: Assert failure at EFIInfo.cpp(453) iowrPred == iordPred FAILED 0 libLLVM-3.0.so 0x00007f64b5b0246f 1 libLLVM-3.0.so 0x00007f64b5b043e2 2 libpthread.so.0 0x00007f64b476a5e0 3 libLLVM-3.0.so 0x00007f64b5970720 acl::efi::EFICallSite::EFICallSite(acl::ACLExternalIowrInst, acl::ACLExternalIordInst, int) + 2384 4 libLLVM-3.0.so 0x00007f64b5971e9c acl::efi::EFIInfo::runOnFunction(llvm::Function&) + 1004 5 libLLVM-3.0.so 0x00007f64b5d2449f llvm::FPPassManager::runOnFunction(llvm::Function&) + 527 6 libLLVM-3.0.so 0x00007f64b5d24600 llvm::FPPassManager::runOnModule(llvm::Module&) + 80 7 libLLVM-3.0.so 0x00007f64b5d23fc1 llvm::MPPassManager::runOnModule(llvm::Module&) + 577 8 libLLVM-3.0.so 0x00007f64b5d2416b llvm::PassManagerImpl::run(llvm::Module&) + 187 9 aocl-opt 0x000000000041956d main + 4781 10 libc.so.6 0x00007f64b3778c05 __libc_start_main + 245 11 aocl-opt 0x000000000040cd49 Stack dump:

  1. Program arguments: /root/intelFPGA_pro/17.0/hld/linux64/bin/aocl-opt --acle ....(a lot of random word........) -board /home/dcp_1.0_beta/opencl/opencl_bsp/hardware/pac_a10/board_spec.xml -libfile /home/CNN/device/RTL/rtl_lib.aoclib -profile -dbg-info-enabled --grif --soft-elementary-math=false --fas=false --wiicm-disable=true CNN.1.bc -o CNN.kwgid.bc
  2. Running pass 'Function Pass Manager' on module 'CNN.1.bc'.
  3. Running pass 'External Function Interfaces Analysis' on function '@convolution_channel' Error: Optimizer FAILED. Refer to CNN/CNN.log for details.

code: ` typedef struct{ DPTYPE ff[FILTER_PARALLEL]; } filter_parallel;

typedef struct{ filter_parallel kk[KERNEL_PARALLEL]; } kernel_parallel;

__kernel(){ kernel_parallel w_in; filter_parallel d_in;

pragma unroll

for(int j=0; j<KERNEL_PARALLEL; j++){

pragma unroll

for(int i=0; i<FILTER_PARALLEL/4; i++){
    result_buffer[j] += mult_add_fix8bx4(w_in.kk[j].ff[i*4],d_in.ff[i*4],w_in.kk[j].ff[i*4+1],d_in.ff[i*4+1],w_in.kk[j].ff[i*4+2],d_in.ff[i*4+2],w_in.kk[j].ff[i*4+3],d_in.ff[i*4+3]);
}

} } `