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