Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-37040

Document interface for readDaq in ts_m2fpga project in Phase 3

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • ts_main_telescope

    Description

      Continue the experiment with LabVIEW FPGA code and C programming using the FPGA C API Interface. Work on the comments/questions in the previous ticket DM-36940:

      • check the mistakes in the code snippet comments.
      • help to clarify the returned memory region in "acquire" function is in stack or heap. And the OS can reallocate the memory after the "releasing" or not. There is the problem of memory leakage or not. This demonstration can be done in another ticket.

      and try to answer these questions:

      • question1: what will happen if there are no elements or less than the requested elements?
      • question2: what will happen if I want to release 5 elements and there are only 2 or 0 elements in the FIFO?
      • question3: what will happen if I want to add more elements in the FIFO but there is no available space?

      Attachments

        Issue Links

          Activity

            Using the "acquire' function, I got the following results:

            1. Assume I want to read 1 element and there is no element in FIFO.
                (a) timeout = 0. I will get the timeout error -50400 immediately (The timeout expired before the FIFO operation could complete) and I will get the "Segmentation fault" message.
                (b) timeout = -1. I will wait for the element forever.

            2. Assume I want to read 1 element and there is 1 element in FIFO. No matter what the timeout value is, I will get the element.

            3. Assume I want to read 2 elements and there is only 1 element in FIFO.
                (a) timeout = 0. I will get the timeout error -50400 immediately (The timeout expired before the FIFO operation could complete)  and I will get the "Segmentation fault" message.
                (b) timeout = -1. I will wait for the element forever.

            I need to read and understand more about this function, how it manages the memory, and why this message appears.

            pcortes Patricio Cortes added a comment - Using the "acquire' function, I got the following results: 1. Assume I want to read 1 element and there is no element in FIFO.     (a) timeout = 0. I will get the timeout error -50400 immediately (The timeout expired before the FIFO operation could complete) and I will get the "Segmentation fault" message.     (b) timeout = -1. I will wait for the element forever. 2. Assume I want to read 1 element and there is 1 element in FIFO. No matter what the timeout value is, I will get the element. 3. Assume I want to read 2 elements and there is only 1 element in FIFO.     (a) timeout = 0. I will get the timeout error -50400 immediately (The timeout expired before the FIFO operation could complete)  and I will get the "Segmentation fault" message.     (b) timeout = -1. I will wait for the element forever. I need to read and understand more about this function, how it manages the memory, and why this message appears.
            ttsai Te-Wei Tsai added a comment -

            Segmentation fault --> application is killed by the OS (as expected). Therefore, the "read" function is safer (the application is still alive).

            ttsai Te-Wei Tsai added a comment - Segmentation fault --> application is killed by the OS (as expected). Therefore, the "read" function is safer (the application is still alive).
            pcortes Patricio Cortes added a comment - - edited

            After a quick analysis with Te-Wei about the C code that I wrote, we realized the "Segmentation fault" appears after I try to print the data received in FIFO, and not after I executed the "acquire" function, Therefore I can conclude the error -50400 appears in both functions and both are safer (the application is still alive). 

            pcortes Patricio Cortes added a comment - - edited After a quick analysis with Te-Wei about the C code that I wrote, we realized the "Segmentation fault" appears after I try to print the data received in FIFO, and not after I executed the "acquire" function, Therefore I can conclude the error -50400 appears in both functions and both are safer (the application is still alive). 
            ttsai Te-Wei Tsai added a comment -

            Discussed with Patricio in Slack. Now we understand the behavior of "get" and "acquire" function. Great job done!

            ttsai Te-Wei Tsai added a comment - Discussed with Patricio in Slack. Now we understand the behavior of "get" and "acquire" function. Great job done!

            you mean "read" instead of "get" function .

            pcortes Patricio Cortes added a comment - you mean "read" instead of "get" function .

            People

              pcortes Patricio Cortes
              pcortes Patricio Cortes
              Te-Wei Tsai
              Patricio Cortes, Te-Wei Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.