Jump to content

SDeepti

Members
  • Posts

    2
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by SDeepti

  1. No, you need to have loop with the function registered as SC_THREAD. For your code, it will be: void d_operation() { while(1){ if (reset.read()==1) { d_out = 0; // std::cout << "reset= " << reset << "...din= " << d_in << ".....d_out" << d_out << std::endl; } else { //d_out.write(d_in.read()); d_out=d_in; // wait(1, SC_NS); // std::cout << "reset= " << reset << "...din= " << d_in << ".....d_out" << d_out << std::endl; } wait(); } }
  2. You have registered d_operation() as a thread. Ideally a thread should have an infinite loop and a wait(). Adding that, you can see changes to your d_out. Also, how about having another thread that does the reset job?
×
×
  • Create New...