I am trying to create an identifier for my methods. This identifier is important for my work as it is in fact hardware synthesis.
I have the following template class:
template <int FF_COUNT, int FB_COUNT, int NEXT_COUNT>
class Core{
public:
...
template<int id> void consume_fb_events (hls::stream<event> feedback_stream [FB_COUNT] [FB_COUNT], weight w_mem [128*128]);
}
template <int FF_COUNT, int FB_COUNT, int NEXT_COUNT>
template <int id>
void Core<FF_COUNT, FB_COUNT, NEXT_COUNT>::consume_fb_events (hls::stream<event> feedback_stream [FB_COUNT] [FB_COUNT], weight w_mem [128*128]){
#pragma HLS INLINE off
event e;
for(int i = 0 ; i < FB_COUNT ; i++) {
while (!feedback_stream[id][i].empty()) {
feedback_stream[id][i].read(e);
ap_uint<16> mem_offset = e << size_exp;
consume_event (e, mem_offset, w_mem);
}
}
}
and this is my function call
#define sth 8
for int i = 0 ; i < sth; i++
core[i].consume_fb_events<i>(....);
I get the compilation error:
ERROR: [HLS 200-70] Compilation errors found: In file included from c1/srnn.cpp:1:
c1/srnn.cpp:197:14: error: no matching member function for call to 'consume_fb_events'
core_1[i].consume_fb_events<i>(buffer_layer1_1, w1[i]);
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
c1/core.h:52:24: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'id'
template<int id> void consume_fb_events (hls::stream<event> feedback_stream [FB_COUNT] [FB_COUNT], weight w_mem [128*128]);
^