Programming in VHDL Using Processes. How Processes Run A process is either in suspend mode or is running. For a process to run, there has to be a change.

Slides:



Advertisements
Similar presentations
Multiplexers Section 3-7 Mano & Kime. Multiplexers & Demultiplexers Multiplexers (Selectors) Lab 1 – Behavioral VHDL -- Multiplexers MUX as a Universal.
Advertisements

Reconfigurable Computing - Resolution Functions John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on Cockburn Sound, Western.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
1/8/ L17 Resolved SiganlsCopyright Joanne DeGroat, ECE, OSU1 Resolved Signals What are resolved signals and how do they work. Resolution???
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Comprehensive VHDL Module 6 Types November Comprehensive VHDL: Types Copyright © 2000 Doulos Types Aim ©To understand the use and synthesis.
VHDL Data Types Module F3.1. VHDL Data Types Scalar Integer Enumerated Real (floating point)* Physical* Composite Array Record Access (pointers)* * Not.
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
The IEEE Libraries And Examples Using Functions. Libraries Using the Library Command VHDL allows libraries defined using: library LibraryName; Here, we.
Introduction to VHDL Multiplexers Discussion D1.1.
1 H ardware D escription L anguages Basic Language Concepts.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic9: Three-State Buffers, Encoders/Decoders José Nelson Amaral.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
Sequential Statements
IAY 0600 Digital Systems Design
ENG241 Digital Design Week #8 Registers and Counters.
IAY 0600 Digital Systems Design VHDL discussion Dataflow&Behavioral Styles Combinational Design Alexander Sudnitson Tallinn University of Technology.
RESOLVED SIGNALS Used for situations where 2 outputs drive one signal. Example of a resolved signal declaration: type tri_state_logic is (‘0’, ‘1’, ‘Z’);
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
EE3A1 Computer Hardware and Digital Design Lecture 2 Introduction to VHDL.
Lecture #7 Page 1 Lecture #7 Agenda 1.VHDL Data Types Announcements 1.n/a ECE 4110– Digital Logic Design.
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.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
DATA TYPES 1.Pre-Defined Data Types 2. User-Defined Data Types.
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
8-Jan-16EE5141 Chapter 6 Subprograms & Packages Subprogram declaration Subprogram body Package declaration Package body Resolution function Subprogram.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 7 Behavioral modeling of a dual ported register set.
Signals & Data-typesVer 1.1, Copyright 1997, TS, Inc. VHDL S i g n a l s & D a t a T y p e s Page 1.
VHDL 7: use of signals v.5a1 VHDL 7 Use of signals In processes and concurrent statements.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
IAY 0600 Digital Systems Design
Combinational logic circuit
Elements of Structural Models
Basic Language Concepts
Describing Combinational Logic Using Processes
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
Behavioral Style Combinational Design with VHDL
Combinational Circuits Using VHDL
Behavioral modeling of a dual ported register set.
Copyright Joanne DeGroat, ECE, OSU
In processes and concurrent statements
ECE 434 Advanced Digital System L15
ECE 434 Advanced Digital System L08
IAS 0600 Digital Systems Design
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
IAS 0600 Digital Systems Design
Figure 8.1. The general form of a sequential circuit.
Behavioral modeling of a dual ported register set.
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Programming in VHDL Using Processes

How Processes Run A process is either in suspend mode or is running. For a process to run, there has to be a change in any of the variables in the sensitivity list of the process. When a process is completed, it enters in suspend mode until the next change in its sensitivity list. If there is no sensitivity list, then the process will run forever. These observations give us the execution model that follows.

An Execution Model for Processes We describe the execution of a process as follows: suspend process; -- in suspend mode while (1) -- continuously check if (change in the sensitivity list or there is no sensitivity list) run process; suspend process; -- when you have a wait command end if

Serial and Parallel Execution Inside an architecture, we note that every time we call a process, function, or a procedure, then all calls are processed in parallel. Internally though, in a process, function, or procedure, we have serial execution; from the first to the second, to the third instruction (just like “C”). A process, function, or a procedure can define sub- function(s) or sub-procedure(s); but we cannot have sub- processes. We need to be careful to avoid parallel changes to the same data. In general, parallel programming rules apply here. Carefully check how the code gets mapped to the hardware!

Defining a Bus in VHDL (Also exposes issues in Parallel Assignment)

Bus Definition Using VHDL (I/II) -- In the following example, we make use of std_ulogic -- to define buses. library IEEE; use IEEE.std_logic_1164.all; -- for the definition of std_ulogic, … -- If Select_inp='0' then Bus_out <= A where Α, Β are 4-bit. -- If Select_inp=‘1' then Bus_out <= B; entity Bus_two_4_bit_inps is port ( Select_inp : in std_logic; -- chooses signals between Α(3:0) and B(3:0). Α, Β : in std_logic_vector (3 downto 0); -- input buses Bus_out : out std_ulogic_vector (3 downto 0)); -- exit bus end Bus_two_4_bit_inps;

Bus Definition Using VHDL (II/II) architecture behavioral_two_4bit_bus of Bus_two_4_bit_inps is begin process (Select_inp, A) – change in A or Select_inp always runs the process. begin if Select_inp='0' -- select A then Bus_out <= To_stdULogicVector (A); -- Copy to the output else Bus_out 'Z'); -- hi-Z value to the rest end if; end process; process (Select_inp, B) -- change in B or Select_inp always runs the process. begin if Select_inp='1' -- select Β then Bus_out <= To_stdULogicVector (B); -- Copy to the output else Bus_out 'Z'); -- hi-Z value for the rest end if; end process; end behavioral_two_4bit_bus;

Bus Synthesis in VHDL We note that Bus_out is affected by two process instructions. Note that any change in Select_inp will force both process instructions to run. Furthermore, they will both attempt to assign a value to the output. What will happen? The final values for Bus_out will be determined by a call to the function resolved, as we explain next.

Using a Function for Determining Values in Parallel Execution In the std_logic_1164 package, we define the type std_ulogic (standard unresolved logic) as an enumerated data type: TYPE std_ulogic IS ( 'U', -- Uninitialized 'X', -- Forcing Unknown '0', -- Forcing 0 '1', -- Forcing 1 'Z', -- High Impedance 'W', -- Weak Unknown 'L', -- Weak 0 'H', -- Weak 1 '-' -- Don't care ); The following definition of std_logic defines the function resolved as the function to use in case we have multiple instructions trying to assign a value to a variable of type std_logic: SUBTYPE std_logic IS resolved std_ulogic;

Definition of the resolved function in the std_logic_1164 package (I/II) TYPE stdlogic_table IS ARRAY (std_ulogic, std_ulogic) OF std_ulogic; resolution function CONSTANT resolution_table : stdlogic_table := ( | U X 0 1 Z W L H - | | ( 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U' ), -- | U | <- unknown outputs. ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | X | ( 'U', 'X', '0', 'X', '0', '0', '0', '0', 'X' ), -- | 0 | <- output=0 if both inputs are 0s... ( 'U', 'X', 'X', '1', '1', '1', '1', '1', 'X' ), -- | 1 | <- output=1 if both inputs are 1s … ( 'U', 'X', '0', '1', 'Z', 'W', 'L', 'H', 'X' ), -- | Z | ( 'U', 'X', '0', '1', 'W', 'W', 'W', 'W', 'X' ), -- | W | ( 'U', 'X', '0', '1', 'L', 'W', 'L', 'W', 'X' ), -- | L | ( 'U', 'X', '0', '1', 'H', 'W', 'W', 'H', 'X' ), -- | H | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ) -- | - | ); --

Definition of the resolved function in the std_logic_1164 package (II/II) FUNCTION resolved ( s : std_ulogic_vector ) RETURN std_ulogic IS VARIABLE result : std_ulogic := 'Z'; -- weakest state default BEGIN -- the test for a single driver is essential otherwise the -- loop would return 'X' for a single driver of '-' and that -- would conflict with the value of a single driver unresolved -- signal. IF (s'LENGTH = 1) THEN RETURN s(s'LOW); ELSE FOR i IN s'RANGE LOOP result := resolution_table(result, s(i)); END LOOP; END IF; RETURN result; END resolved; The expression (s'LENGTH=1) checks if we have only one element in the array, while s(s'LOW) returns the smallest value that we can assign to the signal. For more information, see the discussion on attibutes. If there are two or more attempts to assign a value, we use the resolution_table in sequence …

Basic Problems Analysis problems. Problem 1. Give the logic diagram that describes the bus in our previous example. Problem 2. Compute the values of Bus_out for different input combinations. A Synthesis Problem. Problem 3. Give the VHDL code for a bus with four input signals, each with two bits.