Inferring Storage Elements

Similar documents
Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

Sequential Logic - Module 5

Lecture 12 VHDL Synthesis

[VARIABLE declaration] BEGIN. sequential statements

VHDL And Synthesis Review

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

Problem Set 10 Solutions

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

CASE Statement. Controls execution of one or more sequential statements.

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

Sequential Circuit Design: Principle

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

Concurrent & Sequential Stmts. (Review)

Sequential Statement

VHDL: RTL Synthesis Basics. 1 of 59

Field Programmable Gate Array

General Coding Style Guidelines 5

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas

Introduction to VHDL #3

Control and Datapath 8

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Summary of FPGA & VHDL

CCE 3202 Advanced Digital System Design

ELCT 501: Digital System Design

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

Verilog for Synthesis Ing. Pullini Antonio

Hardware Description Language VHDL (1) Introduction

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

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

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004

Chapter 8 VHDL Code Examples

CCE 3202 Advanced Digital System Design

Introduction to Design Vision. Instructor: Prof. Shantanu Dutt. TA: Soumya Banerjee

The University of Alabama in Huntsville ECE Department CPE Midterm Exam February 26, 2003

Timing in synchronous systems

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

In our case Dr. Johnson is setting the best practices

Computer-Aided Digital System Design VHDL

CprE 583 Reconfigurable Computing

Sequential Circuit Design: Principle

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

VHDL simulation and synthesis

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

EITF35: Introduction to Structured VLSI Design

IT T35 Digital system desigm y - ii /s - iii

Introduction to VHDL #1

CMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

OUTLINE SYSTEM-ON-CHIP DESIGN. GETTING STARTED WITH VHDL September 3, 2018 GAJSKI S Y-CHART (1983) TOP-DOWN DESIGN (1)

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

Introduction to VHDL. Yvonne Avilés Colaboration: Irvin Ortiz Flores Rapid System Prototyping Laboratory (RASP) University of Puerto Rico at Mayaguez

EITF35: Introduction to Structured VLSI Design

Objective Design a 4*4 register file and test it on VSIM, QUARTUS, and UP3 board.

VHDL for Synthesis. Course Description. Course Duration. Goals

VHDL Examples Mohamed Zaky

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1 Solutions

Digital Systems Design

Lab 3. Advanced VHDL

Design Problem 3 Solutions

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2016

Department of Electronics & Communication Engineering Lab Manual E-CAD Lab

Lecture 27. Structural Description of a 3-Bit Synchronous Decade Counter. FIGURE 4.31 A State diagram of a decade counter.

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

Chapter 2 Basic Logic Circuits and VHDL Description

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

EEL 4712 Digital Design Test 1 Spring Semester 2007

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

Maximizing Logic Utilization in ex, SX, and SX-A FPGA Devices Using CC Macros

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

Assignment 01 Computer Architecture Lab ECSE

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

Spiral 1 / Unit 6. Flip-flops and Registers

CS/EE Homework 7 Solutions

8 Register, Multiplexer and

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

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

Hardware Description Languages. Modeling Complex Systems

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

PALMiCE FPGA Probing Function User's Manual

Modeling Sequential Circuits in Verilog

Lattice VHDL Training

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

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

SEQUENTIAL STATEMENTS

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

Transcription:

Inferring Storage Elements In our designs, we usually use flip-flops as our storage elements. Sometimes we use latches, but not often. Latches are smaller in size, but create special, often difficult situations for testing and static timing analysis. Latches are inferred in VHDL by using the IF statement without its matching ELSE. This causes the synthesis to make the logical decision to hold the value of a signal when not told to do anything else with it. The inferred latch is a transparent latch. That is, for as long as enable is high, the q output sees the d input transparently. --infer 4-bit wide latch LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_vector_arith.all; ENTITY storage IS PORT ( data_in : IN STD_LOGIC_VECTOR(3 DOWNTO 0); data_out : OUT STD_LOGIC_VECTOR(3 DOWNTO 0); enable : IN STD_LOGIC); END storage; ARCHITECTURE wed OF storage IS infer_latch: PROCESS (enable, data_in) IF enable = 1 THEN data_out <= data_in; END IF; --look ma, no else! END PROCESS infer_latch; END ARCHITECTURE wed; When synthesized, we see the following structure: Inferring Stroage Elements 1

Latch Inference In our library, the enable is shown as going to the CLK input of the latch. This is misleading as the input should properly be called EN or something like that. If I find the time maybe I ll change these someday. The small size of the latches is reflected in the area report: Cell Library References Total Area latch ami05_typ 4 x 2 10 gates Number of gates : 10 This is of course relative to the size of a 2-input NAND gate. In other words, the area of each latch is about the same as 2, 2-input NAND gates! When we synthesized, the transcript told of the impending latch inference: -- Compiling root entity storage(wed) "/nfs/guille/u1/t/traylor/ece574/src/storage.vhd",line 8: Warning, data_out is not always assigned. latches could be needed. Always watch tool transcripts. They can be very informative. Sometime they can save your bacon. Inferring Stroage Elements 2

Inferring D-type Flip Flops Usually, we want to infer D-type, edge triggered flip flops. Here s how. LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_vector_arith.all; ENTITY storage IS PORT ( data_in : IN STD_LOGIC_VECTOR(3 DOWNTO 0); data_out : OUT STD_LOGIC_VECTOR(3 DOWNTO 0); clock : IN STD_LOGIC); END storage; ARCHITECTURE wed OF storage IS infer_dff: PROCESS (clock, data_in) IF (clock EVENT AND clock = 1 ) THEN data_out <= data_in; END IF; --look ma, still no else!... what gives? END PROCESS infer_dff; END ARCHITECTURE wed; Inferring Stroage Elements 3

Sometime back we stated that IF with ELSE infers a latch. Well... that is usually true. Here is an exception. The line: IF (clock EVENT AND clock = 1 ) THEN is special to the synthesis tool. The conditional statement for the IF uses the attribute which looks for a change in the signal clock (clock EVENT). This is ANDed with the condition that clock is now 1 (AND clock = 1 ). The conditional is looking for a rising edge of the signal clock. Therefore, if there is a rising edge, the statement under the IF will be executed and at no other time. So when the clock rises, data_out will get the value present at data_in. Since a D flip-flop is the only cell that can satisfy this condition and can hold the value once it is acquired it is used to implement the circuit. The conditional (clock EVENT AND clock = 1 )really forms the recipe for a D-type rising edge flip flop. A ELSE clause could be added to the IF statement that explicitly tells the old value to be held. This is not at all harmful, but is redundant and is ignored by the synthesis tool. An example of this is shown below: infer_dff: PROCESS (clock, data_in) IF (clock EVENT AND clock = 1 ) THEN data_out <= data_in; --get new value ELSE data_out <= data_out; --hold old value...unnecessary END IF; END PROCESS infer_dff; Inferring Stroage Elements 4

Adding an Asynchronous Reset We almost never want a flip flop without a reset. Without a reset, how can the simulator determine initial state? It cannot. It is very rare to find flip-flops with out a reset. Here is how to code a flip flop with a asynchronous reset: ARCHITECTURE wed OF storage IS infer_dff: PROCESS (reset_n, clock, data_in) IF (reset_n = 0 ) THEN data_out <= 0000 ; --aysnc reset ELSIF (clock EVENT AND clock = 1 ) THEN data_out <= data_in; END IF; END PROCESS infer_dff; END ARCHITECTURE wed; When synthesized, we get: Inferring Stroage Elements 5

How big is a flip flop/latch? From the area_report.txt file we see: Cell Library References Total Area dffr ami05_typ 4 x 6 24 gates inv02 ami05_typ 1 x 1 1 gates Number of gates : 24 This looks a little fishy. 24 + 1 = 24? At any rate, (assuming round off error) the flip flops are roughly 6 gates a piece. So to summarize the relative sizes of latches and flip flops : CASE CELL SIZE latch no reset latch 2 gates latch with reset latchr 3 gates flip flop with no reset dff 5 gates flip flop with reset dffr 6 gates These numbers are valid only for our library. Other libraries will vary. However, the relative sizes are consistent with most any CMOS library. Inferring Stroage Elements 6