07-05-2017 12:11 AM
Hello,
I am using microblaze processor in Spartan 6 FPGA. I have enabled an interrupt in it. The ISR is functioning properly. But I am having a requirement such that the ISR should return to a different point than point from being called in C code in certain cases. Suppose ISR is executing within one while loop say A , it should return to another while loop say B in certain cases. Is there any method in which I could do this? Any suggestions welcome.
Thanks in advance
With Regards
Shalini
07-06-2017 01:22 AM
An advantage of using an FPGA is that you don't have to do everything (anything) in a processor. If you have a time critical function then you can implement that using more dedicated logic. That logic could be a dedicated peripheral to your MicroBlaze or it could be another processor such as a PicoBlaze with its interrupt response measured in in nanoseconds rather than microseconds.
Indeed, many engineers have recognised the advantages of combining multiple PicoBlaze 'controllers' with a larger MicroBlaze processor. Some cases are to address the need to service and interrupt quickly. At the other end of the spectrum, PicoBlaze can be left to deal with something that takes place slowly (e.g. human interaction or printing a document) allowing the larger MicroBlaze to concentrate on the main task without interruptions.
07-05-2017 02:09 AM
What you are describing certainly goes against the concept of servicing an interrupt and definitely has the potential to lead to unreliable operation. As such, I think every interrupt should be serviced and return to the point that it occurred to continue.
To achieve something similar to what you are looking for then I would make the interrupt service routine (ISR) put a ‘token’ somewhere (e.g. load a register or memory location with a particular value). The processing loop ‘A’ in the main program would contain a check for that ‘token’ and invoke a premature end to loop ‘A’ in a controlled manner. Likewise, the next higher level of the program would be able to check the ‘token’ to recognise that loop ‘A’ had been prematurely abandoned in response to an interrupt and then invoke loop ‘B’.
07-05-2017 02:13 AM
Sir,
Thank you for reply.
In my case the interrupt routine is extremely time critical. I want it to execute every 18us. It is a timer interrupt. so if I am enabling lines in while loop then the ISR is not executing every 18us strictly.
With Regards
Shalini
07-06-2017 01:22 AM
An advantage of using an FPGA is that you don't have to do everything (anything) in a processor. If you have a time critical function then you can implement that using more dedicated logic. That logic could be a dedicated peripheral to your MicroBlaze or it could be another processor such as a PicoBlaze with its interrupt response measured in in nanoseconds rather than microseconds.
Indeed, many engineers have recognised the advantages of combining multiple PicoBlaze 'controllers' with a larger MicroBlaze processor. Some cases are to address the need to service and interrupt quickly. At the other end of the spectrum, PicoBlaze can be left to deal with something that takes place slowly (e.g. human interaction or printing a document) allowing the larger MicroBlaze to concentrate on the main task without interruptions.
07-06-2017 01:25 AM
Thank you for reply sir. I dont have picoblaze ,only microblaze.