UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor malgassim
Visitor
2,769 Views
Registered: ‎12-20-2011

Error("discreatcorr.m"): output z is not assigned through all possible paths.??

Jump to solution

I wrote this code in M block:

 

function z= discreatcorr(x,y)
t=zeros(12288,1);
i=zeros(1,12288);
i(1,4096:8191)=x(1:4096,1); %output of the image filter
t(4096:8191,1)=y(1:4096,1); %output of the template filter
for n=1:8191
k=zeros(12288,1);
k(n:n+4095,1)=t(4096:8191,1);
z(n,1)=i*k;
end
end

------

when I run it it says:

Error("discreatcorr.m"): output z is not assigned through all possible paths.

----

Model is attached.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Advisor eilert
Advisor
2,968 Views
Registered: ‎08-14-2007

Re: Error("discreatcorr.m"): output z is not assigned through all possible paths.??

Jump to solution

Hi,

you can not put just any matlab code into an MCode block.

 

You have a loop with 8191 steps and doing a multiplication in it.

Meaning you want to do over 8000 fully combinatorical multiplications in parallel.

That's what you wrote, even if not intended.

What monstrous FPGA shall be capable of doing this?

 

Welcome to the wonderful world of hardware design. ;-)

 

Now to the error message itself.

I can only guess, but it may be that only z(8191,1) makes it to the output. All other results are discarded, since z is not persistent.

Still the tool assumes that there must be some z(1:8190,1) values, yet unassigned (or discarded)  and so they are missing, and you get the error.

(Besides, even with simple 8 bit values this would mean to have 65628 output wires, and another 65536 input wires to that single function.)

 

Also I doubt that MCode blocks are capable of taking full vectors as inputs.

Mainly because of the already mentioned big number iof wires needed in the resulting hardware.

Instead you may have to feed them one by one on each clock tick.

 

Read the chapter about the limitations and coding rules that apply for MCode blocks.

You are no longer programming sequential matlab functions but using matlab syntax for hardware description purposes now.

A completely different world.

 

Have a nice synthesis

  Eilert

 

 

 

 

0 Kudos
1 Reply
Advisor eilert
Advisor
2,969 Views
Registered: ‎08-14-2007

Re: Error("discreatcorr.m"): output z is not assigned through all possible paths.??

Jump to solution

Hi,

you can not put just any matlab code into an MCode block.

 

You have a loop with 8191 steps and doing a multiplication in it.

Meaning you want to do over 8000 fully combinatorical multiplications in parallel.

That's what you wrote, even if not intended.

What monstrous FPGA shall be capable of doing this?

 

Welcome to the wonderful world of hardware design. ;-)

 

Now to the error message itself.

I can only guess, but it may be that only z(8191,1) makes it to the output. All other results are discarded, since z is not persistent.

Still the tool assumes that there must be some z(1:8190,1) values, yet unassigned (or discarded)  and so they are missing, and you get the error.

(Besides, even with simple 8 bit values this would mean to have 65628 output wires, and another 65536 input wires to that single function.)

 

Also I doubt that MCode blocks are capable of taking full vectors as inputs.

Mainly because of the already mentioned big number iof wires needed in the resulting hardware.

Instead you may have to feed them one by one on each clock tick.

 

Read the chapter about the limitations and coding rules that apply for MCode blocks.

You are no longer programming sequential matlab functions but using matlab syntax for hardware description purposes now.

A completely different world.

 

Have a nice synthesis

  Eilert

 

 

 

 

0 Kudos