SystemC Scheduler Dynamic sensitivity.

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.
Computer Architecture CS 215
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
VHDL Quick Start Peter J. Ashenden The University of Adelaide.
Concurrency…leading up to writing a web crawler. Web crawlers.
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.
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
SystemC: Introduction. SystemC  A C++ based class library and design environment for system-level design.  Suitable for functional description that.
From Scenic to SystemC Mehrdad Abutalebi. Outline Introducing Scenic Scenic Implementation Modeling Reactivity A Simple example From Scenic to SystemC.
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.
Debugging Dwight Deugo Nesa Matic
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Tami Meredith, Ph.D. CSCI  Devices need CPU access  E.g., NIC has a full buffer it needs to empty  These device needs are often asynchronous.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
CSC321 Concurrent Programming: §5 Monitors 1 Section 5 Monitors.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
Multithreading in JAVA
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Concurrency & Dynamic Programming.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 7 Behavioral modeling of a dual ported register set.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 8: More BPEL Notes selected from.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Concurrent Programming in Java Based on Notes by J. Johns (based on Java in a Nutshell, Learning Java) Also Java Tutorial, Concurrent Programming in Java.
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.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
SystemC Language Tutorial Bishnupriya Bhattacharya Cadence Design Systems ISCUG 2013.
Threaded Programming in Python
Processes and threads.
IAY 0600 Digitaalsüsteemide disain
HDL simulation and Synthesis (Marks16)
Scan Library.
PROCESS MANAGEMENT IN MACH
Debugging Dwight Deugo
Timing Model Start Simulation Delay Update Signals Execute Processes
IAY 0600 Digital Systems Design
Behavioral modeling of a dual ported register set.
Important terms Black-box testing White-box testing Regression testing
Tsao, Lin-wei Li, Han-lin Hu, Sun-Bo
Important terms Black-box testing White-box testing Regression testing
Peter J. Ashenden The University of Adelaide
Copyright Joanne DeGroat, ECE, OSU
Operating Systems Chapter 5: Input/Output Management
Multithreading.
COT 5611 Operating Systems Design Principles Spring 2014
Marlon Dumas marlon.dumas ät ut . ee
Multithreading.
Multithreaded Programming
Threads Chapter 4.
Design & Co-design of Embedded Systems
Threads Chapter 5 2/17/2019 B.Ramamurthy.
Threads Chapter 5 2/23/2019 B.Ramamurthy.
How do you achieve deterministic concurrent simulation.
Timing & Concurrency II
Still Chapter 2 (Based on Silberchatz’s text and Nachos Roadmap.)
Debugging Dwight Deugo
Behavioral modeling of a dual ported register set.
RASSP Education & Facilitation
Copyright Joanne DeGroat, ECE, OSU
Threads and Multithreading
Timing & Concurrency II
Timing & Concurrency II
Presentation transcript:

SystemC Scheduler Dynamic sensitivity

Simulation Kernel

Kernel Scheduler: Evaluate-and-then-Update Semantics

Kernel Scheduler: Evaluate-and-then-Update Semantics In these steps some event ordering is required: You know that, but you should NOT bother NOR depend upon that!

Evaluate-and-Update Semantics at Work Synch_A Synch_B Synch_C R S T U V Z Virtual Time Comb_A Comb_B Update Phase Delta Cycle Evaluate Phase Simulated Time 0 ns 1*Tck 2*Tck Clock Cycle

Event-Driven Simulation Virtual Time STOP Order of evaluate and update actions does (and should) not matter Update T Delta Cycle Update V Delta cycles stop when no other sensitivity list changes Each evaluate action reads in the old values of its input signals Many delta cycles are executed by the simulation kernel to complete the simulation for a given discrete point of the “simulated time” Procedure is repeated for the next clock cycle at time 1*Tck Evaluate Comb_B Evaluate Comb_A Update S Update Z Update U Evaluate Synch_B Delta Cycle Evaluate Synch_A Evaluate Synch_C 0 ns Simulated Time

Dynamic sensitivity lists are created during simulation time. When a wait(args) is executed, the thread process suspends. The Process is re-invoked based on the dynamic sensitivity list, which is determined by the arguments in the wait(args) function.

sc_event Event Sc_event: Something that happens at a specific point in time. Has no value or duration Sc_event: A class to model an event Can be triggered and caught. important (the source of a few coding errors): Events have no duration  you must be watching to catch it If an event occurs, and no processes are waiting to catch it, the event goes unnoticed.

sc_event you can perform only two actions with an sc_event: wait for it wait(ev1) SC_THREAD(my_thread_proc); sensitive << ev_1; // or sensitive(ev_1) cause it to occur notify(ev1) Common misunderstanding: if (event1) do_something Events have no value You can test a Boolean that is set by the process that caused an event; However, it is problematic to clear it properly.

Dynamic Sensitivity Given: wait for an event in a list of events: sc_event e1,e2,e3; // events sc_time t(200, SC_NS); // variable t of type sc_time wait for an event in a list of events: wait(e1); wait(e1 | e2 | e3); // wait on e1, e2 or e3 wait for an event in a list of events: wait( e1 & e2 & e3); // wait on e1, e2 and e3 The events do not need to occur at the same time. (Events are "collected" until all three have occurred). wait for specific amount of time: wait(200, SC_NS); // wait for 200 ns wait(t); // wait for 200 ns

Dynamic Sensitivity wait for events with timeout: // wait on e1,e2, or e3,timeout after 200 ns wait(200, SC_NS, e1 | e2 | e3); // wait on e1, e2, or e3, timeout after 200 ns wait(t, e1 | e2 | e3); // wait on e1,e2, and e3,timeout after 200 ns wait(200, SC_NS, e1 & e2 & e3); timed_out() boolean function: wait(t_MAX_DELAY, ack_event | bus_error_event); if (timed_out()) break; // path for a time out wait for one delta cycle: wait( 0, SC_NS ); // wait one delta cycle wait( SC_ZERO_TIME ); // wait one delta cycle

notify() event_name.notify(args); event_name.notify_delayed(args); To trigger an event. Syntax: event_name.notify(args); event_name.notify_delayed(args); notify(args,event_name); Immediate Notification: causes processes which are sensitive to the event to be made ready to run in the current evaluate phase of the current delta-cycle. Delayed Notification: causes processes which are sensitive to the event to be made ready to run in the evaluate phase of the next delta-cycle. Timed Notification: causes processes which are sensitive to the event to be made ready to run at a specified time in the future.

notify(): Examples Given: Immediate: Delayed: Timed: sc_event my_event; // event sc_time t_zero (0,SC_NS); // variable t_zero of type sc_time sc_time t(10, SC_MS); // variable t of type sc_time Immediate: my_event.notify(); // current delta cycle notify(my_event); // current delta cycle Delayed: my_event.notify_delayed(); // next delta cycle my_event.notify(t_zero); // next delta cycle notify(t_zero, my_event); // next delta cycle Timed: my_event.notify(t); // 10 ms delay notify(t, my_event); // 10 ms delay my_event.notify_delayed(t); // 10 ms delay

Method Process: Dynamic Sensitivity next_trigger() Method processes may have a dynamic sensitivity list - but it is different than for a thread. A method process (and only a method process) may call the function next_trigger() to create dynamic sensitivity. The function next_trigger sets the dynamic sensitivity of the method process instance from which it is called for the very next occasion on which that process instance is triggered, and for that occasion only. Arguments are the same as wait().

next_trigger(): Examples Given: sc_event e1,e2,e3; // event sc_time t(200, SC_NS); // variable t of type sc_time trigger on an event in a list of events: next_trigger(e1); next_trigger(e1 | e2 | e3); // trigger on e1, e2 or e3 trigger on all events in a list: next_trigger( e1 & e2 & e3); // trigger on e1, e2 and e3 trigger after a specific amount of time: next_trigger(200, SC_NS); // trigger 200 ns later next_trigger(t); // trigger 200 ns later

Method Process: Dynamic Sensitivity If next_trigger is called more than once during a single execution of a particular method process, the last call prevails. (The earlier calls are cancelled). If an invocation of a method process does not call next_trigger(), then the static sensitivity list will be restored. if no argument is specified, then the static sensitivity list is used. Calling next_Trigger() does not suspend the current method process.

Kernel scheduler: the final algorithm! Initialization: execute all processes (except SC_CTHREADs) in an unspecified order Evaluate: select a process that is ready to run and resume its execution. This may cause immediate event notification to occur, which may result in additional processes being made ready to run in this same phase Repeat step2 until there are no processes ready to run Update: execute all pending calls to update() resulting from calls to request_update() made in step 2. If there were any delta event notifications made during steps 2 or 4, determine which processes are ready to run due to all those events and go back to step 2 If there are no timed events, simulation is finished. Advance the simulation time to the time of the earliest pending timed event notification Determine which processes are ready to run due to all the timed events at what is now the current time, and go back to step 2.