C-Based Hardware Design

Similar documents
CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

Review of Digital Design with VHDL

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Hardware Description Language VHDL (1) Introduction

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

Contents. Appendix D VHDL Summary Page 1 of 23

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

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

COE 405 Design Methodology Based on VHDL

Digital Design with FPGAs. By Neeraj Kulkarni

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

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

Embedded Systems CS - ES

Lecture 3 Introduction to VHDL

ENGIN 241 Digital Systems with Lab

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification

Basic Language Concepts

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

VHDL Structural Modeling II

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

Hardware description languages

Computer-Aided Digital System Design VHDL

VHDL. Douglas L. Perry. Third Edition

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

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

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

ELCT 501: Digital System Design

Concurrent Signal Assignment Statements (CSAs)

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

ECE 3401 Lecture 10. More on VHDL

A Brief Introduction to Verilog Hardware Definition Language (HDL)

VHDL BASIC ELEMENTS INTRODUCTION

Design units can NOT be split across different files

A bird s eye view on VHDL!

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

Performance Engineering of Real-Time and Embedded Systems. Introduction to VHDL

Lecture 4. VHDL Fundamentals. George Mason University

VHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY. Design descriptions & design constructions examples are taken from foundation series examples

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

Declarations. Lexical elements. Type declaration Subtype declaration Constant declaration Signal declaration Variable declaration.

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Libraries. Library ieee; Use ieee.std_logic_1164.all; Use ieee.std_logic_arith.all; Use ieee.std_logic_signed.all; Use ieee.std_logic_unsigned.

Digital Systems Design

Inthis lecture we will cover the following material:

CDA 4253 FPGA System Design Introduction to VHDL. Hao Zheng Dept of Comp Sci & Eng USF

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

What Is VHDL? VHSIC (Very High Speed Integrated Circuit) Hardware Description Language IEEE 1076 standard (1987, 1993)

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification Part II

VHDL Lexical Elements

Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28

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

Getting Started with VHDL

EITF35: Introduction to Structured VLSI Design

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

Introduction to VHDL. Main language concepts

BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon

Declarations of Components and Entities are similar Components are virtual design entities entity OR_3 is

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Verilog Design Principles

VHDL Part 2. What is on the agenda? Basic VHDL Constructs. Examples. Data types Objects Packages and libraries Attributes Predefined operators

Contents. Appendix D Verilog Summary Page 1 of 16

Outline CPE 626. Advanced VLSI Design. Lecture 4: VHDL Recapitulation (Part 2) Signals. Variables. Constants. Variables vs.

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

ECOM4311 Digital Systems Design

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

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

Verilog HDL is one of the two most common Hardware Description Languages (HDL) used by integrated circuit (IC) designers. The other one is VHDL.

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

VHDL. Chapter 1 Introduction to VHDL. Course Objectives Affected. Outline

VHDL: A Crash Course

Synthesis of Combinational and Sequential Circuits with Verilog

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) -

101-1 Under-Graduate Project Digital IC Design Flow

EEL 4783: Hardware/Software Co-design with FPGAs

VHDL for Complex Designs

Outline. CPE/EE 422/522 Advanced Logic Design L07. Review: JK Flip-Flop Model. Review: VHDL Program Structure. Review: VHDL Models for a MUX

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

CPE/EE 422/522. Chapter 8 - Additional Topics in VHDL. Dr. Rhonda Kay Gaede UAH. 8.1 Attributes - Signal Attributes that return a value

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

A Verilog Primer. An Overview of Verilog for Digital Design and Simulation

Verilog Design Principles

Combinational Logic COMB. LOGIC BLOCK. A Combinational Logic Block is one where the outputs depend only on the current inputs

Introduction to the VHDL language. VLSI Digital Design

Introduction to Verilog

Mridula Allani Fall Fall

INTRODUCTION TO VHDL. Lecture 5 & 6 Dr. Tayab Din Memon Assistant Professor Department of Electronic Engineering, MUET

Synthesizable Verilog

HDL. Hardware Description Languages extensively used for:

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

Lecture 4. VHDL Fundamentals. Required reading. Example: NAND Gate. Design Entity. Example VHDL Code. Design Entity

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

VLSI DESIGN (ELECTIVE-I) Question Bank Unit I

Hardware Synthesis. References

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

Transcription:

LECTURE 6 In this lecture we will introduce: The VHDL Language and its benefits. The VHDL entity Concurrent and Sequential constructs Structural design. Hierarchy Packages Various architectures Examples 1

C-Based Hardware Design PC with C++ Application Implements Designs to Hardware Design and simulate at system level using C-based programming language such as Handel-C Need libraries that provide interface drivers including audio and video packages Need FPGA prototyping board, with variety of interfaces References: James Miller, Newsletter on Canadian s System-On-Chip research Network, March 20, 2007, Vol. 5, No.1 2

Design Kit Output Targets Target a variety of FPGA s Or convert Handel-C to: VHDL Verilog EDIF System C The output of the design kit can be down loaded to a variety of FPGAs or if you require some modification it can convert the Handel-C to other Forms such as VHDL. Documentation and working Examples: https://www2.cmc.ca:ca/ 3

Design Specification English Prose V H D L Modeling the behavior Data Path Logic Design Transfer Function, Boolean Equations, Flow Graphs, Pseudo Codes Computational Units,Registers, Buses Flip Flops, Gates, Netlist Netlist, ASCII text describing gates or library modules and their interconnection Implementation is vendor dependent ASIC FPGA Transistors, Wires Masks Manufacturing 4

VHDL Code of the Design VHDL Code of Test Simulation Engine Design Verification Vendor s Library Synthesis is the use of software packages to automatically verify and translate the VHDL code into a targeted device, using embedded optimising methods and meeting all the design constraints. 5

FPGA Design Flow For Xilinx Virtex XCV50 Summit Visual Elite VHDL Entry & Initial Simulation ModelSim SE VHDL 5.75 Detailed Simulation using Test Bench testbench output files MS Excel compare results with expected Target Device Xilinx Virtex XCV50 Synplicity Synplify 7.0.3 Synthesis report files Xilinx Design Manager Place & Route & Programming File Generation report files bit file/ mcs file 6

Verilog Example A B g1 e y // Description of a simple circuit. C g2 x module circuit_1 (A,B, C, x,y); input A,B,C; wire e; output x,y; and g1(e,a,b); not g2 (x,c); or g3(y,x,e); endmodule; 7

//CMOS inverter module inverter (OUT, IN); input IN; output OUT; supply1 PWR; supply0 GND; pmos ( OUT, PWR, IN); // (Drain, Source, Gate) nmos (OUT, GND, IN); // (Drain, Source, Gate) end module PW R IN OUT GND 8

For transmission gate the keyword cmos is used. cmos (output, input, ncontrol, pcontrol); // general description. For example for the transmission gate shown in the Figure below cmos (Y,X,N,P); N x Y P 9

The Language Introduced in 1985, standardized in 1987 modified in 1993. It is used mainly as a specification and modeling language for digital systems. It is used as an intermediate form of design entry for many different tools It is a simulation and verification language. It is a test-synthesis language 10

The Language VHDL is supported by DoD and most manufacturers. Technology Portable It is not yet standardized for synthesis. It has major application in Rapid prototyping 11

The VHDL Entity General Components that performs specific function It can represent the whole system to be designed or its boards, chips, logic gates etc. It consists of 2 parts: The interface The Architecture 12

VHDL DESIGN UNITS Entity Declaration Gives the interface view of the unit. Implementation Independent Architecture Describes the implementation(s) of the entity Package Declaration Contains global information common to many design units. Configuration Relates the design references to the designs saved in the library 13

-Interface entity OR_2 is --Input/output ports port (A, B : in BIT; Z : out BIT); end OR_2 ; --Body architecture DATA_FLOW of OR_2 is begin BASIC CONSTRUCT Interface is responsible for defining the black box s name, input and output Z <= A or B; -- a construct statement implementing the OR gate Interface Body Body is responsible for describing the function that transforms the inputs to the outputs end DATA_FLOW; 14

Entity Organization Entity Interface Identifier, Generic constants, Port, Local types, signals.. Interface Architecture I (could be structural) Declarative Parts, Local signals, constants, types Concurrent statements Architecture N (could be behavioral) Declarative Parts, Local signals, constants, types Concurrent statements Implementation 15

Difference Between two Architectures Architecture DATA_FLOW of Half_Adder is Begin S<= A XOR B; end DATA_FLOW; Architecture Algorithmic of Half_Adder is Process(A,B) begin if A=B then S=0; else end if; end process; end; S=1; 16

Tutorials at http://www.encs.concordia.ca/helpdesk/resource/tut orial.html 17

18 VHDL reserved keywords access after alias all and architecture array assert attribute begin abs block body buffer bus case component configuration constant disconnect downto else elsif end entity exit file for function generate generic guarded if in inout is label library linkage loop map mod new next nor not null of on open or others out package port procedure process range record register rem report return select severity signal subtype then to tansport type units until use variable wait when with xor

Additional reserved keywords in VHDL-93 impure group inertia postponed pure literal reject rol ror shared sla sll sra srl unaffected xnor **All RESERVE WORDS ARE CASE INSENSETIVE** 19

--List of reserved operators = /= := < <= > >= + - * / ** & Equality operator Inequality operator The assignment operator for variables The less than operator less than or equal to when used in an expression on scalar types & array The assignment operator The greater than operator The greater than or equal to operator The addition operator The subtraction operator The multiplication operator The division operator The exponentiation operator The concatenation operator 20

The Interface (connects the entity to its environment) keywords (reserved words) comment line type identifier entity OR_2 is -- Input/output ports port (A, B : in BIT; Z : out BIT); end OR_2 ; the header name of the design (identifier) Port declaration type optional entity declaration terminates statements 21

Identifiers Case insensitive Characters can only be: First character must be a letter Last character must not be an underscore No adjacent underscores a z A Z 0 9 _ (underscore) Extended identifiers Any length Must be delimited by \ \ leading & trailing backslashes All graphic characters Within backslashes any characters in any order can appear (exception is backslash which has to appear in pair) Is case sensitive An extended identifier is different from any keyword or basic identifier 22

Port declaration(provides communication channels between the entity and its environment) Reserved word port Predefined types Value of 0 or 1 Beginning of (A, B : in BIT; Z : out BIT); End of Any legal identifier Is a tri-state and bidirectional Is similar to inout but is available within the architecture and can be updated by one source only Keywords can be in out inout linkage buffer Information on direction of flow 23

--Fundamental Data Types Data Type Values Example Bit Bit_vector Boolean Integer Real Time Character String 1, 0 (array of bits) True, False -20, 0, 1, 5090 200.0, -2.0E2 10 us, 7 ns, 150 ps c, z, 5, #, etc. (Array of characters) Q <= 1 ; BYTE <= 00010101 ; flag <= True; ACC <= ACC + 2; C1 = V2 * 5.3; output <= 0 after 2 ns; DataOut <= Y ; ADD <= MEM ; 24

The Body defines input out put relations Name of the architecture any legal identifier Association of architecture header architecture DATA_FLOW of OR_2 is begin Z <= A or B ; header declaration part of objects to be used within the block Statement Part end DATA_FLOW ; Closes architecture Body declaration (architecture) optional 25

The operators Logical operator Assignment operator Z <= A or B ; End of assignment Other operators: and or xor xnor nand nor not Signal assignment statement *** Anytime the input signal A and or B changes value the signal assignment statement executes and computes a new value for the output signal. This is called Signal Transformation. 26

Concurrency Reserved word Concurrent assignment statement -- Interface 1 entity XOR_2 is 2 Port.3 (A,B : in BIT; Z : out BIT); 4 end XOR_2; 5 -- Body 6 architecture DATA_FLOW of XOR_2 is 7 signal Sig 1, Sig 2: BIT; 8 begin 9 Sig 1 <= A and not B;..10 Sig 2 <= B and not A; 11 Z <=Sig1 or Sig 2; 12 end DATA_FLOW; 13 Signal Declaration 27

Modeling method Structural (A description of the entity by components instantiation where the structure is explicit) such as gates and their interconnection Behavioral Algorithmic (A description of the entity by sequential statements representing behavior but no structural information) Like adding two binary numbers 0001 +1010 Data Flow ( A description of the entity by the use of concurrent statements to represent behavior implying structure) Like logic equation Z= A xor B Mixed any mixture of behavioral and structural 28

Behavioral / Structural Behavioral is easier to think about as it is similar to writing software code. It is based on the functionality of the blocks It executes sequentially so it takes more time. Structural is based on interconnecting tested working components. Data flow the assignment is based on logic expressions The difference is really in the process and signal assignment/variable assignment/scheduling and the delta function 29

Structural Synthesis A B MUX C D behavioral Synthesis A B MUX C D Behavior representation if t=0, then D<=0 else D<=DATA; CLK Control CLK Control 30

Configuration Statement It is used to bind the entity used with the architecture that is desired. Example: for all : OR_2 use entity OR_2 (data_flow) 31

Libraries (Predefined) STD Provides declarations for predefined constructs in VHDL. WORK The working library into which design units are presently being analyzed are stored. (ie. design entities). 32

Libraries The design entities can be stored in libraries Libraries and their storage and implementation are achieved outside VHDL. VHDL is only the language that facilitates the usage of the libraries and its contents ie., the design entities. Any VHDL entity that can be analyzed is a COMPLETE DESIGN ENTITY * analysis means checking the syntax and symantic of a design entity statically. * simulate means checking the behaviour of the modelled entity dynamically. * There are two pre-defined libraries in VHDL: STD The standard IEEE library that holds many predefined types such as BIT. Many of these types are used almost like a reserved word because they are already predefined in the STD library. WORK This is the working library, where we store our currently analysed design entities 33

Structural Modeling Structural modeling is the description of set of interconnected components that are previously defined, compiled and verified. Real Life Design and Implementation 1) Design the board 2) Design the chips 3) Place sockets on the board 4) Put the chips in the socket That is exactly how VHDL operates 1) Design an entity that is the board 2) Design the entities that are the chips 3) You have components that are the sockets 4) Design entities are put in the socket A VHDL STRUCTURAL Model interconnects the instances of chip sockets 34 holding the chips.

--Interface entity CARRY is port (A_IN, B_IN, C_IN : in BIT; C_OUT : out end CARRY; --Body BIT); A_IN B_IN A_IN C_IN B_IN C_IN architecture STRUCTURAL of CARRY is -Declaration of components A1 A2 A3 TEMP1 TEMP2 TEMP3 component AND_2 port (A, B : in BIT ; Z : out BIT); end component ; component OR_3 port --Declare Signals signal TEMP1, TEMP2, TEMP3 : BIT ; begin -Connect Logic Operators to Describe Schematic A1: AND_2 port map (A_IN, B_IN, TEMP1) ; A2: AND_2 port map (A_IN, C_IN, TEMP2) ; A3: AND_2 port map (B_IN, C_IN, TEMP3) ; (A, B, C : in BIT ; Z : out BIT); end component; O3: OR_3 port map (TEMP1, TEMP2, TEMP3, C_OUT) ; end STRUCTURAL ; OR1 C_OUT 35

DATA_FLOW CONSTRUCTS entity FULL_ADDER is port (A_IN,B_IN,C_IN : in BIT; SUM, CARRY : out BIT); end FULL_ADDER; architecture DATA_FLOW of FULL_ADDER is signal S1,S2,S3: BIT; begin S1 <= A_IN xor B_IN; SUM <= S1 xor C_IN; S2 <= S1 and C_IN; S3 <= A_IN and B_IN; CARRY <= S2 or S3; end DATA_FLOW; 36

AND Gate simulation 37

Passgate simulation 38

library ieee; use ieee.std_logic_1164.all; entity Full_Adder is -- generic (TS : TIME := 0.11 ns; TC : TIME := 0.1 ns); port (X, Y, Cin: in std_logic; Cout, Sum: out std_logic); end Full_Adder; architecture Concurrent of Full_Adder is begin Sum <= X xor Y xor Cin after 0.11 ns ; Cout <= (X and Y) or (X and Cin) or (Y and Cin) after 0.11 ns; end Concurrent; 39

What Synthesis Programs do? Synthesis programs are large packages that contain many algorithms for processing the VHDL Code, which generally include : Check the Syntax and Semantics of the Code Deduce the logic and state elements Optimize the technology independent functions (Boolean and State optimization) Map the optimized structure to the target technology (Place and Route) Evaluate the Structure performance ( Timing, Power and Area) Perform technology-dependent to obtain better final result. It is important to note that there is a different synthesis paths with different synthesis packages from different companies, And that not everything that can be simulated can be synthesized. You always have to refer to the synthesis packages to see the sequential construct or the module that you have selected is it synthesizable or not.

Points to watch for The way the code is written will greatly affect the size and speed of the synthesized circuit. For test bench, you may write unsenthesizable structures to test your circuit. Always use hierarchy, regularity, modularity and locality in your code. Insert comments to describe the variables and your construct. Write: date, author, name of the entity in the first line of your entity.