Vitis HLS 现在将在遇到以下代码时推断移位寄存器:
int A[N]; // This will be replaced by a shift register
for(...) {
// The loop below is the shift operation
for (int i = 0; i < N-1; ++i)
A[i] = A[i+1];
A[N] = ...;
// This is an access to the shift register
... A[x] ...
}
移位寄存器每个周期都能执行一次移位操作,还支持在移位寄存器内任意位置每个周期执行一次随机读取访问,因此,比 FIFO 更灵活。