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

Similar documents
ECE 448 Lecture 13. FPGA Memories. George Mason University

ECE 699: Lecture 9. Programmable Logic Memories

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

ECE 545 Lecture 17 RAM. George Mason University

Lecture 11 Memories in Xilinx FPGAs

ECE 545 Lecture 12. FPGA Embedded Resources 12/8/11. Resources. Recommended reading. Use of Embedded FPGA Resources in SHA-3 Candidates

Hardware Design with VHDL Design Example: BRAM ECE 443

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

Basic FPGA Architecture Xilinx, Inc. All Rights Reserved

ELE432. ADVANCED DIGITAL DESIGN HACETTEPE UNIVERSITY ROUTING and FPGA MEMORY. In part from ECE 448 FPGA and ASIC Design with VHDL

Spartan-6 Libraries Guide for HDL Designs. UG615 (v 14.1) April 24, 2012

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

Spartan-6 FPGA Block RAM Resources

EECS150 - Digital Design Lecture 16 - Memory

EECS150 - Digital Design Lecture 16 Memory 1

EE178 Lecture Module 2. Eric Crabill SJSU / Xilinx Fall 2007

ECE 545 Lecture 12. FPGA Resources. George Mason University

Field Programmable Gate Array

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points)

IP cores. V. Angelov

CprE 583 Reconfigurable Computing

CPE 626 Advanced VLSI Design Lecture 7: VHDL Synthesis

Course Overview Revisited

Programmable Logic. Simple Programmable Logic Devices

Xilinx 7 Series FPGA Libraries Guide for HDL Designs. UG768 (v 13.4) January 18, 2012

Block RAM. Size. Ports. Virtex-4 and older: 18Kb Virtex-5 and newer: 36Kb, can function as two 18Kb blocks

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

ECE 448 Lecture 5. FPGA Devices

ECE 448 Lecture 5. FPGA Devices

INTRODUCTION TO VHDL ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás. Additional reading: - ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC)

The Virtex FPGA and Introduction to design techniques

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

Digital System Construction

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

EECS 151/251A Spring 2019 Digital Design and Integrated Circuits. Instructor: John Wawrzynek. Lecture 18 EE141

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

Spartan-6 Libraries Guide for HDL Designs. UG615 (v 13.1) March 1, 2011

HDL Coding Style Xilinx, Inc. All Rights Reserved

The VHDL Hardware Description Language

Vivado Design Suite 7 Series FPGA and Zynq-7000 All Programmable SoC Libraries Guide. UG953 (v2014.2) June 4, 2014

EECS150 - Digital Design Lecture 13 - Project Description, Part 2: Memory Blocks. Project Overview

FPGA RAM (C1) Young Won Lim 5/13/16

Vivado Design Suite 7 Series FPGA Libraries Guide. UG953 (v ) July 25, 2012

Xilinx 7 Series FPGA and Zynq-7000 All Programmable SoC Libraries Guide for HDL Designs

Virtex-II Architecture

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

Review: Timing. EECS Components and Design Techniques for Digital Systems. Lec 13 Storage: Regs, SRAM, ROM. Outline.

ECEU530. Last Few Lectures. ECE U530 Digital Hardware Synthesis. What is on Quiz 2. Projects. Today:

Topics. Midterm Finish Chapter 7

Sequential Statement

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

Writing VHDL for RTL Synthesis

Digital Systems Design

Implementation of Directional Median Filtering using Field Programmable Gate Arrays

Asynchronous FIFO Architectures (Part 1)

ECE 5775 (Fall 17) High-Level Digital Design Automation. Specialized Computing

FPGA Interface to a TMS Series DSP Using EMIF Author: Marc Defossez

Analysis and Improvement of Virtex-4 Block RAM Built-In Self-Test. and Introduction to Virtex-5 Block RAM Built-In Self-Test.

Virtex-5 Libraries Guide for HDL Designs. UG621 (v 14.1) April 24, 2012

MAX 10. Memory Modules

ORCA Series 4 Quad-Port Embedded Block RAM

Digital Design Laboratory Lecture 2

A Video Controller for an FPGA. Dual-Ported RAM

Guidelines to Migrating Spartan Designs to Cyclone Designs

Topics. Midterm Finish Chapter 7

Parameterizable LocalLink FIFO Author: Wen Ying Wei, Dai Huang

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

Timing in synchronous systems

ΔΙΑΛΕΞΗ 2: FPGA Architectures

Field Programmable Gate Array (FPGA)

Summary of FPGA & VHDL

LogiCORE IP Block Memory Generator v7.1

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

Discontinued IP. Distributed Memory v7.1. Functional Description. Features

Sequential Logic - Module 5

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

Virtex-5 Libraries Guide for HDL Designs. UG621 (v 13.1) March 1, 2011

FPGA.

VHDL And Synthesis Review

APPENDIX A SCHEMATICS AND CODE LISTINGS

Laboratory Memory Components

Problem Set 10 Solutions

Lecture 12 VHDL Synthesis

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

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

Design Recommendations User Guide

Midterms Exam Fall 2011 Solu6ons

Xilinx ASMBL Architecture

7-Series Architecture Overview

FPGAs in a Nutshell - Introduction to Embedded Systems-

entity priority is Port ( a,b,c,d : in STD_LOGIC; encoded : out STD_LOGIC_VECTOR(2 downto 0)); end priority;

Spartan-6 Libraries Guide for HDL Designs. UG615 (v 12.3) September 21, 2010

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

Sign here to give permission for your test to be returned in class, where others might see your score:

CDA 4253 FPGA System Design VHDL Testbench Development. Hao Zheng Comp. Sci & Eng USF

Digital Integrated Circuits

EITF35: Introduction to Structured VLSI Design

CDA 4253 FPGA System Design The PicoBlaze Microcontroller. Hao Zheng Comp Sci & Eng U of South Florida

Architecture by Xilinx, Inc. All rights reserved.

Transcription:

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

Xilinx 7-Series FPGA Architecture On-Chip block RAM On-Chip block RAM Distributed RAM by Logic Fabric Distributed RAM by Logic Fabric

Recommended Reading 7 Series FPGA Memory Resources: User Guide Google search: UG473 7 Series FPGA Configurable Logic Block: User Guide Google search: UG474 Xilinx 7 Series FPGA Embedded Memory Advantages: White Paper Google search: WP377 XST User Guide for Virtex-6, Spartan-6, and 7 Series Device Google search: UG687 3

Memory Types 4

Generic Memory Types Memory RAM ROM Memory Single port Dual port Memory With asynchronous read With synchronous read 5

Memory Types Specific to Xilinx FPGAs Memory Distributed (MLUT-based) Block RAM-based (BRAM-based) Memory Inferred Instantiated Manually Using CORE Generator 6

FPGA Distributed Memory 7 Series FPGAs Configurable Logic Block User Guide UG474 (v1.7) November 17, 2014 7

7 Series FPGA CLB Resources Device Slices (1) SLICEL SLICEM 6-input LUTs Distributed RAM (Kb) Shift Register (Kb) Flip-Flops 7A15T 2,600 (2) 1,800 800 10,400 200 100 20,800 7A35T 5,200 (2) 3,600 1,600 20,800 400 200 41,600 Table 2-1: Logic Resources in One CLB Slices LUTs Flip-Flops Arithmetic and Carry Chains Distributed RAM (1) Shift Registers (1) 2 8 16 2 256 bits 128 bits Notes: 1. SLICEM only, SLICEL does not have distributed RAM or shift registers. 8

7 Series FPGA Distributed RAM Config. RAM Description Primitive Number of LUTs 32 x 1S Single port RAM32X1S 1 32 x 1D Dual port RAM32X1D 2 32 x 2Q Quad port RAM32M 4 32 x 6SDP Simple dual port RAM32M 4 64 x 1S Single port RAM64X1S 1 64 x 1D Dual port RAM64X1D 2 64 x 1Q Quad port RAM64M 4 64 x 3SDP Simple dual port RAM64M 4 128 x 1S Single port RAM128X1S 2 128 x 1D Dual port RAM128X1D 4 256 x 1S Single port RAM256X1S 4 9

Single-Port 64x1-bit Distributed RAM RAM64X1S D (DI) DI1 SPRAM64 O6 O Output A[5:0] WCLK WE 6 (D[6:1]) 6 (CLK) (WE/CE) A[6:1] WA[6:1] CLK WE D Q Registered Output (Optional) UG474_c2_07_101210 Four of these signal port 64x1 RAMs can be implemented in a single SLICEM to form a 64x4b RAM. 10

Dual-Port 64x1b Distributed RAM RAM64X1D D (DI) DI1 DPRAM64 O6 SPO A[5:0] WCLK WE (D[6:1]) 6 6 (CLK) (WE/CE) A[6:1] WA[6:1] CLK WE D Q Registered Output (Optional) DI1 DPRAM64 O6 DPO DPRA[5:0] (C[6:1]) 6 6 A[6:1] WA[6:1] CLK WE D Q Registered Output (Optional) UG474_c2_08_101210

Single-Port 128x1b Distributed RAM A6 (CX) RAM128X1S D (DI) DI1 SPRAM64 O6 A[6:0] WCLK WE [5:0] 7 (CLK) (WE/CE) A[6:1] WA[7:1] CLK WE 0 Output [5:0] 7 DI1 A[6:1] WA[7:1] CLK WE SPRAM64 O6 F7BMUX D Q Registered Output (Optional) UG474_c2_11_101210

7 Series FPGA ROM ConfiguraZons on LUTs ROM Number of LUTs 64 x 1 1 128 x 1 2 256 x 1 4 Configura.on Primi.ves: ROM64X1 ROM128X1 ROM256X1 LUTs are oden used to implemented small memories with less than 256 bits. 13

FPGA Block RAM 7 Series FPGAs Memory Resources User Guide UG 473 2014 14

LocaZon of Block RAMs On-Chip block RAM On-Chip block RAM Use block RAM for storage with 64+ depth or 16+ width. 15

7 Series FPGA Block RAM Resources Device Total 36 Kb Block RAM Blocks per Device Number of 36 Kb Block RAM Columns per Device Number of 36 Kb Block RAM Blocks per Column XC7A15T 25 3 30 (1)(2)(4) XC7A35T 50 3 30 (1)(2)(4) XC7A50T 75 3 30 (1)(2) XC7A75T 105 4 40 (1)(2)(4) XC7A100T 135 4 40 (1)(2) XC7A200T 365 9 50 (2)(3) Each 36Kb block RAM can be configured as two independent 18Kb RAM blocks. 16

Block RAM ConfiguraZons (Aspect RaZos) 0 1 0 2 0 4 16K x 2 8K x 4 4,095 32k x 1 16383 0 8+1 4k x (8+1) 4095 32767 0 1023 32+4 1024 x 36 17

Block RAM Interface True Dual Port Ports A and B are fully independent. Each port has its own address, data in/out, clock, and WR enable. Both read/write are synchronous. Simultaneously wri.ng to the same address causes data uncertainty. 32 4 16 4 32 4 16 4 CASCADEOUTA DIA DIPA ADDRA WEA ENA RSTREGA RSTRAMA CLKA REGCEA DIB DIPB ADDRB WEB ENB RSTREGB RSTRAMB CLKB REGCEB CASCADEINA 36-Kbit Block RAM Port A 36 Kb Memory Array Port B CASCADEOUTB DOA DOPA DOB DOPB CASCADEINB 32 4 32 4 18

Block RAM Interface Simple Dual Port Independent read/write ports. 64 8 15 36 Kb Memory Array DI DO DIP DOP RDADDR 64 8 Max port width is 64+8b. RDCLK RDEN Reading & wri.ng to the same mem loca.on causes data uncertainty. 8 15 REGCE SSR WE WRADDR WRCLK WREN UG473_c1_06_011414 19

20

VHDL Coding for Memory XST User Guide for Virtex-6, Spartan-6, and 7 Series Devices Chapter 7, HDL Coding Techniques Sec.ons: RAM HDL Coding Techniques ROM HDL Coding Techniques 21

Distributed vs Block RAMs Distributed RAM: must be used for RAM descrip.ons with asynchronous read. Block RAM: generally used for RAM descrip.ons with synchronous read. Synchronous write for both types of RAMs. Any size and data width are allowed in RAM descrip.ons. - Depending on resource availability Up to two write ports are allowed. 22

Inferring ROM 23

Distributed ROM with Asynchronous Read library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity ROM is generic(w : integer := 12; -- number of bits per ROM word r : integer := 3 -- 2^r = number of words in ROM ); port (addr : in std_logic_vector(r-1 downto 0); dout : out std_logic_vector(w-1 downto 0)); end ROM; 24

Distributed ROM with Asynchronous Read architecture behavioral of ROM is type rom_type is array (2**r-1 downto 0) of std_logic_vector (w-1 downto 0); constant ROM_array : rom_type := ("000011000100", "010011010010", "010011011011", "011011000010, "000011110001", "011111010110", "010011010000", "111110011111"); begin dout <= ROM_array(conv_integer(addr)); end architecture behavioral; 25

Dual-Port ROM with Sync. Read in VHDL library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity roms_dualport is port (clk : in std_logic; ena, enb : in std_logic; addra, addrb : in std_logic_vector(5 downto 0); dataa, datab : out std_logic_vector(19 downto 0)); end roms_dualport; architecture behavioral of roms_dualport is type rom_type is array (63 downto 0) of std_logic_vector (19 downto 0); signal ROM : rom_type:= (X"0200A", X"00300", X"08101", X"04000", X"08601", X"0233A", X"00300", X"08602", X"02310", X"0203B", X"08300", X"04002", X"08201", X"00500", X"04001", X"02500", X"00340", X"00241", X"04002", X"08300", X"08201", X"00500", X"08101", X"00602", X"04003", X"0241E", X"00301", X"00102", X"02122", X"02021", X"00301", X"00102", X"02222", X"04001", X"00342", X"0232B", X"00900", X"00302", X"00102", X"04002", X"00900", X"08201", can be implemented either on LUTs or block RAMs. -- attribute ram_style : string; X"02023", X"00303", X"02433", X"00301", X"04004", X"00301", X"00102", X"02137", X"02036", X"00301", X"00102", X"02237", X"04004", X"00304", X"04040", X"02500", X"02500", X"02500", X"0030D", X"02341", X"08201", X"0400D"); 26

Dual-Port ROM with Sync. Read in VHDL begin process (clk) begin if rising_edge(clk) then if (ena = 1 ) then dataa <= ROM(conv_integer(addra)); end if; end if; end process; process (clk) begin if rising_edge(clk) then if (enb = 1 ) then datab <= ROM(conv_integer(addrb)); end if; end if; end process; end behavioral; 27

Inferring RAM 28

Distributed Single-Port RAM with Async. Read library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; entity raminfr is generic(w : integer := 32; -- number of bits per RAM word r : integer := 3 -- 2^r = number of words in RAM ); port(clk : in std_logic; we : in std_logic; a : in std_logic_vector(r-1 downto 0); di : in std_logic_vector(w-1 downto 0); do : out std_logic_vector(w-1 downto 0)); end raminfr; 29

Distributed Single-Port RAM with Async. Read architecture behavioral of raminfr is type ram_type is array (2**r-1 downto 0) of std_logic_vector (w-1 downto 0); signal RAM : ram_type; begin process (clk) begin if rising_edge(clk) then if (we = '1') then RAM(conv_integer(a)) <= di; end if; end if; end process; do <= RAM(conv_integer(a)); -- async read end behavioral; 30

Block RAM with Sync. Read (Read-First Mode) 31

Block RAM with Sync. Read (Read-First Mode) 32

Block RAM with Sync. Read (Read-First Mode) process (clk) begin if rising_edge(clk) then if (en = '1') then do <= RAM(conv_integer(addr)); if (we = '1') then RAM(conv_integer(addr)) <= di; end if; end if; end if; end process; 33

Block RAM with Sync. Read (Write-First Mode) 34

Block RAM with Sync. Read (Write-First Mode) process (clk) begin if rising_edge(clk) then if (en = '1') then if (we = '1') then RAM(conv_integer(addr)) <= di; do <= di; else do <= RAM(conv_integer(addr)); end if; end if; end if; end process; 35

Block RAM with Sync. Read (No-Change Mode) 36

Block RAM with Sync. Read (No-Change Mode) process (clk) begin if rising_edge(clk) then if (en = '1') then if (we = '1') then RAM(conv_integer(addr)) <= di; else do <= RAM(conv_integer(addr)); end if; end if; end if; end process; 37

Block RAM IniZalizaZon Example 1 type ram_type is array (0 to 127) of std_logic_vector(15 downto 0); signal RAM : ram_type := (others => 0000111100110101 ; Example 2 type ram_type is array (0 to 127) of std_logic_vector(15 downto 0); signal RAM : ram_type := (others => (others => 1 )); Example 3 type ram_type is array (0 to 127) of std_logic_vector(15 downto 0); signal RAM : ram_type := (196 downto 100 => X B9B5, others => X 3344 ); 38

Block RAM IniZalizaZon from a File type RamType is array(0 to 127) of bit_vector(31 downto 0); impure function InitRamFromFile (RamFileName : in string) return RamType is FILE RamFile : text is in RamFileName; variable RamFileLine : line; variable RAM : RamType; begin for I in RamType range loop readline (RamFile, RamFileLine); read (RamFileLine, RAM(I)); end loop; return RAM; end function; signal RAM : RamType := InitRamFromFile("rams_20c.data"); rams_20c.data: 001011000101111011110010000100001111 101011000110011010101010110101110111 101011110111001011111000110001010000 use binary or hex, not mixing them 128 number of lines in the file must match the number of rows in memory 39

Block RAM Interface True Dual Port Ports A and B are fully independent. Each port has its own address, data in/out, clock, and WR enable. Both read/write are synchronous. Simultaneously wri.ng to the same address causes data uncertainty. 32 4 16 4 32 4 16 4 CASCADEOUTA DIA DIPA ADDRA WEA ENA RSTREGA RSTRAMA CLKA REGCEA DIB DIPB ADDRB WEB ENB RSTREGB RSTRAMB CLKB REGCEB CASCADEINA 36-Kbit Block RAM Port A 36 Kb Memory Array Port B CASCADEOUTB DOA DOPA DOB DOPB CASCADEINB 32 4 32 4 40

Dual-Port Block RAM library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity rams_16b is port(clka : in std_logic; clkb : in std_logic; ena : in std_logic; enb : in std_logic; wea : in std_logic; web : in std_logic; addra : in std_logic_vector(6 downto 0); addrb : in std_logic_vector(6 downto 0); dia : in std_logic_vector(15 downto 0); dib : in std_logic_vector(15 downto 0); doa : out std_logic_vector(15 downto 0); dob : out std_logic_vector(15 downto 0)); end rams_16b; 41

Dual-Port Block RAM architecture syn of rams_16b is type ram_type is array (127 downto 0) of std_logic_vector(15 downto 0); shared variable RAM : ram_type; begin process (CLKA) begin if CLKA event and CLKA = 1 then if ENA = 1 then DOA <= RAM(conv_integer(ADDRA)); if WEA = 1 then RAM(conv_integer(ADDRA)) := DIA; end if; end if; end if; end process; process (CLKB) begin if CLKB event and CLKB = 1 then if ENB = 1 then DOB <= RAM(conv_integer(ADDRB)); if WEB = 1 then RAM(conv_integer(ADDRB)) := DIB; end if; end if; end if; end process; end syn; 42