From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Horribly Simple Error-Producing Code (-61003)

Solved!
Go to solution

Can anyone tell me why this piece of code produces error -61003?

 

I am trying to write some code for a new FPGA, and the bothersome thing won't compile. This particular piece of code has absolutely nothing to do with the project, but it is the most simple code that produces the same error when I try to compile it. I have two theories about why it won't compile: 1. the FPGA physically can't shuttle data around in the manner I would like 2. I've found an edge case that the compiler isn't prepared to deal with. If there is a simple reason for this error that I can work around, please let me know. This is by far the worst time I have ever had trying to find the source of an error.

 

To attain error: download both files into the same directory, open FPGA2.lvproj, expand FPGA Target, expand Build Specifications (under FPGA Target), right click WhyDoesThisError, select Build.

Download All
0 Kudos
Message 1 of 11
(7,472 Views)

Sorry, I don't have access to the relevant tools, but what is the VI supposed to do ("shufle data around"?)

 

What is the point of the array with one element? The FOR loop? Why the data mismatch (I32 vs I16), etc.

It seems to me that the data in the array is never used anywhere.

 

Can you explain what you are trying to do?

0 Kudos
Message 2 of 11
(7,457 Views)

I guess ths question is more scientific than anything. The full project is here: https://github.com/IMPACT-Boulder/Accelerator/tree/Forrest_Branch/Device%20IO/FPGA2. The point of the rest of the code (which I did not include for clarity's sake) is to control which particles are allowed through a voltage gate on a dust particle accelerator.

 

My question is: why does this produce an error? In my real code, the only solution I've found requires replacing the for loop with 7 separate instances of the same code. I think that's unacceptable, unscaleable and unclean, so I at least want to know why I have to do it, if I really have to do it. If I can't compile code for an FPGA that runs n instances of the same code in parallel without manually copying that code n times in the vi... that's just horrible. Even if the only solution is to get rid of the for loop, I want to know whether it won't compile because the FPGA can't do it, or because the compiler is stupid.

0 Kudos
Message 3 of 11
(7,450 Views)

Well, the error is

 

"LabVIEW FPGA:  You cannot include this function in a For Loop when the For Loop is inside a single-cycle Timed Loop."

 

As you can read here, you cannot have certain structures and functions inside a SCTL,

 

(I won't sort through huge github hierarchies just to find the original code without really knowing where to look. My participation also reduces when the post contains too many loaded words (horribly, unacceptable, unscaleable and unclean, stupid, etc.). IThey tend to obscure the real issues.)

0 Kudos
Message 4 of 11
(7,440 Views)

I understand why you wouldn't want to search through a github unaided and I apologize for my previously loaded language.

 

Then why will this compile perfectly?

0 Kudos
Message 5 of 11
(7,428 Views)

Sorry, I cannont test because I don't have the hardware, but yes both VIs should work as long as you adhere to the limits of the single cycle loop.

 

(I guess the FOR loop whould get unrolled and parallelized....)

 

I'll try to do some test tomorrow, but maybe somebody from NI should look into it.

0 Kudos
Message 6 of 11
(7,405 Views)

I'd guess the local variable is the problem, rather than the loop. It implies arbitration to a shared resource, which is not supported in the SCTL. You can use a Register or FIFO to accomplish the inter-loop communication.

0 Kudos
Message 7 of 11
(7,391 Views)

Thank you for the suggestion JLewis, but it appears to make no difference if it's a variable or a register.

Download All
0 Kudos
Message 8 of 11
(7,383 Views)
Solution
Accepted by topic author ForrestBarnes

That's what I get for guessing. The arbitration thing applies to multiple accessors within the same loop.

 

What seems to work on my machine is getting rid of the coercion dot on the case structure output tunnel. It looks like loop unrolling analysis is getting tripped up by its presence, possibly in conjunction with the selector being sourced by a control (?).  This sounds like a bug to me, since your other VI works. At the very least it needs a better error message. If you can verify that you're seeing the same thing, I'll file a corrective action request on it.

 

Jim

Message 9 of 11
(7,375 Views)

Thank you so much. It was, indeed, the coercion dot. Once I got rid of all those in my original code, it worked perfectly.

0 Kudos
Message 10 of 11
(7,357 Views)