Design and Implementation of an AHB SRAM Memory Controller

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

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

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.

Chapter 5 Internal Memory

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

Large and Fast: Exploiting Memory Hierarchy

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

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

Computer Organization and Assembly Language (CS-506)

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

ECE 341. Lecture # 16

CENG4480 Lecture 09: Memory 1

ECSE-2610 Computer Components & Operations (COCO)

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Address connections Data connections Selection connections

Chapter 4 Main Memory

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

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

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

MEMORY BHARAT SCHOOL OF BANKING- VELLORE

CS 320 February 2, 2018 Ch 5 Memory

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

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

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

Module 5a: Introduction To Memory System (MAIN MEMORY)

chapter 8 The Memory System Chapter Objectives

Chapter 5. Internal Memory. Yonsei University

Announcement. Computer Architecture (CSC-3501) Lecture 20 (08 April 2008) Chapter 6 Objectives. 6.1 Introduction. 6.

TSEA22, DIGITALTEKNIK LECTURE 7

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

Memory memories memory

CS 261 Fall Mike Lam, Professor. Memory

COMPUTER ARCHITECTURE

Read and Write Cycles

UNIT:4 MEMORY ORGANIZATION

EEM 486: Computer Architecture. Lecture 9. Memory

Computer Memory. Textbook: Chapter 1

Semiconductor Memory Types Microprocessor Design & Organisation HCA2102

CENG3420 Lecture 08: Memory Organization

Architecture of An AHB Compliant SDRAM Memory Controller

EECS150 - Digital Design Lecture 16 Memory 1

! Memory Overview. ! ROM Memories. ! RAM Memory " SRAM " DRAM. ! This is done because we can build. " large, slow memories OR

Very Large Scale Integration (VLSI)

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

UNIT V (PROGRAMMABLE LOGIC DEVICES)

Introduction to Semiconductor Memory Dr. Lynn Fuller Webpage:

EECS150 - Digital Design Lecture 16 - Memory

Chapter 6 Objectives

+1 (479)

Summer 2003 Lecture 18 07/09/03

ECE 485/585 Microprocessor System Design

a) Memory management unit b) CPU c) PCI d) None of the mentioned

The Memory Hierarchy 1

Lecture 18: Memory Systems. Spring 2018 Jason Tang

ECEN 449 Microprocessor System Design. Memories. Texas A&M University

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

RTL Design (2) Memory Components (RAMs & ROMs)

Digital Design, Kyung Hee Univ. Chapter 7. Memory and Programmable Logic

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

Memory & Simple I/O Interfacing

Memory. Outline. ECEN454 Digital Integrated Circuit Design. Memory Arrays. SRAM Architecture DRAM. Serial Access Memories ROM

Semiconductor Memories: RAMs and ROMs

Lecture 13: Memory and Programmable Logic

Read Only Memory ROM

Memory Systems for Embedded Applications. Chapter 4 (Sections )

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

Chapter 8 Memory Basics

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

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 13

ISSN: [Bilani* et al.,7(2): February, 2018] Impact Factor: 5.164

ECE 485/585 Microprocessor System Design

The Memory Hierarchy Part I

Memory and Programmable Logic

Lecture-14 (Memory Hierarchy) CS422-Spring

ELCT 912: Advanced Embedded Systems

MEMORY. Computer memory refers to the hardware device that are used to store and access data or programs on a temporary or permanent basis.

Introduction to SRAM. Jasur Hanbaba

,e-pg PATHSHALA- Computer Science Computer Architecture Module 25 Memory Hierarchy Design - Basics

Memory and Programmable Logic

ECE 2300 Digital Logic & Computer Organization

Semiconductor Memory Classification. Today. ESE 570: Digital Integrated Circuits and VLSI Fundamentals. CPU Memory Hierarchy.

COMPUTER ARCHITECTURES

MEMORY. Objectives. L10 Memory

P-2 Digital Design & Applications

Memory. Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University

Designing with Memory

Memory & Logic Array. Lecture # 23 & 24 By : Ali Mustafa

10/24/2016. Let s Name Some Groups of Bits. ECE 120: Introduction to Computing. We Just Need a Few More. You Want to Use What as Names?!

Memory Study Material

ELE 455/555 Computer System Engineering. Section 1 Review and Foundations Class 3 Technology

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory

Memory Expansion. Lecture Embedded Systems

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

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

COSC 243. Memory and Storage Systems. Lecture 10 Memory and Storage Systems. COSC 243 (Computer Architecture)

Random Access Memory (RAM)

Transcription:

Design and Implementation of an AHB SRAM Memory Controller 1

Module Overview Learn the basics of Computer Memory; Design and implement an AHB SRAM memory controller, which replaces the previous on-chip memory; Memory controller testing using assembly; Lab Demonstration. System on Chip ARM Cortex-M0 Processor 32-bit Data bus Control signals 32-bit Address bus ARM AMBA 3 AHB-Lite System Bus SRAM controller LED Off-chip SRAM memory 2

Module Syllabus Computer Memory Memory Types Volatile Vs. Non-volatile Memory Static RAM (SRAM) Dynamic RAM (DRAM) Non-volatile Memories Memory Controllers AHB SRAM Controller Hardware Implementation Lab Practice 3

Computer Memory 4

Computer Memory Computer Memory: a physical device that is used to store program code or data of a processor on either a temporary or a permanent basis Broadly, we can distinguish between two types of Memory Volatile Memory Requires power to keep the stored data; Non-volatile Memory Can retain stored data after power off 5

Computer Memory A memory is accessed by presenting it with an address, then writing or receiving the data at that address; For example, a memory architecture with 8-bit width and 8-bit data is shown below: One word Address [7:0] Address decoder Memory cells Data_In [7:0] Bit line amplifier Data_Out [7:0] 6

Memory Accessing Present an address: Provide an address to the memory address bus; A particular word is then selected by the address decoder and connected to the bit line amplifier; For larger memory, the address may be divided into row and column sections; Read operation: The selected data is connected to the bit line amplifier; The amplifier restores the signal to the proper voltage level, then outputs it to the Data_Out port; Write operation: Present the data to the Data_In port; The amplifier set the bit lines to the desired values and drives that value from the bit line to the memory cell. 7

Volatile Vs. Non-volatile Memory Volatile memory Requires power to retain the data information; Usually faster access speed and less costly; Used for temporary data storage, such as CPU cache, internal memory; Also known as Random Access Memory (RAM); Non-volatile memory No power is required to retain the data information; Usually slower access speed and more costly; Used for secondary storage, or long-term persistent storage. 8

Types of Memory Volatile memory Static RAM (SRAM) Dynamic RAM (DRAM) Non-volatile Memory Read Only Memory (ROM) Erasable Programmable ROM (EPROM) Electrically Erasable Programmable ROM (EEPROM) Non-volatile Random-access Memory (NVRAM) Flash memory Mechanical storage Hard drive, magnetic tape 9

Static RAM Static RAM (SRAM) Volatile memory Data is retained as long as power is supplied; Usually uses six transistors to store one bit data; Fast data access; Larger power consumption; Less density, larger block size; More expensive. 10

Static RAM An SRAM cell is typically made up of 6 MOSFET transistors; A single bit is stored on 4 transistors (M1-M4), which form 2 inverters that are cross-coupled; The access of the bit is controlled by two access transistors (M5 and M6), which are gated by the word line (select); select V DD M 5 M 2 M 4 M 6 M 1 M 3 bit bit' 11

Accessing a Static RAM Read operation The address is decoded and the desired cell is then selected, in which case the select line is set to one; Depending on the value of the 4 transistors (M1-M4), one of the bit line will be charged to 1 and the other will be drained to 0; The states of the two bit lines (bit and bit ) are then read out as 1-bit data; Write operation The two bit lines (bit and bit ) are pre-charged to the desired value (e.g. bit = V DD, bit = V SS ) The address is decoded and the desired cell is then selected, in which case the select line is set to one; The 4 transistors (M1-M4) are then forced to flip their states (either charged or discharged), since the bit lines normally have much higher capacitance than the 4 transistors; 12

Dynamic RAM Dynamic RAM (DRAM) One bit of data can be stored in one transistor and capacitor pair, the status of the capacitor (charged or uncharged) indicates the bit state (1 or 0); Needs to be refreshed (or recharged) periodically since the capacitor leaks its charge, e.g. every 10 ms; Higher density, smaller block size; Less expensive; DRAM can be categorized according to its data rate and synchronization mode, for example: Single Data Rate (SDR) and Double Data Rate (DDR); Synchronous DRAM (SDRAM) and non-synchronous DRAM. 13

Dynamic RAM In DRAM, each memory cell requires less transistors, e.g. three-transistor cell or even one-transistor cell; For example, the one-transistor cell is composed by one transistor and one capacitor; One-transistor a gate transistor used to select a single cell; One-capacitor stores the value of a single bit. select bit line 14

Accessing a Dynamic RAM Read operation The address decoder decodes the address and set the select line to one; The bit line is then changed according to the state of the capacitor. For example, if the capacitor is discharged, the current will flow from the bit line to the capacitor, whereby the voltage of the bit line will be lowered below the threshold; Write operation The single bit line is pre-charged to a desired value (e.g. VDD or VSS); The address decoder decodes the address and set the select line to one; The capacitor is then either charged or discharged by the bit line; 15

Non-volatile Memory Read Only Memory (ROM) In the early time, ROM is manufactured with desired data which cannot be changed; Later types of ROM allow data to be reprogramed but with a degree of efforts, examples include Erasable Programmable ROM (EPROM) Electrically Erasable Programmable ROM (EEPROM) Non-volatile Random-access Memory (NVRAM) Radom access, data can be both read and written; Best-know form is flash memory. Mechanical storage Non-electrically addressed memories, e,g, hard drive, magnetic tape, optical drive; Less expensive but slower. 16

Memory Controller A memory controller is a piece of hardware that is mainly used for controlling the data flow going to/ from the memory block; Memory controllers facilitate the access to the heterogeneous physical devices, e.g. SRAM, DRAM, FLASH, hard disk etc... Application / OS Standard accessing interface Memory controllers Heterogeneous devices Various data accesses Electrical supports Physical maintenance 17

Memory Controller The role of a memory controller includes: Interfacing with a particular type of memory block; Facilitating the memory access by providing an universal interface to the system, e.g. to a standard bus interface; Supporting a variety of memory access modes, such as burst mode, memory paging, etc May provide electrical supports for the memory, e.g. refreshing a DRAM. 18

AHB SRAM Controller Hardware Implementation 19

AHB SRAM Memory Controller In this set of teaching material, the off-chip memory on the target board is a 16MB cellular RAM from Micron, which has a SRAM-like interface with 16-bit bus width. AHB interface 32 32 32 Data in Data out Address Write Memory Controller 10 26 Data Address RAM CS MemWR MemOE RAM UB Off-chip SRAM Memory Ready RAM LB RAM Cre RAM Adv RAM Clk RAM Wait 20

Signal Description Name IO Description Data[15:0] IO 16-bit data input/ output bus Addr[25:0] I 26-bit address bus RamCS I Chip select, activates the device when LOW MemOE I Output enable: enable the output buffers when LOW MemWR I Write enable: write to the memory when LOW RamLB I Lower byte enable RamUB I Upper byte enable RamClk I Additional clock input used to synchronize with the system, can be set to LOW as it is not needed in this teaching material RamAdv I Address valid: indicates that a valid address is given on to the address bus; can be set to LOW as it is not needed in this teaching material RamCre I Control register enable, can be set to LOW as it is not needed in this teaching material RamWait O Provides data-valid feedback in the burst mode, not needed in this teaching material 21

Example Timing The off-chip memory supports a variety of transfer mode, the following timing graph gives a basic read and write timing. The memory controller also has to cope with different data width, namely merging two 16-bit data from the memory to form a 32-bit data to be transferred through AHB bus. RamCS MemOE Addr[25:0] Address valid Address valid Data[15:0] Data valid Data valid MemWR RamLB/UB 22

Program the Device Once the memory controller is implemented, the off-chip SRAM can be used for the program memory; hence the program code can be updated without reconfiguring the FPGA chip. A variety of download utilities can be used to program the SRAM, such as Adept from Digilent and imapct from Xilinx. 23

Lab Practice 24

Lab Practice Hardware design Design and implement the peripheral (memory controller) in hardware using Verilog; Software programming Test the peripheral using Cortex-M0 processor programed in assembler language; System demonstrating For example, toggle LEDs at a given frequency, using the SRAM controller. 25

Useful Resources Reference1 Nexys3 Reference Manual: http://www.digilentinc.com/data/products/nexys3/nexys3_rm.pdf Reference2 User Guide of Micron CellularRAM1.5 (MT45W8MW16BGX): http://download.micron.com/pdf/datasheets/psram/16mb_asyncpag e_cr1_0_p23z.pdf 26