Pipelines continue to execute as long as data is available at the input of the
pipeline. If there is no data available to process, the pipeline will stall. This is shown in
the following figure, where the input data valid
signal goes
low to indicate there is no more data. Once there is new data available to process, the
pipeline will continue operation.
In some cases, it is desirable to have a pipeline that can be “emptied” or
“flushed.” The flush
option is provided to perform this. When
a pipeline is “flushed” the pipeline stops reading new inputs when none are available (as
determined by a data valid
signal at the start of the
pipeline) but continues processing, shutting down each successive pipeline stage, until the
final input has been processed through to the output of the pipeline.
The default style of pipelining implemented by Vitis HLS is defined by the config_compile
-pipeline_style
command. You can specify stalling pipelines (stp), or free-running
flushing pipelines (frp) to be used throughout the design. You can also define a third type of
flushable pipeline (flp) with the PIPELINE pragma or directive, using the enable_flush
option. This option applies to the specific scope of
the pragma or directive only, and does not change the global default assigned by config_compile
.
Name | Stalled Pipeline (default) | Free-Running/ Flushable Pipeline | Flushable Pipeline |
---|---|---|---|
Global Setting |
config_compile -pipeline_style stp
(default) |
config_compile -pipeline_style frp
|
config_compile -pipeline_style
flp
|
Pragma/Directive |
#pragma HLS pipeline
style=stp
|
#pragma HLS pipeline
style=frp
|
#pragma HLS pipeline
style=flp
|
Advantages |
|
|
|
Disadvantages |
|
|
|
Use cases |
|
|
|