pragma HLS protocol
Description
ThePROTOCOL
pragma specifies a region of the code to be a protocol region, in which no clock operations are inserted by Vivado HLS unless explicitly specified in the code. A protocol region can be used to manually specify an interface protocol to ensure the final design can be connected to other hardware blocks with the same I/O protocol.
Vivado HLS does not insert any clocks between the operations, including those that read from, or write to, function arguments, unless explicitly specified in the code. The order of read and writes are therefore obeyed in the RTL.
A clock operation may be specified:
- In C by using an
ap_wait()
statement (includeap_utils.h
). - In C++ and SystemC designs by using the
wait()
statement (includesystemc.h
).
Theap_wait
andwait
statements have no effect on the simulation of C and C++ designs respectively. They are only interpreted by Vivado HLS.
To create a region of C code:
- Enclose the region in braces,{},
- Optionally name it to provide an identifier.
For example, the following defines a region calledio_section
:
io_section:{ ... }
Syntax
Place the pragma inside the boundaries of a region to define the protocol for the region.
#pragma HLS protocol
Where:
floating
: Protocol mode that allows statements outside the protocol region to overlap with the statements inside the protocol region in the final RTL. The code within the protocol region remains cycle accurate, but other operations can occur at the same time. This is the default protocol mode.fixed
: Protocol mode that ensures that there is no overlap of statements inside or outside the protocol region.Important:If no protocol mode is specified, the default of floating is assumed.
Example 1
This example defines regionio_section
as a fixed protocol region. Place the pragma inside region:
io_section:{ #pragma HLS protocol fixed ... }
See Also
- pragma HLS array_map
- pragma HLS array_reshape
- Vivado Design Suite User Guide: High-Level Synthesis(UG902)
- xcl_array_partition
- SDAccel Environment Optimization Guide(UG1207)