Programmable Logic Memories

Slides:



Advertisements
Similar presentations
Survey of Reconfigurable Logic Technologies
Advertisements

Lecture 11 Xilinx FPGA Memories
FPGA Devices & FPGA Design Flow
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
George Mason University ECE 645 – Computer Arithmetic Introduction to FPGA Devices.
ECE 448 Lecture 7 FPGA Devices
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Random-Access Memory Distributed and Block RAM Discussion D10.3 Example 41.
Memory in FPGAs مرتضي صاحب الزماني. Inferring Memory Inferring Memory in XST:  Distributed or block memory? −XST implements small RAM components on distributed.
Basic Adders and Counters Implementation of Adders in FPGAs ECE 645: Lecture 3.
The Xilinx Spartan 3 FPGA EGRE 631 2/2/09. Basic types of FPGA’s One time programmable Reprogrammable (non-volatile) –Retains program when powered down.
ECE 448 – FPGA and ASIC Design with VHDL Lecture 10 Memories (RAM/ROM)
Designing with FPGAs ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
George Mason University FPGA Memories ECE 448 Lecture 13.
System Arch 2008 (Fire Tom Wada) /10/9 Field Programmable Gate Array.
ECE 448 – FPGA and ASIC Design with VHDL Lecture 11 Memories in Xilinx FPGAs.
George Mason University ECE 645 Lecture 7 FPGA Embedded Resources.
FPGA (Field Programmable Gate Array): CLBs, Slices, and LUTs Each configurable logic block (CLB) in Spartan-6 FPGAs consists of two slices, arranged side-by-side.
ENG241 Digital Design Week #8 Registers and Counters.
ECE 448 Lecture 6 FPGA devices
CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis Aleksandar Milenkovic
FPGA Based System Design
George Mason University ECE 448 – FPGA and ASIC Design with VHDL ECE 448 Lecture 10 Memories: RAM, ROM.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
FPGA Devices & FPGA Design Flow
Data Storage VHDL ET062G & ET063G Lecture 4 Najeem Lawal 2012.
CDA 4253 FGPA System Design Xilinx FPGA Memories
Lecture 10 Xilinx FPGA Memories Part 1
George Mason University ECE 448 – FPGA and ASIC Design with VHDL FPGA Devices ECE 448 Lecture 5.
George Mason University FPGA Memories ATHENa - Automated Tool for Hardware EvaluatioN ECE 545 Lecture 10.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
Lecture 11 Xilinx FPGA Memories Part 2
George Mason University ECE 448 – FPGA and ASIC Design with VHDL FPGA Devices & FPGA Design Flow ECE 448 Lecture 6.
George Mason University ECE 545 Lecture 12 FPGA Embedded Resources.
FPGA Devices & FPGA Design Flow
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Describing Combinational Logic Using Processes
Registers and Counters
VGA Display Part 4 Text Generation
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Sequential-Circuit Building Blocks
COE 405 Programmable Logic and Storage Devices
FPGA Devices & FPGA Tools
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
Programmable Logic Memories
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
ECE 448 Lecture 7 FPGA Devices
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 448 Lecture 5 FPGA Devices
ECE 545 Lecture 17 RAM.
Basic Adders and Counters Implementation of Adders
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
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
Modeling of Circuits with a Regular Structure
ECE 448: Lab 4 FIR Filters.
Data Flow Description of Combinational-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
Memories: RAM, ROM Advanced Testbenches
Variables variable variable_name: variable_type
FPro Video Subsystem: VGA Frame Buffer Core
Pipelined Array Multiplier Aldec Active-HDL Design Flow
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.
Sequntial-Circuit Building Blocks
Presentation transcript:

Programmable Logic Memories ECE 699: Lecture 9 Programmable Logic Memories

Recommended reading XST User Guide for Virtex-6, Spartan-6, and 7 Series Devices Chapter 7, HDL Coding Techniques Sections: RAM HDL Coding Techniques ROM HDL Coding Techniques

Memory Types

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

Memory Types specific to Xilinx FPGAs Distributed (MLUT-based) Block RAM-based (BRAM-based) Memory Inferred Instantiated Using Vivado Manually

Programmable Logic (PL) CLBs and IOBs Source: The Zynq Book

Programmable Logic (PL) BRAMs and DSP units Source: The Zynq Book

FPGA Distributed Memory

Location of Distributed RAM Logic resources (CLB slices) RAM blocks DSP units Logic resources Graphics based on The Design Warrior’s Guide to FPGAs Devices, Tools, and Flows. ISBN 0750676043 Copyright © 2004 Mentor Graphics Corp. (www.mentor.com)

SLICEL

Fast Carry Logic Each SliceL and SliceM contains separate logic and routing for the fast generation of sum & carry signals Increases efficiency and performance of adders, subtractors, accumulators, comparators, and counters Carry logic is independent of normal logic and routing resources MSB Carry Logic Routing LSB

Accessing Carry Logic All major synthesis tools can infer carry logic for arithmetic functions Addition (SUM <= A + B) Subtraction (DIFF <= A - B) Comparators (if A < B then…) Counters (count <= count +1)

ECE 448 – FPGA and ASIC Design with VHDL

SLICEM ECE 448 – FPGA and ASIC Design with VHDL

Xilinx Multipurpose LUT (MLUT) 32-bit SR 64 x 1 RAM 64 x 1 ROM (logic) The Design Warrior’s Guide to FPGAs Devices, Tools, and Flows. ISBN 0750676043 Copyright © 2004 Mentor Graphics Corp. (www.mentor.com)

Single-port 64 x 1-bit RAM

Single-port 64 x 1-bit RAM

Memories Built of Neighboring MLUTs Memories built of 2 MLUTs: Single-port 128 x 1-bit RAM: RAM128x1S Dual-port 64 x 1-bit RAM : RAM64x1D Memories built of 4 MLUTs: Single-port 256 x 1-bit RAM: RAM256x1S Dual-port 128 x 1-bit RAM: RAM128x1D Quad-port 64 x 1-bit RAM: RAM64x1Q Simple-dual-port 64 x 3-bit RAM: RAM64x3SDP (one address for read, one address for write)

Dual-port 64 x 1 RAM Dual-port 64 x 1-bit RAM : 64x1D Single-port 128 x 1-bit RAM: 128x1S

Dual-port 64 x 1 RAM Dual-port 64 x 1-bit RAM : 64x1D Single-port 128 x 1-bit RAM: 128x1S

FPGA Block RAM

Location of Block RAMs Logic resources (CLB slices) RAM blocks DSP units Logic resources Graphics based on The Design Warrior’s Guide to FPGAs Devices, Tools, and Flows. ISBN 0750676043 Copyright © 2004 Mentor Graphics Corp. (www.mentor.com)

Configured as 1 x 36 kbit RAM or 2 x 18 kbit RAMs Block RAM Configured as 1 x 36 kbit RAM or 2 x 18 kbit RAMs

Block RAM Simple Dual Port (SDP) = one port for read, one port for write (write_A-read_B, read_A_write_B) True Dual Port (TDP) = both ports can be used for read or write (read_A-read_B, read_A-write_B, write_A-read_B, write_A-write_B)

Block RAM can have various configurations (port aspect ratios) 1 2 4 4k x 4 8k x 2 4,095 16k x 1 8,191 8+1 2k x (8+1) 2047 16+2 1024 x (16+2) 1023 16,383

18k Block RAM Port Aspect Ratios

Block RAM Interface

Block RAM Ports

Cascadable Block RAM

Block RAM Waveforms – READ_FIRST mode

Block RAM Waveforms – WRITE_FIRST mode

Block RAM Waveforms – NO_CHANGE mode

Features of Block RAMs

Inference vs. Instantiation

Generic Inferred ROM

Distributed ROM with asynchronous read LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.numeric_std.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;

Distributed ROM with asynchronous read architecture behavioral of rominfr is type rom_type is array (0 to 2**r-1) 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(to_integer(unsigned(addr))); end behavioral;

Distributed ROM with asynchronous read architecture behavioral of rominfr is type rom_type is array (0 to 2**r-1) of std_logic_vector (w-1 downto 0); constant ROM_array : rom_type := (X"0C4", X"4D2", X"4DB", X"6C2", X"0F1", X"7D6", X"4D0", X"F9F"); begin dout <= ROM_array(to_integer(unsigned(addr))); end behavioral;

Generic Inferred RAM

Distributed versus Block RAM Inference Examples: Distributed single-port RAM with asynchronous read Distributed dual-port RAM with asynchronous read Block RAM with synchronous read (no version with asynchronous read!) More excellent RAM examples from XST Coding Guidelines.

Distributed single-port RAM with asynchronous read LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.numeric_std.all; entity raminfr is generic ( w : integer := 32; -- number of bits per RAM word r : integer := 6); -- 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;

Distributed single-port RAM with asynchronous read architecture behavioral of raminfr is type ram_type is array (0 to 2**r-1) of std_logic_vector (w-1 downto 0); signal RAM : ram_type := (others => (others => '0')); begin process (clk) if rising_edge(clk) then if (we = '1') then RAM(to_integer(unsigned(a))) <= di; end if; end process; do <= RAM(to_integer(unsigned(a))); end behavioral;

Distributed dual-port RAM with asynchronous read library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity raminfr is generic ( w : integer := 32; -- number of bits per RAM word r : integer := 6); -- 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); dpra : in std_logic_vector(r-1 downto 0); di : in std_logic_vector(w-1 downto 0); spo : out std_logic_vector(w-1 downto 0); dpo : out std_logic_vector(w-1 downto 0)); end raminfr;

Distributed dual-port RAM with asynchronous read architecture syn of raminfr is type ram_type is array (0 to 2**r-1) of std_logic_vector (w-1 downto 0); signal RAM : ram_type := (others => (others => '0')); begin process (clk) if rising_edge(clk) then if (we = '1') then RAM(to_integer(unsigned(a))) <= di; end if; end process; spo <= RAM(to_integer(unsigned(a))); dpo <= RAM(to_integer(unsigned(dpra))); end syn;

Block RAM Waveforms – READ_FIRST mode

Block RAM with synchronous read LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.numeric_std.all; entity raminfr is generic ( w : integer := 32; -- number of bits per RAM word r : integer := 9); -- 2^r = number of words in RAM port (clk : in std_logic; we : in std_logic; en : in std_logic; addr : 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;

Block RAM with synchronous read Read-First Mode - cont'd architecture behavioral of raminfr is type ram_type is array (0 to 2**r-1) of std_logic_vector (w-1 downto 0); signal RAM : ram_type := (others => (others => '0')); begin process (clk) if rising_edge(clk) then if (en = '1') then do <= RAM(to_integer(unsigned(addr))); if (we = '1') then RAM(to_integer(unsigned(addr))) <= di; end if; end process; end behavioral;

Block RAM Waveforms – WRITE_FIRST mode

Block RAM with synchronous read Write-First Mode - cont'd architecture behavioral of raminfr is type ram_type is array (0 to 2**r-1) of std_logic_vector (w-1 downto 0); signal RAM : ram_type := (others => (others => '0')); begin process (clk) if (clk'event and clk = '1') then if (en = '1') then if (we = '1') then RAM(to_integer(unsigned(addr))) <= di; do <= di; else do <= RAM(to_integer(unsigned(addr))); end if; end process; end behavioral;

Block RAM Waveforms – NO_CHANGE mode

Block RAM with synchronous read No-Change Mode - cont'd architecture behavioral of raminfr is type ram_type is array (0 to 2**r-1) of std_logic_vector (w-1 downto 0); signal RAM : ram_type := (others => (others => '0')); begin process (clk) if (clk'event and clk = '1') then if (en = '1') then if (we = '1') then RAM(to_integer(unsigned(addr))) <= di; else do <= RAM(to_integer(unsigned(addr))); end if; end process; end behavioral;

Criteria for Implementing Inferred RAM in BRAMs

FIFOs

FIFO Interface FIFO clk rst clk rst din dout 8 8 full empty write read ECE 448 – FPGA and ASIC Design with VHDL

Operation of the “Standard” FIFO B C D −−−−− ECE 448 – FPGA and ASIC Design with VHDL

Operation of the First-Word Fall-Through FIFO ECE 448 – FPGA and ASIC Design with VHDL