Digital System Construction

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

ECE 545: Lecture 11. Programmable Logic Memories

ECE 545: Lecture 11. Programmable Logic Memories. Recommended reading. Memory Types. Memory Types. Memory Types specific to Xilinx FPGAs

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

ECE 699: Lecture 9. Programmable Logic Memories

Field Programmable Gate Array

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses

CprE 583 Reconfigurable Computing

MAX 10. Memory Modules

Summary of FPGA & VHDL

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

Field Programmable Gate Array (FPGA)

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

ECE 545 Lecture 12. FPGA Resources. George Mason University

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 15 Memories

Implementing Multipliers in Xilinx Virtex II FPGAs

ELCT 501: Digital System Design

ECE 545 Lecture 17 RAM. George Mason University

Programmable Logic. Simple Programmable Logic Devices

Chapter 6 (Lect 3) Counters Continued. Unused States Ring counter. Implementing with Registers Implementing with Counter and Decoder

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits

The Virtex FPGA and Introduction to design techniques

Topics. Midterm Finish Chapter 7

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

Altera FLEX 8000 Block Diagram

Memories. Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu.

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

Lecture 3: Basic Adders and Counters

Basic FPGA Architectures. Actel FPGAs. PLD Technologies: Antifuse. 3 Digital Systems Implementation Programmable Logic Devices

ECEU530. Project Presentations. ECE U530 Digital Hardware Synthesis. Rest of Semester. Memory Structures

Memory and Programmable Logic

Contents. Chapter 9 Datapaths Page 1 of 28

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

Laboratory Memory Components

Asynchronous FIFO Architectures (Part 1)

VHDL for Complex Designs

Sequential Statement

Design and Implementation of an AHB SRAM Memory Controller

Using ProASIC3/E RAM as Multipliers

ECE 448 Lecture 13. FPGA Memories. George Mason University

Introduction to Computer Design

HDL Coding Style Xilinx, Inc. All Rights Reserved

Topics. Midterm Finish Chapter 7

FPGA.

! Program logic functions, interconnect using SRAM. ! Advantages: ! Re-programmable; ! dynamically reconfigurable; ! uses standard processes.

Digital Design Laboratory Lecture 2

Lecture 5: State Machines, Arrays, Loops. EE 3610 Digital Systems

FPGA Architecture Overview. Generic FPGA Architecture (1) FPGA Architecture

Lecture 12 VHDL Synthesis

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Using ProASIC PLUS RAM as Multipliers

FPGA design with National Instuments

Chapter 2. Cyclone II Architecture

Lab 3. Advanced VHDL

Chapter 8 Memory Basics

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

VHDL simulation and synthesis

TSEA22, DIGITALTEKNIK LECTURE 7

HDL. Hardware Description Languages extensively used for:

LABORATORY MANUAL VLSI DESIGN LAB EE-330-F

Lecture 5: Aldec Active-HDL Simulator

Hardware Design with VHDL Design Example: BRAM ECE 443

CDA 4253 FGPA System Design Xilinx FPGA Memories. Hao Zheng Comp Sci & Eng USF

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

VHDL And Synthesis Review

Binary Adders. Ripple-Carry Adder

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

COE Design Process Tutorial

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

VHDL in 1h. Martin Schöberl

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

ENGR 303 Introduction to Logic Design Lecture 7. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

CDA 4253 FPGA System Design Op7miza7on Techniques. Hao Zheng Comp S ci & Eng Univ of South Florida

Lecture #1: Introduction

EECS150 - Digital Design Lecture 16 - Memory

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

Digital Design with SystemVerilog

FPGA Lecture for LUPO and GTO Vol , 31 August (revised 2013, 19 November) H. Baba

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

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

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

EENG 2910 Project III: Digital System Design. Due: 04/30/2014. Team Members: University of North Texas Department of Electrical Engineering

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

[VARIABLE declaration] BEGIN. sequential statements

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

EEL 4712 Digital Design Test 1 Spring Semester 2008

CSEE 3827: Fundamentals of Computer Systems. Storage

Getting Started with VHDL

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

EITF35: Introduction to Structured VLSI Design

In our case Dr. Johnson is setting the best practices

Lattice VHDL Training

ECE 645: Lecture 1. Basic Adders and Counters. Implementation of Adders in FPGAs

Read Only Memory ROM

FPGA architecture and design technology

Altera s Avalon Communication Fabric

Lecture 11 Memories in Xilinx FPGAs

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

Transcription:

Digital System Construction FYSIKUM Lecture 4: More VHDL, memory, PRNG Arithmetic Memories Pipelines and buffers Pseudorandom numbers IP core generation in Vivado Introduction to Lab 3 Digital Systemkonstruktion - 1 1

Arithmetic with vectors ieee.std_logic_unsigned.all Simple arithmetic with vectors representing unisigned numbers Easy to use, but not an official standard ieee.numeric_std.all Standard library supporting unsigned and signed vector arithmetic Adds signed and unsigned vector types Slightly higher learning curve Recommended for new designs Digital Systemkonstruktion - 1 2

Example: unsigned adder LIBRARY ieee ; USE ieee.std_logic_1164.all ; USE ieee.numeric_std.all ; ENTITY adder16 IS PORT (X, Y : IN STD_LOGIC_VECTOR(15 DOWNTO 0) ; S : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ; Cout : OUT STD_LOGIC ) ; END adder16 ;

Unsigned adder: architecture ARCHITECTURE Behavior OF adder16 IS SIGNAL ux : UNSIGNED(15 DOWNTO 0); -- 16 bits SIGNAL uy : UNSIGNED(15 DOWNTO 0); SIGNAL Sum : UNSIGNED(16 DOWNTO 0); -- 17 bits BEGIN ux <= unsigned(x); uy <= unsigned(y); Sum <= ('0' & ux) + ('0' & uy); S <= std_logic_vector(sum(15 DOWNTO 0)) ; Cout <= Sum(16) ; -- Top bit is overflow/carry END Behavior ;

Signed numbers A vector can represent a signed or unsigned value 8 bits unsigned: 0 to 255 8 bits signed: -128 to +127 For signed numbers: Top bit (MSB) is the sign (0=positive, 1=negative) Positive numbers: simple binary representation Decimal +53 = 00110101 Negative numbers: twos complement Invert the bits of the positive value, then add one Decimal -53 = 11001010 + 1 = 11001011 Digital Systemkonstruktion - 1 5

Example: signed adder LIBRARY ieee ; USE ieee.std_logic_1164.all ; USE ieee.numeric_std.all ; ENTITY adder16 IS PORT (X, Y : IN STD_LOGIC_VECTOR(15 DOWNTO 0); S : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ); END adder16 ;

Signed adder: architecture ARCHITECTURE Behavior OF adder16 IS SIGNAL Xs : SIGNED(15 DOWNTO 0); SIGNAL Ys : SIGNED(15 DOWNTO 0); SIGNAL Sum : SIGNED(16 DOWNTO 0) ; BEGIN Xs <= signed(x); Ys <= signed(y); Sum <= resize(xs,sum LENGTH) + Ys; S <= std_logic_vector(resize(sum,16)) ; END Behavior ;

ieee.numeric_std has overloaded operators Digital Systemkonstruktion - 1 8

Memory basics Memory is essentially a data storage array One or more bits of data at each address Different memory types include: ROM (Read-Only Memory) No write capability during normal operations Modern versions allow erase/overwrite by applying higher voltages RAM (Random Access Memory) Individual bit access, read and write capabilities Volatility Volatile memories lose data when power is off Most RAM is volatile, ROM is non-volatile Digital Systemkonstruktion - 1 9

Random Access Memory (RAM) Addressable data storage array Directly access contents of each address Read and write operations supported Normally, ~equal access time to any address not quite true for modern DRAM Can be synchronous (clocked) or asynchronous RAM on Xilinx FPGA is synchronous Digital Systemkonstruktion - 1 10

Static vs. Dynamic RAM DRAM stores charge in quantum wells (analogous to capacitors) Small, inexpensive (good!) Data disappears after short time if not refreshed (not so good ) SRAM stores data stably in latches Stable, no need to refresh (good!) More transistors per data bit Larger, more expensive Less memory/area Most FPGAs have blocks of SRAM DRAM SRAM Digital Systemkonstruktion - 1 11

Single-port RAM block Word size: n bits Capacity: 2 k words Some RAM is clocked, some not k n Address Data_in Wr_en Rd_en Data_out n Clock Digital Systemkonstruktion - 1 12

Writing to memory Sequence of steps: Set address and data (input ports) Assert write Synchronous RAM needs a clock edge Data contents are now stored at the specified address Digital Systemkonstruktion - 1 13

Reading from memory Steps: Set address (input port) Assert read Data available after a certain delay Or with clock edge for a synchronous RAM Digital Systemkonstruktion - 1 14

Xilinx 7-series RAM 36Kb and 18Kb block memories Two independent ports ( dual port RAM ) Distributed RAM also available Can balance address, data widths for same # of total bits 36Kb: 32Kx1bit to 512x72bit 64Kx1b if cascaded with an adjacent 36Kb RAM 18Kb: 16Kx1bit to 512x36bit Synchronous read/write Need a clock Digital Systemkonstruktion - 1 15

Common RAM applications Local memory for embedded CPUs (advanced) Fast, flexible implementation of complex algorithms Memory look-up tables Content-addressable memory (advanced) Diagnostics and testing Capture data and read it out ( spy memory ) Feed test patterns through logic ( playback memory ) Data buffering for temporary storage and readout Synchronous memory buffer ( pipeline ) Asynchronous buffer ( FIFO ) Digital Systemkonstruktion - 1 16

Memory lookup table (LUT) Common application: Use LUT to correct raw data calibration, linearity, etc. Can also do geometric and other calculations quickly ADC 12b A LUT B 10b count count E E 17

ATLAS L1Calo example EEM EHad 9 9 Thr Thr Σ Apply thresholds (LUT) and sum (logic) 10 Ex = Et sin ϕ Ey = Et cos ϕ ET Ex Ey To Summation logic LUTs for geometric calculations 18

Spy/playback memories Play test data to processing logic Capture output data Data in Data out Capture input data Input mem Processing logic Output mem Play test data (to next board) Computer interface Digital Systemkonstruktion - 1 19

Asynchronous data buffer Port A DPR Port B Counter Address Counter n_write Data in Data n_read Data out Simplified diagram. Write to port A and read from port B. Address of each port incremented during read/write Digital Systemkonstruktion - 1 20

Synchronous delay buffer Offset Adder A B Sum DPR Address Counter Clock Data in CLK Port A Data Port B Data out Digital Systemkonstruktion - 1 21

Other topics for Lab 3 Pseudorandom number generation You will use this to test a synchronous data pipeline with adjustable length Implementing device-specific features CoreGen in Xilinx ISE IP Catalog in Vivado You will use this to implement a dual-port RAM Digital Systemkonstruktion - 1 22

Pseudorandom number generator Useful to test designs with many possible inputs Basic concept: Start with a random sequence of bits circulating in a shift register ( seed ) Continuously change the contents of the seed use XOR of other bits (to maintain 1/0 balance) Digital Systemkonstruktion - 1 23

Single-bit PNRG: entity Library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; need a different seed for each PNRG entity prng is generic(init_seed : std_logic_vector (15 downto 0) := "0101110110010101"); port( clk : in std_logic; random : out std_logic); end prng; Digital Systemkonstruktion - 1 24

Single-bit PNRG: architecture architecture prng_arch of prng is signal seed : std_logic_vector (15 downto 0) := init_seed; begin gen_number: process(clk) begin if rising_edge(clk) then seed <= seed(14 downto 0) & (seed(15) xor seed(13) xor seed(12) xor seed(10)); end if; end process; random <= seed(15); end architecture; Maximum-length LFSR linear feedback shift register Digital Systemkonstruktion - 1 25

Generating IP cores in Vivado Many design elements well-described with pure VHDL But device-specific features often need to be declared more precisely: Block memories, dedicated multipliers, digital clock managers, embedded CPUs, fast transceivers, etc. Vendors provide tools to generate code that takes full advantage of these features Xilinx examples: CoreGen (ISE) IP Catalog (Vivado) Digital Systemkonstruktion - 1 26

Launch IP catalog Digital Systemkonstruktion - 1 27

Select the core you want Right click: Customize IP Digital Systemkonstruktion - 1 28

Customize the component Component name Basic configuration Digital Systemkonstruktion - 1 29

Customize the component Configure the ports Digital Systemkonstruktion - 1 30

Generated component Digital Systemkonstruktion - 1 31

Lab 3: Design a 4-bit PRNG Design a programmable-delay pipeline buffer with a block RAM Connect the PRNG output to the buffer input and look at the delayed buffer output Simulation and oscilloscope! Digital Systemkonstruktion - 1 32