Module Goals Introduce structural VHDL constructs Use of components

Slides:



Advertisements
Similar presentations
COE 405 VHDL Basics Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh Computer Engineering.
Advertisements

1 Introduction to VHDL (Continued) EE19D. 2 Basic elements of a VHDL Model Package Declaration ENTITY (interface description) ARCHITECTURE (functionality)
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Package with 4-valued logic Signal Attributes Assertion Data Flow description.
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
Introduction to VHDL (part 2)
1 H ardware D escription L anguages Basic Language Concepts.
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
Tutorial 1 Combinational Logic Synthesis. Introduction to VHDL VHDL = Very high speed Hardware Description Language VHDL and Verilog are the industry.
Copyright  RASSP E&F Structural VHDL RASSP Education & Facilitation Module 11 Version 2.01 Copyright  RASSP E&F All rights reserved.
RASSP E&F SCRA GT UVA Raytheon UCinc EIT ADL Copyright  RASSP E&F Structural VHDL RASSP Education & Facilitation Module 11 Version 2.01 Copyright.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
Copyright  SCRA Methodology Reinventing Electronic Design Architecture Infrastructure DARPA Tri-Service RASSP Structural VHDL RASSP Education.
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.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
(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.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Unit 7 Mixed Language Descriptions SYLLABUS Highlights of Mixed-Language Description, How to invoke One language from the Other Mixed-language Description.
An Introduction to V.H.D.L.. Need of a Compiler… main( ) { int x=10,y=20,z; z = x + y ; printf ( “ %d “, z ); getch( ) ; } What’s That ? Give me only.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Hardware Description Languages: Verilog
IAY 0600 Digital Systems Design
Basic VHDL RASSP Education & Facilitation Module 10 Version 2.02
ECE 4110–5110 Digital System Design
Elements of Structural Models
Introduction To VHDL 홍 원 의.
Basic Language Concepts
Systems Architecture Lab: Introduction to VHDL
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Structural style Modular design and hierarchy Part 1
HDL Programming Fundamentals
Hardware Description Languages: Verilog
IAS 0600 Digital Systems Design
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL VHSIC Hardware Description Language VHSIC
Introduction to Verilog
Structural style Modular design and hierarchy Part 1
Instructions to get MAX PLUS running
VHDL (VHSIC Hardware Description Language)
VHDL Discussion Subprograms
Module Goals Introduce structural VHDL constructs Use of components
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
Hardware Modeling & Synthesis Using VHDL
Modeling Complex Behavior
Data Object By E. Thirumeni Department of Electronics
Design units Lecture 2.
Sequntial-Circuit Building Blocks
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Module Goals Introduce structural VHDL constructs Use of components Component binding indications Use of configuration declarations GENERATE statements The goals of this module are to introduce the concepts and constructs supporting structural modeling using VHDL. These include the mechanisms for incorporating other VHDL design objects into an architecture description. In addition, some powerful VHDL utilities that facilitate the design of systems with regular structures and constructs to support configuration control will be presented. The goal of this module is to bring the student to the point where she/he will be able to write code using the concepts of structural design in VHDL.

Module Outline Generate Statement Examples Summary

Generate Statement VHDL provides the GENERATE statement to create well-patterned structures easily Some structures in digital hardware are repetitive in nature (e.g. RAMs, adders) Any VHDL concurrent statement may be included in a GENERATE statement, including another GENERATE statement Specifically, component instantiations may be made within GENERATE bodies Structural descriptions of large, but highly regular, structures can be tedious. A VHDL GENERATE statement can be used to include as many concurrent VHDL statements (e.g. component instantiation statements) as needed to describe a regular structure easily. In fact, a GENERATE statement may even include other GENERATE statements for more complex devices.. Some common examples include the instantiation and connection of multiple identical components such as half adders to make up a full adder, or exclusive or gates to create a parity tree.

Generate Statement FOR-Scheme All objects created are similar The GENERATE parameter must be discrete and is undefined outside the GENERATE statement Loop cannot be terminated early name : FOR N IN 1 TO 8 GENERATE concurrent-statements END GENERATE name; VHDL provides two different schemes of the GENERATE statement, the FOR-scheme and the IF-scheme. This slide shows the syntax for the FOR-scheme. The FOR-scheme is reminiscent of a FOR loop used for sequence control in many programming languages. The FOR-scheme generates the included concurrent statements the assigned number of times. In the FOR-scheme, all of generated concurrent statements must be the same. The loop variable is created in the GENERATE statement and is undefined outside that statement (i.e. it is not a variable or signal visible elsewhere in the architecture). The syntax for the FOR-scheme GENERATE statement is shown in the slide. The loop variable in this case is N. The range can be any valid discrete range. After the GENERATE keyword, the concurrent statements to be generated are stated, and the GENERATE statement is closed with END GENERATE.

FOR-Scheme Example S2(7:0) S1(7:0) S3(7:0) -- this uses the and_gate component from before ARCHITECTURE test_generate OF test_entity IS SIGNAL S1, S2, S3: BIT_VECTOR(7 DOWNTO 0); BEGIN G1 : FOR N IN 7 DOWNTO 0 GENERATE and_array : and_gate GENERIC MAP (2 ns, 3 ns) PORT MAP (S1(N), S2(N), S3(N)); END GENERATE G1; END test_generate; S2(7:0) S1(7:0) S3(7:0) This slide shows an example of the FOR-scheme. The code generates an array of AND gates. In this case, the GENERATE statement has been named G1 and instantiates an array of 8 and_gate components. The PORT MAP statement maps the interfaces of each of the 8 gates to specific elements of the S1, S2, and S3 vectors by using the FOR loop variable as an index.

Generate Statement IF-Scheme Allows for conditional creation of components Cannot use ELSE or ELSIF clauses with the IF-scheme name : IF (boolean expression) GENERATE concurrent-statements END GENERATE name; The second form of the GENERATE statement is the IF-scheme. This scheme allows for conditional generation of concurrent statements. One obvious difference between this scheme and the FOR-scheme is that all the concurrent statements generated do not have to be the same. While this IF statement may seem reminiscent to the IF-THEN-ELSE constructs in programming languages, note that the GENERATE IF-scheme does not provide ELSE or ELSIF clauses. The syntax of the IF-scheme GENERATE statement is shown in this slide. The boolean expression of the IF statement can be any valid boolean expression.

IF-Scheme Example ARCHITECTURE test_generate OF test_entity SIGNAL S1, S2, S3: BIT_VECTOR(7 DOWNTO 0); BEGIN G1 : FOR N IN 7 DOWNTO 0 GENERATE G2 : IF (N = 7) GENERATE or1 : or_gate GENERIC MAP (3 ns, 3 ns) PORT MAP (S1(N), S2(N), S3(N)); END GENERATE G2; G3 : IF (N < 7) GENERATE and_array : and_gate GENERIC MAP (2 ns, 3 ns) END GENERATE G3; END GENERATE G1; END test_generate; The example here uses the IF-scheme GENERATE statement to make a modification to the and_gate array such that the seventh gate of the array will be an or_gate. Another example use of the IF-scheme GENERATE is in the conditional execution of timing checks. Timing checks can be incorporated inside a GENERATE IF-scheme. For example, the following statement can be used: Check_time : IF TimingChecksOn GENERATE This allows the boolean variable TimingChecksOn to enable timing checks by generating the appropriate concurrent VHDL statements in the description. This parameter can be set in a package or passed as a generic and can improve simulation speed by shutting off this computational section.

Module Outline Examples Introduction Component Instantiation Generate Statement Examples Summary

Examples Build higher level modules from the library of basic gates 8 Bit Register using DFFs 8 Bit Shift Register using Multiplexors and DFFs

Structural 8 Bit Register Example Simple Generate Statement LIBRARY gate_lib; USE gate_lib.resources.all; ENTITY reg8_str IS GENERIC(tprop : delay := 8 ns; tsu : delay := 2 ns); PORT(d : IN level_vector(7 DOWNTO 0); clk : IN level; enable : IN level; q : OUT level_vector(7 DOWNTO 0); qn : OUT level_vector(7 DOWNTO 0)); END reg8_str; ARCHITECTURE structural OF reg8_str IS -- COMPONENT DECLARATION COMPONENT dff GENERIC(tprop : delay; tsu : delay); PORT(d : IN level; clk : IN level; enable : IN level; q : OUT level; qn : OUT level); END COMPONENT; -- BINDING INDICATIONS FOR ALL : dff USE ENTITY gate_lib.dff(behav); BEGIN -- COMPONENT INSTANTIATION (GENERATE) R1:FOR i IN 1 TO 8 GENERATE I1:dff GENERIC MAP(tprop => tprop, tsu => tsu) PORT MAP(d => d(i-1), clk => clk, enable => enable, q => q(i-1), qn => qn(i-1)); END GENERATE R1; END structural; This is a structural description of an 8 bit register using DFFs from the library. A simple generate statement is used to instantiate the DFFs and connect them to the individual “bits” at the register’s input and output. The colors highlight the same parts of the structural description as before. D Q CLK D(0) D(1) D(2) D(7) Q(0) Q(1) Q(2) Q(7) ENABLE E Qn Qn(0) Qn(1) Qn(2) Qn(7)

Structural 8 Bit Register Simulation Results Simulation results showing correct function.

Structural 8 Bit Shift Register Example (Entity) LIBRARY gate_lib; USE gate_lib.resources.all; ENTITY shift_reg8_str IS GENERIC(tprop : delay := 15 ns; tsu : delay := 2 ns); PORT(d : IN level_vector(7 DOWNTO 0); clk : IN level; enable : IN level; scan_in : IN level; shift : IN level; scan_out : OUT level; q : OUT level_vector(7 DOWNTO 0)); END shift_reg8_str; D(0) D(1) D(2) D(7) This is the schematic and entity description for and 8 bit shift register. Note that in the schematic, signals will be needed between the multiplexor output and the dff’s input and the dff output and the shift register output (Q). The signal on the DFF outputs is needed because it feeds back to the input of the muxes, and that can’t be done by connecting both directly to an output port (until VHDL-93 in which OUT ports are readable inside the architecture). Thus, some concurrent signal assignment statements will be necessary to connect the signal at the dff outputs to the Q outputs. SHIFT SCAN_IN CLK ENABLE D D D D CLK CLK CLK CLK E Q E Q E Q E Q SCAN_OUT Q(0) Q(1) Q(2) Q(7)

Structural 8 Bit Shift Register Example (Architecture - Generate with If Scheme) ARCHITECTURE structural OF shift_reg8_str IS -- COMPONENT DECLARATION COMPONENT mux2 GENERIC(tprop : delay); PORT(a : IN level; b : IN level; sel : IN level; c : OUT level); END COMPONENT; COMPONENT dff GENERIC(tprop : delay; tsu : delay); PORT(d : IN level; clk : IN level; enable : IN level; q : OUT level; qn : OUT level); -- BINDING INDICATIONS FOR ALL : mux2 USE ENTITY gate_lib.mux2(behav); FOR ALL : dff USE ENTITY gate_lib.dff(behav); SIGNAL mux_out : level_vector(7 DOWNTO 0); SIGNAL dff_out : level_vector(7 DOWNTO 0); BEGIN -- COMPONENT INSTANTIATION (GENERATE W/ IF) G1:FOR i IN 0 TO 7 GENERATE G2 : IF (i = 0) GENERATE MUX1 : mux2 GENERIC MAP(tprop => tprop/2) PORT MAP(a => scan_in, b => d(i), sel => shift, c => mux_out(i)); DFF1 : dff GENERIC MAP(tprop => tprop/2, tsu => tsu) PORT MAP(d => mux_out(i), clk => clk, enable => enable, q => dff_out(i)); q(i) <= dff_out(i); END GENERATE G2; G3 : IF (i > 0) GENERATE PORT MAP(a => dff_out(i-1), END GENERATE G3; END GENERATE G1; scan_out <= dff_out(7); END structural; This is the architecture which uses a complex generate statement. There is an IF statement within the generate statement to handle the fact that the mux that is connected to the 0th bit is connected to scan_in instead of the output of the DFF in the previous bit position. Here again, the colors highlight the three parts of the structural description. Note that the concurrent signal assignment statements to connect the dff_out signal to the Q outputs are inside the generate statements.

Structural 8 Bit Shift Register Simulation Results Here is the simulation results showing a parallel load followed by scanning the loaded data.