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)
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
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.
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.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
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)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
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.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
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
Systems Architecture Lab: Introduction to VHDL
IAY 0600 Digitaalsüsteemide disain
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
Verification: Testbenches in Combinational Design
Dataflow Style Combinational Design with VHDL
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
Structural style Modular design and hierarchy Part 1
Instructions to get MAX PLUS running
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
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 IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology

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

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.

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.

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 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.

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.

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.

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 ;

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

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.

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