Jump to content

error: ‘process’ is not a member of ‘host_cntrl::SC_CURRENT_USER_MODULE’


Recommended Posts

Thanks for the response guys ...

host_cntrl.hpp

#ifndef HOST_CNTRL_H
#define HOST_CNTRL_H
#include "systemc.h"

class host_cntrl : public sc_module
{
  public:
  SC_CTOR(host_cntrl) {
  SC_THREAD(process);
  }
  //SC_HAS_PROCESS(host_cntrl);
  
  private 
 ......

 }
 

then in host_cntrl.cpp

#include "host_cntrl.hpp"

void host_cntrl::process()
{
  while(1)
  {
  wait(e_HCE);//Host COntroller is enabled by SW
  cout <<"hello"<<endl;
  }
}

Link to post
Share on other sites

thanks that problem is solved ....

now i am using this

bool HCE_register::behavior_after_write(uint32_t data){
       sc_event e_HCE;
       if(data==0x01)
         return e_HCE.notify();
       else
         return 0;
 }

and in other code as mentioned above host_cntrl.cpp  i am using it ...

 

But am getting this compilation error ..

home/mic-24/Desktop/dmi/ufs_dmi/ufs/src/ufs_registers.cpp: In member function ‘bool HCE_register::behavior_after_write(uint32_t)’:
/home/mic-24/Desktop/dmi/ufs_dmi/ufs/src/ufs_registers.cpp:614: error: void value not ignored as it ought to be

could you explain me this errror here ???

Link to post
Share on other sites
bool HCE_register::behavior_after_write(uint32_t data){
       sc_event e_HCE;          // <-- strange
       if(data==0x01)
         return e_HCE.notify(); // <-- error
       else
         return 0;
 }

 

The error is caused by the fact that the notify() function of sc_event returns nothing (i.e. 'void').

So you can't return the (non-existing) return value in the marked line above.

 

Secondly, e_HCE is a local variable.  You won't be able to trigger any other process by notifying this event.  This looks wrong as well.

 

/Philipp

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.

×
×
  • Create New...