gem5  v22.1.0.0
Public Member Functions | Protected Attributes | List of all members
gem5::VirtIORng::RngQueue Class Reference

Virtqueue for data going from the host to the guest. More...

#include <rng 2.hh>

Inheritance diagram for gem5::VirtIORng::RngQueue:
gem5::VirtQueue gem5::VirtQueue gem5::Serializable gem5::Serializable

Public Member Functions

 RngQueue (PortProxy &proxy, ByteOrder bo, uint16_t size, VirtIORng &_parent)
 
virtual ~RngQueue ()
 
void onNotify ()
 Notify queue of pending events. More...
 
void trySend ()
 Try to send data pending data from the terminal. More...
 
std::string name () const
 
 RngQueue (PortProxy &proxy, ByteOrder bo, uint16_t size, VirtIORng &_parent)
 
virtual ~RngQueue ()
 
void onNotify ()
 Notify queue of pending events. More...
 
void trySend ()
 Try to send data pending data from the terminal. More...
 
std::string name () const
 
- Public Member Functions inherited from gem5::VirtQueue
virtual ~VirtQueue ()
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
void reset ()
 Reset cached state in this queue and in the associated ring buffers. More...
 
void setAddress (Addr address)
 Set the base address of this queue. More...
 
Addr getAddress () const
 Get the guest physical address of this queue. More...
 
uint16_t getSize () const
 Get the number of descriptors available in this queue. More...
 
VirtDescriptorgetDescriptor (VirtDescriptor::Index index)
 Get a pointer to a specific descriptor in the queue. More...
 
VirtDescriptorconsumeDescriptor ()
 Get an incoming descriptor chain from the queue. More...
 
void produceDescriptor (VirtDescriptor *desc, uint32_t len)
 Send a descriptor chain to the guest. More...
 
virtual void onNotifyDescriptor (VirtDescriptor *desc)
 Notify queue of pending incoming descriptor. More...
 
void dump () const
 Dump the contents of a queue. More...
 
- Public Member Functions inherited from gem5::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)
 

Protected Attributes

VirtIORngparent
 
- Protected Attributes inherited from gem5::VirtQueue
ByteOrder byteOrder
 Byte order in this queue. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 
- Static Public Attributes inherited from gem5::VirtQueue
static const Addr ALIGN_BITS = 12
 Page size used by VirtIO. It's hard-coded to 4096 bytes in the spec for historical reasons. More...
 
static const Addr ALIGN_SIZE = 1 << ALIGN_BITS
 
- Protected Member Functions inherited from gem5::VirtQueue
 VirtQueue (PortProxy &proxy, ByteOrder bo, uint16_t size)
 Instantiate a new virtqueue. More...
 

Detailed Description

Virtqueue for data going from the host to the guest.

Definition at line 73 of file rng 2.hh.

Constructor & Destructor Documentation

◆ RngQueue() [1/2]

gem5::VirtIORng::RngQueue::RngQueue ( PortProxy proxy,
ByteOrder  bo,
uint16_t  size,
VirtIORng _parent 
)

Definition at line 60 of file rng 2.cc.

◆ ~RngQueue() [1/2]

virtual gem5::VirtIORng::RngQueue::~RngQueue ( )
inlinevirtual

Definition at line 79 of file rng 2.hh.

◆ RngQueue() [2/2]

gem5::VirtIORng::RngQueue::RngQueue ( PortProxy proxy,
ByteOrder  bo,
uint16_t  size,
VirtIORng _parent 
)

◆ ~RngQueue() [2/2]

virtual gem5::VirtIORng::RngQueue::~RngQueue ( )
inlinevirtual

Definition at line 79 of file rng.hh.

Member Function Documentation

◆ name() [1/2]

std::string gem5::VirtIORng::RngQueue::name ( ) const
inline

Definition at line 86 of file rng 2.hh.

References gem5::Named::name(), and parent.

◆ name() [2/2]

std::string gem5::VirtIORng::RngQueue::name ( ) const
inline

Definition at line 86 of file rng.hh.

References gem5::Named::name(), and parent.

◆ onNotify() [1/2]

void gem5::VirtIORng::RngQueue::onNotify ( )
inlinevirtual

Notify queue of pending events.

This method is called by VirtIODeviceBase::onNotify() to notify the device model of pending data in a virtqueue. The default implementation of this method iterates over the available descriptor chains and calls onNotifyDescriptor() for every new incoming chain.

Device models should normally overload one of onNotify() and onNotifyDescriptor().

Reimplemented from gem5::VirtQueue.

Definition at line 81 of file rng 2.hh.

References trySend().

◆ onNotify() [2/2]

void gem5::VirtIORng::RngQueue::onNotify ( )
inlinevirtual

Notify queue of pending events.

This method is called by VirtIODeviceBase::onNotify() to notify the device model of pending data in a virtqueue. The default implementation of this method iterates over the available descriptor chains and calls onNotifyDescriptor() for every new incoming chain.

Device models should normally overload one of onNotify() and onNotifyDescriptor().

Reimplemented from gem5::VirtQueue.

Definition at line 81 of file rng.hh.

References trySend().

◆ trySend() [1/2]

void gem5::VirtIORng::RngQueue::trySend ( )

Try to send data pending data from the terminal.

Definition at line 74 of file rng 2.cc.

References gem5::ArmISA::d, DPRINTF, len, gem5::Random::random(), and gem5::random_mt.

Referenced by onNotify().

◆ trySend() [2/2]

void gem5::VirtIORng::RngQueue::trySend ( )

Try to send data pending data from the terminal.

Member Data Documentation

◆ parent

VirtIORng & gem5::VirtIORng::RngQueue::parent
protected

Definition at line 89 of file rng 2.hh.

Referenced by name().


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

Generated on Wed Dec 21 2022 10:23:22 for gem5 by doxygen 1.9.1