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