Topics. Verilog. Verilog vs. VHDL (2) Verilog vs. VHDL (1)

Similar documents
Unit 2: High-Level Synthesis

Introduction to Electronic Design Automation. Model of Computation. Model of Computation. Model of Computation

High-Level Synthesis

VHDL simulation and synthesis

High-Level Synthesis (HLS)

Based on slides/material by. Topic Design Methodologies and Tools. Outline. Digital IC Implementation Approaches

Verilog Module 1 Introduction and Combinational Logic

Register Transfer Level in Verilog: Part I

HIGH-LEVEL SYNTHESIS

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

VHDL for Synthesis. Course Description. Course Duration. Goals

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

COE 561 Digital System Design & Synthesis Introduction

VHDL Sample Slides Rev Sample Slides from the 2-day and 4-day VHDL Training Courses

Overview. Ram vs Register. Register File. Introduction to Structured VLSI Design. Recap Operator Sharing FSMD Counters.

Reference. Wayne Wolf, FPGA-Based System Design Pearson Education, N Krishna Prakash,, Amrita School of Engineering

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Hardware Description Languages: Verilog

Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification.

Verilog for High Performance

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

Lecture 32: SystemVerilog

MODELING LANGUAGES AND ABSTRACT MODELS. Giovanni De Micheli Stanford University. Chapter 3 in book, please read it.

Verilog. Verilog for Synthesis

Writing Circuit Descriptions 8

Sequential Circuits. inputs Comb FFs. Outputs. Comb CLK. Sequential logic examples. ! Another way to understand setup/hold/propagation time

Verilog 1 - Fundamentals

Introduction to Verilog HDL

23. Digital Baseband Design

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

Hardware Description Languages & System Description Languages Properties

Digital VLSI Design with Verilog

Synthesis of Combinational and Sequential Circuits with Verilog

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

CAD for VLSI Design - I. Lecture 21 V. Kamakoti and Shankar Balachandran

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

EITF35: Introduction to Structured VLSI Design

Hardware/Software Partitioning for SoCs. EECE Advanced Topics in VLSI Design Spring 2009 Brad Quinton

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

CSE140L: Components and Design Techniques for Digital Systems Lab

Lecture 20: High-level Synthesis (1)

Sequential Logic Design

Hardware description languages

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

Controller FSM Design Issues : Correctness and Efficiency. Lecture Notes # 10. CAD Based Logic Design ECE 368

! ISP (circa 1977) - research project at CMU " Simulation, but no synthesis

Synthesis at different abstraction levels

CSE140L: Components and Design

Register Transfer Level

3 Designing Digital Systems with Algorithmic State Machine Charts

Verilog HDL. A Guide to Digital Design and Synthesis. Samir Palnitkar. SunSoft Press A Prentice Hall Title

Digital Design with SystemVerilog

EEL 4783: HDL in Digital System Design

Hardware Description Language VHDL (1) Introduction

Sunburst Design - Comprehensive SystemVerilog Design & Synthesis by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

Introduction to Verilog/System Verilog

EITF35: Introduction to Structured VLSI Design

Contents. Appendix D Verilog Summary Page 1 of 16

Chapter 2 Using Hardware Description Language Verilog. Overview

VLSI II E. Özgür ATES

Quick Introduction to SystemVerilog: Sequental Logic

EE 4755 Digital Design Using Hardware Description Languages

VERILOG 2: LANGUAGE BASICS

Overview. CSE372 Digital Systems Organization and Design Lab. Hardware CAD. Two Types of Chips

Chapter 4 :: Topics. Introduction. SystemVerilog. Hardware description language (HDL): allows designer to specify logic function only.

Chap 6 Introduction to HDL (d)

High Level Synthesis

PINE TRAINING ACADEMY

EECS150 - Digital Design Lecture 10 Logic Synthesis

תכן חומרה בשפת VERILOG הפקולטה להנדסה

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

Control and Datapath 8

Overview. Design flow. Principles of logic synthesis. Logic Synthesis with the common tools. Conclusions

Hardware Description Languages (HDLs) Verilog

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

A Brief Introduction to Verilog Hardware Definition Language (HDL)

Image Courtesy CS250 Section 2. Yunsup Lee 9/4/09

Chapter 10. case studies in sequential logic design

Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING. Fifth Semester. Subject: VHDL Programming

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

An introduction to CoCentric

Hardware Modeling using Verilog Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

RIZALAFANDE CHE ISMAIL TKT. 3, BLOK A, PPK MIKRO-e KOMPLEKS PENGAJIAN KUKUM. SYNTHESIS OF COMBINATIONAL LOGIC (Chapter 8)

Topics. Midterm Finish Chapter 7

DESIGN AND IMPLEMENTATION OF 8 BIT AND 16 BIT ALU USING VERILOG LANGUAGE

SoC Design for the New Millennium Daniel D. Gajski

Introduction to Field Programmable Gate Arrays

Sunburst Design - Verilog-2001 Design & Best Coding Practices by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

Digital Design with FPGAs. By Neeraj Kulkarni

VLSI DESIGN (ELECTIVE-I) Question Bank Unit I

Luleå University of Technology Kurskod SMD098 Datum Skrivtid

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

: : (91-44) (Office) (91-44) (Residence)

Transcription:

Topics Verilog Hardware modeling and simulation Event-driven simulation Basics of register-transfer design: data paths and controllers; ASM charts. High-level synthesis Initially a proprietary language, by Gateway Design Automation (a company later acquired by Cadence); introduced in 984. Released to the public domain in 990. Standardized by IEEE in 995. New IEEE standard in 200 with many enhancements (but backwards compatibility). Modern VLSI Design 3e: Chapter 8 Page Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 2 Copyright 998, 2002 Prentice Hall PTR Verilog vs. VHDL () Verilog is weakly typed, VHDL uses strong typing (wires do not even to be declared in Verilog); No mechanism for introducing new data types and use them; no packages either; Only implicit rules for distinguishing between signed and unsigned arithmetic (solved in Verilog 200); Verilog vs. VHDL (2) No separation of entity and architecture and no configurations (partially solved in Verilog 200); Very limited file I/O (can only read binary or hexadecimal files encoded in ASCII; solved in Verilog 200); No generate loops (solved in Verilog 200). Built-in support for gate-level modeling. Modern VLSI Design 3e: Chapter 8 Page 3 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 4 Copyright 998, 2002 Prentice Hall PTR

SystemVerilog Simulation coding New initiative to support system-level design with Verilog; Backwards compatible with Verilog; Adds strong typing (for new data types only) and object-oriented programming; Support for verification, with mechanisms such as assertions. Modern VLSI Design 3e: Chapter 8 Page 5 Copyright 998, 2002 Prentice Hall PTR Hardware description languages are typically supported by a simulation system: VHDL, Verilog, etc. Simulation engine takes care of scheduling events during simulation. Can hand-code a simulation in a programming language like C. Must be sure that register-transfer events happen in proper order. Modern VLSI Design 3e: Chapter 8 Page 6 Copyright 998, 2002 Prentice Hall PTR Sample C simulator C-based design () while (TRUE) { switch (state) { case S0: x = a + b; state = S; next; case S:... } } loop executed once per clock cycle each case corresponds to a state; sets outputs, next state In recent years, hardware description based on C/C++ is gaining popularity: it is the most popular programming language, avoids need to learn yet another language for hardware; eases hardware-software co-design by keeping the entire system description in one language. Modern VLSI Design 3e: Chapter 8 Page 7 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 8 Copyright 998, 2002 Prentice Hall PTR

C-based design (2) Many variants of C/C++ for hardware, e.g.: ART-C from Adelante (now ARM, to be used in course VLSI Signal Processing); HANDEL-C from Celoxica; SystemC, an open-source initiative supported by Synopsys, Adelante and many others (see www.systemc.org); it has a built-in eventdriven simulator. Simulation vs. programming Simulation tags computations with times. Must know when signals change to properly simulate hardware. Simulation is parallel. Many statements can execute at the same (simulation) time. Just like hardware. Modern VLSI Design 3e: Chapter 8 Page 9 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 0 Copyright 998, 2002 Prentice Hall PTR Types of simulation Event-driven simulation Compiled-code simulation. Generate program that evaluates a hardware block. Operational details within the hardware block are lost. Event-driven simulation. Propagate events through simulation. Don t simulate a block until its inputs change. Modern VLSI Design 3e: Chapter 8 Page Copyright 998, 2002 Prentice Hall PTR An event is a change in a net s value. An event has two components: value; time. net t=35 ns net net=0 @ 35 ns event time Modern VLSI Design 3e: Chapter 8 Page 2 Copyright 998, 2002 Prentice Hall PTR

Event propagation Timewheel Propagate events only when nets change value. If an input change doesn t cause an output change, no event is propagated. 0 0 0 0 no event The timewheel is a data structure in the simulator that efficiently determines the order of events processed. Events are placed on the timewheel in time order. Events are taken out of the head of the timewheel to process them in order. Modern VLSI Design 3e: Chapter 8 Page 3 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 4 Copyright 998, 2002 Prentice Hall PTR Timewheel operation Register-transfer design 0 a b netlist c c=0 @ 2 ns b= @ ns 0 time a= @ 0 ns Timewheel: a circular array Modern VLSI Design 3e: Chapter 8 Page 5 Copyright 998, 2002 Prentice Hall PTR A register-transfer system is a sequential machine. Register-transfer design is structural complex combinations of state machines may not be easily described solely by a large state transition graph. Register-transfer design concentrates on functionality, not details of logic design. Modern VLSI Design 3e: Chapter 8 Page 6 Copyright 998, 2002 Prentice Hall PTR

Register-transfer system example Data path-controller systems A register-transfer machine has combinational logic connecting registers: combinational logic Q D combinational logic D Q combinational logic D Q One good way to structure a system is as a data path and a controller: data path executes regular operations (arithmetic, etc.), holds registers with dataoriented state; controller evaluates irregular functions, sets control signals for data path. Modern VLSI Design 3e: Chapter 8 Page 7 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 8 Copyright 998, 2002 Prentice Hall PTR Data and control are equivalent Data operators We can rewrite control into data and visa versa: control: if i = 0 then o <= a; else o <= b; end if; data: o <= ((i = 0 ) and a) or ((i = ) and b); Data/control distinction is useful but not fundamental. Arithmetic operations are easy to spot in hardware description languages: x <= a + b; Multiplexers are implied by conditionals. Must evaluate entire program to determine which sources of data for registers. Multiplexers also come from sharing adders, etc. Modern VLSI Design 3e: Chapter 8 Page 9 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 20 Copyright 998, 2002 Prentice Hall PTR

Conditionals and multiplexers Alternate data path-controller systems if x = 0 then reg <= a; else controller controller controller reg <= b; end if; data path data path data path code register-transfer Modern VLSI Design 3e: Chapter 8 Page 2 Copyright 998, 2002 Prentice Hall PTR one controller, one data path two communicating data path-controller systems Modern VLSI Design 3e: Chapter 8 Page 22 Copyright 998, 2002 Prentice Hall PTR ASM charts Sample ASM chart An ASM (augmented state machine) chart is a register-transfer description. ASM charts let us describe function without choosing a partitioning between control and data. Once we have specified the function, we can refine it into a block diagram which partitions data and control. Modern VLSI Design 3e: Chapter 8 Page 23 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 24 Copyright 998, 2002 Prentice Hall PTR

ASM state Actions in state An ASM state specifies a machine state and a set of actions in that state. All actions occur in parallel. s x = a + b y = c - d + e o = name of state (notation only) Actions in a state are unconditionally executed. A state can execute as many actions as you want, but you must eventually supply hardware for all those actions. A register may be assigned to only once in a state (single-assignment rule). Modern VLSI Design 3e: Chapter 8 Page 25 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 26 Copyright 998, 2002 Prentice Hall PTR Implementing operations in an ASM state Sequences of states States are linked by transitions. States are executed sequentially. Each state may take independent actions (including assigning to a variable assigned to in a previous state). state with one addition two additions requires two adders s x = a + b s2 x = c + d y = a + d Modern VLSI Design 3e: Chapter 8 Page 27 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 28 Copyright 998, 2002 Prentice Hall PTR

Data paths from states Function unit sharing example Maximum amount of hardware in data path is determined by state which executes the most functionality. Function units implementing data operations may be reused across states, but multiplexers will be required to route values to the shared function units. mux allows + to compute a+b, a+c Modern VLSI Design 3e: Chapter 8 Page 29 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 30 Copyright 998, 2002 Prentice Hall PTR Extracting data path and controller Data path-controller extraction ASM chart notation helps identify data, control. Once you choose what values and operations go into the data path, you can determine by elimination what goes into the controller. Structure of the ASM chart gives structure of controller state transition graph. Modern VLSI Design 3e: Chapter 8 Page 3 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 32 Copyright 998, 2002 Prentice Hall PTR

High-level synthesis Tasks in high-level synthesis Sequential operation is not the most abstract description of behavior. We can describe behavior without assigning operations to particular clock cycles. High-level synthesis (behavioral synthesis) transforms an unscheduled behavior into a register-transfer behavior. Scheduling: determines clock cycle on which each operation will occur. Binding (allocation): chooses which function units will execute which operations. Modern VLSI Design 3e: Chapter 8 Page 33 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 34 Copyright 998, 2002 Prentice Hall PTR Confusing terminology Data dependencies Mapping of an operation to a hardware functional unit is called assignment. The task of reserving functional units of the right type is called allocation or module selection. While scheduling strictly means mapping to a clock cycle, it is often used to include assignment as well. Data dependencies describe relationships between operations: x <= a + b; value of x depends on a, b High-level synthesis must preserve data dependencies. Modern VLSI Design 3e: Chapter 8 Page 35 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 36 Copyright 998, 2002 Prentice Hall PTR

Data flow graph Data flow graph construction Data flow graph (DFG) models data dependencies. Does not require that operations be performed in a particular order. Models operations in a basic block of a functional model no conditionals. Requires single-assignment form. original code: x <= a + b; y <= a * c; z <= x + d; x <= y - d; x <= x + c; single-assignment form: x <= a + b; y <= a * c; z <= x + d; x2 <= y - d; x3 <= x2 + c; Modern VLSI Design 3e: Chapter 8 Page 37 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 38 Copyright 998, 2002 Prentice Hall PTR Data flow graph construction, cont d Goals of scheduling and allocation Data flow forms directed acyclic graph (DAG): Preserve behavior at end of execution, should have received all outputs, be in proper state (ignoring exact times of events). Utilize hardware efficiently. Obtain acceptable performance. Modern VLSI Design 3e: Chapter 8 Page 39 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 40 Copyright 998, 2002 Prentice Hall PTR

Scheduling example Binding values to registers One feasible schedule for last DFG: Cycle registers fall on clock cycle boundaries Cycle 2 Cycle 3 Modern VLSI Design 3e: Chapter 8 Page 4 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 42 Copyright 998, 2002 Prentice Hall PTR Choosing function units Building the sequencer muxes allow function units to be shared for several operations See book, page 442. sequencer requires three states, even with no conditionals Modern VLSI Design 3e: Chapter 8 Page 43 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 44 Copyright 998, 2002 Prentice Hall PTR

Choices during high-level synthesis Finding schedules Scheduling determines number of clock cycles required; binding determines area, cycle time. Area tradeoffs must consider shared function units vs. multiplexers, control. Delay tradeoffs must consider cycle time vs. number of cycles. Two simple schedules: As-soon-as-possible (ASAP) schedule puts every operation as early in time as possible. As-late-as-possible (ALAP) schedule puts every operation as late in schedule as possible. Many schedules exist between ALAP and ASAP extremes. Modern VLSI Design 3e: Chapter 8 Page 45 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 46 Copyright 998, 2002 Prentice Hall PTR ASAP and ALAP schedules Operator chaining ASAP ALAP + + + + + + + May execute several operations in sequence in one cycle operator chaining. Delay through function units may not be additive, such as through several adders. Critical path Modern VLSI Design 3e: Chapter 8 Page 47 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 48 Copyright 998, 2002 Prentice Hall PTR

Control implementation Distributed control Clock cycles are also known as control steps. Longer schedule means more states in controller. Cost of controller may be hard to judge from casual inspection of state transition graph. one centralized controller Product machine of FSM & FSM2 FSM!a a FSM2!b b two distributed controllers Modern VLSI Design 3e: Chapter 8 Page 49 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 50 Copyright 998, 2002 Prentice Hall PTR Synchronized communication between FSMs Hardwired vs. microcoded control To pass values between two machines, must schedule output of one machine to coincide with input expected by the other: Hardwired control has a state register and random logic. A microcoded machine has a state register which points into a microcode memory. Styles are equivalent; choice depends on implementation considerations. Modern VLSI Design 3e: Chapter 8 Page 5 Copyright 998, 2002 Prentice Hall PTR Modern VLSI Design 3e: Chapter 8 Page 52 Copyright 998, 2002 Prentice Hall PTR