- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I have build an application on Stratix II, with three CPU's. I have ONE (!) pio line connected to the system of three CPU's. In the SOPC builder I connected the three CPU's to the PIO module. I enabled the IRQ on edge capture. All three CPU's are handling the interrupt. Now i'm experiencing problems. My system hangs sometimes in the alt_irq_register.c file in the while loop below. I think it is because all CPU's are handling the interrupt and using this method to reset the register:
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(SYNC_CLOCK_BASE, 0x00);
Can this be the problem? Does anyone have experienced the same problems before? I need to have the interrupts on all CPU's. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif The code in alt_irq_register.c (158)
do
{
if (active & mask)
{
alt_irq(alt_irq_arg, i);
break;
}
mask <<= 1;
i++;
} while (1);
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your problem is that the interrupt will interrupt all three CPUs, but obviously they don't all reach the ISR at the same time. One CPU will be first and will have cleared the interrupt before the other ISRs get in, so the software in the ISR will read that there is no active interrupt
The interrupt handler is coded to assume that there must have been an active interrupt, however on some of your CPUs this will not be the case. You could recode the ISR, but you really need to give some more thought to what you're trying to do and design some hardware to cope with one interrupt source going to multiple CPUs- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi jmastron,
I think u could use three different PIO connected to each CPU, and then connect together your PIO signals, maybe outside SOPC builder... it's only an idea...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid I don't see how having more PIO helps.
You need to think about how you wish the interrupt to be cleared, do you want the IRQ to interrupt all 3 processors and remain asserted until they have all seen it, or do you just want it to be cleared when one of them has processed it. The hardware and software will be completely different depending on what you're trying to do.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want the interrupt to be received by all CPU's before clearing it.
Is there a way to implement this?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why don't you design some hardware which takes in the IRQ routes it to 3 signals which connect to each CPU. Have 3 slaves one for each CPU and the IRQ remains active on each CPU until you write to the slave to clear it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi rugbybloke,
<div class='quotetop'>QUOTE </div> --- Quote Start --- I think u could use three different PIO connected to each CPU, and then connect together your PIO signals, maybe outside SOPC builder...[/b] --- Quote End --- could it be the thing that u said: <div class='quotetop'>QUOTE </div> --- Quote Start --- Have 3 slaves one for each CPU and the IRQ remains active on each CPU until you write to the slave to clear it.[/b] --- Quote End --- I mean each PIO could generate the interupt to each CPU, and each PIO is driven by the same signal. bye- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<div class='quotetop'>QUOTE </div>
--- Quote Start --- Hi rugbybloke, QUOTE I think u could use three different PIO connected to each CPU, and then connect together your PIO signals, maybe outside SOPC builder... could it be the thing that u said: QUOTE Have 3 slaves one for each CPU and the IRQ remains active on each CPU until you write to the slave to clear it. I mean each PIO could generate the interupt to each CPU, and each PIO is driven by the same signal. bye[/b] --- Quote End --- I think the thing your missing is that you need separate control logic to clear the IRQ for each CPU.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi rugbybloke,
excuse me but i haven't understand clearly what u tell me. I think that jmastron CPUs only need to be interupted by an external input signal that goes high or low.Isn't it?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is that if you have 3 CPUs and one interrupt source. The first CPU interrupted will clear the cause of the interrupt so that the 2nd and 3rd CPUs will enter their ISR and the cause of the interrupt will have gone away. So you need to design hardware that will only clear the interrupt line when all 3 CPUs have taken the ISR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok, but if u use 3 PIOs (each connected to one CPU), each CPU has its own interupt signal and can clear its interupt.Isn't it?
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using 3 PIOs will enable you to turn off each signal in turn. However you need the logic to disable/clear the original interrupting hardware, plus once all 3 CPUs have handled the IRQ you need to re-enable all 3 of your PIOs. This could be done in software, but you'd be much better off desiging a bit of logic to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I think i've misunderstood the original problem: i didn't think that i had to:
<div class='quotetop'>QUOTE </div> --- Quote Start --- disable/clear the original interrupting hardware[/b] --- Quote End --- but only to "edge-capture" an input signal, without having to clear some extern register. bye
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page