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?

1 Answer 1

4

Use the dont_initialize method see the Language Reference Manual

SC_CTOR(control) {
    SC_METHOD(fsm1);
    sensitive << id1_cmd;
    dont_initialize();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.