DS1701 Posted October 2, 2019 Report Share Posted October 2, 2019 I have a simple code as bellow: class Tmodel{ private: sc_event notify_method_2; sc_event notify_method_4; public: sc_event notify_method_3; sc_in<bool> input_port; ... SC_METHOD(method_1); dont_initialize(); sensitive << input_port; SC_METHOD(method_2); dont_initialize(); sensitive << notify_method_2; SC_METHOD(method_3); dont_initialize(); sensitive << notify_method_3; SC_METHOD(method_4); dont_initialize(); sensitive << notify_method_4; ... void method_1(void){ ... notify_method_2.notify(SC_ZERO_TIME); } void method_2(void){ ... printf("method_2\n"); } void method_3(void){ notify_method_4.notify(SC_ZERO_TIME); } void method_4(void){ printf("method_4\n"); } }; int sc_main(int , char *){ ... objectDUT->input_port.write(true); objectDUT->notify_method_3.notify(SC_ZERO_TIME); sc_start(200,SC_PS); ... } when debug, steps as bellow: 1. method_1 , call notify_method_2 2. method_3, call notify_method_4 3. method_4 4. method_2 I dont understand why at step 3 is method_4 ( I think it is method_2 ). if in sc_main, I insert sc_start(0,SC_PS); int sc_main(int , char *){ ... objectDUT->input_port.write(true); sc_start(0,SC_PS); objectDUT->notify_method_3.notify(SC_ZERO_TIME); sc_start(200,SC_PS); ... } steps is correct: 1. method_1 , call notify_method_2 2. method_3, call notify_method_4 3. method_2 4. method_4 Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted October 2, 2019 Report Share Posted October 2, 2019 SystemC standard does not guarantee any order of process evaluation within a single delta cycle. So in first example both 2,4 and 4,2 will be correct. DS1701 1 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.