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

Similar documents
ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Outline. Concurrent Signal Assignment Statements. 2. Simple signal assignment statement. 1. Combinational vs. sequential circuit

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Digital Systems Design

Lecture 4. VHDL Fundamentals. George Mason University

Digital Systems Design

Digital Systems Design

VHDL for FPGA Design. by : Mohamed Samy

Hardware Description Language VHDL (1) Introduction

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

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

ELE432. ADVANCED DIGITAL DESIGN HACETTEPE UNIVERSITY Designing with VHDL

Lecture 12 VHDL Synthesis

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

Chapter 6 Combinational-Circuit Building Blocks

Basic Language Concepts

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

Nanosistemų programavimo kalbos 4 paskaita. Nuosekliai vykdomi sakiniai

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Introduction to VHDL #1

ELCT 501: Digital System Design

Introduction to VHDL #3

Chapter 2 Basic Logic Circuits and VHDL Description

Lecture 3 Introduction to VHDL

CDA 4253 FPGA System Design Introduction to VHDL. Hao Zheng Dept of Comp Sci & Eng USF

FPGA BASED SYSTEM DESIGN. Dr. Tayab Din Memon Lecture 9 & 10 : Combinational and Sequential Logic

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

VHDL: A Crash Course

ENGIN 241 Digital Systems with Lab

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

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

C-Based Hardware Design

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

Design units can NOT be split across different files

Contents. Appendix D VHDL Summary Page 1 of 23

Digital Design with FPGAs. By Neeraj Kulkarni

Concurrent Signal Assignment Statements (CSAs)

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

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

Introduction to VHDL

Very High Speed Integrated Circuit Har dware Description Language

ECE 545 Lecture 12. FPGA Resources. George Mason University

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

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

Outline. Combinational Circuit Design: Practice. Sharing. 2. Operator sharing. An example 0.55 um standard-cell CMOS implementation

Combinational Circuit Design: Practice

ECE 545 Lecture 4. Simple Testbenches. George Mason University

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

Hardware Description Languages. Modeling Complex Systems

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

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3

IT T35 Digital system desigm y - ii /s - iii

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

Writing VHDL for RTL Synthesis

Sequential Statements

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 2

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

COE 405 Design Methodology Based on VHDL

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

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

TSIU03, SYSTEM DESIGN LECTURE 2

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits

Design Using Verilog

Introduction to VHDL. Main language concepts

ECE 545 Lecture 7. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. Mixing Design Styles. George Mason University

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

VHDL: RTL Synthesis Basics. 1 of 59

Lattice VHDL Training

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Overview. Ram vs Register. Register File. Introduction to Structured VLSI Design. Recap Operator Sharing FSMD Counters.

VHDL in 1h. Martin Schöberl

VHDL simulation and synthesis

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

ECE 545 Lecture 9. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. George Mason University

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

CprE 583 Reconfigurable Computing

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

Modeling Complex Behavior

Computer-Aided Digital System Design VHDL

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

Experiment 8 Introduction to VHDL

EEL 4783: Hardware/Software Co-design with FPGAs

Synthesis of Combinational and Sequential Circuits with Verilog

VHDL VS VERILOG.

ECE 3401 Lecture 10. More on VHDL

Synthesizable Verilog

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

Verilog Design Principles

Review of Digital Design with VHDL

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

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

CCE 3202 Advanced Digital System Design

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group

Transcription:

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

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

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

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

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

Data-Flow VHDL Concurrent Statements concurrent signal assignment ( ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) ECE 448 FPGA and ASIC Design with VHDL 6

Concurrent signal assignment <= target_signal <= expression; 7

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

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

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

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

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

Merging wires and buses a b 5 4 10 d c 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; 13

Splitting buses d 10 4 5 a b c 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); 14

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

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

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

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

No Implied Precedence 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) ; 19

arith_result <= a + b + c 1; RTL Hardware Design Chapter 4 20

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 RTL Hardware Design Chapter 4 21

Data-Flow VHDL Concurrent Statements simple concurrent signal assignment ( ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) generate scheme for equations (for-generate) 22

Conditional concurrent signal assignment When - Else target_signal <= value1 when condition1 else value2 when condition2 else... valuen-1 when conditionn-1 else valuen; 23

Most often implied structure When - Else target_signal <= value1 when condition1 else value2 when condition2 else... valuen-1 when conditionn-1 else valuen; Value N Value N-1 0 1 Condition N-1. Value 2 0 1 Value 1 0 1 Target Signal Condition 2 Condition 1 24

2-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 Design Chapter 4 25

RTL Hardware Design Chapter 4 26

RTL Hardware Design Chapter 4 27

RTL Hardware Design Chapter 4 28

E.g., RTL Hardware Design Chapter 4 29

E.g., RTL Hardware Design Chapter 4 30

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

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

Priority of logic and relational operators 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 33

Data-Flow VHDL Concurrent Statements simple concurrent signal assignment ( ) conditional concurrent signal assignment (when-else) selected concurrent signal assignment (with-select-when) generate scheme for equations (for-generate) 34

Selected concurrent signal assignment With Select-When with choice_expression select target_signal <= expression1 when choices_1, expression2 when choices_2,... expressionn when choices_n; 35

Most Often Implied Structure With Select-When with choice_expression select target_signal <= expression1 when choices_1, expression2 when choices_2,... expressionn when choices_n; expression1 expression2 choices_1 choices_2 target_signal expressionn choices_n choice expression 36

Allowed formats of choices_k WHEN value WHEN value_1 value_2... value N WHEN OTHERS 37

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

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 Design Chapter 4 39

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 Design Chapter 4 40

E.g., 4-to-1 mux RTL Hardware Design Chapter 4 41

Can 11 be used to replace others? RTL Hardware Design Chapter 4 42

E.g., 2-to-2 2 binary decoder RTL Hardware Design Chapter 4 43

E.g., simple ALU RTL Hardware Design Chapter 4 44

E.g., Truth table RTL Hardware Design Chapter 4 45

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 Design Chapter 4 46

select_expression is with a data type of 5 values: c0, c1, c2, c3, c4 RTL Hardware Design Chapter 4 47

RTL Hardware Design Chapter 4 48

E.g., RTL Hardware Design Chapter 4 49

3. Conditional vs. selected signal assignment Conversion between conditional vs. selected signal assignment Comparison RTL Hardware Design Chapter 4 50

From selected assignment to conditional assignment RTL Hardware Design Chapter 4 51

From conditional assignment to selected assignment RTL Hardware Design Chapter 4 52

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 Design Chapter 4 53

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 Design Chapter 4 54

May over-specify for a functional table based circuit. E.g., mux RTL Hardware Design Chapter 4 55