Introduction to VHDL. VHDL DARPA, VHSIC (Very High Speed Integrated Circuits) program Different manufacturers Standard language to describe –Structure.

Slides:



Advertisements
Similar presentations
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Advertisements

Introduction to VHDL CLASS MATERIALS EECE 255. Very High Speed Integrated Circuit Hardware Description Language Industry standard language to describe.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
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 VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
ECE C03 Lecture 161 Lecture 16 Introduction to VHDL Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Comprehensive VHDL Module 6 Types November Comprehensive VHDL: Types Copyright © 2000 Doulos Types Aim ©To understand the use and synthesis.
VHDL Data Types Module F3.1. VHDL Data Types Scalar Integer Enumerated Real (floating point)* Physical* Composite Array Record Access (pointers)* * Not.
VHDL Quick Start Peter J. Ashenden The University of Adelaide.
Data Types. Composite Date Types n Arrays –Single and multi-dimensional –Arrays are single Type n Records –Records are mixed types.
ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
第6章 VHDL NUMBERS, STRINGS, AND EXPRESSIONS 義守大學電機工程學系 陳慶瀚
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
VHDL – Dataflow and Structural Modeling and Testbenches ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
IAY 0600 Digital Systems Design
Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
RTL Hardware Design by P. Chu Chapter Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators RTL Hardware.
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.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
INTRO TO VLSI DESIGN (CPE 448) (VHDL Tutorial ) Prof: Asuif Mahmood.
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
(1) Identifiers, Data Types, and Operators © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
L13 – VHDL Language Elements. VHDL Language Elements  Elements needed for FPGA design Types  Basic Types  Resolved Types – special attributes of resolved.
Lecture #7 Page 1 Lecture #7 Agenda 1.VHDL Data Types Announcements 1.n/a ECE 4110– Digital Logic Design.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
IAY 0600 Digital Systems Design
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
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.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
© 조준동 2008 ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
Scalar Data Types and Operations 大同大學 資訊工程系 副教授 鄭福炯
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
Signals & Data-typesVer 1.1, Copyright 1997, TS, Inc. VHDL S i g n a l s & D a t a T y p e s Page 1.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Sequential Logic Design.
1/8/ L10 AttributesCopyright Joanne DeGroat, ECE, OSU1 Language Attributes and Package Standard A very useful aspect of the language.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
Composite Data Types and Operations Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
13/06/59 1 Copyright  1997, KJH Introduction to VHDL Lecture 2 Prof. K. J. Hintz Department of Electrical and Computer Engineering George Mason University.
Introduction to VHDL.
Introduction To VHDL 홍 원 의.
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Design Entry: Schematic Capture and VHDL
Operators Assignment Operators Logical Operators Relational Operators
VHDL Basics.
Behavioral Modeling in Verilog
ECE 434 Advanced Digital System L17
CHAPTER 10 Introduction to VHDL
Peter J. Ashenden The University of Adelaide
ECE 434 Advanced Digital System L9
ECE 434 Advanced Digital System L10
IAS 0600 Digital Systems Design
CMSC 611: Advanced Computer Architecture
IAS 0600 Digital Systems Design
VHDL Data Types Module F3.1.
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Introduction to VHDL

VHDL DARPA, VHSIC (Very High Speed Integrated Circuits) program Different manufacturers Standard language to describe –Structure –Function VHDL (VHSIC Hardware Description Language) Based on ADA

VHDL Requirements –Describe structure –Specification –Simulation –Synthesis 1987, IEEE Standard 1076, VHDL-87 Revisions: – , VHDL-93 – , VHDL-2001

Domains and Levels of Modeling

VHDL Modeling Concepts entity reg4 is port ( d0, d1, d2, d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end reg4;

Behavioral Model architecture behav of reg4 is begin storage : process is 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; wait on d0, d1, d2, d3, en, clk; end process storage; end architecture behav;

Structural Model

entity d_latch is port ( d, clk : in bit; q : out bit ); end d_latch; architecture basic of d_latch is begin latch_behavior : process is begin if clk = '1' then q <= d after 2 ns; end if; wait on clk, d; end process latch_behavior; end architecture basic; entity and2 is port ( a, b : in bit; y : out bit ); end and2; architecture basic of and2 is begin and2_behavior : process is begin y <= a and b after 2 ns; wait on a, b; end process and2_behavior; end architecture basic;

Structural Model architecture struct of reg4 is signal int_clk : bit; begin bit0 : entity work.d_latch(basic) port map (d0, int_clk, q0); bit1 : entity work.d_latch(basic) port map (d1, int_clk, q1); bit2 : entity work.d_latch(basic) port map (d2, int_clk, q2); bit3 : entity work.d_latch(basic) port map (d3, int_clk, q3); gate : entity work.and2(basic) port map (en, clk, int_clk); end architecture struct;

Test Benches

entity test_bench is end entity test_bench; architecture test_reg4 of test_bench is signal d0, d1, d2, d3, en, clk, q0, q1, q2, q3 : bit; begin dut : entity work.reg4(behav) port map ( d0, d1, d2, d3, en, clk, q0, q1, q2, q3 ); stimulus : process is begin d0 <= '1'; d1 <= '1'; d2 <= '1'; d3 <= '1'; en <= '0'; clk <= '0'; wait for 20 ns; en <= '1'; wait for 20 ns; clk <= '1'; wait for 20 ns; d0 <= '0'; d1 <= '0'; d2 <= '0'; d3 <= '0'; wait for 20 ns; en <= '0'; wait for 20 ns; wait; end process stimulus; end architecture test_reg4;

Lexical elements Comment variable data : bit; --description of variable data --this is a long long comment Identifiers –‘A’ to ‘Z’, ‘a’ to ‘z’, ‘0’ to ‘9’ and ‘_’ –Must start with an alphabetic letter –No successive underlines, not end with underline –Case insensitive: Cat, CAT, cat, CaT are the same

Reserved words absconfigurationimpurenullremtype accessconstantinofreportunaffected afterdisconnectinertialonreturnunits aliasdowntoinoutopenroluntil allelseisorroruse andelsiflabelothersselectvariable architectureendlibraryoutseveritywait arrayentitylinkagepackagesignalwhen assertexitliteralportsharedwhile attributefilelooppostponedslawith beginformapproceduresllxnor blockfunctionmodprocesssraXor bodygeneratenandpuresrl buffergenericnewrangesubtype busgroupnextrecordThen caseguardednorregisterto componentifnotrejecttransport

Numbers Decimal literals –23, 0, 146 Real literals –23.1, 0.0, –46E5, 1E+12, 34.0e-08 Number base –2# #, 16#FD#, 16#0fd#, 8#0375# –2#0.1000#, 8#0.4#, 12#0.6# 123_456, 3.141_592_6, 2#1111_1100#

Characters, strings, bit strings Characters –‘A’, ‘z’, ‘,’, ‘’’, ‘ ‘ Strings –”A string”, ”” --empty string Bit strings –Binary, B” ”, b”0110_0111” –Octal, O”372”, o”00” –Hex, X”FA”, x”0d”

Constant and Variable declaration constant identifier {,...}: subtype_indication [:= expression]; variable identifier {,...}: subtype_indication [:= expression]; constant number_of_bytes : integer := 4; constant number_of_bits : integer := 8* number_of_bytes; constant e : real := ; constant prop_delay : time := 3 ns; constant size_limit, count_limit : integer := 255; variable index : integer := 0; variable sum, average, largest : real; variable start, finish : time := 0 ns;

Type declarations type identifier is type_definition Integer types type_definition <= range expr. (to | downto) expr. type apples is range 0 to 100; type oranges is range 0 to 100; oranges:=apples; --illegal!!! constant number_of_bits : integer :=32; type bit_index is range 0 to number_of_bits-1;

Floating-point types type_definition <= range expr. (to | downto) expr. type input_level is range to +10.0; type probability is range 0.0 to 1.0;

Physical types range expr. (to | downto) expr. units identifier; {identifier = physical_literal;} end units [identifier]; physical_literal <= [decimal_literal | based_literal] unit_name

Physical types type resistance is range 0 to 1E9 units ohm; end units resistance; type length is range 0 to 1E9 units um;--primary unit micron mm=1000 um;--metric units m=1000 mm; inch=25400 um;--English units foot=12 inch; end units length;

Physical types type time is range impl. def. units fs; ps=1000 fs; ns=1000 ps; us=1000 ns; ms=1000 us; sec=1000 ms; min=60 sec; hr=60 min; end units;

Enumeration types type alu_function is (disable, pass, add, subtract, multiply, divide); type octal_digit is (’0’, ’1’, ’2’, ’3’, ’4’, ’5’, ’6’, ’7’); variable alu_op : alu_function; variable last_digit : octal_digit := ’0’; alu_op:=subtract; last_digit:=’7’; type boolean is (false, true);

Bits, Standard logic Bits type bit is (’0’, ’1’); Standard logic type std_ulogic is ( ’U’, --Uninitialized ’X’, --Forcing unknown ’0’, --Forcing 0 ’1’, --Forcing 1 ’Z’, --High impedance ’W’, --Weak unknown ’L’, --Weak 0 ’H’, --Weak 1 ’-’, --Don’t care );

Subtypes subtype identifier is type_mark [ range expr. (to | downto) expr.] Predefinied subtypes –subtype natural is integer range 0 to highest_integer; –subtype positive is integer range 1 to highest_integer;

Type qualification type logic_level is (unknown, low, undriven, high); type system_state is (unknown, ready, busy); subtype valid_level is logic_level range low to high; logic_level’(unknown), system_state ’(unknown) logic_level’(high), valid_level’(high)

Type Conversion real(123) integer(1.23)

Attributes T’left -- first (leftmost) value in T T’right -- last (rightmost) value in T T’low -- least value in T T’high -- greatest value in T T’ascending -- true if T is an ascending range T’image(x) -- a string representing the value of x T’value(s) -- the value in T that is represented by s

Attributes type set_index_range is range 21 downto 11; set_index_range’left= 21 set_index_range’right= 11 set_index_range’low= 11 set_index_range’high= 21 set_index_range’ascending= false set_index_range’image(14)= ”14” set_index_range’value(”20”)= 20

Attributes type logic_level is (unknown, low, undriven, high); logic_level’left= unknown logic_level’right= high logic_level’low= unknown logic_level’high= high logic_level’ascending= true logic_level’image(undriven)= ”undriven” logic_level’value(”LOW”)= low

Attributes for discrete and physical types T’pos(x) -- position number of x in T T’val(n) -- value in T at position x T’succ(x) -- value in T at position one greater than that of x T’pred(x) -- value in T at position one less than that of x T’leftof(x) -- value in T at position one to the left of x T’rightof(x) -- value in T at position one to the right of x

Attributes type logic_level is (unknown, low, undriven, high); logic_level’pos(unknown)= 0 logic_level’val(3)= high logic_level’succ(unknown)= low logic_level’pred(undriven)= low logic_level’ascending= true logic_level’image(undriven)= ”undriven” logic_level’value(”LOW”)= low time’pos(4 ns)=4_000_000

Expressions and operators ** exponentation abs absolute value not negation * multiplication / division mod modulo rem remainder + identity - negation + addition - subtraction & concatenation sll shift-left logical srl shift-right logical sla shift-left arithmetic sra shift-right arithmetic rol rotate left ror rotate right = equality /= inequality < less than <= less than or equal > greater than >= greater than or equal and logical and or logical or nand negated logical and nor negated logical or xor exclusive or xnor negated exclusive or

Arrays array (discrete_range {, …}) of element_subtype_indication discrete_range <= discrete_subtype_indication | expr. ( to | downto) expr. subtype_indication <= type_mark [range expr. (to | downto) expr. ] type word is array (0 to 31) of bit type word is array (31 downto 0) of bit;

Arrays type word is array (0 to 31) of bit subtype coeff_ram_address is integer range 0 to 63; type coeff_array is array (coeff_ram_address) of real; variable buffer_register, data_register : word; variable coeff : coeff_array; coeff(0):=0.0; data_register:=buffer_register;

Arrays type controller_state is (initial, idle, active, error); type state_counts is array (idle to error) of natural; type state_counts is array (controller_state range idle to error) of natural; variable counters : state_counts; counters(active):=counters(active)+1;

Multidimensional arrays type symbol is (’a’, ’t’, ’d’, ’h’, digit, cr, error); type state is range 0 to 6; type transition_matrix is array (state, symbol) of state; variable transition_table : transition_matrix; transition_table(5,’d’);

Multidimensional arrays constant next_state : transition_matrix := ( 0 => ('a' => 1, others => 6), 1 => ('t' => 2, others => 6), 2 => ('d' => 3, 'h' => 5, others => 6), 3 => (digit => 4, others => 6), 4 => (digit => 4, cr => 0, others => 6), 5 => (cr => 0, others => 6), 6 => (cr => 0, others => 6) );

Array aggregates aggregate ] expr. ) {, …}) choices <= (expr. | discrete_range | others) {| …} type coeff_array is array (coeff_ram_address) of real; variable coeff:coeff_array:=(0=>16, 1=>2.3, 2=>1.6, 3 to 63=>0.0); variable coeff:coeff_array:=(0=>16, 1=>2.3, 2=>1.6, others=>0.0); variable coeff:coeff_array:=(0|2=>16, 1=>2.3, others=>0.0);

Array attributes A’left(N) -- left bound of index range A’right(N) -- right bound of index range A’low(N) -- lower bound of index range A’high(N) -- upper bound of index range A’range(N) -- index range of dim. N of A A’reverse_range(N) -- reverse of index range A’length(N) -- length of index range A’ascending(N) -- true if index range is ascending

Array attributes type A is array (1 to 4, 31 downto 0) of boolean; A'left(1)=1A'low(1)=1 A'right(2)=0A'high(2)=31 A'length(1)=4A'length(2)=32 A'ascending(1)=true A'ascending(2)=false A'low=1A'length=4

Unconstrained Array Types type sample is array (natural range <>) of integer; variable short_sample_buf : sample(0 to 63); type string is array (positive range <>) of character; type bit_vector is array (natural range <>) of bit; subtype byte is bit_vector(7 downto 0); type std_ulogic_vector is array (natural range <> ) of std_ulogic; subtype std_ulogic_word is std_ulogic_vector(0 to 31); signal csr_offset : std_ulogic_vector(2 downto 1); variable current_test : std_ulogic_vector(0 to 13) := "ZZZZZZZZZZ----"; constant all_ones : std_ulogic_vector(15 downto 0) := X"FFFF";

Array Slices entity byte_swap is port (input : in halfword; output : out halfword); end entity byte_swap; architecture behavior of byte_swap is begin swap : process (input) begin output(8 to 15) <= input(0 to 7); output(0 to 7) <= input(8 to 15); end process swap; end architecture behavior;

Records type time_stamp is record seconds : integer range 0 to 59; minutes : integer range 0 to 59; hours : integer range 0 to 23; end record time_stamp; variable sample_time, current_time : time_stamp; sample_time:=current_time; sample_hour:=sample_time.hours; constant midday : time_stamp:=(0,0,12); constant midday : time_stamp := (hours => 12, minutes => 0, seconds => 0);

Next time Modelsim VHDL simulator Xilinx Foundation ISE Digilent Nexys-II development board VHDL Sequential Statements