VHDL HIERARCHICAL MODELING

Similar documents
Building Blocks. Entity Declaration. Entity Declaration with Generics. Architecture Body. entity entity_name is. entity register8 is

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

Mridula Allani Fall Fall

Test Bench. Top Level Model Test Bench MUT

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

VHDL: RTL Synthesis Basics. 1 of 59

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Sequential Logic - Module 5

The University of Alabama in Huntsville ECE Department CPE Midterm Exam February 26, 2003

Hardware Description Language VHDL (1) Introduction

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

Control and Datapath 8

Computer-Aided Digital System Design VHDL

VHDL And Synthesis Review

[VARIABLE declaration] BEGIN. sequential statements

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Lattice VHDL Training

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Sequential Statement

VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit.

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points)

Lecture 12 VHDL Synthesis

CDA 4253 FPGA System Design Op7miza7on Techniques. Hao Zheng Comp S ci & Eng Univ of South Florida

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

8 Register, Multiplexer and

EECS150 - Digital Design Lecture 10 Logic Synthesis

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

COVER SHEET: Total: Regrade Info: Problem#: Points. 7 (14 points) 6 (7 points) 9 (6 points) 10 (21 points) 11 (4 points)

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

10 Writing Circuit Descriptions

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

VHDL for FPGA Design. by : Mohamed Samy

VHDL for Synthesis. Course Description. Course Duration. Goals

HIERARCHICAL DESIGN. RTL Hardware Design by P. Chu. Chapter 13 1

Outline HIERARCHICAL DESIGN. 1. Introduction. Benefits of hierarchical design

Introduction to VHDL #3

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

EEL 4712 Digital Design Test 1 Spring Semester 2007

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

ELEC 4200 Lab#10 Interrupting SPI Receiver for use with a Processor Core

Nikhil Gupta. FPGA Challenge Takneek 2012

EECS150 - Digital Design Lecture 10 Logic Synthesis

CCE 3202 Advanced Digital System Design

SEQUENTIAL STATEMENTS

Hardware Description Languages (HDLs) Verilog

ECE 459/559 Secure & Trustworthy Computer Hardware Design

HDL Coding Style Xilinx, Inc. All Rights Reserved

Lecture 11 Memories in Xilinx FPGAs

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

EEL 4712 Digital Design Test 2 Spring Semester 2008

FPGA for Software Engineers

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Asynchronous FIFO Design

Verilog Module 1 Introduction and Combinational Logic

CCE 3202 Advanced Digital System Design

PALMiCE FPGA Probing Function User's Manual

Design Problem 5 Solution

Review of Digital Design with VHDL

Design Problem 3 Solutions

INTRODUCTION TO VHDL. Lecture 5 & 6 Dr. Tayab Din Memon Assistant Professor Department of Electronic Engineering, MUET

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

Performance Engineering of Real-Time and Embedded Systems. Introduction to VHDL

Design Problem 4 Solution

CONCURRENT STATEMENTS COMPONENT DECLARATION COMPONENT INSTANTIATION

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

Inferring Storage Elements

A Tutorial Introduction 1

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Sign here to give permission to return your test in class, where other students might see your score:

COVER SHEET: Total: Regrade Info: 7 (6 points) 2 (10 points) 9 (5 points) 8 (12 points) 12 (5 points) 11 (25 points)

In our case Dr. Johnson is setting the best practices

VHDL simulation and synthesis

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

Topics. Midterm Finish Chapter 7

Verilog. Verilog for Synthesis

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN

Lecture 4. VHDL Fundamentals. Required reading. Example: NAND Gate. Design Entity. Example VHDL Code. Design Entity

Topics. Midterm Finish Chapter 7

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

Fundamental Design Concepts. Fundamental Concepts. Modeling Domains. Basic Definitions. New terminology and overloaded use of common words

EEL 4712 Name: SOLUTION Midterm 1 Spring 2016 VERSION 1 UFID:

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

The Verilog Hardware Description Language

Verilog for High Performance

Introduction to VHDL

Transcription:

To incorporate hierarchy in VHDL we must add component declarations and component instantiations to the model. In addition, we need to declare internal signals to interconnect the components. We can also include processes and concurrent statements in the hierarchical model. Format for Architecture body (for internal signals & hierarchy) architecture architecture_name of entity_name is signal declarations -- for internal signals in model component decalarations -- for hierarchical models component instantiations processes concurrent statements end architecture architecture_name; Format for component declaration component component_name is generic (generic_name(s) type = initial_value; generic_name(s) type = initial_value); port (signal_name(s) mode signal_type; signal_name(s) mode signal_type); end component component_name; Note that the component_name is the same as the entity_name from the model being called up. As a result, component declarations look just like the entity statements (including generics and ports) for the component being declared but with component substituted for entity. (In fact, I usually copy the entity from the component being declared and paste it in the component declaration and do a global replacement of component for entity.) The component instantiation is the actual call to a specific use of the model. A single component declaration can have multiple instantiations. As a result, each component instantiation must include a unique name (instantiation_label along with the component (component_name) being used. Furthermore, the values assigned to generics in the component instantiation will override any initial values assigned to the generic in the entity statement or component declaration for that model (important when a component is called multiple times with different generic values assigned to each call). There are some other subtle variations (noted in red below) in the format for a component instantiation compared to an entity or component declaration. There are two methods (and formats) for connecting signals to the port of the component 1) named association (aka, keyword notation) and 2) positional association (aka, positional notation). C. E. Stroud, ECE Dept., Auburn Univ. 1 8/06

Format for component instantiation (keyword notation) instantiation_label component_name generic map (generic_name => value, -- note, at end & not ; generic_name => value) -- note no ; at end port map (port_name => signal_name, -- note, at end & not ; port_name => signal_name); Note that port_name is the actual signal_name from the component declaration (which is also the same as in the original entity statement). The signal_name given here is the actual signal in the hierarchical design being connected to that particular port_name. The order of the generics values and signal_names can be in any order since each is associated to a unique generic or port by the => operator. The penalty is more junk to type in the spirit of verbosity. Format for component instantiation (positional notation) instantiation_label component_name generic map (generic_value, -- note, at end and not ; generic_value) -- note no ; at end port map (signal_name, -- note, at end and not ; signal_name); Note that the generic_values and signal_names must appear in the order given in the component declaration in order to connect to the correct generic_name or port_name, respectively. Finding the correct order is no big deal since it is given above in the component declaration that must also be included in the model (therefore, positional notation is my personal preference). Components instantiations are treated as concurrent statements where the inputs to component represent the sensitivity list such that the component model is evaluated whenever there is an event on one of its inputs. Therefore, component instantiations cannot be included in a process. Note that a constant logic value (i.e., 0 or 1 ) can be assigned to an unused input in the component instantiation which will allow most synthesis tools to minimize the logic associated with the unused input (or feature of the model being instantiated). This also applies to bit_vectors as well where a string of constant logic values can be applied. This is a powerful capability when used in conjunction with parameterized modeling by allowing even more use of a parameterized model. C. E. Stroud, ECE Dept., Auburn Univ. 2 8/06

For example, consider a rising edge triggered N-bit counter with active high synchronous reset, active high preset, active high parallel load, and active high count enable (with that order of precedence). entity REG is generic (N int = 3); port (CLK,RST,PRE,LOAD,CEN in bit; DATIN in bit_vector (N-1 downto 0); DOUT buffer bit_vector (N-1 downto 0)); end entity REG; architecture RTL of REG is process (CLK) if (CLK event and CLK= 1 ) then if (RST = 1 ) then DOUT <= (others => 0 ); elsif (PRE = 1 ) then DOUT <= (others => 1 ); elsif (LOAD = 1 ) then DOUT <= DATIN; elsif (CEN = 1 ) then DOUT <= DOUT + 1; end if; end if; end process; end architecture RTL; Next consider the 3 instances of REG in the following hierarchical use of this model entity TOP is port (CLK,X,Y,Z in bit; DIN in bit_vector(5 downto 0); Q1 out bit_vector(5 downto 0); Q2 out bit_vector(4 downto 0); Q3 out bit_vector(3 downto 0)); end entity TOP; architecture HIER of TOP is component REG is generic (N int = 3); port (CLK,RST,PRE,LOAD,CEN in bit; DATIN in bit_vector (N-1 downto 0); DOUT buffer bit_vector (N-1 downto 0)); end component REG; R1 REG generic map (6) port map (CLK, 0, 0,X, 0,DIN,Q1); R2 REG generic map (5) port map (CLK,Y, 0, 0,Z, 00000,Q2); R3 REG generic map (4) port map (CLK, 0, 0, 1, 0,DIN(3 downto 0),Q3); end architecture HIER; C. E. Stroud, ECE Dept., Auburn Univ. 3 8/06

When we synthesize this circuit, R1 will be a 6-bit register with active high parallel load signal (not reset, preset, or counter logic), R2 will be a 5 bit counter with active high reset and active high count enable (no parallel load or preset logic), and R3 will simply be 4 flip-flops without any features, as can be seen in the following synthesis report from ISE8.2 Performing bidirectional port resolution... Synthesizing Unit <REG_1>. Found 6-bit register for signal <DOUT>. Summary inferred 6 D-type flip-flop(s). Synthesizing Unit <REG_2>. Found 5-bit up counter for signal <DOUT>. Summary inferred 1 Counter(s). Synthesizing Unit <REG_3>. Found 4-bit register for signal <DOUT>. Summary inferred 4 D-type flip-flop(s). Synthesizing Unit <hier>. HDL Synthesis Report # Counters 1 5-bit up counter 1 # Registers 2 4-bit register 1 6-bit register 1 Advanced HDL Synthesis Report # Counters 1 5-bit up counter 1 # Registers 10 Flip-Flops 10 Final Register Report # Registers 15 Flip-Flops 15 Device utilization summary Selected Device 3s200pq208-5 Number of Slices 3 out of 1920 0% Number of Slice Flip Flops 15 out of 3840 0% Number of 4 input LUTs 6 out of 3840 0% Number of IOs 25 Number of bonded IOBs 25 out of 141 17% IOB Flip Flops 10 Number of GCLKs 1 out of 8 12% Note that only 3 slices and 6 LUTs were used (actually only 5 LUTs in that final design) for the counter R2 the other two registers only used flip-flops which already have C. E. Stroud, ECE Dept., Auburn Univ. 4 8/06

clock enable, reset, and preset capabilities (even though none of these features were used in the case of R3). Otherwise, the design would have required 12 slices and 20 LUTs for implement the three full register designs. C. E. Stroud, ECE Dept., Auburn Univ. 5 8/06