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 on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Nios II, interrupts and internal controller

Altera_Forum
Honored Contributor II
1,418 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
608 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
608 Views

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

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

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

0 Kudos
Altera_Forum
Honored Contributor II
609 Views

As I see it status.CRS is read only.

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