OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
request_transform.h
Go to the documentation of this file.
1
2// request_transform.h for Cosmos+ OpenSSD
3// Copyright (c) 2017 Hanyang University ENC Lab.
4// Contributed by Yong Ho Song <yhsong@enc.hanyang.ac.kr>
5// Jaewook Kwak <jwkwak@enc.hanyang.ac.kr>
6//
7// This file is part of Cosmos+ OpenSSD.
8//
9// Cosmos+ OpenSSD is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 3, or (at your option)
12// any later version.
13//
14// Cosmos+ OpenSSD is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17// See the GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with Cosmos+ OpenSSD; see the file COPYING.
21// If not, see <http://www.gnu.org/licenses/>.
23
25// Company: ENC Lab. <http://enc.hanyang.ac.kr>
26// Engineer: Jaewook Kwak <jwkwak@enc.hanyang.ac.kr>
27//
28// Project Name: Cosmos+ OpenSSD
29// Design Name: Cosmos+ Firmware
30// Module Name: Request Scheduler
31// File Name: request_transform.h
32//
33// Version: v1.0.0
34//
35// Description:
36// - define parameters, data structure and functions of request scheduler
38
40// Revision History:
41//
42// * v1.0.0
43// - First draft
45
46#ifndef REQUEST_TRANSFORM_H_
47#define REQUEST_TRANSFORM_H_
48
49#include "ftl_config.h"
50#include "nvme/nvme.h"
51
52#define NVME_COMMAND_AUTO_COMPLETION_OFF 0
53#define NVME_COMMAND_AUTO_COMPLETION_ON 1
54
55#define ROW_ADDR_DEPENDENCY_CHECK_OPT_SELECT 0 // may need to increase the count of block info
56#define ROW_ADDR_DEPENDENCY_CHECK_OPT_RELEASE 1 // may need to decrease the count of block info
57
58#define BUF_DEPENDENCY_REPORT_BLOCKED 0
59#define BUF_DEPENDENCY_REPORT_PASS 1
60
61#define ROW_ADDR_DEPENDENCY_REPORT_BLOCKED 0
62#define ROW_ADDR_DEPENDENCY_REPORT_PASS 1
63
64#define ROW_ADDR_DEPENDENCY_TABLE_UPDATE_REPORT_DONE 0 // still blocked by buffer dependency
65#define ROW_ADDR_DEPENDENCY_TABLE_UPDATE_REPORT_SYNC 1 // buffer dependency info updated
66
79{
80 unsigned int permittedProgPage : 12; // the next page number to be programed in this block
81 unsigned int blockedReadReqCnt : 16; // the number of blocked read request on this block
82 unsigned int blockedEraseReqFlag : 1; // 1 if there is erase request blocked by the read request
83 unsigned int reserved0 : 3;
85
92{
95
97void ReqTransNvmeToSlice(unsigned int cmdSlotTag, unsigned int startLba, unsigned int nlb, unsigned int cmdCode);
99void IssueNvmeDmaReq(unsigned int reqSlotTag);
101
102void SelectLowLevelReqQ(unsigned int reqSlotTag);
103void ReleaseBlockedByBufDepReq(unsigned int reqSlotTag);
104void ReleaseBlockedByRowAddrDepReq(unsigned int chNo, unsigned int wayNo);
105
107
108/* -------------------------------------------------------------------------- */
109/* util macros for request scheduling */
110/* -------------------------------------------------------------------------- */
111
112#define ROW_ADDR_DEP_ENTRY(iCh, iWay, iBlk) (&rowAddrDependencyTablePtr->block[(iCh)][(iWay)][(iBlk)])
113
114#endif /* REQUEST_TRANSFORM_H_ */
#define USER_CHANNELS
Definition: ftl_config.h:207
#define MAIN_BLOCKS_PER_DIE
Definition: ftl_config.h:162
#define USER_WAYS
Definition: ftl_config.h:208
struct _ROW_ADDR_DEPENDENCY_ENTRY ROW_ADDR_DEPENDENCY_ENTRY
The dependency info of this physical block.
struct _ROW_ADDR_DEPENDENCY_TABLE ROW_ADDR_DEPENDENCY_TABLE
The row address dependency table for all the user blocks.
void ReleaseBlockedByRowAddrDepReq(unsigned int chNo, unsigned int wayNo)
Update the row address dependency of all the requests on the specified die.
void ReqTransSliceToLowLevel()
Data Buffer Manager. Handle all the pending slice requests.
void InitDependencyTable()
struct _ROW_ADDR_DEPENDENCY_TABLE * P_ROW_ADDR_DEPENDENCY_TABLE
void ReleaseBlockedByBufDepReq(unsigned int reqSlotTag)
Pop the specified request from the buffer dependency queue.
void IssueNvmeDmaReq(unsigned int reqSlotTag)
Allocate data buffer for the specified DMA request and inform the controller.
struct _ROW_ADDR_DEPENDENCY_ENTRY * P_ROW_ADDR_DEPENDENCY_ENTRY
void SelectLowLevelReqQ(unsigned int reqSlotTag)
Dispatch given NVMe/NAND request to corresponding request queue.
P_ROW_ADDR_DEPENDENCY_TABLE rowAddrDependencyTablePtr
void CheckDoneNvmeDmaReq()
void ReqTransNvmeToSlice(unsigned int cmdSlotTag, unsigned int startLba, unsigned int nlb, unsigned int cmdCode)
Split NVMe command into slice requests.
The dependency info of this physical block.
unsigned int blockedReadReqCnt
unsigned int permittedProgPage
unsigned int blockedEraseReqFlag
unsigned int reserved0
The row address dependency table for all the user blocks.
ROW_ADDR_DEPENDENCY_ENTRY block[USER_CHANNELS][USER_WAYS][MAIN_BLOCKS_PER_DIE]