Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
12748 Discussions

Nios II, interrupts and internal controller

Altera_Forum
Honored Contributor II
1,432 Views

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?

0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
622 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
622 Views

Agree, - but just right now it would be a simple solution for me.

0 Kudos
Altera_Forum
Honored Contributor II
622 Views

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).

0 Kudos
Altera_Forum
Honored Contributor II
622 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
622 Views

Can't you just write to the CRS field of the status register?

0 Kudos
Altera_Forum
Honored Contributor II
623 Views

As I see it status.CRS is read only.

0 Kudos
Altera_Forum
Honored Contributor II
623 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
623 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
623 Views

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.

0 Kudos
Reply