UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

ap_memory interface scheduling error

Highlighted
Observer
Posts: 44
Registered: ‎06-28-2016

ap_memory interface scheduling error

[ Edited ]

EDIT: added a simple code example.

 

I have a piece of code that is pipelined with II=3, and performs up to 3 accesses to a BRAM array:

#include <ap_int.h>
#include <hls_stream.h>

#define LENGTH 20

typedef ap_uint<LENGTH * 8> element;
typedef element memory[1 << 18];

size_t h(const element& tag) {
#pragma HLS inline off
#pragma HLS pipeline enable_flush ii=3
    std::size_t seed = 5381;
    for (int i = 0; i < LENGTH; ++i) {
#pragma HLS unroll
        seed = ((seed << 5) + seed) + tag(i * 8 + 7, i * 8);
    }

    return seed;
}

void top(hls::stream<element>& write_stream, const element& aread,
         hls::stream<bool> bool_stream, element *read, const element& awrite, memory m) {
#pragma HLS pipeline enable_flush ii=3
#pragma HLS interface ap_memory port=m
#pragma HLS resource core=RAM_1P variable=m latency=1
    if (write_stream.empty()) {
        m[h(awrite)] = write_stream.read();
    }

    if (bool_stream.empty())
        return;

    if (bool_stream.read())
        *read = m[h(aread)];
    else
        if (m[h(awrite)] == 1)
            m[h(awrite)] = 0;
}

Instead of II=3, I'm getting II=4 for the top function, and these errors:

WARNING: [SCHED 204-63] Unable to schedule the whole 2 cycles 'store' operation (top.cpp:27) of variable 'tmp.V', top.cpp:27 on array 'm_V' within the first 3 cycles (II = 3).
WARNING: [SCHED 204-63] Please consider increasing the target initiation interval of the pipeline.
WARNING: [SCHED 204-69] Unable to schedule 'load' operation ('m_V_load_1', top.cpp:36) on array 'm_V' due to limited memory ports.
WARNING: [SCHED 204-63] Unable to schedule the whole 2 cycles 'store' operation (top.cpp:27) of variable 'tmp.V', top.cpp:27 on array 'm_V' within the first 4 cycles (II = 4).
WARNING: [SCHED 204-63] Please consider increasing the target initiation interval of the pipeline.

 

Remove the calls to the hash function h(), or decreasing the LENGTH macro to 1 byte eliminates the warnings.

 

Any idea what can cause this kind of behavior?

Voyager
Posts: 314
Registered: ‎01-28-2014

Re: ap_memory interface scheduling error

You're going to have to show us some example code that demonstrates this behavior before anyone can assist. 

Observer
Posts: 44
Registered: ‎06-28-2016

Re: ap_memory interface scheduling error

Thanks. I tried creating a minimal example that I can post, but the error didn't show there. Anyway, I'll continue try to create an example.

Observer
Posts: 44
Registered: ‎06-28-2016

Re: ap_memory interface scheduling error

@jprice, I was finally able to create a minimal example. I've updated the post with it. Could you have a look?

 

Thanks,

Haggai