-1
SC_MODULE(example) {

  sc_in < int > a, b;

  sc_in < int > out

  Void process() {

    // Output delay implement here

  }

  SC_CTOR(example) {

    SC_METHOD(process);

    sensitivity << a << b;

  }

};
toolic
  • 57,801
  • 17
  • 75
  • 117
anu ch
  • 1
  • The question should give some information about what problem you are trying to solve by modeling a delay through a method, as well as some information about why you think you need to use a method here (just in case we can suggest another option). – RayaneCTX Feb 02 '23 at 16:26

1 Answers1

0

You can define an event and create a timed notification for it within your process method. Then, whatever needs to happen at the end of your delay can be done through another process that is made sensitive to the event.

sc_core::sc_event delay_e;

void process() {
    delay_e.notify(<enter your delay here>);
}

void respond() {
    // Do what needs to happen at the end of the delay...
}

SC_CTOR(example) {
    // ...

    SC_METHOD(respond);
    dont_initialize();
    sensitive << delay_e;
}
RayaneCTX
  • 573
  • 4
  • 13