IAY 0600 Digital Systems Design

Slides:



Advertisements
Similar presentations
HDL Programming Fundamentals
Advertisements

1 Introduction to VHDL (Continued) EE19D. 2 Basic elements of a VHDL Model Package Declaration ENTITY (interface description) ARCHITECTURE (functionality)
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
Managing design complexity Partition of designs Typical design process using VHDL Test Bed A VHDL example.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
ECE 331 – Digital System Design
Lecture #6 Page 1 Lecture #6 Agenda 1.VHDL - Architecture 2.VHDL - Packages Announcements 1.HW #3 assigned ECE 4110– Sequential Logic Design.
(1) Programming Mechanics © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
1 H ardware D escription L anguages Basic Language Concepts.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
Circuit Simulation 1) Functional simulation :- Propagation delay through the circuit are neglected. 2) Timing simulation :- Propagation delay through the.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 6: Configurations.
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 IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description 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.
IAY 0600 Digital Systems Design VHDL discussion Dataflow&Behavioral Styles Combinational Design Alexander Sudnitson Tallinn University of Technology.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
Basic Overview of VHDL Matthew Murach Slides Available at:
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
1 component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words  Declarations of Components and Entities are similar  Components are.
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
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.
IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Alexander Sudnitson Tallinn University of Technology.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
Digital System Projects
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
ECOM 4311—Digital System Design with VHDL
Digital Design Using VHDL and PLDs ECOM 4311 Digital System Design Chapter 1.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design Timing and Post-Synthesis Verifications Hazards in Combinational Circuits Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
Explain Half Adder and Full Adder with Truth Table.
IAY 0600 Digital Systems Design VHDL discussion Structural style Modular design and hierarchy Part 1 Alexander Sudnitson Tallinn University of Technology.
SUBJECT : DIGITAL ELECTRONICS CLASS : SEM 3(B) TOPIC : INTRODUCTION OF VHDL.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
IAY 0600 Digital Systems Design
Introduction to design with VHDL
IAY 0600 Digital Systems Design
Elements of Structural Models
Structural style Modular design and hierarchy Part 1
Basic Language Concepts
IAY 0600 Digitaalsüsteemide disain
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
Dataflow Style Combinational Design with VHDL
Structural style Modular design and hierarchy Part 1
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
ECE 4110–5110 Digital System Design
IAS 0600 Digital Systems Design
Introduction to Verilog
IAS 0600 Digital Systems Design
Structural style Modular design and hierarchy Part 1
IAY 0600 Digital Systems Design
VHDL Discussion Subprograms
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
Digital Systems Design 2
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

IAY 0600 Digital Systems Design VHDL discussion Structural style Modular design and hierarchy Alexander Sudnitson Tallinn University of Technology

Hierarchy tree for the modular partition There are tradeoffs in deciding the complexity of a leaf nodes, such as code readability and maintainability, module reuse, and synthesis and verification efficiency.

Advantages of good design partition Design management is easier Modules can be designed and verified by different individuals Maximum reuse of modules is made possible The design description is more readable and easier comprehend Verification is simplified Better design results are likely The portability of the design is enhanced

A simple example (full adder) Modular and hierarchical designs are implemented in VHDL using structural style architectures. A structural architecture is, ultimately, a collection of design entities interconnected by signals.

Hierarchy tree for a full adder The partitioning process is continued until each leaf node represents a relatively simple module that we can easily comprehend and directly code.

Design file and design units A name made directly visible to a primary library unit by a context clause is automatically visible in any associated secondary library unit.

Design file and design units A design unit is a VHDL construct that can be construct that can be independently compiled and stored in a design library. Design units provide modularity for the design management of complex systems. A design file is a source file containing one or more design units. A design file is the input to a VHDL compiler. Design units in a design file are compiled in the same order as their textual order in the file. Using separate files allows separate compilation and verification of each design entity.

Description in a single design file -1- library ieee; use ieee.std_logic_1164. all ; entity half_adder is port (a, b : in std_logic; sum, carry_out : out std_logic); end half_add; architecture dataflow of half_adder is begin sum <= a xor b ; carry_out <= and b ; end dataflow ; entity or_2 is port (a, b : in std_logic; sum, or_out : out std_logic); end or_2; architecture dataflow of or_2 is or_out <= a or b ;

Description in a single design file -2- library ieee; use ieee.std_logic_1164. all ; entity full_adder is port (a, b, carry_in : in std_logic; sum, carry_out : out std_logic) ; end full_add; architecture structure of full_adder is signal s1, s2, s3 : std_logic ; begin ha1 : entity half_adder port map (a => a, b => b, sum => s1, carry_out=>s2); ha2 : entity half_adder port map (a =>s1, b =>carry_in, sum =>sum, carry_out =>s3); or1 : entity or_2 port map (a => s3, b => s2, or_out => carry-out) ; end structure ;

Design file containing top-level entity library ieee; use ieee.std_logic_1164. all ; library parts ; use parts.all ; entity full_adder is port (a, b, carry_in : in std_logic; sum, carry_out : out std_logic) ; end full_add; architecture structure of full_adder is signal s1, s2, s3 : std_logic ; begin ha1 : entity half_adder port map (a => a, b => b, sum => s1, carry_out=>s2); ha2 : entity half_adder port map (a =>s1, b =>carry_in, sum =>sum, carry_out =>s3); or1 : entity or_2 port map (a => s3, b => s2, or_out => carry-out) ; end structure ; - - The half_adder and OR gate design entities have been compiled - - to a user-created library called parts.

Design libraries A simulator can only simulate programs that have been successfully compiled and stored in a library. A design library is a logical storage area in the host computer environment for compiled design units (library units) A design library is identified by its logical name. There are two kinds of design libraries: working library and resource library

Design libraries All VHDL compilers come with the library STD included. This built-in library is provided by standard IEEE Std 1076. Library STD contains two packages: STANDARD and TEXTIO. VHDL compilers also include the library IEEE. This library contains packages defined by VHDL’s supporting standards, such as packages STD_LOGIC_1164. Of course, we can write our own packages and place them in libraries that we create – user-defined libraries. Third-party intellectual property provides sell libraries containing complex design entities that we can use as modules. PLD vendor libraries (Source code for the architecture bodies and package bodies is usually not provided)

Using library units Implicit context clause: Every library unit is assumed to be preceded by the implicit context clause library std, work ; use std.standard.all ; Rules: A primary unit whose name is referenced within a given design unit must be compiled prior to compiling the given design unit. A primary unit must be compiled prior to compiling any associated secondary units. User written packages and other design units can be precompiled and placed in a resource library. Design entities in a resource library can be used as modules by design entities in a design file. The appropriate context clauses for any resource libraries used must be included prior to each library unit in a design file.

Closer look at structiral design In a structural style description, component instantiation statements are used to create an instance of each design entity. The syntax provides two forms for a component instantiation statement: 1) Direct instantiation of a design entity. 2) Indirect instantiation. Indirect instantiation instantiates a component, which serves as a placeholder for a design entity rather than directly instantiating a design entity. The binding of each component to an actual design entity is then accomplished using either default binding or an explicit binding indication.

Direct instantiation of design entities Consider a following example. Assume that we have created separate design files for each of the following entity declarations and architecture bodies and compiled them into our working library in the order listed: Entity and_2 Architecture dataflow of and_2 Architecture behavioral of and_2 Entity or_2 Architecture dataflow of or_2 We now want to use these entity in a structural style description of the simple combinational circuit (next slide) The order of compilation

Logic diagram of a simple comb. circuit

Direct instantiation of design entities Binding is the process of associating a design entity and, optionally, a specific architecture body with an instance of a component. library ieee; use ieee.std_logic_1164. all ; entity comb_ckt is port (a, b, c, d : in std_logic; f : out std_logic) ; end comb_ckt; architecture structural_1 of comb_ckt is signal s1 : std_logic ; begin u1 : entity and_2 port map (in1 => a, in2 => b, out1 => s1) ; u2 : entity and_2 port map (in1 => c, in2 => d, out1 => s2) ; u3 : entity or_2 port map (in1 => s1, in2 => s2, out1 => f) ; end structural_1 ;

Default binding rules The compiler can follow a set of default binding rules, defined in the LRM, to accomplish bindings. For example, by default compiler looks in the working library (work) for an entity declaration whose name and interface match those specified in the component instantiation statement. If, in the working library, there is more than one architecture body associated with that entity declaration, then the compiler uses the one most recently compiled. For entity and_2 (previous slide), there are two possible architectures: dataflow and behavioral. Assuming that behavioral was the most recently compiled, instances u1 and u2 will both use that that architecture body. If we want binding other than default binding, we can specify the desired architecture with the entity name in the component instantiation statement. u1: entity and_2 (dataflow) port map (…); u2: entity and_2 (behavioral) port map (…); Specifying the library: u1: entity work.and_2 (dataflow) port map (…);

Components and indirect instantiation Indirect design entity instantiation uses a placeholder, called a component, to stand for the design entity in a component instantiation statement. Thus a component can be viewed as a virtual design entity. Look next slide. First, each component must be declared before it can be used. Second, each instantiation statement is an instance of a component, not an instance of a design entity A component declaration is placed in the declarative part of the architecture in which the component is used. Alternatively, if a component is likely to be used in multiple designs, its declaration can be placed in a package in a library.

Interconnection of entities via components

Indirect instantiation of design entities -1- library ieee; use ieee.std_logic_1164. all ; entity comb_ckt is port (a, b, c, d : in std_logic; f : out std_logic) ; end comb_ckt; architecture structural_2 of comb_ckt is component and_2 is port (in1, in2: in std_logic ; out1 : out std_logic) ; end component ; component or_2 is

Indirect instantiation of design entities -2- signal s1, s2 : std_logic ; begin u1 : entity and_2 port map (in1 => a, in2 => b, out1 => s1) ; u2 : entity and_2 port map (in1 => c, in2 => d, out1 => s2) ; u3 : entity or_2 port map (in1 => s1, in2 => s2, out1 => f ) ; end structural_2 ;

Components and configuration specification For components, there are three ways that binding can be accomplished: Default binding Configuration specification Configuration declaration In contrast to default binding, use of a configuration declaration or specification allows us to explicitly specify bindings. Configuration specifications are place in the declarative part of the architecture in which the components are instantiated. A configuration declaration is a design unit. A configuration specification starts with a keyword for.

Components and configuration specification library ieee; use ieee.std_logic_1164. all ; entity comb_ckt is port (a, b, c, d : in std_logic; f : out std_logic) ; end comb_ckt; architecture structural_3 of comb_ckt is component and_2 is port (in1, in2: in std_logic ; out1 : out std_logic) ; end component ; component or_2 is

Components and configuration specification signal s1, s2 : std_logic ; begin for u1 : and_2 use entity work.and_2 (dataflow) ; for u2 : and_2 use entity work.and_2 (behavioral) ; for u3 : or_2 use entity work.or_2 (dataflow) ; u1 : and_2 port map (in1 => a, in2 => b, out1 => s1) ; u2 : and_2 port map (in1 => c, in2 => d, out1 => s2) ; u3 : entity or_2 port map (in1 => s1, in2 => s2, out1 => f ) ; end structural_3 ;

Components and configuration specification There are two fundamental differences in Listing slides 21-22 and Listing slides 24-25: 1) each component in Listing slides 24-25 must be declared before it can be used, 2) each instantiation statement is an instance of a component, not an instance of a design entity.

or_3 desig entity bound to u3 or_2 Let us consider the following example. The configuration specification for u3 could be written as for u3 : or_2 use entity work.and_2 (dataflow) ; and no compilation error would occur. But, the function of the resulting combinationa circuit has been changed (the effect of using this configuration specificationis shown in next slide).

and_2 desig entity bound to u3 or_2

or_3 desig entity bound to u3 or_2

Port maps in configuration specification For example, assume that we did not have a design entity or_2 to bind to component or_2, but we did have a three-input OR designentity in the library parts (full adder example). Assume that the entity declaration is entity or_3 is port (inp1, inp2, inp3 : in std_logic; outp1 : out std_logic) ; end or_3; We can change the configuration specification for u3 to for u3 : or_2 use entity parts.or_3 (dataflow) ; port map (inp1 => in1, inp2 => in2, inp3 => ´0´, outp1 => f) ;

Configuration declaration Using configuration specifications is advantageous when we don’t intend to change our component-instance/design-entity bindings. Greater flexibility in specifying bindings can be achieved using a configuration declaration. A configuration declaration is a design unit that allows bindings of architecture bodies to entity declarations, as well as bindings of components to design entities, to be specified. Since a configuration declaration is a separate design unit, these bindings are specified outside of the architecture body.

Configuration declaration for comb_ckt configuration config2 of comb_ckt is for structural_2 -- block configuration for u1 : and_2 -- component configuration use entity work.and_2(dataflow); end for; for u2 : and_2 -- component configuration use entity work.and_2(behavioral); for u3 : or_2 -- component configuration use entity work.or_2(dataflow); end config2;

Simplified syntax of package declaration Package is a primary design unit used to organize and collect together related commonly used declarations (constants,types, functions, procedures).

Simplified syntax of package body