Go to the documentation of this file.
142 #ifndef __DEV_ARM_UFS_DEVICE_HH__
143 #define __DEV_ARM_UFS_DEVICE_HH__
146 #include <functional>
151 #include "debug/UFSHostDevice.hh"
159 #include "params/UFSHostDevice.hh"
376 memset(
static_cast<void*
>(
this), 0,
sizeof(*
this));
877 void taskHandler(
struct UTPUPIUTaskReq* request_in,
878 uint32_t req_pos,
Addr finaladdress, uint32_t finalsize);
896 request_in,
int req_pos,
Addr finaladdress,
897 uint32_t finalsize, uint32_t done);
921 struct UTPUPIURSP request_out, uint32_t size,
944 int size, uint8_t*
destination, uint64_t SCSIDiskOffset,
947 uint8_t* SCSIDestination,
bool no_cache,
948 Event* additional_action);
957 sg_table_length,
struct UFSHCDSGEntry* sglist);
959 uint32_t sg_table_length,
960 struct UFSHCDSGEntry* sglist);
1215 #endif //__DEV_ARM_UFS_DEVICE_HH__
void setValues()
Initialization function.
Stats::Scalar totalWriteUFSTransactions
Logic unit information structure.
uint32_t vendorSpecific
vendor specific register
void readDevice(bool lastTransfer, Addr SCSIStart, uint32_t SCSISize, uint8_t *SCSIDestination, bool no_cache, Event *additional_action)
Dma transaction function: read device.
struct SCSIReply SCSICMDHandle(uint32_t *SCSI_msg)
SCSI command handle function; determines what the command is and returns a reply structure that allow...
Host Controller Interface This is a set of registers that allow the driver to control the transaction...
@ regControllerCapabilities
struct UTPTransferReqDesc * destination
Disk transfer burst information.
void commandHandler()
Command handler function.
void clearSignal()
Clear signal.
std::deque< struct transferInfo > SSDReadPending
Information from the Disk, waiting to be pushed to the DMA.
struct UTPUPIUTaskReq destination
Different events, and scenarios require different types of information.
void transferStart()
Transfer Start function.
UFSSCSIDevice(const UFSHostDeviceParams *p, uint32_t lun_id, const Callback &transfer_cb, const Callback &read_cb)
Constructor and destructor.
void readFlash(uint8_t *readaddr, uint64_t offset, uint32_t size)
Disk access functions.
struct UFSHCDSGEntry - UFSHCI PRD Entry baseAddr: Lower 32bit physical address DW-0 upperAddr: Upper ...
This is an interface between the disk interface (which will handle the disk data transactions) and th...
void SSDWriteStart()
SSD write start.
Callback memWriteCallback
@ regUTPTaskREQListRunStop
Stats::Histogram transactionLatency
Histogram of latencies.
uint32_t ORInterruptStatus
Operation and runtime registers.
uint32_t ORHostControllerStatus
uint32_t amountOfReadTransfers
std::deque< struct transferStart > transferStartInfo
void SSDReadStart(uint32_t total_read)
Start the transactions to (and from) the disk The host will queue all the transactions.
std::vector< UFSSCSIDevice * > UFSDevice
logic units connected to the UFS Host device Note again that the "device" as such is represented by o...
std::deque< struct transferInfo > SSDReadInfo
SSDReadInfo: Structure from disk to dma, that contains data, and helper info to get it to the right p...
@ SCSIReservationConflict
Callback signalDone
Callbacks between Host and Device.
uint64_t Tick
Tick count type.
static const unsigned int UTPTransferREQCOMPL
Bits of interest within UFS data packages.
HCIMem UFSHCIMem
Host controller memory.
void SSDReadDone()
SSD Read done; Determines if the final callback of the transaction should be made at the end of a rea...
void readCallback()
Read callback Call back function for the logic units to indicate the completion of a read action.
void unserialize(CheckpointIn &cp) override
Unserialize; needed to restore from checkpoints.
static const unsigned int UICCommandCOMPL
uint32_t ORHostControllerEnable
Stats::Scalar totalReadSSD
Amount of data read/written.
DrainState drain() override
Drain; needed to enable checkpoints.
bool finishedCommand() const
finished command.
uint32_t residualTransferCount
std::deque< struct transferInfo > SSDWriteinfo
Information from DMA transaction to disk.
Stats::Scalar maxDoorbell
std::deque< EventFunctionWrapper > transferEventQueue
void writeDevice(Event *additional_action, bool toDisk, Addr start, int size, uint8_t *destination, uint64_t SCSIDiskOffset, uint32_t lun_id)
DMA transfer functions These allow the host to push/pull the data to the memory The provided event in...
void SCSIStart()
Transfer SCSI function.
void readGarbage()
Read garbage A read from disk data structure can vary in size and is therefor allocated on creation.
DiskImage * flashDisk
The objects this model links to.
uint32_t TRUTRLBA
Transfer control registers.
struct UTPTransferReqDesc * RequestIn
bool transferCompleted
Signals to Host layer 1: signal for transaction completion 2: signal for read action completion.
std::deque< EventFunctionWrapper > writeDoneEvent
bool finishedRead() const
Finished read.
std::deque< EventFunctionWrapper > readDoneEvent
Transfer flow events Basically these events form two queues, one from memory to UFS device (DMA) and ...
const uint32_t capacityUpper
struct UPIUMessage message
void taskHandler(struct UTPUPIUTaskReq *request_in, uint32_t req_pos, Addr finaladdress, uint32_t finalsize)
Task handler function.
uint32_t HCCAP
Specify the host capabilities.
struct UTPUPIUHeader header
@ regUICErrorCodePHYAdapterLayer
uint16_t responseUPIUOffset
DrainState
Object drain/handover states.
This is a simple scalar statistic, like a counter.
Stats::Average averageSCSIQueue
Average Queue lengths.
struct UTPUPIURSP - Response UPIU structure header: UPIU header DW-0 to DW-2 residualTransferCount: R...
void SSDWriteDone()
SSD Write Done; This is the callback function for the memory model.
uint32_t countInt
interrupt verification This keeps track of the number of interrupts generated.
uint8_t responseUPIU[128]
struct UTPUPIUTaskReq - Task request UPIU structure header - UPIU header structure DW0 to DW-2 inputP...
Stats::Histogram idleTimes
void serialize(CheckpointOut &cp) const override
Serialize; needed to make checkpoints.
Stats::Average averageReadSSDQueue
Basic interface for accessing a disk image.
Stats::Average averageWriteSSDQueue
transferDoneInfo transferInfo
End of transfer information.
Callback deviceReadCallback
Stats::Scalar currentSCSIQueue
Queue lengths.
static const unsigned int UPIUHeaderDataIndWord1
void writeDone()
Write done After a DMA write with data intended for the disk, this function is called.
uint16_t responseUPIULength
void taskStart()
Task Start function.
void requestHandler()
Handler functions.
struct SCSIReply request_out_datain
SCSI reply structure, used for direct answering.
void checkDrain()
Checkdrain; needed to enable checkpoints.
void readCallback()
Functions to indicate that the action to the SSD has completed.
uint32_t commandDescBaseAddrHi
Callback memReadCallback
Callbacks between Device and Memory.
@ regUICErrorCodeDataLinkLayer
static const unsigned int recoveryPage[3]
uint8_t activeDoorbells
Statistics helper variables Active doorbells indicates how many doorbells are in teh process of being...
struct UTPUPIUHeader header
uint32_t ORInterruptEnable
std::deque< struct writeToDiskBurst > dmaWriteInfo
Information to get a DMA transaction.
UFS command flow state machine digraph CommandFlow{ node [fontsize=10]; IDLE -> transferHandler [ lab...
Stats::Formula averageWriteSSDBW
void setReadSignal()
set signal to indicate that the read action has been completed
void statusCheck(uint8_t status, uint8_t *sensecodelist)
Status of SCSI.
@ regUTPTransferREQListRunStop
uint32_t transferTrack
Track the transfer This is allows the driver to "group" certain transfers together by using a tag in ...
Stats::Scalar totalReadUFSTransactions
std::deque< EventFunctionWrapper > taskEventQueue
Multiple tasks transfers can be scheduled at once for the device, the only thing we know for sure abo...
Stats::Formula averageReadSSDBW
Average bandwidth for reads and writes.
device layer: This is your Logic unit This layer implements the SCSI functionality of the UFS Device ...
AddrRangeList getAddrRanges() const override
Address range functions.
std::deque< struct taskStart > taskInfo
When a task/transfer is started it needs information about the task/transfer it is about to perform.
Transfer start information.
void readDone()
Read done Started at the end of a transaction after the last read action.
void finalUTP()
final UTP, sends the last acknowledge data structure to the system; prepares the clean up functions.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
@ regUTPTransferREQDoorbell
const uint32_t blkSize
Logic unit dimensions.
Tick transactionStart[32]
Helper for latency stats These variables keep track of the latency for every doorbell.
struct LUNInfo lunInfo
Logic unit info; needed for SCSI Info messages and LU identification.
Stats::Scalar currentReadSSDQueue
static const unsigned int controlPage[3]
These pages are SCSI specific.
EventFunctionWrapper UTPEvent
Wait for the moment where we can send the last frame.
int readPendingNum
Track number of DMA transactions in progress.
void manageWriteTransfer(uint8_t LUN, uint64_t offset, uint32_t sg_table_length, struct UFSHCDSGEntry *sglist)
Disk transfer management functions these set up the queues, and initiated them, leading to the data t...
Stats::Formula curDoorbell
Number of doorbells rung.
@ regUICErrorCodeNetworkLayer
std::deque< struct SCSIResumeInfo > SCSIInfoQueue
Information message queues, as there can be multiple messages queued for handling in this system.
static const unsigned int UPIUHeaderDataIndWord0
transfer completion info.
AbstractNVM * flashDevice
const Addr pioAddr
Host controller information.
A stat that calculates the per tick average of a value.
struct UTPTransferCMDDesc - UFS Commad Descriptor structure commandUPIU: Command UPIU Frame address r...
@ regUTPTransferREQListBaseL
uint32_t taskCommandTrack
void generateInterrupt()
set interrupt and sort out the doorbell register.
uint32_t commandDescBaseAddrLo
struct UTPUPIUHeader header
void transferHandler(struct UTPTransferReqDesc *request_in, int req_pos, Addr finaladdress, uint32_t finalsize, uint32_t done)
Transfer handler function.
struct UFSHostDevice::UTPTransferReqDesc::RequestDescHeader header
struct UFSHCDSGEntry PRDTable[128]
void regStats() override
register statistics
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint32_t CMDUICCMDR
Command registers.
@ regUTPTransferREQListClear
void clearInterrupt()
Interrupt control functions.
struct UFSHostDeviceStats stats
RequestHandler stats.
static const unsigned int cachingPage[5]
Tick read(PacketPtr pkt) override
register access functions
std::deque< struct transferInfo > SSDWriteDoneInfo
SSDWriteDoneInfo: Structure from dma to disk, that contains data, and helper info to get it to the ri...
void clearReadSignal()
Clear signal.
Stats::Scalar totalReadDiskTransactions
static const unsigned int UPIUHeaderDataIndWord2
Tick write(PacketPtr pkt) override
UFSHCD write function.
Stats::Scalar totalWrittenSSD
std::vector< uint8_t > destination
After a SCSI command has been identified, the SCSI resume function will handle it.
std::ostream CheckpointOut
std::vector< uint32_t > dataMsg
void transferDone(Addr responseStartAddr, uint32_t req_pos, struct UTPUPIURSP request_out, uint32_t size, Addr address, uint8_t *destination, bool finished, uint32_t lun_id)
transfer done, the beginning of the final stage of the transfer.
void setSignal()
set signal to indicate that the transaction has been completed.
std::deque< struct UTPTransferReqDesc * > garbage
garbage queue, ensure clearing of the allocated memory
@ regUTPTransferREQListBaseH
static const unsigned int UICCommandReady
Stats::Average averageDoorbell
uint32_t TMUTMRLBA
Task control registers.
std::deque< EventFunctionWrapper > readGarbageEventQueue
Event after a read to clean up the UTP data structures.
uint32_t amountOfWriteTransfers
transaction progress tracking
void LUNSignal()
LU callback function to indicate that the action has completed.
std::vector< uint8_t > buffer
void SCSIResume(uint32_t lun_id)
Starts the scsi handling function in the apropriate Logic unit, prepares the right data transfer sche...
Stats::Scalar totalWriteDiskTransactions
UFSHostDevice(const UFSHostDeviceParams *p)
Constructor for the UFS Host device.
std::function< void()> Callback
struct SCSIResumeInfo SCSIInfo
SCSI resume info information structure for SCSI resume.
struct UTPTransferReqDesc - UTRD structure header: UTRD header DW-0 to DW-3 commandDescBaseAddrLo: UC...
@ regUTPTransferREQINTAGGControl
EventFunctionWrapper SCSIResumeEvent
The events that control the functionality.
@ regUICErrorCodeTransportLayer
struct UTPUPIURSP requestOut
void setTotalWrite(uint32_t total_write)
Sets total amount of write transactions that needs to be made.
static const unsigned int UTPTaskREQCOMPL
void manageReadTransfer(uint32_t size, uint32_t LUN, uint64_t offset, uint32_t sg_table_length, struct UFSHCDSGEntry *sglist)
Manage read transfer.
Stats::Scalar currentWriteSSDQueue
const uint32_t capacityLower
void writeFlash(uint8_t *writeaddr, uint64_t offset, uint32_t size)
Write flash.
uint32_t totalRead
Total amount transactions that need to be made.
std::deque< struct transferStart > transferEnd
To finish the transaction one needs information about the original message.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:10 for gem5 by doxygen 1.8.17