gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ()
 
BaseMasterPortgetMasterPort ()
 
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
 
EventWrapper
< CopyEngineChannel,&CopyEngineChannel::fetchDescComplete
fetchCompleteEvent
 
EventWrapper
< CopyEngineChannel,&CopyEngineChannel::fetchAddrComplete
addrCompleteEvent
 
EventWrapper
< CopyEngineChannel,&CopyEngineChannel::readCopyBytesComplete
readCompleteEvent
 
EventWrapper
< CopyEngineChannel,&CopyEngineChannel::writeCopyBytesComplete
writeCompleteEvent
 
EventWrapper
< CopyEngineChannel,&CopyEngineChannel::writeStatusComplete
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

Enumerator
Idle 
AddressFetch 
DescriptorFetch 
DMARead 
DMAWrite 
CompletionWrite 

Definition at line 84 of file copy_engine.hh.

Constructor & Destructor Documentation

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

Definition at line 108 of file copy_engine.cc.

Member Function Documentation

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

Definition at line 146 of file copy_engine.hh.

References ce, channelId, CPA::cpa(), CPA::FL_NONE, CPA::hwBegin(), and PioDevice::sys.

void CopyEngine::CopyEngineChannel::anDq ( )
inlineprivate

Definition at line 158 of file copy_engine.hh.

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

void CopyEngine::CopyEngineChannel::anPq ( )
inlineprivate

Definition at line 164 of file copy_engine.hh.

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

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

Definition at line 170 of file copy_engine.hh.

References ce, channelId, CPA::cpa(), CPA::FL_NONE, CPA::hwQ(), X86ISA::size(), and PioDevice::sys.

void CopyEngine::CopyEngineChannel::anWait ( )
inlineprivate

Definition at line 152 of file copy_engine.hh.

References ce, channelId, CPA::cpa(), CPA::FL_NONE, CPA::hwWe(), and PioDevice::sys.

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

Definition at line 553 of file copy_engine.cc.

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 650 of file copy_engine.cc.

References MipsISA::ce, DPRINTF, Drained, Draining, and Running.

void CopyEngine::CopyEngineChannel::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from Drainable.

Definition at line 741 of file copy_engine.cc.

References DPRINTF.

void CopyEngine::CopyEngineChannel::fetchAddrComplete ( )
private

Definition at line 619 of file copy_engine.cc.

References DPRINTF.

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

Definition at line 446 of file copy_engine.cc.

References MipsISA::ce, DPRINTF, and MemCmd::ReadReq.

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

Definition at line 607 of file copy_engine.cc.

References MipsISA::ce, DPRINTF, and MemCmd::ReadReq.

BaseMasterPort & CopyEngine::CopyEngineChannel::getMasterPort ( )

Definition at line 131 of file copy_engine.cc.

bool CopyEngine::CopyEngineChannel::inDrain ( )
private
std::string CopyEngine::CopyEngineChannel::name ( )
inline

Definition at line 100 of file copy_engine.hh.

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

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

Definition at line 101 of file copy_engine.hh.

References panic.

void CopyEngine::CopyEngineChannel::readCopyBytes ( )
private

Definition at line 496 of file copy_engine.cc.

References MipsISA::ce, DPRINTF, and MemCmd::ReadReq.

void CopyEngine::CopyEngineChannel::readCopyBytesComplete ( )
private

Definition at line 507 of file copy_engine.cc.

References DPRINTF.

void CopyEngine::CopyEngineChannel::recvCommand ( )
private

Definition at line 137 of file copy_engine.cc.

References MipsISA::ce, panic, and Running.

void CopyEngine::CopyEngineChannel::restartStateMachine ( )
private

Definition at line 715 of file copy_engine.cc.

References panic.

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 679 of file copy_engine.cc.

References arrayParamOut(), MipsISA::ce, SERIALIZE_ARRAY, and SERIALIZE_SCALAR.

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 696 of file copy_engine.cc.

References arrayParamIn(), MipsISA::ce, UNSERIALIZE_ARRAY, and UNSERIALIZE_SCALAR.

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

Definition at line 103 of file copy_engine.hh.

References panic.

void CopyEngine::CopyEngineChannel::writeCompletionStatus ( )
private

Definition at line 586 of file copy_engine.cc.

References MipsISA::ce, DPRINTF, and MemCmd::WriteReq.

void CopyEngine::CopyEngineChannel::writeCopyBytes ( )
private

Definition at line 517 of file copy_engine.cc.

References MipsISA::ce, DPRINTF, and MemCmd::WriteReq.

void CopyEngine::CopyEngineChannel::writeCopyBytesComplete ( )
private

Definition at line 532 of file copy_engine.cc.

References CopyEngineReg::DESC_CTRL_CP_STS, and DPRINTF.

void CopyEngine::CopyEngineChannel::writeStatusComplete ( )
private

Definition at line 600 of file copy_engine.cc.

References DPRINTF.

Member Data Documentation

EventWrapper<CopyEngineChannel, &CopyEngineChannel::fetchAddrComplete> CopyEngine::CopyEngineChannel::addrCompleteEvent
private

Definition at line 124 of file copy_engine.hh.

bool CopyEngine::CopyEngineChannel::busy
private

Definition at line 73 of file copy_engine.hh.

CopyEngine* CopyEngine::CopyEngineChannel::ce
private

Definition at line 67 of file copy_engine.hh.

Referenced by anBegin(), anDq(), anPq(), anQ(), anWait(), CopyEngineChannel(), and name().

DmaPort CopyEngine::CopyEngineChannel::cePort
private

Definition at line 66 of file copy_engine.hh.

int CopyEngine::CopyEngineChannel::channelId
private

Definition at line 69 of file copy_engine.hh.

Referenced by anBegin(), anDq(), anPq(), anQ(), anWait(), and name().

uint64_t CopyEngine::CopyEngineChannel::completionDataReg
private

Definition at line 82 of file copy_engine.hh.

uint8_t* CopyEngine::CopyEngineChannel::copyBuffer
private

Definition at line 71 of file copy_engine.hh.

Referenced by CopyEngineChannel().

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

Definition at line 68 of file copy_engine.hh.

Referenced by CopyEngineChannel().

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

Definition at line 70 of file copy_engine.hh.

Referenced by CopyEngineChannel().

Addr CopyEngine::CopyEngineChannel::fetchAddress
private

Definition at line 77 of file copy_engine.hh.

EventWrapper<CopyEngineChannel, &CopyEngineChannel::fetchDescComplete> CopyEngine::CopyEngineChannel::fetchCompleteEvent
private

Definition at line 119 of file copy_engine.hh.

Addr CopyEngine::CopyEngineChannel::lastDescriptorAddr
private

Definition at line 76 of file copy_engine.hh.

Tick CopyEngine::CopyEngineChannel::latAfterCompletion
private

Definition at line 80 of file copy_engine.hh.

Tick CopyEngine::CopyEngineChannel::latBeforeBegin
private

Definition at line 79 of file copy_engine.hh.

ChannelState CopyEngine::CopyEngineChannel::nextState
private

Definition at line 93 of file copy_engine.hh.

EventWrapper<CopyEngineChannel, &CopyEngineChannel::readCopyBytesComplete> CopyEngine::CopyEngineChannel::readCompleteEvent
private

Definition at line 129 of file copy_engine.hh.

bool CopyEngine::CopyEngineChannel::refreshNext
private

Definition at line 75 of file copy_engine.hh.

EventWrapper<CopyEngineChannel, &CopyEngineChannel::writeStatusComplete> CopyEngine::CopyEngineChannel::statusCompleteEvent
private

Definition at line 139 of file copy_engine.hh.

bool CopyEngine::CopyEngineChannel::underReset
private

Definition at line 74 of file copy_engine.hh.

EventWrapper<CopyEngineChannel, &CopyEngineChannel::writeCopyBytesComplete> CopyEngine::CopyEngineChannel::writeCompleteEvent
private

Definition at line 134 of file copy_engine.hh.


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

Generated on Fri Jun 9 2017 13:04:06 for gem5 by doxygen 1.8.6