pragma HLS protocol

Description

The PROTOCOL 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.

Note: See "Specifying Manual Interface"in the Vivado Design Suite User Guide: High-Level Synthesis (UG902) for more information.

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 (include ap_utils.h).
  • In C++ and SystemC designs by using the wait() statement (include systemc.h).

The ap_wait and wait 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:

  1. Enclose the region in braces, {},
  2. Optionally name it to provide an identifier.

For example, the following defines a region called io_section:

io_section:{
...
}

Syntax

Place the pragma inside the boundaries of a region to define the protocol for the region.

#pragma HLS protocol <floating | fixed>

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 region io_section as a fixed protocol region. Place the pragma inside region:

io_section:{
  #pragma HLS protocol fixed
  ...
}

See Also