Introduction to VHDL By Mr. Fazrul Faiz Zakaria School of Computer and Communication Engineering UniMAP.

Slides:



Advertisements
Similar presentations
CMSC 611: Advanced Computer Architecture
Advertisements

COE 405 VHDL Basics Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh Computer Engineering.
Fundamental Concepts 大同大學 資訊工程系 副教授
© 1998, Peter J. AshendenVHDL Quick Start1 Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis.
Hardware Description Language (HDL)
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Adv. Digital Circuit Design
History TTL-logic PAL (Programmable Array Logic)
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
Introduction to VHDL Dr. Adnan Shaout The University of Michigan-Dearborn.
ECE C03 Lecture 17ECE C03 Lecture 61 Lecture 17 VHDL Structural Modeling Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
VHDL Quick Start Peter J. Ashenden The University of Adelaide.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Simple Testbenches Behavioral Modeling of Combinational Logic
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Introduction to VHDL (part 2)
An Introduction to VHDL Using Altera’s Quartus II IDE Dr. William M. Jones Coastal Carolina University Numbers and Bytes Meeting 20 OCT 2008.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
1 Digital System Design Subject Name : Digital System Design Course Code : IT- 308 Instructor : Amit Prakash Singh Home page :
Introduction to VHDL Arab Academy for Science, Technology & Maritime Transport Computer Engineering Department Magdy Saeb, Ph.D.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
1/26 VHDL VHDL Structural Modeling Digital Logic.
1 Introduction to VHDL Spring What is VHDL? VHDL can be uses to model and synthesise digital systems. VHDL = VHSIC Hardware Description Language.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Systems Lecture # 6 Computer-Aided Design Technology for VLSI.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Design Lecture # 11 High Desecration Language- Based Design.
HARDWARE DESCRIPTION LANGUAGE (HDL). What is HDL? A type of programming language for sampling and modeling of electronic & logic circuit designs It can.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
CMSC 611: Advanced Computer Architecture Design & Simulation Languages Practically everything adapted from slides by Peter J. Ashenden, VHDL Quick Start.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
ECOM 4311—Digital System Design with VHDL
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
CMSC 611: Advanced Computer Architecture Hardware Design Languages Some material adapted from slides by Peter J. Ashenden, VHDL Quick Start Some material.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
An Introduction to V.H.D.L.. Need of a Compiler… main( ) { int x=10,y=20,z; z = x + y ; printf ( “ %d “, z ); getch( ) ; } What’s That ? Give me only.
Basic Language Concepts
Systems Architecture Lab: Introduction to VHDL
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
ECE 434 Advanced Digital System L08
Peter J. Ashenden The University of Adelaide
VHDL (VHSIC Hardware Description Language)
CMSC 611: Advanced Computer Architecture
VHDL Introduction.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Introduction to VHDL By Mr. Fazrul Faiz Zakaria School of Computer and Communication Engineering UniMAP

VHDL ??? Very Hard Difficult Language VHSIC Hardware Description Language Very High Speed Integrated Circuits VHDL is an IEEE standard

3 Why VHDL? HDL is a software solution due to limits in hardware solutions and to: – Increasing design complexity – Increasing cost in time and investment – Increasing knowledge requirement – Inadequacy of other existing languages

VHDL main Features Supports the whole design process: system level RT level logic level circuit level (to some extent) Suitable for specification in behavioral domain structural domain Precise simulation semantics is associated with the language constructs

Behavioral Modeling Only the functionality of the circuit, no structure Synthesis tool creates correct logic For the purpose of synthesis as well as simulation outputs if (shift_left) for (j=0; j<8; j=j+1) #5 out[j]=out[j-1]; else for (j=0; j<8; j=j+1) #5 out[j] = out[j+1]; Input

Structural Modeling Functionality and structure of the circuit Call out the specific hardware For the purpose of synthesis input1 inputn output1 outputn Higher-level Component Lower-level Component1 Lower-level Component1

VHDL Architectures Behavioral Structural Algorithmic FSM RTL Gate Layout Abstraction Levels VHDL Architectures How it works How it is connected

Basic VHDL Modeling Structure Library / Package Declaration Entity Declaration Architecture Flow

LIBRARY / PACKAGE DECLARATION library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_signed.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; library work; use work.my_package.entity_name; use work.my_package.function_name;

Entity Declaration Specifies the input and output signals of the entity modes : in, out, inout, buffer Format : Entity name is port (port_name : mode data_type); End name; Entity name is port (port_name : mode data_type); End name;

Entity Declaration (2) entity reg4 is port ( d0, d1, d2, d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end entity reg4; entity nameport namesport mode (direction) port typereserved words punctuation

Rules for Entity Name Any alphanumeric character may be used in the name, as well as the ‘_’ underscore character. It is not case sensitive Cannot be a VHDL keyword Cannot begin with a number, must begin with a letter Cannot have 2 straight ‘_ _’ underscores Cannot end with an ‘_’ underscore Cannot have a blank space

ARCHITECTURE The Internal Aspect of a Design Unit Can be behavioral (RTL) or structural Always associated with single entity Single entity can have multiple architectures architecture_name entity_name architecture architecture_name of entity_name is{architecture_declarative_part} begin{architecture_descriptive_part} [architecture_name]; end [architecture_name]; architecture_name entity_name architecture architecture_name of entity_name is{architecture_declarative_part} begin{architecture_descriptive_part} [architecture_name]; end [architecture_name];

Operators

Architecture : Behavioral Modeling Architecture body – describes an implementation of an entity – may be several per entity Behavioral architecture – describes the algorithm performed by the module – contains process statements, each containing – sequential statements, including » signal assignment statements and » wait statements

Architecture : Behavioral Modeling architecture behav of reg4 is begin process (d0, d1, d2, d3, en, clk) variable stored_d0, stored_d1, stored_d2, stored_d3 : bit; begin if en = '1' and clk = '1' then stored_d0 := d0; stored_d1 := d1; stored_d2 := d2; stored_d3 := d3; end if; q0 <= stored_d0 after 5 ns; q1 <= stored_d1 after 5 ns; q2 <= stored_d2 after 5 ns; q3 <= stored_d3 after 5 ns; end process; end behav; simulates real-world propagation delays. notice := syntax used for equating values from signals... sensitivity list

Behavioral Way’s Example

Behavioral Way’s Example (2)

Architecture : Structural Modeling Structural architecture – implements the module as a composition of subsystems – contains signal declarations, for internal interconnections – the entity ports are also treated as signals component instances – instances of previously declared entity/architecture pairs port maps in component instances – connect signals to component ports

Structural way’s example

Structural way cont.. First declare D-latch and and-gate entities and architectures entity d_latch is port ( d, clk : in bit; q : out bit ); end entity d_latch; architecture basic of d_latch is begin process (clk, d) begin if clk = ‘1’ then q <= d after 2 ns; end if; end process; end basic; entity and2 is port ( a, b : in bit; y : out bit ); end entity and2; architecture basic of and2 is begin process (a, b) begin y <= a and b after 2 ns; end process ; end basic;

Structural way... Declare corresponding components in register architecture body architecture struct of reg4 is component d_latch port ( d, clk : in bit; q : out bit ); end component; component and2 port ( a, b : in bit; y : out bit ); end component; signal int_clk : bit;...

Structural way.. Now use them to implement the register... begin bit0 : d_latch port map ( d0, int_clk, q0 ); bit1 : d_latch port map ( d1, int_clk, q1 ); bit2 : d_latch port map ( d2, int_clk, q2 ); bit3 : d_latch port map ( d3, int_clk, q3 ); gate : and2 port map ( en, clk, int_clk ); end struct;

Mixed Behavior and Structure An architecture can contain both behavioral and structural parts process statements and component instances collectively called concurrent statements processes can read and assign to signals Example: register-transfer-level (RTL) Model data path described structurally control section described behaviorally

Mixed Example

entity multiplier is port ( clk, reset : in bit; multiplicand, multiplier : in integer; product : out integer ); end multiplier; architecture mixed of mulitplier is signal partial_product, full_product : integer; signal arith_control, result_en, mult_bit, mult_load : bit; begin arith_unit : entity work.shift_adder(behavior) port map ( addend => multiplicand, augend => full_product, sum => partial_product, add_control => arith_control ); result : entity work.reg(behavior) port map ( d => partial_product, q => full_product, en => result_en, reset => reset );...

Mixed Example … multiplier_sr : entity work.shift_reg(behavior) port map ( d => multiplier, q => mult_bit, load => mult_load, clk => clk ); product <= full_product; process (clk, reset) -- variable declarations for control_section -- … begin -- sequential statements to assign values to control signals -- … end process; end mixed;

Concurrent vs Sequential Behavioral part for a combinational system divided into 2 categories Concurrent assignment statements Simple signal assignment Conditional signal assignment (when…else) Selected signal assignment (with…select) Sequential assignment statements If statement (if…then…else) Case statement (case…when) Loop statement (For-Loop & While-Loop)

Concurrent Assignment Statements Defines an interconnected block by assigning values to signals Executes continuously Order of statements in a body is not affected Eg : signal_name <= expression;

“when…else” Statements Architecture beh of dec_norm_we is Begin I0 <= ‘1’ when D = “00” else ‘0’; I1 <= ‘1’ when D = “01” else ‘0’; I2 <= ‘1’ when D = “10” else ‘0’; I3 <= ‘1’ when D = “11” else ‘0’; End beh;

“when…else” Statements Entity dec_we is Port(D: instd_logic_vector(1 downto 0); I: outstd_logic_vector(3 downto 0)); End dec_we; Architecture beh of dec_we is Begin I <=“0001” when D=“00” else “0010” when D=“01” else “0100” when D=“10” else “1000” when D=“11”; End beh;

“with…select” Statements Architecture beh of dec_sel is Begin with D select I <=“0001” when “00”, “0010” when “01”, “0100” when “10”, “1000” when “11”; End beh;

Sequential Assignment Statements The order of the statements is significant and can affect the semantics of the code To differentiate from concurrent assignment, sequential assignment must be separated Sequential assignments are enclosed inside a “process statement” to distinguish from concurrent assignments

“if…then…else” Statements Architecture beh of dec_if is Begin process (D) begin if D=“00” then I <= “0001”; elsif D=“01” then I <= “0010”; elsif D=“10” then I <= “0100”; else I <= “1000”; end if; end process; End beh;

“case…when” Statements Architecture beh of dec_cs is Begin process (D) begin case (D) is when “00” => I <= “0001”; when “01” => I <= “0010”; when “10” => I <= “0100”; when “11” => I <= “1000”; end case; end process; End beh;

Loop Statements Library ieee; Use ieee.std_logic_1164.all; Entity numbits is Port(D: instd_logic_vector(1 to 3); count: outinteger range 0 to 3); End numbits; Architecture beh of numbits is Begin process (D) variable tmp : integer; begin tmp := 0; for i in 1 to 3 loop if D(i) = ‘1’ then tmp := tmp + 1; end if; end loop; count <= tmp; end process; End beh;

Mixed Behavioral Statements Processes are concurrent Sequential activity within each process Nesting of statements : Concurrent statements in a concurrent statement Sequential statements in a concurrent statement Sequential statements in a sequential statement

Basic Design Methodology Requirements SimulateRTL Model Gate-level Model Synthesize SimulateTest Bench ASIC or FPGA Place & Route Timing Model Simulate