Computer Memory. Textbook: Chapter 1

Similar documents
Memory Systems for Embedded Applications. Chapter 4 (Sections )

Large and Fast: Exploiting Memory Hierarchy

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

Introduction read-only memory random access memory

Address connections Data connections Selection connections

Read and Write Cycles

Computer Organization. 8th Edition. Chapter 5 Internal Memory

Embedded Systems Design: A Unified Hardware/Software Introduction. Outline. Chapter 5 Memory. Introduction. Memory: basic concepts

Embedded Systems Design: A Unified Hardware/Software Introduction. Chapter 5 Memory. Outline. Introduction

chapter 8 The Memory System Chapter Objectives

William Stallings Computer Organization and Architecture 8th Edition. Chapter 5 Internal Memory

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

Chapter TEN. Memory and Memory Interfacing

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

ECE 485/585 Microprocessor System Design

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

Chapter 5 Internal Memory

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

Design with Microprocessors

ECE 485/585 Microprocessor System Design

Concept of Memory. The memory of computer is broadly categories into two categories:

Internal Memory. Computer Architecture. Outline. Memory Hierarchy. Semiconductor Memory Types. Copyright 2000 N. AYDIN. All rights reserved.

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (5 th Week)

ECE 341. Lecture # 16

Mark Redekopp, All rights reserved. EE 352 Unit 10. Memory System Overview SRAM vs. DRAM DMA & Endian-ness

Design with Microprocessors

Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Memory Challenges. Issues & challenges in memory design: Cost Performance Power Scalability

Design and Implementation of an AHB SRAM Memory Controller

Memories: Memory Technology

Storage Technologies and the Memory Hierarchy

8051 INTERFACING TO EXTERNAL MEMORY

Memory classification:- Topics covered:- types,organization and working

CS 261 Fall Mike Lam, Professor. Memory

EE 308: Microcontrollers

CS 320 February 2, 2018 Ch 5 Memory

Real Time Embedded Systems

EECS150 - Digital Design Lecture 16 Memory 1

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture

Memory System Overview. DMA & Endian-ness. Technology. Architectural. Problem: The Memory Wall

CENG4480 Lecture 09: Memory 1

CS 33. Memory Hierarchy I. CS33 Intro to Computer Systems XVI 1 Copyright 2016 Thomas W. Doeppner. All rights reserved.

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

EECS150 - Digital Design Lecture 16 - Memory

Memory & Simple I/O Interfacing

ECE7995 (4) Basics of Memory Hierarchy. [Adapted from Mary Jane Irwin s slides (PSU)]

UNIT V (PROGRAMMABLE LOGIC DEVICES)

Chapter 4 Main Memory

Computer Organization and Assembly Language (CS-506)

The D igital Digital Logic Level Chapter 3 1

The Memory Hierarchy Sept 29, 2006

EE414 Embedded Systems Ch 5. Memory Part 2/2

UMBC. Select. Read. Write. Output/Input-output connection. 1 (Feb. 25, 2002) Four commonly used memories: Address connection ... Dynamic RAM (DRAM)

Memory Overview. Overview - Memory Types 2/17/16. Curtis Nelson Walla Walla University

COA. Prepared By: Dhaval R. Patel Page 1. Q.1 Define MBR.

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Memory Organization Part II


Foundations of Computer Systems

Semiconductor Memories: RAMs and ROMs

CENG3420 Lecture 08: Memory Organization

Chapter 5. Internal Memory. Yonsei University

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422)

Allmost all systems contain two main types of memory :

Summer 2003 Lecture 18 07/09/03

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Menu. word size # of words byte = 8 bits

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

Design with Microprocessors

Basics DRAM ORGANIZATION. Storage element (capacitor) Data In/Out Buffers. Word Line. Bit Line. Switching element HIGH-SPEED MEMORY SYSTEMS

k -bit address bus n-bit data bus Control lines ( R W, MFC, etc.)

Chapter 8 Memory Basics

Memory Expansion. Lecture Embedded Systems

Memory Device Evolution

UMBC D 7 -D. Even bytes 0. 8 bits FFFFFC FFFFFE. location in addition to any 8-bit location. 1 (Mar. 6, 2002) SX 16-bit Memory Interface

Chapter 2: Fundamentals of a microprocessor based system

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

CSE140: Components and Design Techniques for Digital Systems

Components of a personal computer

Chapter 6 Storage and Other I/O Topics

Topic 21: Memory Technology

Topic 21: Memory Technology

Giving credit where credit is due

A+3 A+2 A+1 A. The data bus 16-bit mode is shown in the figure below: msb. Figure bit wide data on 16-bit mode data bus

The Memory Component

ECEN 449 Microprocessor System Design. Memories

1 PC Hardware Basics Microprocessors (A) PC Hardware Basics Fal 2004 Hadassah College Dr. Martin Land

CISC 360. The Memory Hierarchy Nov 13, 2008

eaymanelshenawy.wordpress.com

Architecture of An AHB Compliant SDRAM Memory Controller

Memory and Disk Systems

The Memory Hierarchy Part I

CS 261 Fall Mike Lam, Professor. Memory

Unit 6 1.Random Access Memory (RAM) Chapter 3 Combinational Logic Design 2.Programmable Logic

211: Computer Architecture Summer 2016

Random Access Memory (RAM)

Where Have We Been? Ch. 6 Memory Technology

Unit IV MEMORY SYSTEM PART A (2 MARKS) 1. What is the maximum size of the memory that can be used in a 16-bit computer and 32 bit computer?

Transcription:

Computer Memory Textbook: Chapter 1 ARM Cortex-M4 User Guide (Section 2.2 Memory Model) STM32F4xx Technical Reference Manual: Chapter 2 Memory and Bus Architecture Chapter 3 Flash Memory Chapter 36 Flexible Static Memory Controller 1

Computer Memory Systems Memory system hierarchy Disk, ROM, RAM, Cache Memory module (chip) organization On-chip (address) decoder, cell array Memory system interfacing Address decoding Bus timing Direct memory access (DMA) Transfer data directly between memory and I/O devices Coordinated by a DMA controller

Computer Memory Hierarchy CPU Registers Cache Memory M C Main Memory M M Secondary Memory (Disk) M D Memory Content: M C M M M D Memory Parameters: Access Time: increase with distance from CPU Cost/Bit: decrease with distance from CPU Capacity: increase with distance from CPU 3

Semiconductor Memory RAM (Random Access Memory) Constant access time, independent of location A unique address for each location (generally a byte) The address is decoded by one or more address decoders RAM (Read/Write Memory) vs. ROM (Read Only Memory) RAM ROM User s application programs and data Information is lost when the power is off Embedded system program code and operating system Information is retained even without power Each ROM cell is simpler than a RAM cell

Read-only memory types Mask-programmed ROM Programmed at factory PROM (Programmable ROM) Programmable once by users Electric pulses selectively applied to fuses EPROM (Erasable PROM) Repeatedly programmable/reprogrammable Electric pulses for programming (seconds) Ultraviolet light for erasing (minutes) EEPROM (Electrically Erasable PROM) Electrically erasable at the single-byte level (msec) & programmable Flash EPROM Electrically programmable (µsec) & erasable (block-by-block: msec~sec) Most common program memory in embedded applications Widely used in digital cameras, multimedia players, smart phones, etc. ROM devices are non-volatile they retain information, even when not powered.

Read-write memory types Static RAM (SRAM) Each cell is a flip-flop, storing 1-bit information Information is retained as long as power is on (lost when power off) Faster than DRAM Requires a larger area per cell (more transistors) than DRAM Dynamic RAM (DRAM) Each cell is a capacitor, which needs to be refreshed periodically to retain the 1-bit information A refresh consists of reading followed by writing back Refresh overhead

Memory organization (RAM) RAM Structure Memory Cell Select Data In D Data Out R/W A byte consists of 8 memory cells, with common control signals, Select and R/W, and 8 bidirectional data lines. Some RAMs have separate Din and Dout With n bit address, the memory system can contain up to 2 n bytes. An n-bit address is decoded by one or more address decoders to generate the control signal, Select.

ROM/RAM device organization Memory organization = 2 n x d (from system designer s perspective) Address n Column # c Row # r Row Decoder Memory array Size. 2 n addressable words Address width = n = r + c Aspect ratio. Data width d. 8 Column Decoder d Data bus connection

Address Decoding Selecting a sub-space of memory address A simple example Microprocessor with 5 address bits (A 4 A 0 ) 2 5 = 32 bytes addressable Memory chip: 4 x 8 (4 bytes) Decodes two address bits (A 1 A 0 ) Can address up to 8 chips (decode address bits (A 4 A 3 A 2 ) for chip enable On-Chip Decoder Memory Array Off-Chip Decoder A 0 A 1 A B 0 1 Byte 0 Byte 1 A 2 A 3 A 4 Decode Upper Address Bits Enable 2 3 Byte 2 Byte 3

Typical generic SRAM CE OE WE Address Data SRAM 10 CE = chip enable: initiate memory access when active OE = output enable: drive Data lines when active WE = write enable: update SRAM contents with Data (May have one R/W signal instead of OE and WE ) Multi-byte data bus devices have a byte-enable signal for each byte.

Timing diagrams Signals 11

Generic SRAM timing CE Chip enabled Chip enabled OE WE Adrs read Read Address write Write Address Data From SRAM From CPU 12 CPU captures Data SRAM captures Data time

Microprocessor buses Mechanism for communication with memories and I/O devices signal wires with designated functions protocol for data transfers electrical parameters (voltage, current, capacitance, etc.) physical design (connectors, cables, etc.) Clock for synchronization. R/W true when reading ** (R/W false when reading). Address = bundle of a address lines. Data = bundle of n data lines. Data ready => addressed device ready to complete the read/write 13 ** Instead of R/W some CPUs have separate RD and WR

Typical bus read and write timing 14 From memory to CPU From CPU to memory

Bus wait state Insert additional clock cycle(s) before completing read/write. 15

IS61LV51216-12T: 512K x 16 SRAM 2 19 1024K Bytes = 1M Byte Byte Lane Select - Upper byte D15-8 - Lower byte D7-0 Decoded A 31-24 16

ISSI IS61LV51216 SRAM read cycle Timing Parameters: Max data valid times following activation of Address, CE, OE 17

18 Flash memory devices Available in NAND or NOR structures NOR flash system interface similar to SRAM (random access) NAND flash system interface typically serial (indirect access) Read operations are the default, and similar to other memory devices Writing/erasing is initiated by writing commands to the Flash memory controller Flash is programmed at system voltages. Erasure time is long, and must be erased in blocks.

Ex: SST39VF1601-1M x 16 NOR Flash SST39VF3201=2M x 16 (4Mbyte: 2 22 ) / SST39VF3201=4M x 16 (8Mbyte: 2 23 ) D[15..0] A[20..1]** 2Mbyte (2 21 ) used of 64Mbyte (2 26 ) addr. space Therefore, 5 address bits not decoded: A[25..21]** A[0] is part of NBL[1:0]* NRESET NOE NWE NEx 19 Byte lane selects NBL[1:0] not used: all operations are words SST39VF3201 uses A[21..1], SST39VF6401 uses A[22..1]

SST39VF1601 characteristics Organized as 1M x 16 2K word sectors, 32K word blocks Performance: Read access time = 70ns or 90ns Word program time = 7us Sector/block erase time = 18ms Chip erase time = 40ms Check status of write/erase operation via read DQ7 = complement of written value until write complete DQ7=0 during erase, DQ7=1 when erase done 20

21 SST39VF1601 command sequences (assert WE# and CE# to write commands)

Generic DRAM device CE R/W RAS CAS Address DRAM Data RAS = Row Address Strobe: row# on Address inputs CAS = Column Address Strobe: column# on Address inputs 22

Generic DRAM timing CE R/W RAS CAS Adrs Data row adrs col adrs data time 23

Page mode access CE R/W RAS CAS Adrs row adrs col adrs col adrs col adrs Data data data data time 24

25 Bus burst read (if supported)

Dynamic RAM refresh Value decays in approx. 1-4 ms. Refresh value by reading it Read row of bits and then copy back Can t access memory during refresh. RAS-only refresh CAS-before-RAS refresh. Hidden refresh. 4 Mbyte DRAM: Refresh every 4 msec Organized as 2048 rows x 2048 columns 2048 refreshes Assume 1 row refresh 80 nsec 26 2048 80 10 4 10 3 9 0.041 4.1% of time spent refreshing

Other DRAM forms Extended data out (EDO): improved page mode access. Synchronous DRAM: clocked access for pipelining. Double Data Rate (DDR) transfer on both edges of clock DDR-1, DDR-2, DDR-3 support increasingly higher bandwidths Rambus: highly pipelined DRAM. 27

Cortex-M4 memory map uc decodes A 31-28 for 0.5 GB blocks Add external memory in this address range On-chip

STM32F407 Microcontroller External Bus AHB 168MHz APB 142MHz APB 84MHz 29

STM32 Flexible Static Memory Controller (FSMC) - STM32F4xx Tech. Ref. Manual, Chap. 36 Control external memory on AHB bus in 4-256K banks Upper address bits decoded by the FSMC Bank 1 addresses: A[31:28] = 0110 A[27:26 ]= 64MB bank select A[25:0] = 64MB bank offset Static memorymapped devices: * SRAM * Pseudo-Static RAM * NOR flash 2 banks NAND flash 16-bit PC-Card devices 30

Example SRAM address decoding SRAM/NE4 Addresses: [ 0x6C00 0000 0x6F00 0000] 31 28 27-26 25 0 0110 1 1 0.. 6.. 4Gbyte E address space 4-to-16 decoder Ext SRAM bank 2-to-4 decoder Flash NE1 NE2 NE3 Ext SRAM NE4 Cortex peripherals NOE NWE 2 26 = 64 Mbytes A25-A0 CE OE WE 31 Within the microcontroller SRAM

FSMC block diagram N = negative (active low) NE[4:1] = NOR/PSRAM enable NE[1]: A[27:26]=00 NE[2]: A[27:26]=01 NE[3]: A[27:26]=10 NE[4]: A[27:26]=11 NL = address latch/advance NBL = byte lane CLK for sync. Burst A[25:0] = Address bus D[15:0] = Data bus** NOE = output enable NWE = write enable NWAIT = wait request ** Data bus = 8 or 16 bits 32

FSMC Mode 1 memory read Other modes: * Provide ADV (address latch/ advance) * Activate OE and WE only in DATAST * Multiplex A/D bits 15-0 * Allow WAIT to extend DATAST 33 ADDSET/DATAST programmed in chip-select timing register (HCLK = AHB clock)

Example: 512K x 16 SRAM (1 Mbyte) D[15..0] A[19..1] 1Mbyte (2 20 ) used of this 64Mbyte (2 26 ) address space for NEx Therefore, 6 address bits not decoded: A[25..20] A[0] is part of NBL[1:0] NBL[1] NBL[2] NOE NWE NEx 34 Microcontroller decodes upper address bits ADDR[31..26] for NEx

CPU Bus Types Synchronous vs. Asynchronous Sync: all op s synchronized to a clock Async: devices signal each other to indicate start/stop of operations May combine sync/async (80x86 Ready signal) Data transfer types: Processor to/from memory Processor to/from I/O device I/O device to/from memory (DMA) Data bus types Parallel (data bits transferred in parallel) Serial (data bits transferred serially) 35

Typical bus data rates 36 Source: Peter Cheung Computer Architecture & Systems Course Notes

Hierarchical Bus Architecture CPU Local Cache controller System Main Memory Main Memory bridge Expansion LAN Controller Video Controller Mouse/ Keyboard USB Controller USB Disk Controller IDE/SCSI USB Device 37

Example ARM System 38 Joe Bungo (ARM): CPU Design Concept to SoC

DMA Direct memory access (DMA) performs data transfers without executing instructions. CPU sets up transfer by programming the DMA controller. DMA engine fetches, writes. DMA controller is a separate unit can become bus master. 39

Bus mastership Bus master controls operations on the bus. By default, CPU is bus master and initiates transfers. Other devices may request bus mastership. Separate set of handshaking lines. CPU can t use bus when it is not master. Bus mastership protocol: Bus request a device requests bus mastership from CPU Bus grant CPU relinquishes and grants mastership to device Situations for multiple bus masters: DMA data transfers Multiple CPUs with shared memory One CPU might be graphics/network processor 40

DMA operation CPU configures DMA controller registers for: peripheral address, memory start address, #xfers, direction (P->M or M->P) Peripheral issues DMA request to DMA controller. DMA controller takes bus mastership from CPU Once DMA is bus master, it transfers automatically. Memory address incremented and count decremented for each transfer. May run continuously until complete. May use every n th bus cycle. 41