468Lec20_SC_DynamicProcesses

This screfwheell lf scspawnrup scbindforkroadthread

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: void fork_thread(); bool road_thread(sc_fifo<double>& which); }; void Fork::fork_thread() { bool l_up, r_up; SC_FORK sc_spawn(&l_up, sc_bind(&Fork::road_thread, this, sc_ref(wheel_L), “lf”) , sc_spawn(&r_up, sc_bind(&Fork::road_thread, this, sc_ref(wheel_R), “rt”) SC_JOIN } Process name ECEN 468 Lecture 20 13 Design Hierarchy sc_main car_i engine_i fuelmix_i exhaust_i cylinder_i body_i wheel_left wheel_right Chapter 10, “SystemC: From the Ground Up” ECEN 468 Lecture 20 14 How To Instantiate Submodule? Direct top-level (sc_main) Indirect top-level Direct submodule header-only Direct submodule Indirect submodule header-only Indirect submodule ECEN 468 Lecture 20 15 Direct Top-Level // File: main.cpp #include <systemc> #include “Car.h” int sc_main(int argc, char* argv) { Car car_i(“car_i”); sc_start(); return 0; } ECEN 468 Lecture 20 16 Indirect Top-Level // File: main.cpp #include <systemc> #include “Car.h” int sc_main(int argc, char* argv) { Car* car_iptr; //Pointer to Car car_iptr = new Car(“car_i”); sc_start(); delete car_iptr; return 0; } ECEN 468 Lecture 20 17 Direct Submodule Header-Only // File: Ca...
View Full Document

This note was uploaded on 09/07/2012 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