Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread support for continue #374

Open
zhuanhao-wu opened this issue Oct 31, 2022 · 0 comments
Open

thread support for continue #374

zhuanhao-wu opened this issue Oct 31, 2022 · 0 comments
Labels

Comments

@zhuanhao-wu
Copy link
Collaborator

https://github.com/intel/systemc-compiler/blob/main/tests/cthread/test_continue.cpp

For continue_break_exit1, we are currently generating the following, where the next state is not assigned for state 1.

    void continue_break_exit1() {
        int k = 0;
        wait();
        
        while (1) {
            k = 0;
            for ( ; ; ) {
                wait();
                k = k + 1;
                if (a.read()) {
                    break;
                } else {
                    continue;
                }
                sct_assert_level(2);
            }
            sct_assert_level(1);
            k = 1;
        }
    }   
    hProcesses  NONAME [
      hProcess continue_break_exit1 [
        hFunction continue_break_exit1_func [
          hFunctionRetType  NONAME NOLIST
          hCStmt  NONAME [
            hSwitchStmt  NONAME [
              hVarref state_continue_break_exit1# NOLIST
              hCStmt  NONAME [
                hSwitchCase  NONAME [
                  hLiteral 0 NOLIST
                  hVarAssign  NONAME [
                    hVarref k_continue_break_exit1_thread_0 NOLIST
                    hLiteral 0 NOLIST
                  ]
                  hBinop = [
                    hVarref _next_state_continue_break_exit1# NOLIST
                    hLiteral 1 NOLIST
                  ]
                  hReturnStmt  NONAME NOLIST
                ]
                hSwitchCase  NONAME [
                  hLiteral 1 NOLIST
                  hIfStmt  NONAME [
                    hLiteral 1 NOLIST
                    hCStmt  NONAME NOLIST
                  ]
                  hBinop = [
                    hVarref k_continue_break_exit1_thread_0 NOLIST
                    hLiteral 0 NOLIST
                  ]
                  hIfStmt  NONAME [ // notice here, there is no condition
                    hCStmt  NONAME NOLIST
                  ]
                  hIfStmt  NONAME [
                    hSigAssignR read [
                      hVarref a_scclang_global_0 NOLIST
                    ]
                    hCStmt  NONAME NOLIST
                  ]
                ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant