Design & Co-design of Embedded Systems Processes in SystemC Maziar Goudarzi.

Slides:



Advertisements
Similar presentations
VHDL 5 FINITE STATE MACHINES (FSM) Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at.
Advertisements

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.
Synchronous Sequential Logic
Combinational Logic.
Hardware Description Language (HDL)
Design & Co-design of Embedded Systems Synchronous Sequential Logic (2) and Miscellaneous Logic in SystemC Maziar Goudarzi.
Digital System Design Verilog ® HDL Behavioral Modeling (3) Maziar Goudarzi.
CSE Spring Verilog for Sequential Systems - 1 Today: Verilog and Sequential Logic zFlip-flops yrepresentation of clocks - timing of state.
Chapter 3 : Combination and Sequential Circuits Modeling.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Chapter 6 : Channel Refinement. SystemC Communication Refinement Vital part of overall system refinement: Add more details  To gain more precise analysis.
Why Behavioral Wait statement Signal Timing Examples of Behavioral Descriptions –ROM.
ELEN 468 Lecture 161 ELEN 468 Advanced Logic Design Lecture 16 Synthesis of Language Construct II.
Copyright © 2001 Stephen A. Edwards All rights reserved SystemC Prof. Stephen A. Edwards.
Digital System Design Verilog ® HDL Tasks and Functions Maziar Goudarzi.
Copyright © 2001 Stephen A. Edwards All rights reserved SystemC Prof. Stephen A. Edwards.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 14: SystemC (2/3) Prof. Sherief Reda Division of.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 13: SystemC (1/3) Prof. Sherief Reda Division of.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Timing control in verilog Module 3.1 Delays in Verilog.
Overview Logistics Last lecture Today HW5 due today
Introduction to Counter in VHDL
Tasks and Functions Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar Gudarzi.
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.
ECE 2372 Modern Digital System Design
SystemC Tutorial Author: Silvio Veloso
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
1 Freeha Azmat Saba Zia Dec 02, Agenda Installation Introduction From Verilog to SystemC Counter as an Example Complete SystemC Modeling 2.
Winter-Spring 2001Codesign of Embedded Systems1 Processes in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
Design & Co-design of Embedded Systems Combinational Logic in SystemC Maziar Goudarzi.
Modules and Processes in SystemC A Presentation by: Najmeh Fakhraie Mozhgan Nazarian-Naeini Hardware-Software Codesign Spring 2006.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Winter-Spring 2001Codesign of Embedded Systems1 Reactivity, Ports, and Signals in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
1 IMEC / KHBO June 2004 Micro-electronics SystemC Dorine Gevaert.
1 Very Large Scale Integration II - VLSI II SystemC Gürer Özbek ITU VLSI Laboratories Istanbul Technical University.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
1 EE121 John Wakerly Lecture #12 PLD-based state machine structures WITH statements Finite-memory state-machine design PLD-based state-machine design.
CPE 626 The SystemC Language – VHDL, Verilog Designer’s Guide Aleksandar Milenkovic Web:
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
Object Oriented Simulation with OOSimL Conditional Waiting.
Introduction to ASIC flow and Verilog HDL
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
Design & Co-design of Embedded Systems Introduction to SystemC Maziar Goudarzi.
Timing Controls in Behavioral Modeling Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar.
1 Ivan Marsic Rutgers University LECTURE 19: Concurrent Programming.
Winter-Spring 2001Codesign of Embedded Systems1 Modules in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
Verilog® HDL Behavioral Modeling (2)
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
A Fast SystemC Engine D. Gracia Pérez LRI, Paris South Univ. O. Temam LRI, Paris South Univ. G. Mouchard LRI, Paris South Univ. CEA.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Interacting Finite State Machine Design Shaun Murphy.
Winter-Spring 2001Codesign of Embedded Systems1 Processes in SystemC: Examples and Exercises Part of HW/SW Codesign of Embedded Systems Course (CE )
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
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.
ECE 4110–5110 Digital System Design
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Chapter 3 : Combination and Sequential Circuits Modeling
B e h a v i o r a l to R T L Coding
Digital System Design Verilog ® HDL Scheduling Semantics Maziar Goudarzi.
Tsao, Lin-wei Li, Han-lin Hu, Sun-Bo
SystemC for SoC Designs
Design & Co-design of Embedded Systems
Design & Co-design of Embedded Systems
Presentation transcript:

Design & Co-design of Embedded Systems Processes in SystemC Maziar Goudarzi

2005 Design & Co-design of Embedded Systems2 Today Program zProcesses in SystemC zElements in defining processes in SystemC zSome examples

2005 Design & Co-design of Embedded Systems3 Process zModule yBasic unit of hierarchy (basic building block) in SystemC zProcess yBasic unit of execution in SystemC zProcesses are called to emulate the behavior of a target device or system

2005 Design & Co-design of Embedded Systems4 Process zBasics yBasic unit of execution within SystemC yEmulate the behavior of target device yAre triggered by clock edges and/or signal expressions yProcesses are not hierarchical xA process does not call another process C++ allows this. Avoid using that. yProcesses communicate through signals

2005 Design & Co-design of Embedded Systems5 Process (cont’d) Module Process 1 Process 2 Internal signal Input ports IO port Output ports

2005 Design & Co-design of Embedded Systems6 Process (cont’d) zEach process has ySensitivity list yExecution type yA series of statements zA process is specified in two parts yProcess declaration xRegisters the process with the SystemC simulation kernel yProcess definition xSpecifies the C++/SystemC statements that the process executes

2005 Design & Co-design of Embedded Systems7 Process (cont’d) zProcess declaration ySensitivity list + execution type yMust be given to SystemC simulation kernel to enable simulation xSystemC uses SC_MODULE constructor for this xExample: SC_CTOR(a_module) { SC_METHOD(a_process); sensitive<<a_port; }

2005 Design & Co-design of Embedded Systems8 Process (cont’d) zProcess definition yThe series of statements (operations) to be executed xIncludes reading/writing ports, signals, and variables Any valid C++ statement (display messages, calculations, etc.)  SystemC uses SC_MODULE member functions for this xSystemC simulation kernel calls this member function when a corresponding event happens xExample: SC_MODULE(a_module) { void a_process(void) {... } SC_CTOR(a_module) { SC_METHOD(a_process); } };

2005 Design & Co-design of Embedded Systems9 Process (cont’d) zCommunication between processes  SystemC (actually C++) allows to use SC_MODULE data members for this xShould we use that? Why?  Use signals ( sc_signal<> type) to synchronize processes

2005 Design & Co-design of Embedded Systems10 Declaring a Process zProcess sensitivity list yList of events that trigger this process yThree types of sensitivity xsensitive Any change of value on the port/signal triggers the process xsensitive_pos A positive edge on the port/signal triggers the process xsensitive_neg A negative edge on the port/signal triggers the process yGeneral syntax xsensitive << port_1 << signal_1 <<... << port_n xsensitive_pos << port_1 << signal_1; xsensitive_neg << port_1 << signal_1;

2005 Design & Co-design of Embedded Systems11 Declaring a Process (cont’d) zProcess sensitivity list (cont’d) yThe other syntax: xsensitive( port1 ); sensitive( signal1 ); xsensitive_pos( port1 ); sensitive_pos( sig1 ); xSensitive_neg( port1 ); sensitive_neg( sig1 );

2005 Design & Co-design of Embedded Systems12 Declaring a Process (cont’d) zProcess execution types in SystemC yDefines the way that the process is executed yProcess types xMethod xThread xClocked Thread

2005 Design & Co-design of Embedded Systems13 Execution Types of Processes in SystemC zThree types of Process in SystemC yMethods  SC_METHOD process yThreads  SC_THREAD process yClocked threads  SC_CTHREAD process

2005 Design & Co-design of Embedded Systems14 SC_METHOD Process zIs called once, when events occur on its sensitivity list  Cannot suspend execution (i.e. cannot wait() )  wait() is a function in SystemC kernel.  What happens if you put a wait() in a SC_METHOD process? zReturns control to the caller (SystemC Kernel)

2005 Design & Co-design of Embedded Systems15 Method Example: Packet Receiver #include “frame.h” SC_MODULE(rcv) { sc_in xin; sc_out id; void extract_id(); SC_CTOR(rcv){ SC_METHOD(extract_id); sensitive(xin); }}; void rcv::extract_id() { frame_type frame; frame = xin; if(frame.type==1) id = frame.ida; else id = frame.idb; } rcv frame id xinid

2005 Design & Co-design of Embedded Systems16 SC_THREAD Process  Declaration to SystemC kernel is the same as SC_METHOD process zCan be suspended and re-activated  wait() system call xProcess is re-activated when an event occurs on process sensitivity list zGeneral syntax: void a_thread_process() { // some statements (initialization) while ( 1) { // some other statements wait(); }

2005 Design & Co-design of Embedded Systems17 SC_THREAD Example: Traffic Light Controller SC_MODULE(traff) { sc_in roadsensor; sc_in clock; sc_out NSred; sc_out NSyellow; sc_out NSgreen; sc_out EWred; sc_out EWyellow; sc_out EWgreen; void control_lights(); SC_CTOR(traff){ SC_THREAD(control_lights); sensitive << roadsensor; sensitive_pos << clock; } }; Road Sensor

2005 Design & Co-design of Embedded Systems18 SC_THREAD Example: Traffic Light Controller (cont’d) void traff::control_lights() { NSred = NSyellow = false; NSgreen = true; EWred = true; EWyellow = EWgreen = false; while (true) { while (roadsensor == false) wait(); NSgreen = false; NSyellow = true; NSred = false; for (i=0; i<5; i++) wait(); NSgreen = NSyellow = false; NSred = true; EWgreen = true; EWyellow = EWred = false; for (i= 0; i<50; i++) wait(); NSgreen = NSyellow = false; NSred = true; EWgreen = false; EWyellow = true; EWred = false; for (i=0; i<5; i++) wait();

2005 Design & Co-design of Embedded Systems19 SC_THREAD Example: Traffic Light Controller (cont’d) NSgreen = true; NSyellow = NSred = false; EWgreen = EWyellow = false; EWred = true; for (i=0; i<50; i++) wait(); } // while (true) }

2005 Design & Co-design of Embedded Systems20 SC_THREAD Process (cont’d)  The SC_THREAD process is the most general one  Implementing traff module with SC_METHOD process requires defining several states zPerformance issue ySC_THREAD simulation is slower than SC_METHOD

2005 Design & Co-design of Embedded Systems21 SC_CTHREAD Process  The same as SC_THREAD, but is merely sensitive to edge of one clock zResults in better descriptions for synthesis zOne major use: Implicit state machine zImplicit state machine vs. Explicit state machine zAdditional waiting mechanisms  wait_until( ) system call xProcess is re-activated when the condition on the signals hold ytimed wait, wait until condition with timeout (SystemC 2.0)

2005 Design & Co-design of Embedded Systems22 SC_CTHREAD Example: Bus Controller SC_MODULE(bus) { sc_in_clk clock; sc_in newaddr; sc_in > addr; sc_in ready; sc_out > data; sc_out start; sc_out datardy; sc_inout > data8; sc_uint tdata; sc_uint taddr; void xfer(); SC_CTOR(bus) { SC_CTHREAD(xfer, clock.pos()); datardy.initialize(true); } }; Bus Cntrlr Mem Cntrlr addr 32 newaddrstart data8 ready data 32 datardy

2005 Design & Co-design of Embedded Systems23 SC_CTHREAD Example: Bus Controller (cont’d) void bus::xfer() { while (true) { wait_until( newaddr.delayed() == true); taddr = addr.read(); datardy = false; data8 = taddr.range(7,0); start = true; wait(); data8 = taddr.range(15,8); start = false; wait(); data8 = taddr.range(23,16); wait(); data8 = taddr.range(31,24); wait(); wait_until(ready.delayed() == true); tdata.range(7,0)=data8; wait(); tdata.range(15,8)=data8; wait(); tdata.range(23,16)=data8; wait(); tdata.range(31,24)=data8; data = tdata; datardy = true; }

2005 Design & Co-design of Embedded Systems24 What we learned today zProcesses in SystemC yVarious sensitivity styles yVarious execution styles zSystemC ver. 2.0 User’s Guide yMost of Chapter 4

2005 Design & Co-design of Embedded Systems25 Assignments zToday: Due date for Assignment 1 zAssignment 2: yIs put on the course web-page 1.Implement the traffic-light controller using only SC_METHOD 2.Model a file-server and its clients yDue date: xOne week from now: Tuesday, Aban 3rd

2005 Design & Co-design of Embedded Systems26 Complementary Notes: SystemC_Win zhttp://

2005 Design & Co-design of Embedded Systems27 Complementary Notes: SystemC_Win zhttp://