Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Call host code functions with dependency analysis. Use angle brackets to point to an extern function. You can also declare extern variables

Column
width50%
Code Block
languagesct
linenumberstrue
scchart MainSCChart {
 
} 

...

Column
width50%
Code Block
languagesct
linenumberstrue
@hostcode "#include <stdio.h>"
@hostcode "#include <stdlib.h>"
@hostcode "#include <unistd.h>"
@hostcode "#include <sys/time.h>"
@hostcode "struct timeval val;"
scchart hostcode {
  output int ms;
  
  initial state getChar {
    entry / 'gettimeofday(&val, NULL)'; 
    		ms = 'val.tv_sec'
  }
  --> print with / 'printf("Second: %d\\n", ms); fflush( stdout )';
  
  state print 
  --> getChar;
}
 
Column
width50%


Image Modified

Annotations

...