gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 MemObject ClockedObject SimObject Clocked EventManager Serializable Drainable

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
 
virtual AddrRangeList getAddrRanges () const
 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
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
virtual BaseSlavePortgetSlavePort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a slave port with a given name and index. More...
 
- Public Member Functions inherited from MemObject
const Paramsparams () const
 
 MemObject (const Params *params)
 
virtual BaseMasterPortgetMasterPort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a master 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...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
void regStats () override
 Register statistics for this 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 resetStats ()
 Reset statistics associated with this object. 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
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
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)
 
void setCurTick (Tick newVal)
 
- 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 Clocked
void updateClockPeriod () const
 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...
 
- Protected Member Functions inherited from AmbaDevice
bool readId (PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
 

Protected Attributes

EventWrapper< Pl011,&Pl011::generateInterruptintEvent
 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...
 
BaseGic *const gic
 Gic to use for interrupting. More...
 
const bool endOnEOT
 Should the simulation end on an EOT. More...
 
const int intNum
 Interrupt number to generate. More...
 
const Tick intDelay
 Delay before interrupting. More...
 
- Protected Attributes inherited from Uart
int status
 
Platformplatform
 
Terminalterm
 
MakeCallback< Uart,&Uart::dataAvailablecallbackDataAvail
 
- 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 pioPort
 The pioPort that handles the requests for us and provides us requests that it sees. More...
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- 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_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 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 MemObject
typedef MemObjectParams 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 ()
 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
 

Detailed Description

Definition at line 58 of file pl011.hh.

Constructor & Destructor Documentation

Pl011::Pl011 ( const Pl011Params *  p)

Definition at line 57 of file pl011.cc.

Member Function Documentation

void Pl011::clearInterrupts ( uint16_t  ints)
inlineprotected

Convenience function to clear interrupts.

See Also
setInterrupts
Parameters
intsSet of interrupts to clear

Definition at line 110 of file pl011.hh.

References imsc, rawInt, and setInterrupts().

Referenced by read(), and write().

void Pl011::dataAvailable ( )
overridevirtual

Inform the uart that there is data available.

Implements Uart.

Definition at line 247 of file pl011.cc.

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

Referenced by read(), and write().

void Pl011::generateInterrupt ( )
protected

Function to generate interrupt.

Definition at line 256 of file pl011.cc.

References DPRINTF, gic, imsc, intNum, maskInt(), rawInt, and BaseGic::sendInt().

uint16_t Pl011::maskInt ( ) const
inlineprotected

Masked interrupt status register.

Definition at line 113 of file pl011.hh.

References imsc, and rawInt.

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

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 103 of file pl011.hh.

References imsc, rawInt, and setInterrupts().

Referenced by dataAvailable(), and write().

Tick Pl011::read ( PacketPtr  pkt)
overridevirtual
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 286 of file pl011.cc.

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

void Pl011::setInterruptMask ( uint16_t  mask)
inlineprotected

Convenience function to update the interrupt mask.

See Also
setInterrupts
Parameters
maskNew interrupt mask

Definition at line 96 of file pl011.hh.

References rawInt, and setInterrupts().

Referenced by write().

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 268 of file pl011.cc.

References BaseGic::clearInt(), curTick(), gic, imsc, intDelay, intEvent, intNum, ArmISA::mask, maskInt(), rawInt, EventManager::schedule(), and Event::scheduled().

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

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 301 of file pl011.cc.

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

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 166 of file pl011.cc.

References clearInterrupts(), control, data, dataAvailable(), Terminal::dataAvailable(), DPRINTF, endOnEOT, exitSimLoop(), fbrd, Packet::get(), Packet::getAddr(), Packet::getSize(), ibrd, ifls, lcrh, Packet::makeAtomicResponse(), Terminal::out(), panic, BasicPioDevice::pioAddr, BasicPioDevice::pioDelay, BasicPioDevice::pioSize, raiseInterrupts(), setInterruptMask(), Uart::term, UART_CR, UART_DR, UART_FBRD, UART_IBRD, UART_ICR, UART_IFLS, UART_IMSC, UART_LCRH, and UART_TXINTR.

Member Data Documentation

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

Definition at line 119 of file pl011.hh.

Referenced by read().

uint16_t Pl011::control
protected

Definition at line 149 of file pl011.hh.

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

const bool Pl011::endOnEOT
protected

Should the simulation end on an EOT.

Definition at line 178 of file pl011.hh.

Referenced by write().

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().

BaseGic* const Pl011::gic
protected

Gic to use for interrupting.

Definition at line 175 of file pl011.hh.

Referenced by generateInterrupt(), and setInterrupts().

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().

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().

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().

const Tick Pl011::intDelay
protected

Delay before interrupting.

Definition at line 184 of file pl011.hh.

Referenced by setInterrupts().

EventWrapper<Pl011, &Pl011::generateInterrupt> Pl011::intEvent
protected

Wrapper to create an event out of the thing.

Definition at line 116 of file pl011.hh.

Referenced by setInterrupts().

const int Pl011::intNum
protected

Interrupt number to generate.

Definition at line 181 of file pl011.hh.

Referenced by generateInterrupt(), and setInterrupts().

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().

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().

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

Definition at line 146 of file pl011.hh.

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

Definition at line 139 of file pl011.hh.

const int Pl011::UART_CR = 0x030
staticprotected

Definition at line 130 of file pl011.hh.

Referenced by read(), and write().

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

Definition at line 138 of file pl011.hh.

const int Pl011::UART_DR = 0x000
staticprotected

Definition at line 120 of file pl011.hh.

Referenced by read(), and write().

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

Definition at line 140 of file pl011.hh.

const int Pl011::UART_FBRD = 0x028
staticprotected

Definition at line 128 of file pl011.hh.

Referenced by read(), and write().

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

Definition at line 144 of file pl011.hh.

const int Pl011::UART_FR = 0x018
staticprotected

Definition at line 121 of file pl011.hh.

Referenced by read().

const int Pl011::UART_FR_CTS = 0x001
staticprotected

Definition at line 122 of file pl011.hh.

Referenced by read().

const int Pl011::UART_FR_RXFE = 0x010
staticprotected

Definition at line 123 of file pl011.hh.

Referenced by read().

const int Pl011::UART_FR_RXFF = 0x040
staticprotected

Definition at line 125 of file pl011.hh.

Referenced by read().

const int Pl011::UART_FR_TXFE = 0x080
staticprotected

Definition at line 126 of file pl011.hh.

Referenced by read().

const int Pl011::UART_FR_TXFF = 0x020
staticprotected

Definition at line 124 of file pl011.hh.

const int Pl011::UART_IBRD = 0x024
staticprotected

Definition at line 127 of file pl011.hh.

Referenced by read(), and write().

const int Pl011::UART_ICR = 0x044
staticprotected

Definition at line 135 of file pl011.hh.

Referenced by write().

const int Pl011::UART_IFLS = 0x034
staticprotected

Definition at line 131 of file pl011.hh.

Referenced by read(), and write().

const int Pl011::UART_IMSC = 0x038
staticprotected

Definition at line 132 of file pl011.hh.

Referenced by read(), and write().

const int Pl011::UART_LCRH = 0x02C
staticprotected

Definition at line 129 of file pl011.hh.

Referenced by read(), and write().

const int Pl011::UART_MIS = 0x040
staticprotected

Definition at line 134 of file pl011.hh.

Referenced by read().

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

Definition at line 147 of file pl011.hh.

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

Definition at line 145 of file pl011.hh.

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

Definition at line 137 of file pl011.hh.

const int Pl011::UART_RIS = 0x03C
staticprotected

Definition at line 133 of file pl011.hh.

Referenced by read().

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

Definition at line 143 of file pl011.hh.

Referenced by dataAvailable(), and read().

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

Definition at line 141 of file pl011.hh.

Referenced by dataAvailable(), and read().

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 Fri Jun 9 2017 13:04:16 for gem5 by doxygen 1.8.6