[英]Problems handling sc_logic values in SystemC
I'm writing an application in order to simulate a hardware system using SystemC libraries. 我正在编写一个应用程序,以便使用SystemC库模拟硬件系统。 My problem is handling the
sc_logic
type. 我的问题是处理
sc_logic
类型。 Consider a simple module 考虑一个简单的模块
SC_MODULE(MyModule) {
sc_in_clk clk;
sc_out<sc_logic> outsig;
void main_process();
SC_CTOR(MyModule) {
SC_METHOD(main_process);
sensitive << clk;
}
};
Consider the implementation of the process: 考虑执行过程:
void MyModule::main_process() {
this->outsig.write(SC_LOGIC_1);
}
OK. 好。 Problem:
outsig
is always '0'
and never changes its value. 问题:
outsig
始终为'0'
并且从不更改其值。 I write many signals in my simulation but this problem occurs only with sc_logic
values in sc_out
ports. 我在仿真中写入了许多信号,但是仅在
sc_out
端口中的sc_logic
值会出现此问题。
Can anybody help me? 有谁能够帮助我?
将sensitive << clk
放在构造函数中的SC_METHOD
之前 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.