Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Code: 61056: Component prim_RAMR has invalid arbitration for Single-Cycle Timed Loop

I am trying to use an FPGA memory read in a single cycle timed loop. According to the help listing the memory read vi should work in SCTLs as long as the outputs are attached directly to unitialized shift registers. Does anyone have any idea what may be causing this problem.

My hardware is a cRIO-9102 with a cRIO-9002 controller. Modules are not important here since this happens without any IO in the program.
0 Kudos
Message 1 of 6
(4,890 Views)
Hi John

What else are you doing in your Single Cycle Timed Loop (SCTL)? I tested the memory read VI in a SCTL with the attached VI, and did not get any compile or run errors using a cRIO-9104. It should not be any different for a cRIO-9102. I also found this KnowledgeBase that mentions this error code when comparing two arrays in a SCTL. Are you doing anything similar?
0 Kudos
Message 2 of 6
(4,880 Views)
Russell,

Thank you for your response. Since I posted this question I have found that indeed the Memory Read vi can be used in the SCTL as specified, but there are a number of factors which contribute to whether a Memory read can be used in a SCTL. I'm including them here for those who might encounter this problem in the future. I would also invite any comments on these observations.

1. Multiple memory reads cannot run in parallel in an SCTL. I'm assuming that this is because two memory locations cannot be accessed simultaneously.

2. I initially missed the fact that the shift register to which the Memory Read vi was attached must be unititialized. The Memory Read vi will not work in the SCTL if the shift register is initialized.

3. Use of the Memory Read vi also appears to drastically limit the amount of other processing which can be performed in the SCTL. There also appears to be a relation between this and the amount of processing being performed in other parts of the block diagram.

4.Perhaps the most intriguing observation is that the Memory Read vi does not appear to work in the SCTL if the Memory Read vi is used at any other point in the block diagram, even if it is in series with the SCTL.
0 Kudos
Message 3 of 6
(4,879 Views)
Hi John

In regards to Observations #1 and #4, you're right. The FPGA Memory Read can only be used once in each block diagram. Basically, shared resources OTHER than the FPGA Device I/O resources (in this case FPGA memory VI's) use the Normal (Optimize for Single Accessor) arbitration option, which limits you to only one instance of the memory read VI in your block diagram. LabVIEW FPGA does not allow you to select a different arbitration option for these resources. There is alot more information on the different arbitration options in the Arbitration Options section of the LabVIEW FPGA User Manual.

In regards to Observation #3, there is a limit to the amount of code that the compiler can optimize to execute in a single clock tick, but you should not see any other parts of your block diagram being effected by the Memory Read VI. As long as you are not sharing resources between different loops in your VI, every loop that you have on your FPGA executes seperately, so one should not effect the other. How have you determined that the memory read VI in a SCTL has effected other parts of your program?
0 Kudos
Message 4 of 6
(4,869 Views)
It appears that my observation #3 was not entirely clear. What I see happening is that if the memory read vi is included in a SCTL then the amount of code which can be successfully compiled to the FPGA device is more limited than if the memory read is in a regular loop (I can get more code on the FPGA). It does not effect the execution of the other code (they run independently). It appears that using the memory read in an SCTL takes up more of the FPGA resources than in a regular loop.
0 Kudos
Message 5 of 6
(4,855 Views)
Hello I would like to clarify a few points:


1. Multiple memory reads cannot run in parallel in an SCTL. I'm assuming that this is because two memory locations cannot be accessed simultaneously.



This is correct. You cannot access the memory block simultaneously. Since you are trying to use the memory blocks in a SCTL the calls would occur simultaneous. The memory block is essentially a shared resource. Therefore if you have multiple accessors to the shared resource an arbiter must be used to control what function gets access to the resource. Outside of a SCTL this arbitration is usually fine, but arbitration is not supported in a SCTL. That is what the initial error you saw was telling you (Invalid Arbitration for SCTL). While some functions (I/O) allow you to modify the arbitration options, the memory blocks do not. If you are going to use a memory block in a SCTL you cannot have 2 memory reads or 2 memory writes in the block diagram.



2. I initially missed the fact that the shift register to which the Memory Read vi was attached must be unititialized. The Memory Read vi will not work in the SCTL if the shift register is initialized.



Correct! For the memory and lookup table functions in a SCTL the shift register on the loop is actually a reference to a register that is within the memory/lookup table. You cannot access this register externally because it is a component of the memory block. By forcing the programmer to use shift registers on the loop the program execution is better understood i.e. the outputs of the memory block has an iteration delay. This would not be obvious if you could wire an indicator directly to the memory block. Of course you can use the "Select" and "First Call?" functions to write a simple initialization routine inside the SCTL.



3. Use of the Memory Read vi also appears to drastically limit the amount of other processing which can be performed in the SCTL. There also appears to be a relation between this and the amount of processing being performed in other parts of the block diagram.



I would not agree with this statement. The memory function takes an entire tick to execute. That means you cannot put code serially with the memory function in a SCTL. You can however use pipelining to execute other functions in parallel to the memory function. Since an FPGA supports truly parallel operations the memory function has no role in the execution of parallel functions. I am not sure which resources you were referring to but code within the SCTL should use less slices than code outside a SCTL. I have attached a screenshot of a simple test of this. The build reports show that the code using the SCTL uses less slices. So perhaps the additional resource usage is coming from somewhere else in your code.



4.Perhaps the most intriguing observation is that the Memory Read vi does not appear to work in the SCTL if the Memory Read vi is used at any other point in the block diagram, even if it is in series with the SCTL.



This is a good point and goes along the line of your first point. In order to handle multiple accessors we put in arbiters. The code generation does not detect that your functions will not be executed at the same time and thus uses an arbiter. An elegant workaround for this situation is to implement a state machine within 1 SCTL. This way you only use one memory read block and it is in the SCTL.
Message 6 of 6
(4,834 Views)