简体   繁体   English

在SystemC中处理sc_logic值时出现问题

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

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