Tsao, Lin-wei Li, Han-lin Hu, Sun-Bo

Slides:



Advertisements
Similar presentations
CS 3850 Lecture 6 Tasks and Functions. 6.1 Tasks and Functions Tasks are like procedures in other programming languages. e. g., tasks may have zero or.
Advertisements

Simulation Verification of Different Constraints in System Level Design in SystemC Piyush Ranjan Satapathy CS220 Class Project Presentation.
VBA Modules, Functions, Variables, and Constants
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Case, Arrays, and Structures. Summary Slide  Case Structure –Select Case - Numeric Value Example 1 –Select Case - String Value Example  Arrays –Declaring.
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
Why Behavioral Wait statement Signal Timing Examples of Behavioral Descriptions –ROM.
Topics of Lecture Structural Model Procedures Functions Overloading.
Topics Entity DeclarationsEntity Declarations Port ClausePort Clause Component DeclarationComponent Declaration Configuration DeclarationConfiguration.
MicroC/OS-II Embedded Systems Design and Implementation.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Fundamentals of Python: From First Programs Through Data Structures
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
Parallel Processing (CS526) Spring 2012(Week 8).  Thread Status.  Synchronization in Shared Memory Programming(Java threads ) ◦ Locks ◦ Barriars.
SystemC: Introduction. SystemC  A C++ based class library and design environment for system-level design.  Suitable for functional description that.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
Inheritance. Introduction Inheritance is one of the cornerstones of object-oriented programming because it allows the creation of hierarchical classifications.
111 © 2002, Cisco Systems, Inc. All rights reserved.
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for.
Java Threads. What is a Thread? A thread can be loosely defined as a separate stream of execution that takes place simultaneously with and independently.
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
CS324e - Elements of Graphics and Visualization Timing Framework.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
Slides prepared by Rose Williams, Binghamton University Chapter 20 Java Never Ends.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
1 of 14 Ivan Ukhov Embedded Systems Laboratory Department of Computer and Information Science Linköping University TDDI08: Embedded Systems Design Introduction.
CIS 4930/6930 System-on-Chip Design Introduction to SystemC Hao Zheng Computer Science & Engineering U of South Florida.
TOPIC : SEQUENTIAL AND PARALLEL BLOCKS Module 2.3 : Behavioral modeling in verilog.
Chapter 4 – Thread Concepts
Tutorial 1 COEN691B.
SystemC Language Tutorial Bishnupriya Bhattacharya Cadence Design Systems ISCUG 2013.
IAY 0600 Digitaalsüsteemide disain
HDL simulation and Synthesis (Marks16)
Scan Library.
PROCESS MANAGEMENT IN MACH
Behavioral Style Combinational Design with VHDL
Applied Operating System Concepts -
Programming with ANSI C ++
Chapter 4 – Thread Concepts
Timing Model Start Simulation Delay Update Signals Execute Processes
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
This pointer, Dynamic memory allocation, Constructors and Destructor
Object Oriented Programming
LESSON 11 – WHILE LOOPS UNIT 5 – 1/10/17.
Exception Handling Chapter 9.
ECE 434 Advanced Digital System L08
SystemC Scheduler Dynamic sensitivity.
IAS 0600 Digital Systems Design
Exception Handling Chapter 9 Edited by JJ.
Multithreading.
Multithreaded Programming
Iterative Constructs Review
Test Fixture (Testbench)
Threads Chapter 4.
Design & Co-design of Embedded Systems
Threads Chapter 5 2/17/2019 B.Ramamurthy.
IAS 0600 Digital Systems Design
Threads Chapter 5 2/23/2019 B.Ramamurthy.
Timing & Concurrency II
Still Chapter 2 (Based on Silberchatz’s text and Nachos Roadmap.)
9-10 Classes: A Deeper Look.
Timing & Concurrency II
Timing & Concurrency II
CS561 Computer Architecture Hye Yeon Kim
9-10 Classes: A Deeper Look.
Presentation transcript:

Tsao, Lin-wei Li, Han-lin Hu, Sun-Bo SystemC (Week 3) Tsao, Lin-wei Li, Han-lin Hu, Sun-Bo 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Today’s Articles Chap. 2 Execution Semantics Chap. 4 Events Chap. 9 Processes 19 September 2018 Embedded Computing Lab

Chap. 2 Execution Semantics 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Execution Semantics Start at time = 0 Move forward only Time increment are base on the default time unit and time resolution. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab main() and sc_main() main() It is a part of SystemC library. It calls the function sc_main(). 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Elaboration Elaboration is defined as the execution of sc_main() function from the start if sc_main() to the first invocation of sc_start(). Includes the construction of instances of modules and channels to connect them, sc_object and sc_time variables. Invocation: 激發 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Elaboration sc_set_default_time_unit() Changing default time unit. sc_set_time_resolution() Changing time resolution. If the 2 functions are called, must called during elaboration. The 2 functions must also be called before any sc_time objects are constructed. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Elaboration During elaboration, the structural elements of the system are created and connected throughout the system hierarchy. Facilitated by C++ class object constructor behavior. There are no constraints on the order in which port to channel binding occurs during elaboration. a port must be bound to some channel, then the port must be bound by the time elaboration completes Facilitated: 使…容易 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Elaboration Finally, the top level modules are connected via channels in the sc_main() function. SystemC does not support the dynamic creation of modules. The structure of the system is created during elaboration time and does not change during simulation. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Initialization Initialization is the first step in the SystemC scheduler. dont_initialize() To turn off the initialization of a process, this function can be called after SC_METHOD or SC_THREAD process declaration inside the module constructor Macro (ref chap. 9) 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Initialization Different versions or a different simulator may yield a different result if care is not taken when writing models. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Simulation Semantics The SystemC scheduler: Controls the timing of process execution supports the notion of delta-cycles A delta-cycle consists of the execution of an evaluate and update phase. There may be a variable number of delta-cycles for every simulation time notion:想法 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Simulation Semantics SystemC processes are non-preemptive. The scheduler is invoked by sc_start(). Once scheduler is returned, simulation may continue from the time the scheduler last stopped by invoking the sc_start() function. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Simulation Semantics Once started the scheduler continues until there are no more events a process explicitly stops it (by calling the sc_stop() function) an exception condition occurs. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Scheduler Steps Initialize phase (chap. 2.3) Evaluate phase From the set of processes that are ready to run, select a process and resume its execution. The order is unspecified The execution of a process may include calls to the request_update() function which schedules pending calls to update() function in the update phase. The request_update() function may only be called inside member functions of a primitive channel. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Scheduler Steps Repeat step 2 for any other process ready to run. Update phase Execute any pending calls to update() from calls to the request_update() function executed in the evaluate phase. If there are pending delta-delay notifications, determine which processes are ready to run and go to step 2. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Scheduler Steps If there are no more timed event notifications, the simulation is finished. Else, advance the current simulation time to the time of the earliest (next) pending timed event notification. Determine which processes become ready to run due to the events that have pending notifications at the current time. Go to step 2. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Simulation functions sc_start() Called in sc_main() to start the scheduler. sc_stop() Called in sc_main() to stop the scheduler. Process can not be continued anymore Two functions are provided for the user to obtain the current simulation time. sc_time_stamp() (Chapter 12.20 ) sc_simulation_time() (Chapter 12.16 ). 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Event 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Event Occurrence 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Notification Immediate notification. Event occurs in the same evaluate phase within a delta-cycle Delta-delay notification. Event occurs in the evaluate phase within the next delta-cycle Non-zero delay notification (timed notification). Event occurs delayed by the time value 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Example Process C will be triggered only in this delta cycle. Example Code sc_event my_event ; // event declaration sc_time t (10, SC_NS) // declaration of a 10 ns time interval my_event.notify(); // immediate notification my_event.notify (SC_ZERO_TIME); // delta-delay notification my_event.notify (t); // notification in 10 ns 19 September 2018 Embedded Computing Lab

Canceling event notifications Define event and const value sc_event a, b, c; sc_time t(10, SC_MS); Notify an event a.notify(); // current delta-cycle notify(SC_ZERO_TIME, b); // next delta-cycle notify(t, c); // 10 ms delay Cancel an event notification a.cancel(); // Error! Can't cancel immediate notification b.cancel(); // cancel notification on event b c.cancel(); // cancel notification on event c 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Process 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Basic Concept Target A member function of a module class. Be invoked by events (sensitivity list). Static Sensitivity , Dynamic Sensitivity Not hierarchical. Type Method , Thread , Clocked Thread. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Method Process When completion, it returns control to the SystemC kernel (simulator scheduler). Never write infinite loop. Never call wait() to suspend process. Has no internal state. Code example 1. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Thread Process Be invoked only once (during simulation initialization). Be implemented with an infinite loop. When calling wait(), the process is suspended and internal state (local variables) is saved. The process is resumed by sensitivity list (state is restored). 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Static Sensitivity Be declared in the module constructor for that process. Both the () and the << operators are overloaded in sc_sensitive class. Code example 2. 19 September 2018 Embedded Computing Lab

Embedded Computing Lab Dynamic Sensitivity Set the sensitivity list in runtime for next trigger condition. Method process => next_trigger() Thread process => wait() 19 September 2018 Embedded Computing Lab

Dynamic Sensitivity - next_trigger Execution of a next_trigger() statement sets the sensitivity for the next trigger for the method process. If multiple next_trigger() statements are executed, the last one wins. 19 September 2018 Embedded Computing Lab

Dynamic Sensitivity - wait wait() specifies the condition for resuming the thread process. 19 September 2018 Embedded Computing Lab

Dynamic Sensitivity - Argument There are several different function prototypes for dynamic sensitivity. Code example 3. 19 September 2018 Embedded Computing Lab