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

  }

};

您可以定義事件並在process方法中為其創建定時通知。 然后,在延遲結束時需要發生的任何事情都可以通過另一個對事件敏感的過程來完成。

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