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++

Interrupt assignment

Altera_Forum
Honored Contributor II
1,928 Views

Within SOPC Builder, I generated two new components from my VHDL codes that had all the necessary signals tied to the Avalon bus. There are 5 interrupts that are tied to the Avalon bus for one component, 4 are from external, off-board devices, and 1 internally generated. For the other component, there's just 1 internally generated interrupt tied to the Avalon bus. Is there a way to assign specific interrupt numbers either through SOPC Builder or Quartus II for these 6 interrupt lines? All the pre-build modules can have their interrupt numbers reassigned, but it doesn't seem possible with user generated components.

0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
684 Views

It doesn't sound like you're using the component editor/builder to create your new component(s). You should give it a try.  

 

Also, I'm not sure that Avalon supports connecting a _bus_ of interrupts. What you can do is connect a single "irq" signal to Avalon and then create a status register, containing information about which device (external or internal) caused the interrupt. If that won't work, for you, you should consider a different design architecture....perhaps, splitting it up into smaller components? 

 

Best of luck! 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
684 Views

I did use the Create New Component option from SOPC Builder to import my design. I should have been more clear about the interrupts. The 4 external interrupts lines are "on a bus," but I've separated them into individual irq_n's on the top level when assigning them to the Avalon bus. Each interrupt is assigned to a different slave since you can only have one interrupt for each slave. I'm just wondering if there's a way to assign specific interrupt numbers to those slave interrupts.

0 Kudos
Altera_Forum
Honored Contributor II
684 Views

If I understand you, correctly, just assign them from within SOPC Builder.... or, are you asking about something else? I don't know of a way to assign a specific IRQ# during component generation, since that is something that is done _after_ component generation in SOPC Builder. 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
684 Views

Well, I was asking whether specific interrupt numbers can be assigned after component generation in SOPC Builder, but I've yet to find a way to do so. I have assigned specific interrupt numbers to other modules like PIO, UART, or SPI, as long as they're pre-built. Thanks for you responses, slacker.

0 Kudos
Altera_Forum
Honored Contributor II
684 Views

I think there is a bug in the component editor. You could try editting the class.ptf file that the component generator creates and change the Has_IRQ field to "1" from "0". 

 

 

EDIT: 

 

This change isn't sufficient. If you have address and data and chipselect, etc. The interrupt is changeable. But if you only have an IRQ line it doesn't seem to work. I still believe this is a bug in Altera's Component Editor.
0 Kudos
Altera_Forum
Honored Contributor II
684 Views

Ok, I do see the field where IRQ can be turned on in the class.ptf file, but nothing to have a specific interrupt number assigned. 

 

However, I have a top level entity containing a few other low level entities, should their "Has_IRQ" fields be turned on also in the class.ptf file? Or just the top-level? 

 

Thanks.
0 Kudos
Altera_Forum
Honored Contributor II
684 Views

I figured out how to assign specific interrupt numbers if there are multiple interrupt outputs from a component build. I looked at the generated class.ptf file from a design that had pre-built components which can have their interrupt number reassigned, took that same format and applied them to my component builds' class.ptf files. Once I restarted SOPC builder, deleted the old components, and added the updated components, the interrupt numbers all came out on the IRQ column.

0 Kudos
Reply