Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Documentation for C compiler/linker

Is there a good documentation available for Nios II compiler/linker tools, including section elaborating on details of floating point emulation library ?

BTW - I am quite surprised the compiler does not understand C++ syntax, is there a way to replace standard C compiler with some C++ and keep the integration with the Nios II IDE ?

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    All of the documentation, that you're interested in, can be browsed to from within the IDE (from the Help menu) or you can just point your browser at:

    <nios2_install>/documents/index.htm

    For the specific questions you have:

    1. Yes, the compiler supports C++.

    - Ecos is written using C++ and it is ported to Nios II and uses the identical GCC toolchain.

    - Be sure that your C++ code has a file extension of .cpp [perhaps, other extensions will work as well?] or (I think) the IDE won&#39;t handle it correctly.

    2. The floating point library details can likely be found in the documentation on newlib.

    Best of luck,

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes, after I wrote my question I could not believe my own words and I went back and find the C++ is activated when the file has extension other than c (ie. cpp, C, cc etc).

    I will search for some floating point emulation library documents where you pointed me to - thanks.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by pszemol@Apr 24 2006, 10:50 PM

    i will search for some floating point emulation library documents where you pointed me to - thanks.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=14630)

    --- quote end ---

    --- Quote End ---

    Cannot find any details on floating point emulation library implementation under Nios II.

    Any help ?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by pszemol@Apr 25 2006, 01:42 PM

    cannot find any details on floating point emulation library implementation under nios ii.

    any help ?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=14670)

    --- quote end ---

    --- Quote End ---

    Sure. There&#39;s some additional documentation on the math section of Newlib here (http://sourceware.org/newlib/libm.html).

    Do you need something at a lower-level. still, or is this good enough? Perhaps, some more digging on Newlib implementation specifics would yield the information you desire..??

    Best Regards,

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by slacker@Apr 25 2006, 06:19 PM

    do you need something at a lower-level. still, or is this good enough? perhaps, some more digging on newlib implementation specifics would yield the information you desire..??

    --- Quote End ---

    What I need to know is if I can use without any problems floating point library in a multitasking environment of the MicroC/OS-II operating system.

    I am using fp library in a limited way (log(), pow(), some of *, / + and -) and it looks to me like everything is fine until two tasks want to do same thing concurently. They all have their own data to work on separatelly, so it is no problem of sharing my program data, but it almosts looks like the math functions are not designed for the multitasking environment...

    I have found some worrying reference for the math emulation library for the Borland x86 compiler and I would like to know if something similar applies to the NiosII C/C++ compiler and if so, how to deal with it. http://www.micrium.com/downloads/appnotes/an1001.pdf (http://www.micrium.com/downloads/appnotes/an1001.pdf)

    Anybody has any experience with NiosII and multitasking of floating point emulation library ?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Anybody has any experience with NiosII and multitasking of floating point emulation library ?

    --- Quote End ---

    No, sorry.