ciroceissler Posted August 7, 2014 Report Share Posted August 7, 2014 hello, I trying to do coverage using gcov and can't reach 100% for line coverage, for example: #####: 32: SC_MODULE(test) { -: 33: sc_in<bool> clk; -: 34: sc_in<bool> arst_n; -: 35: -: 36: void func1 (); -: 37: void func2 (); -: 38: 18: 39: SC_CTOR(test) { 18: 40: SC_CTHREAD(func1, clk.pos()) 18: 41: async_reset_signal_is(arst_n, false); -: 42: 18: 43: SC_CTHREAD(func2, clk.pos()); 18: 44: async_reset_signal_is(arst_n, false); -: 45: -: 46: } // end of SC_CTOR -: 47: }; // end of SC_MODULE From other project, I have another behavior (just put a stub from module), here above: 18: 32: SC_MODULE(test2) { -: 33: sc_in<bool> clk; -: 34: sc_in<bool> arst_n; -: 35: 18: 36: void func1 (); 18: 37: void func2 (); -: 38: 18: 39: SC_CTOR(test2) { 18: 40: SC_CTHREAD(func1, clk.pos()) 18: 41: async_reset_signal_is(arst_n, false); -: 42: 18: 43: SC_CTHREAD(func2, clk.pos()); 18: 44: async_reset_signal_is(arst_n, false); -: 45: -: 46: } // end of SC_CTOR -: 47: }; // end of SC_MODULE I don't understand why SC_MODULE wasn't covered from the first example, but SC_CTOR was. Can anyone tell me why this happen or could suggest another tool for coverage? Quote Link to comment Share on other sites More sharing options...
ciroceissler Posted August 8, 2014 Author Report Share Posted August 8, 2014 gcov only reach SC_MODULE line when the destructor is called, look at gdb results: "Breakpoint 1, ~test2 (this=0x7fff8447a790) at test2.h:29" So, I use 'return 0;' instead of 'exit(SUCCESS);' at sc_main from the first project. 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.