Tutorial FTL - AndroBenchcsl.skku.edu › uploads › ICE3028S13 › lab3-tutorial.pdf ·...

Preview:

Citation preview

Jinyong Ha(jinyongha@csl.skku.edu)

Computer Systems Laboratory

Sungkyunkwan University

http://csl.skku.edu

Tutorial FTL

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 2

Contents

▪ NAND Flash Memory

▪ NAND Flash Operation

▪ NAND Flash Configuration

▪ NAND Controller

▪ Tutorial FTL

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 3

Schedule

Date Title

3/11 (Mon) Intro. to the Jasmine OpenSSD Platform

3/18 (Mon) Dummy FTL

3/25 (Mon) Tutorial FTL

4/1 (Mon) Greedy FTL

4/8 (Mon) Reliability Issues

4/15 (Mon) Project #1

4/29 (Mon) Project #1 Q&A, Kernel-Based FTL

5/5 (Mon) Project #2 Suggestions

5/27 (Mon) Project #2 Progress Report

6/10 (Mon) Project #2 Presentation

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 4

NAND Flash Memory

▪ K9LCG08U1M (Dual die)

• Samsung 35 nm 2-bit MLC flash

• 16 sectors per page (8 KB + 640 B)

• 128 pages per block (1 MB + 80 KB)

• 4096 + 56 blocks per die

• Page read : 250 us

• Page program : 1.3 ms

• Block erase : 1.5 ms

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 5

NAND Flash Memory

▪ NAND Flash Code Information

• http://www.samsung.com/global/business/semiconductor/support/label-code-info/code-info/memory-component

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 6

0

NAND Flash Memory

▪ NAND Flash Organization

Page Buffer

0

2

4

4150

Die

1 (“H

igh”)

Pla

ne 0

Die

0 (“L

ow

”)

Page Buffer

1

3

5

4151

Pla

ne 1

Block

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 7

NAND Flash Memory

▪ NAND Flash Organization

0

1

2

127

Data (8KB) Spare (640B)

Block (1MB + 80KB)

Page (8KB + 640B)

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 8

NAND Flash Operation

▪ Page read

• Cell -> Page Buffer -> RAM

▪ Page program

• RAM -> Page Buffer -> Cell

▪ Page copy-back

• Cell (Src) -> Page Buffer -> Cell (Dst)

▪ Block erase

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 9

NAND Flash Configuration

▪ Channel / Bank (Way)

8 Bank

4 C

hannel

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 10

NAND Flash Configuration

▪ Banks share the same IO bus

▪ Each bank can perform cell operation in parallel

• Cell to Page Buffer operation, Block erase

▪ Barefoot has only 4 R/B signal inputs per channel

• A0 and A4 are tied together

• Maximum 4 way interleaving

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 11

NAND Flash Configuration

Ch A/BBank 0(4)

Ch C/DBank 3(7)

Ch A/BBank 2(6)

Ch C/DBank 1(5)

Ch A/BBank 1(5)

Ch A/BBank 3(7)

Ch C/DBank 2(6)

Ch C/DBank 0(4)

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 12

NAND Flash Configuration

▪ 2 Plane operation, 16 bit IO program

• 33 44 55 66 ………… 77 88 99 AA …………

Die 0 (Low) Die 1 (High)

Plane 0 Plane 1 Plane 0 Plane 1

... ... ... ...

77 99 .. 88 AA ..44 66 ..33 55 ..

Block 0 Block 1 Block 0 Block 1

16KB 16KB

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 13

NAND Flash Controller

▪ To issue NAND Flash operation

• Defined in ./include/flash.h

FC_COL_ROW_READ_OUTFC_COL_ROW_IN_PROGFC_COPYBACK

FO_PFO_EFO_B_SATA_WFO_B_SATA_R

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 14

NAND Flash Controller

▪ To issue NAND Flash operation

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 15

Tutorial FTL

▪ ./ftl_tutorial

• ftl.c, ftl.h

▪ Page Mapping FTL

• Write data from DRAM to NAND

• Read data from NAND to DRAM

• But no garbage collection

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 16

Page Mapping Table

▪ LPN to PPN map

• LPN: Logical Page Number

- LPN = LBA / Sectors Per Page

• PPN: Physical Page Number

Index 0 1 2 3 … 2097151

Value 100 256 0 INVALID … 20000

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 17

Read Operation

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 18

Write Operation

▪ ./ftl_tutorial/ftl.c

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 19

Write Operation

▪ ./ftl_tutorial/ftl.c

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 20

Write Operation

▪ ./ftl_tutorial/ftl.c

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 21

NAND Flash Operation

▪ ./target_spw/flash_wrapper.c

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 22

NAND Flash Operation

▪ ./target_spw/flash.c

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 23

NAND Flash Operation

▪ ./target_spw/flash.c

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 24

Error Handling

▪ ./ftl_tutorial/ftl.c

ftl_open()

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim (jinsookim@skku.edu) 25

Any Questions?

Recommended