Structural style Modular design and hierarchy Part 1

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)
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
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
(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.
IAY 0600 Digital Systems Design
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.
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.
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.
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 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.
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.
IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Alexander Sudnitson Tallinn University of Technology.
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.
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
Lecture 2 Supplement Verilog-01
Structural style Modular design and hierarchy Part 1
Behavioral Style Combinational Design with VHDL
ENG6530 Reconfigurable Computing Systems
IAY 0600 Digital Systems Design
IAS 0600 Digital Systems Design
ECE 434 Advanced Digital System L08
Introduction to Verilog
IAS 0600 Digital Systems Design
Instructions to get MAX PLUS running
IAY 0600 Digital Systems Design
Hardware Descriptive Languages these notes are taken from Mano’s book
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
IAS 0600 Digital Systems Design
Supplement on Verilog adder examples
Design units Lecture 2.
Digital Systems Design 2
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Structural style Modular design and hierarchy Part 1 IAS 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology

Design Entity design entity entity declaration architecture 1 Design Entity - most basic building block of a design. One entity can have many different architectures.

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.

Structural style Structural style describes a system as a hierarchical interconnection of design entities. The top-level design entity’s architecture describes the interconnection of lower-level design entities. Each lower-level design entity can, in turn, be described as an interconnection of design entities at the next-lower level, and so on. The half adder is described as an interconnection of an XOR gate design entity and an AND gate design entity. A total of three design entities are described in the design file: the XOR gate (xor_2), the AND gate (and_2), and, at the end of the file, the top-level entity half_adder. Design entity half_adder describes how the XOR gate and the AND gate are connected to implement a half adder. It is this top-level entity that has a structural style description.

Half-adder structural implementation Half-adder structural implementation using XOR and AND design entities u1: entity xor_2 port map (i1 => a, i2 => b, o1 => sum); Ccomponent instantiation statements are concurrent statements. An event on any signal associated with a design entity’s inputs (in its port map) causes the design entity to “execute.” In the structural half-adder example, an event on either input a or b causes each design entity to simultaneously update its output value.

Component instatiation (Port map) statement u1: entity xor_2 port map (i1 => a, i2 => b, o1 => sum); A port map tells how a design entity is connected in the enclosing architecture. Each port of the design entity is associated with either a signal in the enclosing architecture, an expression, or the keyword open. Signals in the enclosing architecture include both the ports of the enclosing architecture as well as any signals declared in the declarative part of the enclosing architecture.

Positional and named association Using named association, each association is explicit and the listing order of the associations in the port map is of no concern. For example, a design entity instantiated with a port map equivalent to the previous one is: u1: entity xor_2 port map (i2 => b, o1 => sum, i1 => a); Alternatively, we can use positional association to specify how a design entity is connected. Using positional association, signals are associated based on their relative positions as specified in the entity’s declaration. The corresponding component instantiation statement using positional association is: u1: entity xor_2 port map (a, b, sum); While positional association is more concise, named association is preferable because it is more readable and less error prone.

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 entity instantiation 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 structure-1 of half_adder is begin u1: entity xor_2 port map (i1 => a, i2 => b, o1 => sum); u2: entity and_2 port map (i1 => a, i2 => b, o1 => carry_out); end structure-1 ; Here we suppose that there are deisgn units xor_2 and and_2 in the library WORK. The form of component instatiation statement that direcly instantiates a design did not become a part of VHDL until 1993.

Indirect design entity instantiation architecture structure-2 of half_adder is component xor_2 -- xor_2 component declaration port (i1, i2 : in std_logic; o1: out std_logic); end component; component and_2 -- and_2 component declaration begin u1: component xor_2 port map (i1 => a, i2 => b, o1 => sum); u2: component and_2 port map (i1 => a, i2 => b, o1 => carry_out); end structure-2 ;

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 (each design entity is simple enogh to be behavivorally described in VHDL).

Hierarchy tree for a full adder Ultimately, the lowest level components in a structural design must each be described behaviorally (dataflow and behavioral styles) in their respective architectures. Otherwise, the top-level description cannot be compiled, simulated, or synthesized.

Design file and design units A design unit is a VHDL construct that 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.

Hierarchy tree for a full adder structural description In a structural design each leaf node must be described behaviorally (dataflow and behavioral styles) in their respective architectures.

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 <= a 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 ;

Architecture with indirect instantiation of design entities architecture structure-2 of full_adder is component half_adder is -- component declaration port (a, b : in std_logic; sum, carry_out : out std_logic) ; end component ; component or_2 is -- component declaration port (a, b : in std_logic; carry_out : out std_logic) ; signal s1, s2, s3 : std_logic ; -- signals declaration begin -- component instantiations ha1 : component half_adder port map (a => a, b => b, sum => s1, carry_out=>s2); ha2 : component half_adder port map (a =>s1, b =>carry_in, sum =>sum, carry_out =>s3); or1 : component or_2 port map (a => s3, b => s2, or_out => carry-out) ; end structure-2 ;

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

Full adder block diagram (lab. Adder) A simple 1-bit full adder circuit has three inputs and two outputs. It can be built from three half adders as shown in Figure 2. Note that the carry output of the ha3 half adder is left floating, as it would always equal to ‘0’ (other half adders cannot have their carry outputs equal to ‘1’ both at the same time)

Full adder block design (lab. Adder) The full adder in Figure 2 can be created using Vivado Block Design.

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.

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.

Design file containing top-level entity - - The half_adder and OR gate design entities have been - - compiled to a user-created library called parts. 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 ;

GENERATE statement 4 bit equality comparator example

Structural code -1-

Structural code -2- Here we use positional association. COMPONENT keyword is omitted (in general, it is optional).

Naming signals

Generate statement