Why do I get an error with system object calls in HDL Code Generation?
Ältere Kommentare anzeigen
error: hdlcoder:pirudd:systemobjectmultipleuse: System object methods can only be called once
My Code:
main fucntion:
[x,validOut] = mainfc(data_in,st)
persistent var ifft128 out1
if isempty(var)
var=0;
ifft128 = dsp.HDLIFFT('FFTLength',128);
end
if st==1
[out1] = func1(data);
%IFFT calculation
[Xt,validOut]=ifft128_fc(ifft128,out1,true)
elseif st==0
%To complete the IFFT calculation
[Xt,validOut]=ifft128_fc(ifft128,out1,false)
end
%ifft128_fc
function [yOut,validOut] = ifft128_fc(objeto,yIn,validIn)
[yOut,validOut] = step(objeto,yIn,validIn);
end
%My test bench for the main function
N = 128;
for i=1:1:N
[X,V] = main_fc(data_in,1);
end
for i = N+1:1:3*N
[X,V] = main_fv(data_in,0)
end
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 16 Jul. 2016
You have
if isempty(var)
but you never assign to var so isempty will continue to be true, resulting in the next line being executed every pass.
2 Kommentare
Pablo Medina
am 16 Jul. 2016
Bearbeitet: Pablo Medina
am 16 Jul. 2016
Walter Roberson
am 17 Jul. 2016
Please post the actual code. For example should the first bit you posted a function definition where the "function" keyword has wandered off to the washroom, or is that code part of a script file? I don't think HDL can compile script files as the main entry.
Kategorien
Mehr zu HDL Code Generation finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!