1

My method fsm1 executes once even without event and therefore id1_cmd.read() and id1_value.read() contain 0 and not the correct values.

//------------------------------------------------------------------
//  Method:  control::fsm1() 
//  Parameter: None
//  @Sensitivity: ID_1_cmd (unsigned int)
//------------------------------------------------------------------
void control::fsm1() {
   cout << id1_cmd.read() << endl;
   cout << id1_value.read() << endl;

}

//------------------------------------------------------------------
//  Method: Constructor
//------------------------------------------------------------------
SC_CTOR(control) {
    SC_METHOD(fsm1);
    sensitive << id1_cmd;
}

Exists there a way to prevent it from executing once or do i have to handle that case always in my methods?

TheDoctor
  • 2,362
  • 4
  • 22
  • 39

1 Answers1

4

Use the dont_initialize method see the Language Reference Manual

SC_CTOR(control) {
    SC_METHOD(fsm1);
    sensitive << id1_cmd;
    dont_initialize();
}
systemcpro
  • 856
  • 1
  • 7
  • 15