-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;

  }

};
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). Commented Feb 2, 2023 at 16:26

1 Answer 1

1

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;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.