cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
blank
Visitor
Visitor
535 Views
Registered: ‎10-30-2020

How to Write a scheduler with HLS

Jump to solution

Hi there, 

I'm writing a block kind of like a scheduler which consumes data from axi stream and outputs data to another axi stream. 

The block contains multiple(say 32) workers to consume the input data while the workers feed the result to output axi stream.

The duration of workers' computation is variable, so I have to feed the input data to a worker which is idle.

How should I do this?  This can't be done with a for loop and unroll pragma

                /-> worker 0 \

input ==>|-> worker 1   | => output

                \-> worker 2 /

 

Thanks

 

0 Kudos
1 Solution

Accepted Solutions
u4223374
Advisor
Advisor
511 Views
Registered: ‎04-26-2015

I expect that the answer is simply "don't use HLS".

 

HLS is aiming to match the behaviour of a single-threaded C/C++ program. It may use parallelism to accelerate that, but fundamentally the behaviour is single-threaded. Obviously a single-threaded C/C++ program isn't going to have multiple workers running in parallel, which renders it unsuitable for this task. Even if it is possible to make it work, simulating it will be horrible (because the simulation is a single-threaded C/C++ program).

 

With that said - it feels like the scheduling and recombining should be trivially easy to do in any HDL. All it has to do is wait for data to be available in the stream, wait for at least one worker to be available, and then connect the data to the worker. If the work is complex, then write the worker in HLS and attach a bunch of those to the HDL block.

View solution in original post

2 Replies
u4223374
Advisor
Advisor
512 Views
Registered: ‎04-26-2015

I expect that the answer is simply "don't use HLS".

 

HLS is aiming to match the behaviour of a single-threaded C/C++ program. It may use parallelism to accelerate that, but fundamentally the behaviour is single-threaded. Obviously a single-threaded C/C++ program isn't going to have multiple workers running in parallel, which renders it unsuitable for this task. Even if it is possible to make it work, simulating it will be horrible (because the simulation is a single-threaded C/C++ program).

 

With that said - it feels like the scheduling and recombining should be trivially easy to do in any HDL. All it has to do is wait for data to be available in the stream, wait for at least one worker to be available, and then connect the data to the worker. If the work is complex, then write the worker in HLS and attach a bunch of those to the HDL block.

View solution in original post

blank
Visitor
Visitor
455 Views
Registered: ‎10-30-2020
Thank you! It's quite different from what I thought HLS is capable of.
0 Kudos