Read from the Shifter - 2021.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
ft:locale
English (United States)
Release Date
2021-12-15
Version
2021.2 English

The read method allows a specified location to be read from the shifter register.

The ap_shift_reg.h header file that defines the ap_shift_reg class is also included with Vitis HLS as a standalone package. You have the right to use it in your own source code. The package xilinx_hls_lib_<release_number>.tgz is located in the include directory in the Vitis HLS installation area.

// Include the Class
#include "ap_shift_reg.h"

// Define a variable of type ap_shift_reg<type, depth>
// - Sreg must use the static qualifier
// - Sreg will hold integer data types
// - Sreg will hold 4 data values
static ap_shift_reg<int, 4> Sreg;
int var1;

// Read location 2 of Sreg into var1
var1 = Sreg.read(2);