Forum Discussion

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

about the head file io.h in the nios2 ide

Hello:

i created a project template "hello led" in the nios2 ide.then i see the content of the io.h file.there are something i don't know what they are.

for example:# define IORD_32DIRECT(BASE, OFFSET)

__builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)))

what does "__builtin_ldwio"mean?what is the usage of "__builtin_ldwio"?

where can i find the information about"__builtin_ldwio"?

thank you!

1 Reply

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

    i have found the answer from altera.

    this is altera's reply:

    These built-in functions now are used instead of doing direct peripheral register access. They mean reading/writing register REGNUM offset from base address BASE. They use LDxIO or STxIO instructions.

    Please find the detailed Nios II instruction set reference in NiosII Processor Reference Book ( <NiosII Installation Path>\documents\n2cpu_nii5v1.pdf, chapter 8).