简体   繁体   English

如何使用 sc_method 模拟 output 延迟但不在 SystemC 中使用 next_trigger()?

[英]How to simulate output delay using sc_method but without using next_trigger() in SystemC?

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;

  }

};

You can define an event and create a timed notification for it within your process method.您可以定义事件并在process方法中为其创建定时通知。 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;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM