读取方法允许从移位器寄存器读取指定的位置。
Vitis HLS 还包含 ap_shift_reg.h 头文件作为独立封装,用于定义 ap_shift_reg
类。您有权在自己的源代码中使用此头文件。xilinx_hls_lib_<release_number>.tgz 封装位于 Vitis 安装区域的 include 目录中。
// 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);