Hi sir i am working on hdl coder and i am new to it and my pbm is have written the matlab code and compiled it sucessfully, even generated hdl code but in hdl test bench i am not getting the exact ans( matlab output and hdl output not matching).

1 view (last 30 days)
function[y,result] = taylor(a,x_rad,n) Y = 0; d_fact = 6; for i= 1:n d = (2*i+1) y = y+(power(a,i)*power(x_rad,d)/d_fact d_fact = d_fact*(2*i+2)*(2*i+3) end result = x_rad+y end TESTBENCH FILE x = 0:10:360; x_rad = (pi/180)*x; a = -1 n = 8 for j = 1:length(x_rad) [y,result(j)] = taylor(a,x_rad(j),n) end
Sir in this when I run the hdl test bench I will get the y value as zero that is affecting my final .please guide what should I change so I will get the exact answer..

Answers (1)

Kiran Kintali
Kiran Kintali on 24 May 2021
HDL Coder generates bit true and cycle accurate code corresponding to the design. The testbench captures the stimulus and response to the DUT and compares the results of the generated HDL code match original design simulation in MATLAB.
mlhdlc_demo_setup('heq')

Products

Community Treasure Hunt

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

Start Hunting!