Jump to content
taog

How to ensure handling interrupt in time when using quantum keeper?

Recommended Posts

Dear experts,

I'm developing an ISS SystemC wrapper for a processor. In the SystemC wrapper, I decided to use quantum keeper to improve simulation performance. But, I found some issues when handling external interrupt. An external interrupt controller model is connect with my processor model by using some "sc_signal". When executing interrupt handler, SW need to clear interrupt by write some register in the external interrupt controller. But, my model used quantum keeper, it always need to execute enough instructions to reach quantum without sync with SystemC kernel. So, of cause, it do not know that the interrupt has already been cleared until it reached quantum. It always entered interrupt handler multi times. Who can tell me some solutions???

Share this post


Link to post
Share on other sites

There are several ways to do this: you might use a different way to carry signals which are more TLM like. One option would be to use tlm_signal. The other common option is if your CPU writes into the register of your interrupt controller via TLM it carries the delay which is essentially the offset of the CPU local time to the SystemC kernel time. If you here just break the quantum and call a wait() so that the SystemC kernel can sync up and the signal change propagates you should be fine.

Share this post


Link to post
Share on other sites

It looks like we need to sync with SystemC kernel once CPU access other models in the system. Anyway, we must balance simulation performance and correct model behavior.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×