How to get all the entries of matrix serially. (How to write the matlab code sothat when I convert it to VHDL and simulate it, I get all the entries of matrix serially)?

I have written an algorithm in MATLAB. The output is a matrix. I have converted that code to VHDL using HDL coder. As output is a matrix of 100x100, I want the all the 10,000 matrix elements should go out serially. I have tried many options to get the output serially but in all the attempts when I have simulated the generated VHDL files, I have got only the last value matrix. Please suggest me how to get all the entries serially. I am showing how I have tried and please suggest me where I am wrong:
*A of 100x100 size
By A1, i want all the entries should go out serially:
ih=100;
iw=100;*
for ii=1:iw
for jj=1:ih
index=ih*(ii-1)+jj;
A1 = A(index);
end
end
another one
for ii=1:iw
for jj=1:ih
ind=ih*(ii-1)+jj;
ramWriteAddr = rdAddrCtr;
ramWriteData = A(ind);
ramReadAddr = rdAddrCtr;
% execute single step of RAM
hRam(ramWriteAddr)=ramWriteData;
ramRdDout=hRam(ramReadAddr);
if (rdAddrCtr<=9999)
rdAddrCtr = rdAddrCtr + 1;
end
A1 = ramRdDout
end
end

Réponses (1)

In both cases do this:
for ind = 1:ih*iw
refer to A(ind)
end

1 commentaire

When I am running the MATLAB code, I am getting all entries of output matrix but when I am simulating the generated VHDL files using ModelSIM, I am getting only the last entry of the matrix in this case also.

Connectez-vous pour commenter.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by