katang

How to implement an ordered queue?

4 posts in this topic

My task is to implement what in C++ would be an ordered queue. I.e. my consumer wants to "see" a FIFO, and several consumers put data independently (i.e in parallel) and the channel inserts the received data at the right position. My idea is to start with sc_fifo, and sc_semaphore to write contents. Then I need method for inserting the new content at the right position, with the goal to synthesize the design.  Is there a better idea to start with? What is the "best" approach to implement insertion, in terms of resource usage and speed?

Share this post


Link to post
Share on other sites

If your goal is to synthesize the design, then your first step should be to check what is synthesisable - are you using a particular high level synthesis tool? Have you checked this it will support sc_fifo and sc_semaphore?

If your tool supported std::map, couldn't you use use that?

regards

Alan

Share this post


Link to post
Share on other sites

Yes, I want to synthesize the design, and that is why I am looking for ideas for components which enable this.

To your second question: are there chances that standard components like sc_fifo and sc_semaphore are not supported? Till now this did not cross my mind.

 

Share this post


Link to post
Share on other sites
15 hours ago, katang said:

Yes, I want to synthesize the design, and that is why I am looking for ideas for components which enable this.

To your second question: are there chances that standard components like sc_fifo and sc_semaphore are not supported? Till now this did not cross my mind.

 

The only supported standard channel for synthesis in modern HLS tools is sc_signal. It is pretty low-level.  Unfortunately, other high-level communication components are vendor-specific.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now