Jump to content
Sign in to follow this  
ciroceissler

line coverage with gcov

Recommended Posts

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?
 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...