• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. unpacked structure in DPI

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 64
  • Views 17960
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

unpacked structure in DPI

archive
archive over 17 years ago

Hi,

Does anyone know whether the SV unpacked structure can be passed to a C function through DPI?

I tried this in LDV6.2 but was told that this data type is unsupported as a formal augment.

Thanks!
Daniel


Originally posted in cdnusers.org by zqlsi
  • Cancel
  • archive
    archive over 17 years ago

    Check this out.

    http://www.cdnusers.org/Forums/tabid/52/forumid/66/postid/2261/view/topic/Default.aspx

    -Vivek


    Originally posted in cdnusers.org by prasad_vc
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Vivek,

    Thanks for your reply! The example showes a packed structure while what I want is an unpacked structure with real type members. Do you have examples for unpacked structure in DPI?

    Regards,
    Daniel


    Originally posted in cdnusers.org by zqlsi
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago


    Daniel,

    Do you have any example code, which you can share?

    -Vivek


    Originally posted in cdnusers.org by prasad_vc
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    I wrote two examples, one using packed structures, and another using unpacked structures.  The unpacked example is here:

    The title is: Manipulating Unpacked Arrays using DPI

    http://www.cdnusers.org/Forums/tabid/52/view/topic/forumid/66/postid/3123/Default.aspx


    Originally posted in cdnusers.org by tmackett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi Todd,

    The example is helpful. Thanks! How about the unpacked STRUCT (with integer and real members)? Can I use this as arguments in an imported C function? 

    Regards,
    Daniel


    Originally posted in cdnusers.org by zqlsi
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    I don't believe you can make reals part of a packed structure or put them into a unpacked array. Here's another example showing how to use reals and DPI http://www.cdnusers.org/Forums/tabid/52/view/topic/forumid/66/postid/2841/Default.aspx


    Originally posted in cdnusers.org by tmackett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    You can have an unpacked array of reals.

    Shalom.Bresticker@intel.com


    Originally posted in cdnusers.org by shalom
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    I'll clarify that by saying, I don't think you can have a packed structure of reals (somehow) or an upacked array of reals AND put them over a DPI interface.


    Originally posted in cdnusers.org by tmackett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Thanks Todd!

    I can use unpacked array of integer to exchange data in DPI now.  However, what I really need is to use an unpacked structure which has both real and integer data members in DPI. Will Cadence support this kind of thing in future release of LDV?

    Regards,
    Daniel


    Originally posted in cdnusers.org by zqlsi
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    The spec basically says that class cannot be put across the DPI interface - only packed structures of bits and logic. This restriction basically leaves out classes and packed/unpacked reals (reals by themselves are fine). I'm not the one to comment on if Cadence will support that - but if any supplier does, it will be a non-standard implementation.

    I have one thought...this might work...never tried it. If someone can code this up - please post it:
    from SV:
    a) create a SV real. Use realtobits() to convert it to a vector, pack the converted real into a packed structure.
    b) send that structure across the DPI interface

    DPI C code:
    a) recieve packed structure containing encoded real per usual DPI transfer
    b) decode it back to a C double using some function call <-- is there such a function call??


    Originally posted in cdnusers.org by tmackett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
>

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information