Forum Discussion

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

NIOS Starter Info

Hello guys,

I'm a total NEWBIE with NIOS. I'm just a 2nd yr undergrad student trying to compile some C++/C code to the assembly code for NIOS. I need to do some other analysis with the assembly language. Could someone instruct me, step by step, how I get that assembly language? Btw, I installed the NIOSII IDE & SOPC Builder (from the Altera website) but I couldn't get things to work out the way I wanted! :-(

Thanks a bunch in advance~!

Nahid

3 Replies

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

    I have to assume you installed Quartus II from the web site? Not just Sopc Builder?

    Sopc Builder has not been an installable product for a long time.

    Have you followed the tutorials that come with Nios II?

    If you haven't then try them, they are well done and should help you in general.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The Nios II compiler is GCC, therefore you ought to try looking at the output of 'nios2-elf-gcc --help'... It should point you towards the "-S" switch (compile only, don't assemble or link). This will allow you to get the intermediate assembly language representation of the C/C++ code that (I think) you're trying to get.

    If this is not what you want, then you need to post more details of what you're trying to do...

    Hope this helps!

    Cheers,

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

    If you create your project in the IDE then the HAL makefiles will already contain the correct rules to make assembler files.

    Just type `make obj/<filename>.s` from a shell.

    You can get preprocessed files (.i files) in a similar way.