{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

468Lec03_SC_Concurrency

468Lec03_SC_Concurrency - ECEN 468 Advanced Logic Design...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 3: SystemC Concurrency ECEN 468 Advanced Logic Design ECEN 468 Lecture 3
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Modeling of Hardware Concurrency SystemC uses simulation processes to model concurrency Works like cooperative multitasking coordinated by the simulation kernel A process or a segment of process runs and then returns control to the kernel Non-preemptive, a poorly behaved process may hold control forever Chapter 6.1-6.7, “SystemC: From the Group Up” ECEN 468 Lecture 3 2
Image of page 2
SC_THREAD A C++ function registered as SC_THREAD (func_name) o Must be a member function of an SC_MODULE o Used only during the elaboration stage o Takes no argument and returns no values How does a thread yield control to the kernel? o Executing a return A thread is invoked only once, a return means permanent end, and cannot be restarted again o Call wait () ECEN 468 Lecture 3 3 Within SC_CTOR ()
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
wait() Model delays (such as those of signal propagation) in simulated time Suspends the thread temporarily Yield control to the kernel Resume the thread later ECEN 468 Lecture 3 4 wait (sc_time); // wait for specific amount of time wait (time_delay, time_unit); wait (event);
Image of page 4
Example of wait() ECEN 468 Lecture 3 5 #include “systemc.h” SC_MODULE (proc2){ void wiper( void ); void blinker( void ); SC_CTOR (proc2){ SC_THREAD (wiper); SC_THREAD (blinker); } … … }; void proc2::wiper( void ){ while (
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern