Hardware Design with VHDL VHDL Introduction ECE 443

Similar documents
ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

VHDL Test Bench Tutorial

In this example the length of the vector is determined by D length and used for the index variable.

9/14/ :38

VHDL GUIDELINES FOR SYNTHESIS

if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;

Quartus II Introduction for VHDL Users

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

Digital Design with VHDL

Modeling Latches and Flip-flops

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

Printed Circuit Board Design with HDL Designer

Verification & Design Techniques Used in a Graduate Level VHDL Course

Digital Systems Design! Lecture 1 - Introduction!!

Discrete event modeling: VHDL

Modeling Registers and Counters

Lab 1: Full Adder 0.0

Example-driven Interconnect Synthesis for Heterogeneous Coarse-Grain Reconfigurable Logic

Using Xilinx ISE for VHDL Based Design

A Verilog HDL Test Bench Primer Application Note

Testing & Verification of Digital Circuits ECE/CS 5745/6745. Hardware Verification using Symbolic Computation

Digital Design with Synthesizable VHDL

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

Hardware Implementation of the Stone Metamorphic Cipher

The Designer's Guide to VHDL

A Platform for Visualizing Digital Circuit Synthesis with VHDL

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Digital Electronics Detailed Outline

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr

Digital Systems. Role of the Digital Engineer

Gates, Circuits, and Boolean Algebra

Chapter 13: Verification

Space product assurance

Testing of Digital System-on- Chip (SoC)

Product Development Flow Including Model- Based Design and System-Level Functional Verification

Introduction to Digital System Design

Introduction. Jim Duckworth ECE Department, WPI. VHDL Short Course - Module 1

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Digital Design and Synthesis INTRODUCTION

Digital Circuit Design Using Xilinx ISE Tools

Asynchronous & Synchronous Reset Design Techniques - Part Deux

Multiplexers Two Types + Verilog

Quartus II Software Design Series : Foundation. Digitale Signalverarbeitung mit FPGA. Digitale Signalverarbeitung mit FPGA (DSF) Quartus II 1

AES1. Ultra-Compact Advanced Encryption Standard Core. General Description. Base Core Features. Symbol. Applications

Visualization of Verilog Digital Systems Models

ON SUITABILITY OF FPGA BASED EVOLVABLE HARDWARE SYSTEMS TO INTEGRATE RECONFIGURABLE CIRCUITS WITH HOST PROCESSING UNIT

A New Paradigm for Synchronous State Machine Design in Verilog

YAML: A Tool for Hardware Design Visualization and Capture

Digital Design Verification

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

Finite State Machine Design and VHDL Coding Techniques

Combinational-Circuit Building Blocks

Agenda. Michele Taliercio, Il circuito Integrato, Novembre 2001

Fault Modeling. Why model faults? Some real defects in VLSI and PCB Common fault models Stuck-at faults. Transistor faults Summary

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

DIGITAL DESIGN FLOW OPTIONS

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Rapid System Prototyping with FPGAs

Using ModelSim, Matlab/Simulink and NS for Simulation of Distributed Systems

ESP-CV Custom Design Formal Equivalence Checking Based on Symbolic Simulation

Modeling a GPS Receiver Using SystemC

High-Level Synthesis for FPGA Designs

VHDL-Testbench as Executable Specification

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Altera Error Message Register Unloader IP Core User Guide

State Machines in VHDL

FPGA Implementation of an Advanced Traffic Light Controller using Verilog HDL

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2)

From UML to HDL: a Model Driven Architectural Approach to Hardware-Software Co-Design

Understanding Verilog Blocking and Non-blocking Assignments

Understanding Logic Design

Introduction to Functional Verification. Niels Burkhardt

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

Implementation and Design of AES S-Box on FPGA

SDLC Controller. Documentation. Design File Formats. Verification

FSMD and Gezel. Jan Madsen

What is a System on a Chip?

VHDL programmering H2

HDL Simulation Framework

CHAPTER 3 Boolean Algebra and Digital Logic

AES (Rijndael) IP-Cores

Quartus II Introduction Using VHDL Design

! " # # $ '"() * #! +, # / $0123$

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Designing Digital Circuits a modern approach. Jonathan Turner

Contents. System Development Models and Methods. Design Abstraction and Views. Synthesis. Control/Data-Flow Models. System Synthesis Models

SystemC Tutorial. John Moondanos. Strategic CAD Labs, INTEL Corp. & GSRC Visiting Fellow, UC Berkeley

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Lab 1: Introduction to Xilinx ISE Tutorial

Digital Systems Design. VGA Video Display Generation

System-on. on-chip Design Flow. Prof. Jouni Tomberg Tampere University of Technology Institute of Digital and Computer Systems.

Architectures and Platforms

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

Design of Remote Laboratory dedicated to E2LP board for e-learning courses.

Lecture 5: Gate Logic Logic Optimization

Hunting Asynchronous CDC Violations in the Wild

Transcription:

Programming Languages (PL) vs. Hardware Description Languages (HDL) Programming languages such as C or Java cannot serve as HDLs (unless modified significantly). Programming languages are modeled after a sequential process, where operations are performed in a sequential order (order matters). This is amenable to the human thinking process, in which an algorithm is unfolded into a recipe or step-by-step process HDLs such as VHDL (VHSIC (Very High Speed Integrated Circuit) HDL) and Verilog were developed to support the underlying characteristics of hardware Connections of parts Concurrent operations Concept of propagation delay and timing These characteristics cannot be captured by traditional PLs ECE UNM 1 (8/19/15)

Hardware Description Languages (HDL) HDLs serve several roles in the design process Formal documentation Input to a simulator Input to a synthesizer The fundamental characteristics of a digital circuit are captured using the concepts: Entity: a self-contained, basic building block of a real circuit Connectivity: models the connecting wires among the circuit components Concurrency: models parallel operations carried out by interconnected components Timing: models starting and ending of each operation and defines an order HDLs can be used to describe a design at the gate level and RT level, in either a structural or behavioral view. Other highlights of a modern HDL include: Sequential execution constructs (similar to PLs) for modeling behavior A set of mathematical, Boolean and other special purpose operations, e.g., shifting Constructs to support hierarchical design process ECE UNM 2 (8/19/15)

Hardware Description Languages (HDL) VHDL and Verilog are the industry standards Syntax and appearance of the two languages are very different Capabilities and scopes are quite similar Both are supported by most software tools VHDL initially sponsored by DoD as a hardware documentation standard, early 80s Transferred to IEEE and ratified it as IEEE standard 1176 in 1987 (known as VHDL-87) Major modification in 93 (known as VHDL-93), but revisions continue IEEE Extensions IEEE standard 1076.1 Analog and Mixed Signal Extensions (VHDL-AMS) IEEE standard 1076.2 VHDL Mathematical Packages IEEE standard 1076.3 Synthesis Packages IEEE standard 1076.4 VHDL Initiative Towards ASIC Libraries (VITAL) IEEE standard 1076.6 VHDL Register Transfer Level (RTL) Synthesis IEEE standard 1164 Multivalue Logic System for VHDL Model Interoperability IEEE standard 1029 VHDL Waveform and Vector Exchange (WAVES) ECE UNM 3 (8/19/15)

VHDL Introduction VHDL introduction through an example: Even parity detection circuit Input: a(2), a(1), a(0) Output: even SOP expr: library ieee; use ieee.std_logic_1164.all; -- entity declaration entity even_detector is port( a: in std_logic_vector(2 downto 0); even: out std_logic ); end even_detector; ECE UNM 4 (8/19/15)

VHDL Introduction -- architecture body architecture sop_arch of even_detector is signal p1, p2, p3, p4 : std_logic; even <= (p1 or p2) or (p3 or p4); p1 <= (not a(2)) and (not a(1)) and (not a(0)); p2 <= (not a(2)) and a(1) and a(0); p3 <= a(2) and (not a(1)) and a(0); p4 <= a(2) and a(1) and (not a(0)); end sop_arch; Entity declaration Specifies I/O ports One input port, an array a of three components and one output port, even. Architecture body specifies internal operation of the circuit Signal declaration: defines a set of wires p1 through p4 ECE UNM 5 (8/19/15)

VHDL Introduction The concurrent (signal assignment) statements Are the circuit components Architecture body can be thought as a "collection of five circuit parts" Signal name on both right and left indicates a wire connecting these components Component order does NOT matter! Conceptual Interpretation: ECE UNM 6 (8/19/15)

VHDL Introduction More efficient architecture which uses xor operator (entity declaration is the same): architecture xor_arch of even_detector is signal odd: std_logic; even <= not odd; odd <= a(2) xor a(1) xor a(0); end xor_arch; Structural Description In structural view, a circuit is constructed of smaller components A structural description specifies the types of parts and connections Essentially a textual description of a schematic ECE UNM 7 (8/19/15)

Structural Description A structural description can also be done using the concept of component First declared (make known) Then instantiated (used) Consider the even-parity detector again Assume there is a library of predesigned parts, xor2 and not1: ECE UNM 8 (8/19/15)

Structural Description architecture str_arch of even_detector is component xor2 -- declaration for xor gate port( i1, i2: in std_logic; o1: out std_logic ); end component; component not1 -- declaration for inverter port( i1: in std_logic; o1: out std_logic ); end component; signal sig1,sig2: std_logic; ECE UNM 9 (8/19/15)

Structural Description -- instantiation of the 1st xor instance unit1: xor2 port map (i1=>a(0), i2=>a(1), o1=>sig1); -- instantiation of the 2nd xor instance unit2: xor2 port map (i1=>a(2), i2=>sig1, o1=>sig2); -- instantiation of inverter unit3: not1 port map (i1=>sig2, o1=>even); end str_arch; Architecture body consists of three statements Each statement consists of three parts: The unit1 label serves as a unique id for this part The xor2 identifies the instantiated component The port map specifies the mapping between the formal and actual signals ECE UNM 10 (8/19/15)

Structural Description The mapping indicates that formal signals i1, i2 and o1 are connected to actual signals a(0), a(1) and sig1 Component instantiation is one type of concurrent statement, and can be mixed with other types When the architecture body consists of only component instantiations (as above), it is just a textual description of a schematic A schematic is a more natural representation but this textual description enables schematics to be embedded with other VHDL coding styles The definition of the actual components are decoupled and hidden from the architecture and can be defined (and later changed) in a library library ieee; use ieee.std_logic_1164.all entity xor2 is port( i1, i2: in std_logic; ECE UNM 11 (8/19/15)

Structural Description o1: out std_logic ); end xor2; architecture beh_arch of xor2 is o1 <= i1 xor i2; end beh_arch; library ieee; use ieee.std_logic_1164.all entity not1 is port( i1: in std_logic; o1: out std_logic ); end not1; ECE UNM 12 (8/19/15)

Structural Description architecture beh_arch of not1 is i1 <= not o1; end beh_arch; The use of components facilitates Hierarchical design (divide a system into smaller components, each designed individually) IP incorporation (use of complex, third party, predesigned circuits that can be black boxes) Behavioral Description Human reasoning and algorithms resemble a sequential process VHDL provides language constructs that resemble sequential semantics The process: a language construct to encapsulate sequential semantics The entire process stmt is a concurrent statement ECE UNM 13 (8/19/15)

Behavioral Description Syntax: process (sensitivity_list) variable declaration; sequential statements; end process; The process has a sensitivity list, which is a set of signals When a signal in the sensitivity list changes, the process is "activated" Inside the process, the semantics are similar to that of a PL, e.g., variables can be used and execution of the statements is sequential Consider the even-parity detector: architecture beh1_arch of even_detector is signal odd: std_logic; ECE UNM 14 (8/19/15)

Behavioral Description -- inverter even <= not odd; -- xor network for odd parity process(a) variable tmp: std_logic; tmp := 0 ; for i in 2 downto 0 loop tmp := tmp xor a(i); end loop; odd <= tmp; end process; end beh1_arch; The xor network is described by a process that utilizes a variable and a for loop Unlike signal assignment in a concurrent statement, the variable and loop constructs do NOT have a direct hardware counterpart ECE UNM 15 (8/19/15)

Behavioral Description The process should be treated as one indivisible part, whose behavior is specified by sequential statements A second example: architecture beh2_arch of even_detector is process(a) variable sum, r: integer; ECE UNM 16 (8/19/15)

Behavioral Description sum := 0; for i in 2 downto 0 loop if a(i)= 1 then sum := sum + 1; end if; end loop ; r := sum mod 2; if (r=0) then even <= 1 ; else even <= 0 ; end if; end process; end beh2_arch; Note that this is easy to understand, but there is no clue about the underlying structure and how this will be actually implemented The code describes the behavior of the component, not the structure. ECE UNM 17 (8/19/15)

Behavioral Description Conceptual diagram Testbench A virtual experiment setup, consisting of The circuit to be tested The input stimuli (e.g., pattern generator) An output monitor (e.g., logic analyzer) ECE UNM 18 (8/19/15)

Testbench Testbench for even-parity detector library ieee; use ieee.std_logic_1164.all; entity even_detector_testbench is end even_detector_testbench; architecture tb_arch of even_detector_testbench is -- declaration of component to be tested component even_detector port( a: in std_logic_vector(2 downto 0); even: out std_logic ); end component; signal test_in: std_logic_vector(2 downto 0); signal test_out: std_logic; ECE UNM 19 (8/19/15)

Testbench -- instantiate the circuit under test uut: even_detector port map(a=>test_in, even=>test_out); -- test vector generator process test_in <= "000"; wait for 200 ns; test_in <= "001"; wait for 200 ns; test_in <= "010"; wait for 200 ns; test_in <= "011"; wait for 200 ns; test_in <= "100"; wait for 200 ns; ECE UNM 20 (8/19/15)

Testbench test_in <= "101"; wait for 200 ns; test_in <= "110"; wait for 200 ns; test_in <= "111"; wait for 200 ns; end process; --verifier process variable error_status: boolean; wait on test_in; wait for 100 ns; if ((test_in="000" and test_out = 1 ) or (test_in="001" and test_out = 0 ) or (test_in="010" and test_out = 0 ) or (test_in="011" and test_out = 1 ) or ECE UNM 21 (8/19/15)

Testbench (test_in="100" and test_out = 0 ) or (test_in="101" and test_out = 1 ) or (test_in="110" and test_out = 1 ) or (test_in="111" and test_out = 0 )) then error_status := false; else error_status := true; end if; -- error reporting assert not error_status report "test failed." severity note; end process; end tb_arch; ECE UNM 22 (8/19/15)

Testbench Two concurrent process statements are given, and both processes run simultaneously Note the use of non-synthesizable statements such as wait for and assert not Since testbenches are NOT synthesized to logic (only used in simulations), this is not a problem Conceptually: ECE UNM 23 (8/19/15)

VHDL in Development Flow Behavioral description written first, simulated Synthesis-oriented code developed It is also simulated, many times using the same testbench to confirm it meets specification Once synthesized, the result is a gate-level netlist represented by a structural VHDL description It is also simulated, and and timing analyzed Place and route produces a GDS for ASICs or a bitstream for FPGAs Final simulation w/ accurate timing information ECE UNM 24 (8/19/15)

Coding for Synthesis Execution of VHDL code For Simulation: Design is realized in a virtual environment, the simulation software All language constructs can be realized here For Synthesis Design is realized by hardware components Many VHDL constructs can NOT be synthesized, e,g, file operation, floatingpoint data type, division Also realize that although any VHDL code is easy to simulate, it may be difficult to synthesize VHDL code that contains 10 additions needs to be mapped to 10 adders (unless resources are shared), a fairly complex set of hardware components ECE UNM 25 (8/19/15)