[英]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.