bluephilosopher Posted July 3, 2013 Report Share Posted July 3, 2013 I hope I have made the topic title understandable, jeje There is the question: I have a sc_method method1 with static sensitivity to 2 signals, sig_1 and sig_2. and sc_method method2 is sensitive to sig_1. When the sig_1 in simulator is changed, method1 is triggered by sig_1, and after a delta cycle, agian by sig_2. Is there a way to let the sensitivity of method1 to sig_1 wait for a delta cycle, i.e. ignore the sensitiviy of sig_1, if after a delta cycle there is the sensitiviy of sig_2 thanks sc_method(method1) sensitivity << sig_1 <<sig_2; sc_method(method2) sensitivity << sig_1; /* simulator */ sig_1.write(variable); Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted July 3, 2013 Report Share Posted July 3, 2013 Hi. You cannot wait in an sc_method. But you can delay the execution of method1 for one delta cycle by introducing an additional signal: sc_method(method1) sensitive << sig_3 << sig_2; ... sc_method(method3) sensitive << sig_1; method3() { sig_3.write(!sig_3); } ... Quote Link to comment Share on other sites More sharing options...
bluephilosopher Posted July 3, 2013 Author Report Share Posted July 3, 2013 then how about to wait for a certain time, but not a delta cycle? Should I then change the method3 to a sc_thread? ############################################ Why is the idea of let sc_method to run without delay? Does it represent any real hardware? Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted July 3, 2013 Report Share Posted July 3, 2013 In the sense of hardware, an sc_method could be a pure combinatorical block, e.g. something you would implement in a concurrent signal assignment in VHDL. For simulation, the difference is in the simulation performance. An sc_method is always 'run-to-completion' an has no persistent local variables. Hence, it can run in the context of another process. An sc_thread has to have its own process context. As a result, you get less context switches and faster simulation with sc_method. To achieve 'run-to-completion' you are not allowed to wait inside an sc_method. If you want to wait inside the process you have to use SC_THREAD or SC_CTHREAD. Quote Link to comment Share on other sites More sharing options...
bluephilosopher Posted July 29, 2013 Author Report Share Posted July 29, 2013 hey Ralph thanks... sorry for the late reply... I have figured out the solution. I just changed the sc_method to sc_thread...I was reluctant to do it, just because of wait(). But since it´s working, so why not... 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.