Comments (4)
The cell_type should be flash_type.
FEMU_OPTIONS=${FEMU_OPTIONS}",flash_type=3"
from femu.
I refactored that part of code, and haven't fully finished it yet. Stick to the default option for now. The TLC/QLC support is temporarily broken.
from femu.
//Due to the static, the initialization of latency data did not work, so I made some simple changes(for TLC).
static inline uint8_t get_page_type(int flash_type, int pg)
{
static bool first_in=0;
if(first_in==0){
int i, j;
int rows = (MAX_SUPPORTED_PAGES_PER_BLOCK + 5) / 6;
int lpflag = TLC_LOWER_PAGE;
int page_per_row=6;
int lowp[] = {0, 1, 2, 3, 4, 5};
int centerp[] = {6, 7};
for (i = 0; i < sizeof(lowp)/sizeof(lowp[0]); i++)
tlc_tbl[lowp[i]] = TLC_LOWER_PAGE;
for (i = 0; i < sizeof(centerp)/sizeof(centerp[0]); i++)
tlc_tbl[centerp[i]] = TLC_CENTER_PAGE;
for (i = 0; i < rows - 2; i++) {
for(j = 0; j < page_per_row; j += 2) {
int idx = 8 + (i * page_per_row) + j;
tlc_tbl[idx] = tlc_tbl[idx+1] = lpflag;
lpflag = (lpflag == TLC_UPPER_PAGE) ? TLC_LOWER_PAGE : lpflag + 1;
}
}
first_in=1;
}
switch (flash_type) {
case SLC:
return slc_tbl[pg];
case MLC:
return mlc_tbl[pg];
case TLC:
//printf("tlc_tblget_page地址=%p\n",tlc_tbl);
return tlc_tbl[pg];
case QLC:
return qlc_tbl[pg];
default:
abort();
}
}
static inline int64_t get_page_read_latency(int flash_type, int page_type)
{
static bool get_page_read_latency_first_in=0;
if(get_page_read_latency_first_in==0){
nand_flash_timing = (NandFlashTiming) {
/* From low pages to high/upper pages */
/* Nand Page Read */
.pg_rd_lat[SLC] = {
[SLC_PAGE] = SLC_PAGE_READ_LATENCY_NS,
},
.pg_rd_lat[MLC] = {
[MLC_LOWER_PAGE] = MLC_LOWER_PAGE_READ_LATENCY_NS,
[MLC_UPPER_PAGE] = MLC_UPPER_PAGE_READ_LATENCY_NS
},
.pg_rd_lat[TLC] = {
[TLC_LOWER_PAGE] = TLC_LOWER_PAGE_READ_LATENCY_NS,
[TLC_CENTER_PAGE] = TLC_CENTER_PAGE_READ_LATENCY_NS,
[TLC_UPPER_PAGE] = TLC_UPPER_PAGE_READ_LATENCY_NS,
},
.pg_rd_lat[QLC] = {
[QLC_LOWER_PAGE] = QLC_LOWER_PAGE_READ_LATENCY_NS,
[QLC_LOWER_CENTER_PAGE] = QLC_CENTER_LOWER_PAGE_READ_LATENCY_NS,
[QLC_UPPER_CENTER_PAGE] = QLC_CENTER_UPPER_PAGE_READ_LATENCY_NS,
[QLC_UPPER_PAGE] = QLC_UPPER_PAGE_READ_LATENCY_NS,
},
/* Nand Page Write */
.pg_wr_lat[SLC] = {
[SLC_PAGE] = SLC_PAGE_WRITE_LATENCY_NS,
},
.pg_wr_lat[MLC] = {
[MLC_LOWER_PAGE] = MLC_LOWER_PAGE_WRITE_LATENCY_NS,
[MLC_UPPER_PAGE] = MLC_UPPER_PAGE_WRITE_LATENCY_NS
},
.pg_wr_lat[TLC] = {
[TLC_LOWER_PAGE] = TLC_LOWER_PAGE_WRITE_LATENCY_NS,
[TLC_CENTER_PAGE] = TLC_CENTER_PAGE_WRITE_LATENCY_NS,
[TLC_UPPER_PAGE] = TLC_UPPER_PAGE_WRITE_LATENCY_NS,
},
.pg_wr_lat[QLC] = {
[QLC_LOWER_PAGE] = QLC_LOWER_PAGE_WRITE_LATENCY_NS,
[QLC_LOWER_CENTER_PAGE] = QLC_CENTER_LOWER_PAGE_WRITE_LATENCY_NS,
[QLC_UPPER_CENTER_PAGE] = QLC_CENTER_UPPER_PAGE_WRITE_LATENCY_NS,
[QLC_UPPER_PAGE] = QLC_UPPER_PAGE_WRITE_LATENCY_NS,
},
/* Nand Block Erase */
.blk_er_lat = {
[SLC] = SLC_BLOCK_ERASE_LATENCY_NS,
[MLC] = MLC_BLOCK_ERASE_LATENCY_NS,
[TLC] = TLC_BLOCK_ERASE_LATENCY_NS,
[QLC] = QLC_BLOCK_ERASE_LATENCY_NS,
},
/* Nand Page Channel Transfer */
.chnl_pg_xfer_lat = {
[SLC] = SLC_CHNL_PAGE_TRANSFER_LATENCY_NS,
[MLC] = MLC_CHNL_PAGE_TRANSFER_LATENCY_NS,
[TLC] = TLC_CHNL_PAGE_TRANSFER_LATENCY_NS,
[QLC] = QLC_CHNL_PAGE_TRANSFER_LATENCY_NS,
},
};
get_page_read_latency_first_in=1;
}
return nand_flash_timing.pg_rd_lat[flash_type][page_type];
}
from femu.
Good to know!
from femu.
Related Issues (20)
- The guest would be broken down when I intentionally made some mistakes with the ZNS SSD simulated by FEMU. HOT 2
- where is the log in FEMU? HOT 2
- Could FEMU process requests in parallel? HOT 1
- function address_space_rw mistakes the parameter HOT 1
- ftl_thread number HOT 2
- a bug in the function declaration "nvme_discontig" in "nvme.h" HOT 1
- Black-ssd HOT 1
- Dose FEMU require certain configuration of Linux kernel when emulating zns? HOT 2
- TLC+SLC HOT 1
- How can i add a OS-SSD NVME command? HOT 3
- The emulated devices disappeared in /dev HOT 1
- what is the simplest way to insert modified zns module in guest os? HOT 1
- Problem when write to the drive under whitebox mode. HOT 2
- Implement namespace in black box mode HOT 1
- how can i configure zone size in femu zns mode? HOT 6
- How to emulate GC impact with FEMU HOT 2
- Many problems with the current ZNS delay emulation code, DO NOT use it !!! HOT 2
- Can I simulate a QLC SSD in BB mode?
- when I use the SHA 76a9d8e333f081a9df30b5f8706e9be81517665c to compile femu,It produces the error outside array bounds. HOT 3
- Can FEMU simulate the difference in sequential and random read/write performance on SSD?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from femu.