gem5  v19.0.0.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CopyEngine::CopyEngineChannel Class Reference
Inheritance diagram for CopyEngine::CopyEngineChannel:
Drainable Serializable

Public Member Functions

 CopyEngineChannel (CopyEngine *_ce, int cid)
 
virtual ~CopyEngineChannel ()
 
PortgetPort ()
 
std::string name ()
 
virtual Tick read (PacketPtr pkt)
 
virtual Tick write (PacketPtr pkt)
 
void channelRead (PacketPtr pkt, Addr daddr, int size)
 
void channelWrite (PacketPtr pkt, Addr daddr, int size)
 
DrainState drain () override
 Notify an object that it needs to drain its state. More...
 
void drainResume () override
 Resume execution after a successful drain. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Types

enum  ChannelState {
  Idle, AddressFetch, DescriptorFetch, DMARead,
  DMAWrite, CompletionWrite
}
 

Private Member Functions

void fetchDescriptor (Addr address)
 
void fetchDescComplete ()
 
void fetchNextAddr (Addr address)
 
void fetchAddrComplete ()
 
void readCopyBytes ()
 
void readCopyBytesComplete ()
 
void writeCopyBytes ()
 
void writeCopyBytesComplete ()
 
void writeCompletionStatus ()
 
void writeStatusComplete ()
 
void continueProcessing ()
 
void recvCommand ()
 
bool inDrain ()
 
void restartStateMachine ()
 
void anBegin (const char *s)
 
void anWait ()
 
void anDq ()
 
void anPq ()
 
void anQ (const char *s, uint64_t id, int size=1)
 

Private Attributes

DmaPort cePort
 
CopyEnginece
 
CopyEngineReg::ChanRegs cr
 
int channelId
 
CopyEngineReg::DmaDesccurDmaDesc
 
uint8_t * copyBuffer
 
bool busy
 
bool underReset
 
bool refreshNext
 
Addr lastDescriptorAddr
 
Addr fetchAddress
 
Tick latBeforeBegin
 
Tick latAfterCompletion
 
uint64_t completionDataReg
 
ChannelState nextState
 
EventFunctionWrapper fetchCompleteEvent
 
EventFunctionWrapper addrCompleteEvent
 
EventFunctionWrapper readCompleteEvent
 
EventFunctionWrapper writeCompleteEvent
 
EventFunctionWrapper statusCompleteEvent
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 

Detailed Description

Definition at line 63 of file copy_engine.hh.

Member Enumeration Documentation

◆ ChannelState

Enumerator
Idle 
AddressFetch 
DescriptorFetch 
DMARead 
DMAWrite 
CompletionWrite 

Definition at line 84 of file copy_engine.hh.

Constructor & Destructor Documentation

◆ CopyEngineChannel()

CopyEngine::CopyEngineChannel::CopyEngineChannel ( CopyEngine _ce,
int  cid 
)

◆ ~CopyEngineChannel()

CopyEngine::CopyEngineChannel::~CopyEngineChannel ( )
virtual

Definition at line 110 of file copy_engine.cc.

References copyBuffer, and curDmaDesc.

Member Function Documentation

◆ anBegin()

void CopyEngine::CopyEngineChannel::anBegin ( const char *  s)
inlineprivate

◆ anDq()

void CopyEngine::CopyEngineChannel::anDq ( )
inlineprivate

Definition at line 153 of file copy_engine.hh.

References CPA::cpa(), CPA::FL_NONE, CPA::hwDq(), and PioDevice::sys.

Referenced by fetchDescriptor().

◆ anPq()

void CopyEngine::CopyEngineChannel::anPq ( )
inlineprivate

Definition at line 159 of file copy_engine.hh.

References CPA::cpa(), CPA::FL_NONE, CPA::hwDq(), and PioDevice::sys.

◆ anQ()

void CopyEngine::CopyEngineChannel::anQ ( const char *  s,
uint64_t  id,
int  size = 1 
)
inlineprivate

Definition at line 165 of file copy_engine.hh.

References CPA::cpa(), CPA::FL_NONE, CPA::hwQ(), and PioDevice::sys.

Referenced by writeCopyBytesComplete().

◆ anWait()

void CopyEngine::CopyEngineChannel::anWait ( )
inlineprivate

◆ channelRead()

void CopyEngine::CopyEngineChannel::channelRead ( PacketPtr  pkt,
Addr  daddr,
int  size 
)

◆ channelWrite()

void CopyEngine::CopyEngineChannel::channelWrite ( PacketPtr  pkt,
Addr  daddr,
int  size 
)

◆ continueProcessing()

void CopyEngine::CopyEngineChannel::continueProcessing ( )
private

◆ drain()

DrainState CopyEngine::CopyEngineChannel::drain ( )
overridevirtual

Notify an object that it needs to drain its state.

If the object does not need further simulation to drain internal buffers, it returns DrainState::Drained and automatically switches to the Drained state. If the object needs more simulation, it returns DrainState::Draining and automatically enters the Draining state. Other return values are invalid.

Note
An object that has entered the Drained state can be disturbed by other objects in the system and consequently stop being drained. These perturbations are not visible in the drain state. The simulator therefore repeats the draining process until all objects return DrainState::Drained on the first call to drain().
Returns
DrainState::Drained if the object is drained at this point in time, DrainState::Draining if it needs further simulation.

Implements Drainable.

Definition at line 656 of file copy_engine.cc.

References ce, DPRINTF, Drained, Draining, Drainable::drainState(), Idle, nextState, and Running.

Referenced by write().

◆ drainResume()

void CopyEngine::CopyEngineChannel::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from Drainable.

Definition at line 747 of file copy_engine.cc.

References CopyEngine::CopyEngine(), DPRINTF, nextState, and restartStateMachine().

Referenced by write().

◆ fetchAddrComplete()

void CopyEngine::CopyEngineChannel::fetchAddrComplete ( )
private

◆ fetchDescComplete()

void CopyEngine::CopyEngineChannel::fetchDescComplete ( )
private

◆ fetchDescriptor()

void CopyEngine::CopyEngineChannel::fetchDescriptor ( Addr  address)
private

◆ fetchNextAddr()

void CopyEngine::CopyEngineChannel::fetchNextAddr ( Addr  address)
private

◆ getPort()

Port & CopyEngine::CopyEngineChannel::getPort ( )

Definition at line 133 of file copy_engine.cc.

References cePort.

Referenced by CopyEngine::params().

◆ inDrain()

bool CopyEngine::CopyEngineChannel::inDrain ( )
private

◆ name()

std::string CopyEngine::CopyEngineChannel::name ( )
inline

Definition at line 100 of file copy_engine.hh.

References csprintf(), and SimObject::name().

Referenced by CopyEngineChannel(), and CopyEngine::regStats().

◆ read()

virtual Tick CopyEngine::CopyEngineChannel::read ( PacketPtr  pkt)
inlinevirtual

Definition at line 101 of file copy_engine.hh.

References panic.

Referenced by CopyEngine::params().

◆ readCopyBytes()

void CopyEngine::CopyEngineChannel::readCopyBytes ( )
private

◆ readCopyBytesComplete()

void CopyEngine::CopyEngineChannel::readCopyBytesComplete ( )
private

Definition at line 513 of file copy_engine.cc.

References DMAWrite, DPRINTF, inDrain(), nextState, and writeCopyBytes().

Referenced by CopyEngineChannel().

◆ recvCommand()

void CopyEngine::CopyEngineChannel::recvCommand ( )
private

◆ restartStateMachine()

void CopyEngine::CopyEngineChannel::restartStateMachine ( )
private

◆ serialize()

void CopyEngine::CopyEngineChannel::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 685 of file copy_engine.cc.

References arrayParamOut(), busy, ce, channelId, completionDataReg, copyBuffer, cr, curDmaDesc, fetchAddress, lastDescriptorAddr, nextState, CopyEngine::params(), refreshNext, CopyEngineReg::ChanRegs::serialize(), SERIALIZE_ARRAY, SERIALIZE_SCALAR, and underReset.

Referenced by CopyEngine::params(), and write().

◆ unserialize()

void CopyEngine::CopyEngineChannel::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 702 of file copy_engine.cc.

References arrayParamIn(), busy, ce, channelId, completionDataReg, copyBuffer, cr, curDmaDesc, fetchAddress, lastDescriptorAddr, nextState, CopyEngine::params(), refreshNext, underReset, CopyEngineReg::ChanRegs::unserialize(), UNSERIALIZE_ARRAY, and UNSERIALIZE_SCALAR.

Referenced by CopyEngine::params(), and write().

◆ write()

virtual Tick CopyEngine::CopyEngineChannel::write ( PacketPtr  pkt)
inlinevirtual

◆ writeCompletionStatus()

void CopyEngine::CopyEngineChannel::writeCompletionStatus ( )
private

◆ writeCopyBytes()

void CopyEngine::CopyEngineChannel::writeCopyBytes ( )
private

◆ writeCopyBytesComplete()

void CopyEngine::CopyEngineChannel::writeCopyBytesComplete ( )
private

◆ writeStatusComplete()

void CopyEngine::CopyEngineChannel::writeStatusComplete ( )
private

Definition at line 606 of file copy_engine.cc.

References continueProcessing(), and DPRINTF.

Referenced by CopyEngineChannel().

Member Data Documentation

◆ addrCompleteEvent

EventFunctionWrapper CopyEngine::CopyEngineChannel::addrCompleteEvent
private

Definition at line 122 of file copy_engine.hh.

Referenced by CopyEngineChannel(), and fetchNextAddr().

◆ busy

bool CopyEngine::CopyEngineChannel::busy
private

◆ ce

CopyEngine* CopyEngine::CopyEngineChannel::ce
private

◆ cePort

DmaPort CopyEngine::CopyEngineChannel::cePort
private

◆ channelId

int CopyEngine::CopyEngineChannel::channelId
private

◆ completionDataReg

uint64_t CopyEngine::CopyEngineChannel::completionDataReg
private

◆ copyBuffer

uint8_t* CopyEngine::CopyEngineChannel::copyBuffer
private

◆ cr

CopyEngineReg::ChanRegs CopyEngine::CopyEngineChannel::cr
private

◆ curDmaDesc

CopyEngineReg::DmaDesc* CopyEngine::CopyEngineChannel::curDmaDesc
private

◆ fetchAddress

Addr CopyEngine::CopyEngineChannel::fetchAddress
private

◆ fetchCompleteEvent

EventFunctionWrapper CopyEngine::CopyEngineChannel::fetchCompleteEvent
private

Definition at line 118 of file copy_engine.hh.

Referenced by fetchDescriptor().

◆ lastDescriptorAddr

Addr CopyEngine::CopyEngineChannel::lastDescriptorAddr
private

◆ latAfterCompletion

Tick CopyEngine::CopyEngineChannel::latAfterCompletion
private

Definition at line 80 of file copy_engine.hh.

Referenced by writeCompletionStatus().

◆ latBeforeBegin

Tick CopyEngine::CopyEngineChannel::latBeforeBegin
private

Definition at line 79 of file copy_engine.hh.

Referenced by fetchDescriptor().

◆ nextState

ChannelState CopyEngine::CopyEngineChannel::nextState
private

◆ readCompleteEvent

EventFunctionWrapper CopyEngine::CopyEngineChannel::readCompleteEvent
private

Definition at line 126 of file copy_engine.hh.

Referenced by CopyEngineChannel(), and readCopyBytes().

◆ refreshNext

bool CopyEngine::CopyEngineChannel::refreshNext
private

Definition at line 75 of file copy_engine.hh.

Referenced by continueProcessing(), recvCommand(), serialize(), and unserialize().

◆ statusCompleteEvent

EventFunctionWrapper CopyEngine::CopyEngineChannel::statusCompleteEvent
private

Definition at line 134 of file copy_engine.hh.

Referenced by CopyEngineChannel(), and writeCompletionStatus().

◆ underReset

bool CopyEngine::CopyEngineChannel::underReset
private

Definition at line 74 of file copy_engine.hh.

Referenced by continueProcessing(), recvCommand(), serialize(), and unserialize().

◆ writeCompleteEvent

EventFunctionWrapper CopyEngine::CopyEngineChannel::writeCompleteEvent
private

Definition at line 130 of file copy_engine.hh.

Referenced by CopyEngineChannel(), and writeCopyBytes().


The documentation for this class was generated from the following files:

Generated on Fri Feb 28 2020 16:27:09 for gem5 by doxygen 1.8.13