EmbDev.net

Forum: FPGA, VHDL & Verilog Error using Matlab HDL Coder


von Jamil H. (jamil)


Attached files:

Rate this post
useful
not useful
Hi, Can some one please help out.Thanks. I am trying to convert below 
code to VHDL using HDL Coder but getting error. The HDL Coder Block file 
is also attached .Please can you have a look on it and see whats the 
mistake in block diagram.
1
x1=[1 2 3 4 5 6 7 8 9];
2
x2=[3 4 5 6 7 8 9 2 1];
3
n=length(x1);
4
xc=zeros(2*n-1,1);
5
for i=1:2*n-1
6
  if(i>n)
7
      j1=1;
8
      k1=2*n-i;
9
      j2=i-n+1;
10
      k2=n;
11
  else
12
      j1=n-i+1;
13
      k1=n;
14
      j2=1;
15
      k2=i;
16
  end
17
  xc(i)=sum(conj(x1(j1:k1)).*x2(j2:k2));
18
end
19
xc=flipud(xc);


Error:

Cannot connect to model 'prc4'; please try Update Diagram (Ctrl-D).

Error due to multiple causes.

Errors occurred during parsing of MATLAB function 'MATLAB Function'(#24)

Error in port widths or dimensions. Output port 1 of 'prc4/MATLAB 
Function/u' is a one dimensional vector with 1 elements.

: Edited by Moderator
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.