How to serialize vector data for HDL coder.
조회 수: 3 (최근 30일)
이전 댓글 표시
I have an HDL coder function, whose task is to gather serial data based on a valid bit and buffer it and then send the buffered data serially by giving a valid bit high.
function [out_y,valid_out]= buffer(x,start,give_out)
persistent y
if isempty(y)
y = zeros(1, 8192);
end
if (start == 1)
for ii = 1 : 1: 8192
y(ii) = x;
end
end
if (give_out == '1')
for jj=1:1:8192
out_y = y(jj);
valid_out = 1;
end
end
--- Its test bench is given below,
load('xc_estim2.mat');
xc_E =xc_estim2(1:8192);
out_y = zeros(1,8192);
for kk = 1: 1 : 8192
start = 1;
give_out = 1;
data=xc_E(kk);
[out_y(kk),valid_out]=...
buffer(data,start,give_out);
end
Please guide me. I am new to hdl coder function.
댓글 수: 0
답변 (1개)
Kiran Kintali
2020년 10월 19일
You can find some common techniques to create buffered data in this example.
>> type mlhdlc_heq
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!