How to serialize vector data for HDL coder.

2 visualizaciones (últimos 30 días)
Awais Khan
Awais Khan el 28 de Jun. de 2020
Respondida: Kiran Kintali el 19 de Oct. de 2020
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.

Respuestas (1)

Kiran Kintali
Kiran Kintali el 19 de Oct. de 2020
You can find some common techniques to create buffered data in this example.
>> type mlhdlc_heq

Categorías

Más información sobre Code Generation en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by