pragma HLS protocol

Description

ThePROTOCOLpragma 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 anap_wait()statement (includeap_utils.h).
  • In C++ and SystemC designs by using thewait()statement (includesystemc.h).

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

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

See Also