Forum Discussion

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

Nios II, interrupts and internal controller

Does any one know if it is possible to setup a Nios II, with internal interrupt controller using shadow register sets? And how does you specify what register set to use for each interrupt?

9 Replies

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

    Even if it was possible why not use the vectored interrupt controller that already does this?

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

    In that case what are you looking to achieve? Maybe a different method would work for you using the internal interrupt controller (maybe a custom jump table for example).

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

    I just wanted to get a fast interrupt respons with the internal interrupt controller, - without saving all registers. But as far as I can see, I only got the wrprs and rdprs instructions, - but no instructions to actually switch to a shahow register set during the interrupt processing. - Later in our process we are adding the external interrupt controler, and then my problems will be solved.

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

    I'm sure I'd just checked the docs :-)

    In that case you need to execute an 'iret' having set the approriate saved status to the required value.

    Actualy it is an 'eret', see page 3-28
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    oh, - I see you point, - but it might as well open for interrupt again. Or maybe I can control this in the saved status? Anyway the code would not be easy to understand and need good comments.

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

    An interrupt entry/exit pair should leave the system in the original state - regardless as to the actual current register set. So you should only need to save enough state to restore the original set.