ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.

Slides:



Advertisements
Similar presentations
Hardware Description Language (HDL)
Advertisements

Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
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.
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
ECE C03 Lecture 161 Lecture 16 Introduction to VHDL Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
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.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Topics of Lecture Structural Model Procedures Functions Overloading.
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.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE 331 – Digital System Design Course Introduction and VHDL Fundamentals (Lecture #1)
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
VHDL Asutosh Kar Asst. Prof. in IIIT, Bhubaneswar.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Introduction to VHDL (part 2)
1 H ardware D escription L anguages Basic Language Concepts.
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 4: Modeling Dataflow.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
The Xilinx Spartan-3E FPGA family. Field Programmable Gate Array (FPGA) Configurable Logic Block (CLB) –Look-up table (LUT) –Register –Logic circuit Adder.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
Basic Concepts in VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Module 1.2 Introduction to Verilog
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
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.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
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.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
VHDL Tutorial.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Introduction To VHDL 홍 원 의.
Basic Language Concepts
Systems Architecture Lab: Introduction to VHDL
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
IAY 0600 Digitaalsüsteemide disain
HDL simulation and Synthesis (Marks16)
Timing Model Start Simulation Delay Update Signals Execute Processes
Behavioral Modeling in Verilog
ECE 434 Advanced Digital System L08
VHDL VHSIC Hardware Description Language VHSIC
ECE 434 Advanced Digital System L9
Introduction to Verilog
ECE 434 Advanced Digital System L10
COE 202 Introduction to Verilog
EEL4712 Digital Design (VHDL Tutorial).
VHDL - Introduction.
Presentation transcript:

ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002

ECE C03 Lecture 122 Outline VHDL Language Basics Interface Architecture Body Process Signal Assignment and Delay Models Various Sequential Statements READING: Dewey 11.2, 11.3, 11.4, , 15.1, 15.2, 18.2, 18.3, 18.4, 18.5

ECE C03 Lecture 123 Modeling Digital Systems Digital system: Any digital circuit that processes or stores information in digital form: gates to functional units Model represents only relevant information and abstracts away irrelevant detail Model needed to: –Develop and specify requirements –Communicate understanding of a system to a user –Allow testing of design through simulation –Allow formal verification –Allow automated synthesis

ECE C03 Lecture 124 What is VHDL (Very High Speed Integrated Circuits) VHSIC Hardware Description Language Used for two things –(1) Used to model digital systems, designs can then be SIMULATED A simulator runs a VHDL description computing the outputs of a modeled system –(2) Used as a language to enter designs into CAD tools, designs can then be SYNTHESIZED VHDL also provides a blackboard for designing digital systems An initial design is progressively expanded and refined Another popular hardware language is Verilog

ECE C03 Lecture 125 Relationship between VHDL and hardware Model VHDL description Simulator Simulated / actual outputs Hardware

ECE C03 Lecture 126 Example of VHDL Description VHDL Model of a 2input exclusive OR gate entity XOR2_OP is -- input output ports port (A, B : in BIT; Z : out BIT); -- Body architecture EX_DISJUNCTION of XOR_OP2 is begin Z <= A xor B; end EX_DISJUNCTION;

ECE C03 Lecture 127 VHDL Entity Definitions A VHDL entity consists of two parts: –interface denoted by keyword “entity” – body denoted by keyword “architecture” Interface describes aspects visible outside Body describes how black box operates inside FORMAT: entity identifier is port (name: in / out / inout BIT/type); end identifier; -- lines beginning with two dashes are comments

ECE C03 Lecture 128 VHDL Architecture Body Architecture body describes how entity operates Allows for different implementations Can have behavioral or structural or mixed representations FORMAT architecture EX_DISJUNCTION of XOR_OP2 is begin Z <= A xor B; end EX_DISJUNCTION;

ECE C03 Lecture 129 Architecture Body Body is divided into two parts –Declarative part –Statement part architecture EX_DISJUNTION of XOR_OP2 is -- declarative part -- objects must be declared before they are used begin -- statement part Z <= A xor B; end EX_DISJUNCTION;

ECE C03 Lecture 1210 Data Types in VHDL The type of a data object defines the set of values that object can assume and set of operations on those values –VHDL is a strongly typed language Four classes of objects –constants –variables –signals –files

ECE C03 Lecture 1211 Constant Declaration The value of a constant cannot be changed FORMAT: constant identifier {, } : subtype [ := expression] EXAMPLES: constant number_of_bytes : integer := 4; constant prop_delay : time := 3nsec; constant e : real := ;

ECE C03 Lecture 1212 Variable Declaration The value of a variable can be changed FORMAT variable identifier {,..} subtype [ := expression] EXAMPLES variable index: integer := 0; variable sum, average, largest : real; variable start, finish : time : = 0 nsec;

ECE C03 Lecture 1213 Variable Assignment Statement Once a variable is declared, its value can be modified by an assignment statement FORMAT: [ label : ] name := expression; EXAMPLES: program_counter := 0; index := index + 1; Variable assignment different from signal assignment –A variable assignment immediately overviews variable with new value –A signal assignment schedules new value at later time

ECE C03 Lecture 1214 Scalar Types Variable can only assign values of nominated type Default types –“integer”, “real”, “character,” “boolean”, “bit” User defined types –FORMAT: type small_int is range 0 to 255; Enumerated type: –FORMAT: type logiclevel is (unknown, low, driven, high);

ECE C03 Lecture 1215 Sub Types A type defines a set of values We can define a sub-type as a restricted set of values from a base type –FORMAT subtype identifier is name range simple_expression to/downto simple_expression –EXAMPLE subtype small_int is integer range -128 to 127; subtype bit_index is integer range 31 downto 0;

ECE C03 Lecture 1216 Attributes of Types A type defines a set of values and set of applicable operations A predefined set of attributes are used to give information about the values included in the type T’left = first (leftmost) value in T T’right = last (righmost) value in T T’value(s) = the value in T that is represented by s EXAMPLES: type set_index_range is range 21 downto 11; set_index_range’left = 21 set_index_range’right = 11 set_index_range’value(“20”) = 20

ECE C03 Lecture 1217 Expressions and Operators

ECE C03 Lecture 1218 VHDL Modeling Concepts Semantics (meaning) is heavily based on SIMULATION A design is described as a set of interconnected modules A module could be another design (component) or could be described as a sequential program (process)

ECE C03 Lecture 1219 A general VHDL design I1 I2 O1 IO1 Entity … is … End entity; component process 1process 2 concurrent assignment concurrent assignment I1 I2 O1 IO1 s1 s2 s3 s4 s5 s6 s7 s8s9 architecture … of … is... begin … end;

ECE C03 Lecture 1220 VHDL Simulator start stop Init t = 0 more event get earliest event delta delay update signals advance time execute triggered processes during process execution, new events may be added

ECE C03 Lecture 1221 Process Statements FORMAT PROCESS_LABEL: process -- declarative part declares functions, procedures, types, constants, variables, etc begin -- Statement part sequential statement; wait statement; -- eg. Wait for 1 ms; or wait on ALARM_A; sequential statement; … wait statement; end process; Flow of control

ECE C03 Lecture 1222 Sequential Statements Sequential statements of various types are executed in sequence within each VHDL process Variable statement variable := expression; Signal Assignment If statement Case statement Loop statement Wait statement

ECE C03 Lecture 1223 Variable and Sequential Signal Assignment Variable assignment –new values take effect immediately after execution variable LOGIC_A, LOGIC_B : BIT; LOGIC_A := ‘1’; LOGIC_B := LOGIC_A; Signal assignment –new values take effect after some delay (delta if not specified) signal LOGIC_A : BIT; LOGIC_A <= ‘0’; LOGIC_A <= ‘0’ after 1 sec; LOGIC_A <= ‘0’ after 1 sec, ‘1’ after 3.5 sec;

ECE C03 Lecture 1224 Signal Declaration and Assignment Signal declaration: describes internal signal signal identifier {…} : subtype [ := expression] EXAMPLE: signal and_a, and_b : bit; Signal Assignment name <= value_expression [ after time_expression]; EXAMPLE y <= not or_a_b after 5 ns; This specifies that signal y is to take on a new value at a time 5 ns later statement execution. Difference from variable assignment: –which only assigns some values to a variable

ECE C03 Lecture 1225 Concepts of Delays and Timing The time dimension in the signal assignment refers to simulation time in a discrete event simulation There is a simulation time clock When a signal assignment is executed, the delay specified is added to current simulation time to determine when new value is applied to signal –Schedules a transaction for the signal at that time input output

ECE C03 Lecture 1226 Specifying Technology Information One predefined physical type in VHDL: TIME Units: fs (10** -15 seconds), ps (1000 fs), ns, us, ms, sec, min ( 60 sec), hr (60 min) User-defined physical types type CAPACITANCE is range 0 to INTEGER’HIGH units fF; -- Femtofarads pF = 1000 fF;-- Picofarads nF = 1000 pF;-- Nanofarads end units type VOLTAGE is range 0 to 2 ** units uV; -- Microvolt; mV = 1000 uV; V = 1000 mV; end units;

ECE C03 Lecture 1227 Specifying Delays Inertial Delay Model –reflects physical inertia of physical systems –glitches of very small duration not reflected in outputs SIG_OUT <= not SIG_IN after 7 nsec --implicit SIG_OUT <= inertial ( not SIG_IN after 7 nsec ) Logic gates exhibit lowpass filtering SIG_IN SIG_OUT 2ns 9 ns19 ns 3 ns 10ns

ECE C03 Lecture 1228 Transport Delays Under this model, ALL input signal changes are reflected at the output SIG_OUT <= transport not SIG_IN after 7 ns; SIG_IN SIG_OUT 2ns 9 ns19 ns 3 ns 10ns 30 ns

ECE C03 Lecture 1229 If Statement FORMAT if boolean_expression then {sequential statement} elsif boolean_expression then {sequential statement} else {sequential statement} endif; EXAMPLE if sel=0 then result <= input_0; -- executed if sel = 0 else result <= input_1; -- executed if sel = 1 endif ;

ECE C03 Lecture 1230 Case Statement EXAMPLE of an ALU operation: case func is when pass1 => result := operand1; when pass2 => result := operand2; when add => result := operand1 + operand2; when subtract => result := operand1 - operand2; end case;

ECE C03 Lecture 1231 Loop Statements While condition loop {sequential statements} end loop; for identifier in range loop {sequential statements} end loop; while index > 0 loop index := index -1; end loop; for count in 0 to 127 loop count_out <= count; wait for 5 ns; end loop; for i in 1 to 10 loop count := count + 1; end loop;

ECE C03 Lecture 1232 Wait Statement A wait statement specifies how a process responds to changes in signal values. wait on signal_name wait until boolean_expression wait for time_expression Example on right shows process sensitivity list EXAMPLE: SAME AS: half_add: process is begin sum <= a xor b after T_pd; carry <= a and b after T_pd; wait on a, b; end process; half_add: process (a,b) is begin sum <= a xor b after T_pd; carry <= a and b after T_pd; end process;

ECE C03 Lecture 1233 Example of Architecture Body (AND_OR_INVERT) architecture primitive of and_or_inv is signal and_a, and_b, or_a_b : bit; begin and_gate_a : process (a1,a2) is begin and_a <= a1 and a2; end process and_gate_a; and_gate_b : process (b1,b2) is begin and_b <= b1 and b2; end process and_gate_b; or_gate: process (and_a, and_b) is begin or_a_b <= and_a or and_b; end process or_gate; inv : process (or_a_b) is begin y <= not or_a_b; end process inv; end architecture primitive; a1 a2 b1 b2 y

ECE C03 Lecture 1234 Process Declaration of Clock Generator Clock_gen: process (clk) is begin if clk = ‘0’ then clk <= ‘1’ after T_pw, ‘0’ after 2*T_pw; endif; end process clock_gen; T_pw 2*T_pw

ECE C03 Lecture 1235 Process Generator for Multiplexer a b sel z mux: process (a, b, sel) is begin case sel is when ‘0’ => z <= a after prop_delay; when ‘1’ => z <= b after prop_delay; end process mux;

ECE C03 Lecture 1236 Summary VHDL Language Basics Interface Architecture Body Process Signal Assignment and Delay Models Various Sequential Statements NEXT LECTURE: VHDL Structural Description READING: Dewey 12.1, 12.2, 12.3, 12.4, 13.1, 13.2, , 13.6,