03-09-2013 11:06 AM
Hi,
I don't get why i get this error when compiling my testbench.
../xtm640/xtm640_test.cpp: In function ‘int main()’: ../xtm640/xtm640_test.cpp:7: error: invalid conversion from ‘ap_ulong’ to ‘ap_uint<8>*’ ../xtm640/xtm640_test.cpp:7: error: initializing argument 1 of ‘void xtm640(ap_uint<8>*, ap_uint<8>*)’ ../xtm640/xtm640_test.cpp:7: error: invalid conversion from ‘ap_ulong’ to ‘ap_uint<8>*’ ../xtm640/xtm640_test.cpp:7: error: initializing argument 2 of ‘void xtm640(ap_uint<8>*, ap_uint<8>*)’
I only use one type, here is the code:
xtm640.cpp
#include "ap_int.h" void xtm640(ap_uint<8> * din,ap_uint<8> * dout){ #pragma HLS INTERFACE ap_fifo port=dout #pragma HLS INTERFACE ap_fifo port=din ap_uint<8> temp; while(1){ temp = (*din++); (*dout++) = temp; } }
xtm640_test.cpp
#include "ap_int.h" #include "xtm640.h" int main(){ ap_uint<8> din=20; ap_uint<8> dout; xtm640(din,dout); if(din==dout){ printf("OK"); } else { printf("NOT OK!"); } return 0; }
xtm640.h
#ifndef XTM640_H #define XTM640_H void xtm640(ap_uint<8> * din, ap_uint<8> * dout); #endif
Its a simple fifo loopback that i am going to place on the fifo from xillybus.
Thnx,
Matthias
03-20-2013 12:19 AM
You are passing two scalars to a function with pointer parameter.
The correct function call should be : xtm640( &din, &dout);
BTW, the "while(1)" statement in your design makes the C simulation never end.
xtm640(din,dout);