468Lec03_SC_Concurrency

H scmoduleproc2 void wipervoid void blinkervoid

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: E(proc2){ void wiper(void); void blinker(void); SC_CTOR(proc2){ SC_THREAD(wiper); SC_THREAD(blinker); } …… }; void proc2::wiper(void){ while(true){ wipe_left(); wait(99,SC_MS); wipe_right(); wait(99,SC_MS); } } void proc2::blinker(void){ while(true){ blink=true; wait(99,SC_MS); blink=false; wait(99,SC_MS); } } ECEN 468 Lecture 3 5 Main Steps of SytemC Run Elaboration o Instantiate modules o Instantiate connections among modules Initialization o Identify runnable and waiting processes Simulation Post-processing Runnable P1 P2 ECEN 468 Lecture 3 Running P3 Waiting P4 Done P5 6 Simplified Simulation Engine sc_main() Elaborate sc_start() Simplified SystemC Simulation Kernel While runnable processes exists Execute code, suspend wait() or exit Initialize Evaluate Advance time Cleanup No more to do or sc_stop() ECEN 468 Lecture 3 Wait for time 7 Simulation Termination The evaluation and advance-time loop terminates if o All processes have yielded (nothing in the runnable set) o A process executes sc_stop( ) o Internal 64-bit time variable runs out of values ECEN 468 Lecture 3 8 Simulation Schedule The order of process run at a specific simulated time is uncertain but repeatable Bottom line: your code should not depend on a specific order Process_A Process_B Process_C t1 t2 ECEN 468 Lecture 3 t3 Simulated time 9 SystemC Events The occurrence of an sc_event notification and happens at a single instant in time, has no d...
View Full Document

This note was uploaded on 03/02/2014 for the course ECEN 468 taught by Professor Jianghu during the Spring '08 term at Texas A&M.

Ask a homework question - tutors are online