George Mason University Data Flow Modeling in VHDL ECE 545 Lecture 7.

Slides:



Advertisements
Similar presentations
Lecture 6 Chap 8: Sequential VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Advertisements

Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
Algorithmic State Machine (ASM) Charts
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
Simple Testbenches Behavioral Modeling of Combinational Logic
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
George Mason University Modeling of Arithmetic Circuits ECE 545 Lecture 7.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
Data Flow Modeling of Combinational Logic Simple Testbenches
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 4: Modeling Dataflow.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
ENG241 Digital Design Week #4 Combinational Logic Design.
ECE Advanced Digital Systems Design Lecture 4 – Combinational Circuits in VHDL Capt Michael Tanner Room 2F46A HQ U.S. Air Force Academy.
IAY 0600 Digital Systems Design VHDL discussion Dataflow&Behavioral Styles Combinational Design Alexander Sudnitson Tallinn University of Technology.
Module 1.2 Introduction to Verilog
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Alexander Sudnitson Tallinn University of Technology.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
CS/EE 3700 : Fundamentals of Digital System Design
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.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches Concurrent Statements & Adders.
ECOM 4311—Digital System Design with VHDL
Data Flow Modeling in VHDL
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
RTL Hardware Design Chapter Combinational versus sequential circuit 2. Simple signal assignment statement 3. Conditional signal assignment statement.
Lecture #10 Page 1 Lecture #10 Agenda 1.VHDL : Concurrent Signal Assignments 2.Decoders using Structural VHDL Announcements 1.HW #4 due 2.HW #5 assigned.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
CDA 4253 FPGA System Design Behavioral modeling of Combinational Circuits Hao Zheng Dept of Comp Sci & Eng USF.
ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 1 Implementing Combinational Logic in VHDL.
VHDL 표현방식.
George Mason University Data Flow Modeling of Combinational Logic ECE 545 Lecture 5.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
George Mason University ECE 545 – Introduction to VHDL Data Flow & Structural Modeling of Combinational Logic ECE 545 Lecture 2.
Combinational logic circuit
Basic Language Concepts
Describing Combinational Logic Using Processes
ENG2410 Digital Design “Combinational Logic Design”
Dataflow Style Combinational Design with VHDL
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
IAS 0600 Digital Systems Design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL Hardware Description Language
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
VHDL Structural Architecture
Concurrent vs Sequential
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Description of Combinational-Circuit Building Blocks
Data Flow Description of Combinational-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CprE / ComS 583 Reconfigurable Computing
EEL4712 Digital Design (VHDL Tutorial).
(Carry Lookahead Adder)
Presentation transcript:

George Mason University Data Flow Modeling in VHDL ECE 545 Lecture 7

2 Required reading P. Chu, RTL Hardware Design using VHDL Chapter 4, Concurrent Signal Assignment Statements of VHDL

3 Components and interconnects structural VHDL Descriptions dataflow Concurrent statements behavioral (sequential) Registers State machines Instruction decoders Sequential statements Subset most suitable for synthesis Testbenches Types of VHDL Description

4 Synthesizable VHDL Dataflow VHDL Description VHDL code synthesizable VHDL code synthesizable Dataflow VHDL Description

5 Register Transfer Level (RTL) Design Description Combinational Logic Combinational Logic Registers … Today’s Topic

6 Data-Flow VHDL simple concurrent signal assignment (  ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) Concurrent Statements

7 Simple concurrent signal assignment target_signal <= expression; <=

8 Conditional concurrent signal assignment target_signal <= value1 when condition1 else value2 when condition2 else... valueN-1 when conditionN-1 else valueN; When - Else

9 Selected concurrent signal assignment with choice_expression select target_signal <= expression1 when choices_1, expression2 when choices_2,... expressionN when choices_N; With –Select-When

10 Data-Flow VHDL simple concurrent signal assignment (  ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) Concurrent Statements

11ECE 448 – FPGA and ASIC Design with VHDL Wires and Buses

12 Signals SIGNAL a : STD_LOGIC; SIGNAL b : STD_LOGIC_VECTOR(7 DOWNTO 0); wire a bus b 1 8

13 Merging wires and buses SIGNAL a: STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL b: STD_LOGIC_VECTOR(4 DOWNTO 0); SIGNAL c: STD_LOGIC; SIGNAL d: STD_LOGIC_VECTOR(9 DOWNTO 0); d <= a b c d = a || b || c

14 Merging wires and buses SIGNAL a: STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL b: STD_LOGIC_VECTOR(4 DOWNTO 0); SIGNAL c: STD_LOGIC; SIGNAL d: STD_LOGIC_VECTOR(9 DOWNTO 0); d <= a & b & c; a b c d = a || b || c

15 Splitting buses SIGNAL a: STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL b: STD_LOGIC_VECTOR(4 DOWNTO 0); SIGNAL c: STD_LOGIC; SIGNAL d: STD_LOGIC_VECTOR(9 DOWNTO 0); a <= b <= c <= a = d.. b = d.. c = d d

16 Splitting buses SIGNAL a: STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL b: STD_LOGIC_VECTOR(4 DOWNTO 0); SIGNAL c: STD_LOGIC; SIGNAL d: STD_LOGIC_VECTOR(9 DOWNTO 0); a <= d(9 downto 6); b <= d(5 downto 1); c <= d(0); a = d 9..6 b = d 5..1 c = d 0 d

17 Data-flow VHDL: Example x y cin s cout

18 Data-flow VHDL: Example (1) LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY fulladd IS PORT ( x : IN STD_LOGIC ; y : IN STD_LOGIC ; cin: IN STD_LOGIC ; s : OUT STD_LOGIC ; cout: OUT STD_LOGIC ) ; END fulladd ;

19 Data-flow VHDL: Example (2) ARCHITECTURE dataflow OF fulladd IS BEGIN s <= x XOR y XOR cin ; cout <= (x AND y) OR (cin AND x) OR (cin AND y) ; END dataflow ; ARCHITECTURE dataflow OF fulladd IS BEGIN cout <= (x AND y) OR (cin AND x) OR (cin AND y) ; s <= x XOR y XOR cin ; END dataflow ; equivalent to

20 Logic Operators Logic operators Logic operators precedence and or nand nor xor not xnor not and or nand nor xor xnor Highest Lowest only in VHDL-93 or later

21 Wanted: y = ab + cd Incorrect y <= a and b or c and d ; equivalent to y <= ((a and b) or c) and d ; equivalent to y = (ab + c)d Correct y <= (a and b) or (c and d) ; No Implied Precedence

RTL Hardware DesignChapter 422 arith_result <= a + b + c – 1;

RTL Hardware DesignChapter 423 Signal assignment statement with a closed feedback loop a signal appears in both sides of a concurrent assignment statement E.g., q <= ((not q) and (not en)) or (d and en); Syntactically correct Form a closed feedback loop Should be avoided

24 Data-Flow VHDL simple concurrent signal assignment (  ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) Concurrent Statements

25 Conditional concurrent signal assignment target_signal <= value1 when condition1 else value2 when condition2 else... valueN-1 when conditionN-1 else valueN; When - Else

26 Most often implied structure target_signal <= value1 when condition1 else value2 when condition2 else... valueN-1 when conditionN-1 else valueN; When - Else.… Value N Value N-1 Condition N-1 Condition 2 Condition 1 Value 2 Value 1 Target Signal … FTFT FTFT FTFT

RTL Hardware DesignChapter to-1 “abstract” mux sel has a data type of boolean If sel is true, the input from “T” port is connected to output. If sel is false, the input from “F” port is connected to output.

RTL Hardware DesignChapter 428

RTL Hardware DesignChapter 429

RTL Hardware DesignChapter 430

RTL Hardware DesignChapter 431 E.g.,

RTL Hardware DesignChapter 432 E.g.,

33 Signed and Unsigned Types Behave exactly like STD_LOGIC_VECTOR plus, they determine whether a given vector should be treated as a signed or unsigned number. Require USE ieee.numeric_std.all;

34 Operators Relational operators Logic and relational operators precedence = /= >= not = /= >= and or nand nor xor xnor Highest Lowest

35 compare a = bc Incorrect … when a = b and c else … equivalent to … when (a = b) and c else … Correct … when a = (b and c) else … Priority of logic and relational operators

36 Data-Flow VHDL simple concurrent signal assignment (  ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) Concurrent Statements

37 Selected concurrent signal assignment with choice_expression select target_signal <= expression1 when choices_1, expression2 when choices_2,... expressionN when choices_N; With –Select-When

38 Most Often Implied Structure with choice_expression select target_signal <= expression1 when choices_1, expression2 when choices_2,... expressionN when choices_N; With –Select-When choices_1 choices_2 choices_N expression1 target_signal choice expression expression2 expressionN

39 Allowed formats of choices_k WHEN value WHEN value_1 | value_2 |.... | value N WHEN OTHERS

40 Allowed formats of choice_k - example WITH sel SELECT y <= a WHEN "000", c WHEN "001" | "111", d WHEN OTHERS;

RTL Hardware DesignChapter 441 Syntax Simplified syntax: with select_expression select signal_name <= value_expr_1 when choice_1, value_expr_2 when choice_2, value_expr_3 when choice_3,... value_expr_n when choice_n;

RTL Hardware DesignChapter 442 select_expression –Discrete type or 1-D array –With finite possible values choice_i –A value of the data type Choices must be –mutually exclusive –all inclusive –others can be used as last choice_i

RTL Hardware DesignChapter 443 E.g., 4-to-1 mux

RTL Hardware DesignChapter 444 Can “11” be used to replace others?

RTL Hardware DesignChapter 445 E.g., 2-to-2 2 binary decoder

RTL Hardware DesignChapter 446 E.g., simple ALU

RTL Hardware DesignChapter 447 E.g., Truth table

RTL Hardware DesignChapter 448 Conceptual implementation Achieved by a multiplexing circuit Abstract (k+1)-to-1 multiplexer –sel is with a data type of (k+1) values: c0, c1, c2,..., ck

RTL Hardware DesignChapter 449 –select_expression is with a data type of 5 values: c0, c1, c2, c3, c4

RTL Hardware DesignChapter 450

RTL Hardware DesignChapter 451 E.g.,

RTL Hardware DesignChapter Conditional vs. selected signal assignment Conversion between conditional vs. selected signal assignment Comparison

RTL Hardware DesignChapter 453 From selected assignment to conditional assignment

RTL Hardware DesignChapter 454 From conditional assignment to selected assignment

RTL Hardware DesignChapter 455 Comparison Selected signal assignment: –good match for a circuit described by a functional table –E.g., binary decoder, multiplexer –Less effective when an input pattern is given a preferential treatment

RTL Hardware DesignChapter 456 Conditional signal assignment: –good match for a circuit that needs to give preferential treatment for certain conditions or to prioritize the operations –E.g., priority encoder –Can handle complicated conditions. e.g.,

RTL Hardware DesignChapter 457 –May “over-specify” for a functional table based circuit. –E.g., mux

58 when-else vs. with-select-when (1) "when-else" should be used when: 1) there is only one condition (and thus, only one else), as in the 2-to-1 MUX 2) conditions are independent of each other (e.g., they test values of different signals) 3) conditions reflect priority (as in priority encoder); one with the highest priority need to be tested first.

59 when-else vs. with-select-when (2) "with-select-when" should be used when there is 1) more than one condition 2) conditions are closely related to each other (e.g., represent different ranges of values of the same signal) 3) all conditions have the same priority (as in the 4-to-1 MUX).