gem5  v20.1.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Pl011 Class Reference

#include <pl011.hh>

Inheritance diagram for Pl011:
Uart AmbaDevice BasicPioDevice PioDevice ClockedObject SimObject Clocked EventManager Serializable Drainable Stats::Group

Public Member Functions

 Pl011 (const Pl011Params *p)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Tick read (PacketPtr pkt) override
 Pure virtual function that the device must implement. More...
 
Tick write (PacketPtr pkt) override
 Pure virtual function that the device must implement. More...
 
void dataAvailable () override
 Inform the uart that there is data available. More...
 
- Public Member Functions inherited from Uart
 Uart (const Params *p, Addr pio_size)
 
const Paramsparams () const
 
bool intStatus ()
 Return if we have an interrupt pending. More...
 
- Public Member Functions inherited from BasicPioDevice
 BasicPioDevice (const Params *p, Addr size)
 
const Paramsparams () const
 
AddrRangeList getAddrRanges () const override
 Determine the address ranges that this device responds to. More...
 
- Public Member Functions inherited from PioDevice
 PioDevice (const Params *p)
 
virtual ~PioDevice ()
 
const Paramsparams () const
 
void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port with a given name and index. More...
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual void startup ()
 startup() is the final initialization call before simulation. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. 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 EventManager
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- 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)
 
- 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 Stats::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters. More...
 
virtual void resetStats ()
 Callback to reset stats. More...
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (Stats::Info *info)
 Register a stat with this group. More...
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object. More...
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object. More...
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block. More...
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from Clocked
void updateClockPeriod ()
 Update the tick to the current tick. More...
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More...
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge. More...
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More...
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 

Protected Member Functions

void generateInterrupt ()
 Function to generate interrupt. More...
 
void setInterrupts (uint16_t ints, uint16_t mask)
 Assign new interrupt values and update interrupt signals. More...
 
void setInterruptMask (uint16_t mask)
 Convenience function to update the interrupt mask. More...
 
void raiseInterrupts (uint16_t ints)
 Convenience function to raise a new interrupt. More...
 
void clearInterrupts (uint16_t ints)
 Convenience function to clear interrupts. More...
 
uint16_t maskInt () const
 Masked interrupt status register. More...
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 
virtual void clockPeriodUpdated ()
 A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More...
 
- Protected Member Functions inherited from AmbaDevice
bool readId (PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
 

Protected Attributes

EventFunctionWrapper intEvent
 Wrapper to create an event out of the thing. More...
 
uint16_t control
 
uint16_t fbrd
 fractional baud rate divisor. More...
 
uint16_t ibrd
 integer baud rate divisor. More...
 
uint16_t lcrh
 Line control register. More...
 
uint16_t ifls
 interrupt fifo level register. More...
 
uint16_t imsc
 interrupt mask register. More...
 
uint16_t rawInt
 raw interrupt status register More...
 
const bool endOnEOT
 Should the simulation end on an EOT. More...
 
ArmInterruptPin *const interrupt
 
const Tick intDelay
 Delay before interrupting. More...
 
- Protected Attributes inherited from Uart
int status
 
Platformplatform
 
SerialDevicedevice
 
- Protected Attributes inherited from BasicPioDevice
Addr pioAddr
 Address that the device listens to. More...
 
Addr pioSize
 Size that the device's address range. More...
 
Tick pioDelay
 Delay that the device experinces on an access. More...
 
- Protected Attributes inherited from PioDevice
Systemsys
 
PioPort< PioDevicepioPort
 The pioPort that handles the requests for us and provides us requests that it sees. More...
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Static Protected Attributes

static const uint64_t AMBA_ID = ULL(0xb105f00d00341011)
 
static const int UART_DR = 0x000
 
static const int UART_RSR = 0x004
 
static const int UART_ECR = 0x004
 
static const int UART_FR = 0x018
 
static const int UART_FR_CTS = 0x001
 
static const int UART_FR_RXFE = 0x010
 
static const int UART_FR_TXFF = 0x020
 
static const int UART_FR_RXFF = 0x040
 
static const int UART_FR_TXFE = 0x080
 
static const int UART_IBRD = 0x024
 
static const int UART_FBRD = 0x028
 
static const int UART_LCRH = 0x02C
 
static const int UART_CR = 0x030
 
static const int UART_IFLS = 0x034
 
static const int UART_IMSC = 0x038
 
static const int UART_RIS = 0x03C
 
static const int UART_MIS = 0x040
 
static const int UART_ICR = 0x044
 
static const int UART_DMACR = 0x048
 
static const uint16_t UART_RIINTR = 1 << 0
 
static const uint16_t UART_CTSINTR = 1 << 1
 
static const uint16_t UART_CDCINTR = 1 << 2
 
static const uint16_t UART_DSRINTR = 1 << 3
 
static const uint16_t UART_RXINTR = 1 << 4
 
static const uint16_t UART_TXINTR = 1 << 5
 
static const uint16_t UART_RTINTR = 1 << 6
 
static const uint16_t UART_FEINTR = 1 << 7
 
static const uint16_t UART_PEINTR = 1 << 8
 
static const uint16_t UART_BEINTR = 1 << 9
 
static const uint16_t UART_OEINTR = 1 << 10
 
- Static Protected Attributes inherited from AmbaDevice
static const int AMBA_PER_ID0 = 0xFE0
 
static const int AMBA_PER_ID1 = 0xFE4
 
static const int AMBA_PER_ID2 = 0xFE8
 
static const int AMBA_PER_ID3 = 0xFEC
 
static const int AMBA_CEL_ID0 = 0xFF0
 
static const int AMBA_CEL_ID1 = 0xFF4
 
static const int AMBA_CEL_ID2 = 0xFF8
 
static const int AMBA_CEL_ID3 = 0xFFC
 

Additional Inherited Members

- Public Types inherited from Uart
typedef UartParams Params
 
- Public Types inherited from BasicPioDevice
typedef BasicPioDeviceParams Params
 
- Public Types inherited from PioDevice
typedef PioDeviceParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 
- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Public Attributes inherited from ClockedObject
PowerStatepowerState
 

Detailed Description

Definition at line 55 of file pl011.hh.

Constructor & Destructor Documentation

◆ Pl011()

Pl011::Pl011 ( const Pl011Params *  p)

Definition at line 53 of file pl011.cc.

References generateInterrupt().

Member Function Documentation

◆ clearInterrupts()

void Pl011::clearInterrupts ( uint16_t  ints)
inlineprotected

Convenience function to clear interrupts.

See also
setInterrupts
Parameters
intsSet of interrupts to clear

Definition at line 107 of file pl011.hh.

References imsc, rawInt, and setInterrupts().

Referenced by read(), and write().

◆ dataAvailable()

void Pl011::dataAvailable ( )
overridevirtual

Inform the uart that there is data available.

Implements Uart.

Definition at line 260 of file pl011.cc.

References DPRINTF, raiseInterrupts(), UART_RTINTR, and UART_RXINTR.

Referenced by read(), and write().

◆ generateInterrupt()

void Pl011::generateInterrupt ( )
protected

Function to generate interrupt.

Definition at line 269 of file pl011.cc.

References DPRINTF, imsc, interrupt, maskInt(), ArmInterruptPin::raise(), and rawInt.

Referenced by Pl011().

◆ maskInt()

uint16_t Pl011::maskInt ( ) const
inlineprotected

Masked interrupt status register.

Definition at line 110 of file pl011.hh.

References imsc, and rawInt.

Referenced by generateInterrupt(), read(), and setInterrupts().

◆ raiseInterrupts()

void Pl011::raiseInterrupts ( uint16_t  ints)
inlineprotected

Convenience function to raise a new interrupt.

See also
setInterrupts
Parameters
intsSet of interrupts to raise

Definition at line 100 of file pl011.hh.

References imsc, rawInt, and setInterrupts().

Referenced by dataAvailable(), and write().

◆ read()

Tick Pl011::read ( PacketPtr  pkt)
overridevirtual

◆ serialize()

void Pl011::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 299 of file pl011.cc.

References control, DPRINTF, fbrd, ibrd, ifls, imsc, lcrh, paramOut(), rawInt, and SERIALIZE_SCALAR.

◆ setInterruptMask()

void Pl011::setInterruptMask ( uint16_t  mask)
inlineprotected

Convenience function to update the interrupt mask.

See also
setInterrupts
Parameters
maskNew interrupt mask

Definition at line 93 of file pl011.hh.

References ArmISA::mask, rawInt, and setInterrupts().

Referenced by write().

◆ setInterrupts()

void Pl011::setInterrupts ( uint16_t  ints,
uint16_t  mask 
)
protected

Assign new interrupt values and update interrupt signals.

A new interrupt is scheduled signalled if the set of unmasked interrupts goes empty to non-empty. Conversely, if the set of unmasked interrupts goes from non-empty to empty, the interrupt signal is cleared.

Parameters
intsNew raw interrupt status
maskNew interrupt mask

Definition at line 281 of file pl011.cc.

References ArmInterruptPin::clear(), curTick(), imsc, intDelay, interrupt, intEvent, ArmISA::mask, maskInt(), rawInt, EventManager::schedule(), and Event::scheduled().

Referenced by clearInterrupts(), raiseInterrupts(), and setInterruptMask().

◆ unserialize()

void Pl011::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 314 of file pl011.cc.

References control, DPRINTF, fbrd, ibrd, ifls, imsc, lcrh, paramIn(), rawInt, and UNSERIALIZE_SCALAR.

◆ write()

Tick Pl011::write ( PacketPtr  pkt)
overridevirtual

Pure virtual function that the device must implement.

Called when a write command is recieved by the port.

Parameters
pktPacket describing this request
Returns
number of ticks it took to complete

Implements PioDevice.

Definition at line 169 of file pl011.cc.

References clearInterrupts(), control, data, dataAvailable(), SerialDevice::dataAvailable(), Uart::device, DPRINTF, endOnEOT, exitSimLoop(), fbrd, Packet::getAddr(), Packet::getLE(), Packet::getSize(), ibrd, ifls, lcrh, Packet::makeAtomicResponse(), panic, BasicPioDevice::pioAddr, BasicPioDevice::pioDelay, BasicPioDevice::pioSize, raiseInterrupts(), setInterruptMask(), UART_CR, UART_DMACR, UART_DR, UART_ECR, UART_FBRD, UART_IBRD, UART_ICR, UART_IFLS, UART_IMSC, UART_LCRH, UART_TXINTR, warn, and SerialDevice::writeData().

Member Data Documentation

◆ AMBA_ID

const uint64_t Pl011::AMBA_ID = ULL(0xb105f00d00341011)
staticprotected

Definition at line 116 of file pl011.hh.

Referenced by read().

◆ control

uint16_t Pl011::control
protected

Definition at line 149 of file pl011.hh.

Referenced by read(), serialize(), unserialize(), and write().

◆ endOnEOT

const bool Pl011::endOnEOT
protected

Should the simulation end on an EOT.

Definition at line 175 of file pl011.hh.

Referenced by write().

◆ fbrd

uint16_t Pl011::fbrd
protected

fractional baud rate divisor.

Not used for anything but reporting written value

Definition at line 153 of file pl011.hh.

Referenced by read(), serialize(), unserialize(), and write().

◆ ibrd

uint16_t Pl011::ibrd
protected

integer baud rate divisor.

Not used for anything but reporting written value

Definition at line 157 of file pl011.hh.

Referenced by read(), serialize(), unserialize(), and write().

◆ ifls

uint16_t Pl011::ifls
protected

interrupt fifo level register.

Not used for anything but reporting written value

Definition at line 165 of file pl011.hh.

Referenced by read(), serialize(), unserialize(), and write().

◆ imsc

uint16_t Pl011::imsc
protected

interrupt mask register.

Definition at line 168 of file pl011.hh.

Referenced by clearInterrupts(), generateInterrupt(), maskInt(), raiseInterrupts(), read(), serialize(), setInterrupts(), and unserialize().

◆ intDelay

const Tick Pl011::intDelay
protected

Delay before interrupting.

Definition at line 180 of file pl011.hh.

Referenced by setInterrupts().

◆ interrupt

ArmInterruptPin* const Pl011::interrupt
protected

Definition at line 177 of file pl011.hh.

Referenced by generateInterrupt(), and setInterrupts().

◆ intEvent

EventFunctionWrapper Pl011::intEvent
protected

Wrapper to create an event out of the thing.

Definition at line 113 of file pl011.hh.

Referenced by setInterrupts().

◆ lcrh

uint16_t Pl011::lcrh
protected

Line control register.

Not used for anything but reporting written value

Definition at line 161 of file pl011.hh.

Referenced by read(), serialize(), unserialize(), and write().

◆ rawInt

uint16_t Pl011::rawInt
protected

raw interrupt status register

Definition at line 171 of file pl011.hh.

Referenced by clearInterrupts(), generateInterrupt(), maskInt(), raiseInterrupts(), read(), serialize(), setInterruptMask(), setInterrupts(), and unserialize().

◆ UART_BEINTR

const uint16_t Pl011::UART_BEINTR = 1 << 9
staticprotected

Definition at line 146 of file pl011.hh.

◆ UART_CDCINTR

const uint16_t Pl011::UART_CDCINTR = 1 << 2
staticprotected

Definition at line 139 of file pl011.hh.

◆ UART_CR

const int Pl011::UART_CR = 0x030
staticprotected

Definition at line 129 of file pl011.hh.

Referenced by read(), and write().

◆ UART_CTSINTR

const uint16_t Pl011::UART_CTSINTR = 1 << 1
staticprotected

Definition at line 138 of file pl011.hh.

◆ UART_DMACR

const int Pl011::UART_DMACR = 0x048
staticprotected

Definition at line 135 of file pl011.hh.

Referenced by read(), and write().

◆ UART_DR

const int Pl011::UART_DR = 0x000
staticprotected

Definition at line 117 of file pl011.hh.

Referenced by read(), and write().

◆ UART_DSRINTR

const uint16_t Pl011::UART_DSRINTR = 1 << 3
staticprotected

Definition at line 140 of file pl011.hh.

◆ UART_ECR

const int Pl011::UART_ECR = 0x004
staticprotected

Definition at line 119 of file pl011.hh.

Referenced by write().

◆ UART_FBRD

const int Pl011::UART_FBRD = 0x028
staticprotected

Definition at line 127 of file pl011.hh.

Referenced by read(), and write().

◆ UART_FEINTR

const uint16_t Pl011::UART_FEINTR = 1 << 7
staticprotected

Definition at line 144 of file pl011.hh.

◆ UART_FR

const int Pl011::UART_FR = 0x018
staticprotected

Definition at line 120 of file pl011.hh.

Referenced by read().

◆ UART_FR_CTS

const int Pl011::UART_FR_CTS = 0x001
staticprotected

Definition at line 121 of file pl011.hh.

Referenced by read().

◆ UART_FR_RXFE

const int Pl011::UART_FR_RXFE = 0x010
staticprotected

Definition at line 122 of file pl011.hh.

Referenced by read().

◆ UART_FR_RXFF

const int Pl011::UART_FR_RXFF = 0x040
staticprotected

Definition at line 124 of file pl011.hh.

Referenced by read().

◆ UART_FR_TXFE

const int Pl011::UART_FR_TXFE = 0x080
staticprotected

Definition at line 125 of file pl011.hh.

Referenced by read().

◆ UART_FR_TXFF

const int Pl011::UART_FR_TXFF = 0x020
staticprotected

Definition at line 123 of file pl011.hh.

◆ UART_IBRD

const int Pl011::UART_IBRD = 0x024
staticprotected

Definition at line 126 of file pl011.hh.

Referenced by read(), and write().

◆ UART_ICR

const int Pl011::UART_ICR = 0x044
staticprotected

Definition at line 134 of file pl011.hh.

Referenced by write().

◆ UART_IFLS

const int Pl011::UART_IFLS = 0x034
staticprotected

Definition at line 130 of file pl011.hh.

Referenced by read(), and write().

◆ UART_IMSC

const int Pl011::UART_IMSC = 0x038
staticprotected

Definition at line 131 of file pl011.hh.

Referenced by read(), and write().

◆ UART_LCRH

const int Pl011::UART_LCRH = 0x02C
staticprotected

Definition at line 128 of file pl011.hh.

Referenced by read(), and write().

◆ UART_MIS

const int Pl011::UART_MIS = 0x040
staticprotected

Definition at line 133 of file pl011.hh.

Referenced by read().

◆ UART_OEINTR

const uint16_t Pl011::UART_OEINTR = 1 << 10
staticprotected

Definition at line 147 of file pl011.hh.

◆ UART_PEINTR

const uint16_t Pl011::UART_PEINTR = 1 << 8
staticprotected

Definition at line 145 of file pl011.hh.

◆ UART_RIINTR

const uint16_t Pl011::UART_RIINTR = 1 << 0
staticprotected

Definition at line 137 of file pl011.hh.

◆ UART_RIS

const int Pl011::UART_RIS = 0x03C
staticprotected

Definition at line 132 of file pl011.hh.

Referenced by read().

◆ UART_RSR

const int Pl011::UART_RSR = 0x004
staticprotected

Definition at line 118 of file pl011.hh.

Referenced by read().

◆ UART_RTINTR

const uint16_t Pl011::UART_RTINTR = 1 << 6
staticprotected

Definition at line 143 of file pl011.hh.

Referenced by dataAvailable(), and read().

◆ UART_RXINTR

const uint16_t Pl011::UART_RXINTR = 1 << 4
staticprotected

Definition at line 141 of file pl011.hh.

Referenced by dataAvailable(), and read().

◆ UART_TXINTR

const uint16_t Pl011::UART_TXINTR = 1 << 5
staticprotected

Definition at line 142 of file pl011.hh.

Referenced by write().


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

Generated on Wed Sep 30 2020 14:02:29 for gem5 by doxygen 1.8.17