Minu Posted July 19, 2022 Report Share Posted July 19, 2022 Hi All, I am trying to schedule interrupt of timer for next time as my current logic only executed interrupt only one time. void call_overflow_interrupt(){ //check overflow //cout<<"\nIn callInterrupts func\n"; if((timer_cntrl &(1<<TIMER_CNTRL_OV))&& timer_val==0xff) { intr1=1; timer_intr_status=ENABLE(timer_intr_status,TIMER_OV_INTR); } else{ cout<<"\ncall_overflow_interrupt is not coming\n"; } } And in SC_CTOR i am registering this process SC_METHOD(call_overflow_interrupt); sensitive<<Event; dont_initialize(); Event.notify(256*20,SC_NS);//count=256(0xFF),clock period=20ns I wrote above code but it is not scheduling the process for next time.How this can be achieved? Quote Link to comment Share on other sites More sharing options...
tmp_sc Posted July 19, 2022 Report Share Posted July 19, 2022 SC_METHOD is like a cpp function, you need explicitly to trigger it's sensitivity list (in this case to notify Event again), otherwise it won't be re-entered. E.g. void call_overflow_interrupt(){ //check overflow //cout<<"\nIn callInterrupts func\n"; if((timer_cntrl &(1<<TIMER_CNTRL_OV))&& timer_val==0xff) { intr1=1; timer_intr_status=ENABLE(timer_intr_status,TIMER_OV_INTR); } else{ cout<<"\ncall_overflow_interrupt is not coming\n"; } // Added this line to trigger SC_METHOD's sensitivity Event.notify(256*20,SC_NS);//count=256(0xFF),clock period=20ns } Minu 1 Quote Link to comment Share on other sites More sharing options...
Minu Posted July 19, 2022 Author Report Share Posted July 19, 2022 Thanks @tmp_sc for answering my question.But when I did as you suggested it is coming to else part. One more thing ,like at 256*20 ns interrupt will enable . I want to disable interrupt after 20ns also.How this can be achieved in SC_METHOD? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.