Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "IAY 0600 Digital Systems Design VHDL discussion Structural style Modular design and hierarchy Part 1 Alexander Sudnitson Tallinn University of Technology."— Presentation transcript:

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

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

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

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

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

6 6 Design Entity

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

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

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

10 10 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 ; library ieee; use ieee.std_logic_1164. all ; 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 begin or_out <= a or b ; end dataflow ;

11 11 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 ;

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

13 13 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); Component 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.

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

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

16 16 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)

17 17 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: 1. A primary unit whose name is referenced within a given design unit must be compiled prior to compiling the given design unit. 2. 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.


Download ppt "IAY 0600 Digital Systems Design VHDL discussion Structural style Modular design and hierarchy Part 1 Alexander Sudnitson Tallinn University of Technology."

Similar presentations


Ads by Google