Chapter 3 : Combination and Sequential Circuits Modeling

Slides:



Advertisements
Similar presentations
Tutorial 2 Sequential Logic. Registers A register is basically a D Flip-Flop A D Flip Flop has 3 basic ports. D, Q, and Clock.
Advertisements

The Verilog Hardware Description Language
Synchronous Sequential Logic
ECE C03 Lecture 131 Lecture 13 VHDL Structural Modeling Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Verilog Intro: Part 1.
Chapter 9 Pointers and Dynamic Arrays. Overview 9.1 Pointers 9.2 Dynamic Arrays.
Hardware Description Language (HDL)
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
Functions ROBERT REAVES. Functions  Interface – the formal description of what a subprogram does and how we communicate with it  Encapsulation – Hiding.
Chapter 1 OO using C++. Abstract Data Types Before we begin we should know how to accomplish the goal of the program We should know all the input and.
Chapter 3 : Combination and Sequential Circuits Modeling.
Latches Section 4-2 Mano & Kime. Sequential Logic Combinational Logic –Output depends only on current input Sequential Logic –Output depends not only.
Hung-Hsiang WuWindows Processing Design1 Chapter 3 基本觀念 變數宣告與型態 特殊運算子符號 字串與數值的轉換 類別與物件的觀念 建立新的專案 WinMain 程式進入點 Include Header File.
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.
Introduction to Counter in VHDL
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.
Modeling styles: 1. Structural Modeling: As a set of interconnected components (to represent structure), 2. Dataflow Modeling: As a set of concurrent assignment.
ECE 2372 Modern Digital System Design
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
1 Freeha Azmat Saba Zia Dec 02, Agenda Installation Introduction From Verilog to SystemC Counter as an Example Complete SystemC Modeling 2.
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.
Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog.
Winter-Spring 2001Codesign of Embedded Systems1 Reactivity, Ports, and Signals in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
1 Very Large Scale Integration II - VLSI II SystemC Gürer Özbek ITU VLSI Laboratories Istanbul Technical University.
Module 1.2 Introduction to Verilog
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
The Verilog Hardware Description Language. GUIDELINES How to write HDL code: How to write HDL code:
George Mason University Simple Testbenches ECE 545 Lecture 4.
VHDL – Behavioral Modeling and Registered Elements ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr.
M.Mohajjel. Structured Procedures Two basic structured procedure statements always initial All behavioral statements appear only inside these blocks Each.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
Chapter1: Introduction Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 1-1 Chapter 1: Introduction Prof. Ming-Bo.
Overview Logistics Last lecture Today HW5 due today
Reg and Wire:.
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
‘if-else’ & ‘case’ Statements
Behavioral Modeling Structural modeling Behavioral modeling
Lecture 2 Supplement Verilog-01
Chapter 7 - Pointers Outline 7.1 Introduction
SystemC for SoC Designs
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Design & Co-design of Embedded Systems
CS150 Introduction to Computer Science 1
Combinational Circuits
The Verilog Hardware Description Language
Supplement on Verilog adder examples
The Verilog Hardware Description Language
XOR Function Logic Symbol  Description  Truth Table 
Variables variable variable_name: variable_type
ECE 545 Lecture 5 Simple Testbenches.
Chapter 1 : SystemC Overview
System Controller Approach
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

Chapter 3 : Combination and Sequential Circuits Modeling

SC_MODULE SC_MODULE (module_name) { // declarations of ports : input, output and inout // Declarations of signals used in inter-process // Communication // Process method declarations // Other (non-process) methods // Child module instantiation pointer declarations // Data variable declarations SC_CTOR (module_name) { //Child module instantiations and interconnections SC_METHOD (process_method_name); // Sensitivity list for process SC_THREAD (process_method_name);

Combination Logic : Single Process SC_MODULE (mac) { sc_in<int> a, b, c; sc_out<int> sum; void proc_mac() { sum = a * b + c;}; SC_CTOR(mac) { SC_METHOD(proc_mac) sensitive << a << b << c; } };

Combination Logic Multiple Processes SC_MODULE (mult_procs) { Sc_int<bool> source; Sc_out<bool> drain; Sc_signal<bool> connect1, connect2; void mult_procs_1() { connect1 = !source;); void mult_procs_2() { connect2 = !connect;}; void mult_procs_3() { drain = !connect2;}; SC_CTOR (mult_procs) { SC_METHOD (mult_procs_1); sensitvie << source; SC_METHOD (mult_procs_2); sensitvie << connect1; SC_METHOD (mult_procs_3); sensitvie << connect2; } };

Sequential Logic Example SC_MODULE (count4) { //sc_in_clk  sc_in<bool> sc_in_clk clk; sc_in<bool> rst; sc_out<int> cout; int curValue; void proc_mac() { curValue = rst ? 0 : curValue + 1; cout = curValue;}; SC_CTOR(mac) { SC_METHOD(proc_mac) sensitive_pos << clk << rst; //async reset sensitive_pos << clk; //sync reset } };

Port Read and Write Issues Code SC_MODULE (xor) { sc_in<sc_uint<4> > bre, sty; sc_out<sc_uint<4> > tap; void proc_xor() { tap = bre ^ sty;}; SC_CTOR (xor) { SC_METHOD (proc_xor); sensitive << bre << sty; } }; Compiler error error C2678: 二元運算子 '^' : 找不到使用左方運算元型別 'sc_in<T>' 的運算子 (或是沒有可接受的轉換) with [ T=sc_dt::sc_uint<4> ]

Port Read and Write Issues (cont.) Code SC_MODULE (xor) { sc_in<sc_uint<4> > bre, sty; sc_out<sc_uint<4> > tap; void proc_xor() { tap = bre.read() ^ sty.read();}; tap.write(bre.read() ^ sty.read()); SC_CTOR (xor) { SC_METHOD (proc_xor); sensitive << bre << sty; } }; Suggestion Explicitly use port’s read and write method

Process Function Call No hierarchy Sensitivity List Processes can’t call other processes directly Sensitivity List

Process : SC_METHOD vs SC_THREAD void full_adder::proc_full_adder() { sum = a ^ b ^ carry; co = (a & b) | (b & carry) | (carry & a); } SC_THREAD while (true) { wait();

Process : SC_THREAD example void blah::proc() { while (true) { if (mem_ready) { tdata.range(7,0) = data8.read(); wait(); tdata.range(15,8) = data8.read(); tdata.range(23,16) = data8.read(); …. } …

Process : wait and wait_until No argument Process will be reactivated when certain variables, specified in sensitivity list, changes Wait_until() Need argument(s) Prcoess will be reactivated when expression is true Example // now wait for ready signal from memory // controller wait_until(mem_ready.delayed() == true);