• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » Is there a data fifo in dsp/bios?
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Is there a data fifo in dsp/bios?

Is there a data fifo in dsp/bios?

This question is answered
Bryan Hehn
Posted by Bryan Hehn
on Dec 20 2012 09:01 AM
Intellectual410 points

I am trying to pass (stream) data between two tasks.  Currently, I am using dsp/bios mailboxes to pass the data and block taks based on data availablity.  However, because of the fixed mailbox size this is becoming cumbersome.  So, what I need is a data fifo with blocking on data ability.  Dsp/Bios does not have one as far as I can tell.  So, my question is:  Should I write my own fifo with semaphores or is there a Dsp/bios API I should use?   SIO (streaming io) seems like it might work but it seems like overkill for my application. 

Thanks

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • ToddMullanix
    Posted by ToddMullanix
    on Dec 20 2012 09:14 AM
    Genius15630 points

    Hi Bryan,

    What versionof BIOS are you using. There is MSGQ (in DSP/BIOS) and MessageQ (in Ipc product that can be used with SYS/BIOS).

    Both MSGQ and MessageQ are basically a FIFO queue and a synchronization mechanism (usually a semaphore). It is zero copy based (unlike mailbox) and allows variable size messages. Both MSGQ and MessageQ support routing to other processors assuming there is a transport that supports the communication (i.e. shared memory and interrupts, RapidIO, Ethernet, etc.).

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Bryan Hehn
    Posted by Bryan Hehn
    on Dec 20 2012 10:30 AM
    Intellectual410 points

    Thanks for the quick reply.

    I'm using DSP/Bios 5.41.

    Let give you a better understanding of my application.

    On one side I receive variable length packets of raw byte data (they can vary from 200 to around 1500 bytes).  This can be thought of as streaming raw data that gets put into a fifo of some sort.  The other side of the fifo needs this data in fixed (but can vary by a run time variable) size chucks.  The sizes on the two sides are totally independent.  Right now I am using MBX and the filling side breaks the incoming data into messageSize and posts messages to the MBX.  The MBX pend side then must have a fixed (at compile time) size.  I want the get size to be variable in run time.  This is why I thought a simple fifo would be the way to go.  That way the put side would just put the entire packet and get side just waits for as many bytes as it wants before getting and processing the data.  I would like the two sides not to need to know how much the other side is putting or getting.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Bryan Hehn
    Posted by Bryan Hehn
    on Dec 20 2012 10:31 AM
    Intellectual410 points

    By the way the two sides are tasks on a single processor.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Dec 20 2012 11:28 AM
    Verified Answer
    Verified by Bryan Hehn
    Genius15630 points

    Bryan,

    With MSGQ, the messages must have a MSGQ_MsgHeader as it first field. Given that, you could either have the messages contain the entire data packet or it can contain a pointer to the data (and probably a size). For example:

    struct MyMsg {
        MSGQ_MsgHeader msgHeader; // required and do not modify directly...use MSGQ APIs
        Char data[1000];
    }  

    The above approach requires you to know the worst case data size. Note: you can have MyMsg1, MyMsg2, etc and use the MsgId field to help the receiving thread determine what type of message it is.

    struct MyMsg {
        MSGQ_MsgHeader msgHeader; // required and do not modify directly...use MSGQ APIs
        Ptr data;
        Int dataSize;
    }

    The above allows more flexible messages, but does not work on a multi-processor system.

    For your case of having the sender (producer) put in X bytes and the receiver (consumer) take out Y bytes (where Y <= X), basically works with MSGQ. If you do the second use case (pass the pointer and size), the receiving thread could still consume the received data as chunks. It would not free the message (or return it to the producing thread) until it was completed with the entire data block in the msg though. There might be some edge conditions (i.e. received msg's dataSize is 500, but you want to consume in 128 chunks, so you'll have 116bytes in the last chunk). Not sure if this is a show stopper or not.

    Please refer to the MSGQ documentation in the User Guide and the API Reference for more details.

    Having said all this, it sounds like what you really want is a simple circular (or ring) buffer implementation. DSP/BIOS does not provide one. You might want to just take the afternoon and write one up instead of using MSGQ.

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • RandyP
    Posted by RandyP
    on Jan 05 2013 08:45 AM
    Guru60320 points

    Bryan,

    Did Todd's suggestion above for MSGQ meet your need, or do you have more questions on this topic?

    Regards,
    RandyP

    Search for answers, Ask a question, click  Verify  when complete, Help others, Learn more.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Bryan Hehn
    Posted by Bryan Hehn
    on Jan 08 2013 07:08 AM
    Intellectual410 points

    Yes it did thanks.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use