Go to the documentation of this file.
44 #include "debug/Checkpoint.hh"
45 #include "debug/Uart.hh"
50 #include "params/Pl011.hh"
56 control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12),
58 endOnEOT(
p->end_on_eot), interrupt(
p->interrupt->get()),
59 intDelay(
p->int_delay)
86 DPRINTF(
Uart,
"Re-raising interrupt due to more data "
87 "after UART_DR read\n");
103 "Reading FR register as %#x rawInt=0x%x "
104 "imsc=0x%x maskInt=0x%x\n",
134 warn(
"PL011: DMA not supported\n");
144 panic(
"Tried to read PL011 at offset %#x that doesn't exist\n", daddr);
159 panic(
"Uart read size too big?\n");
176 DPRINTF(
Uart,
" write register %#x value %#x size=%d\n", daddr,
195 panic(
"Uart write size too big?\n");
238 DPRINTF(
Uart,
"Re-raising interrupt due to more data after "
247 panic(
"Tried to enable DMA on PL011\n");
249 warn(
"PL011: DMA not supported\n");
252 panic(
"Tried to write PL011 at offset %#x that doesn't exist\n", daddr);
264 DPRINTF(
Uart,
"Data available, scheduling interrupt\n");
271 DPRINTF(
Uart,
"Generate Interrupt: imsc=0x%x rawInt=0x%x maskInt=0x%x\n",
283 const bool old_ints(!!
maskInt());
291 }
else if (old_ints && !
maskInt()) {
301 DPRINTF(Checkpoint,
"Serializing Arm PL011\n");
316 DPRINTF(Checkpoint,
"Unserializing Arm PL011\n");
330 Pl011Params::create()
332 return new Pl011(
this);
uint16_t ifls
interrupt fifo level register.
bool scheduled() const
Determine if the current event is scheduled.
static const uint16_t UART_RTINTR
void makeAtomicResponse()
Addr pioAddr
Address that the device listens to.
static const int UART_FBRD
static const uint64_t AMBA_ID
uint16_t ibrd
integer baud rate divisor.
#define UNSERIALIZE_SCALAR(scalar)
void setInterruptMask(uint16_t mask)
Convenience function to update the interrupt mask.
static const int UART_RIS
static const int UART_IFLS
virtual void clear()=0
Clear a signalled interrupt.
uint16_t lcrh
Line control register.
virtual void raise()=0
Signal an interrupt.
static const int UART_FR_CTS
uint64_t Tick
Tick count type.
static const int UART_IBRD
void unserialize(CheckpointIn &cp) override
Unserialize an object.
uint16_t maskInt() const
Masked interrupt status register.
void setInterrupts(uint16_t ints, uint16_t mask)
Assign new interrupt values and update interrupt signals.
const Tick intDelay
Delay before interrupting.
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
void serialize(CheckpointOut &cp) const override
Serialize an object.
static const int UART_IMSC
static const int UART_ECR
uint16_t rawInt
raw interrupt status register
void schedule(Event &event, Tick when)
static const int UART_FR_RXFE
void clearInterrupts(uint16_t ints)
Convenience function to clear interrupts.
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
static const int UART_ICR
virtual bool dataAvailable() const =0
Check if there is pending data from the serial device.
static const uint16_t UART_RXINTR
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
Addr pioSize
Size that the device's address range.
uint16_t imsc
interrupt mask register.
static const uint16_t UART_TXINTR
virtual uint8_t readData()=0
Read a character from the device.
void raiseInterrupts(uint16_t ints)
Convenience function to raise a new interrupt.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ArmInterruptPin *const interrupt
const std::string & name()
#define SERIALIZE_SCALAR(scalar)
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
static const int UART_FR_RXFF
uint16_t fbrd
fractional baud rate divisor.
void dataAvailable() override
Inform the uart that there is data available.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
static const int UART_RSR
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
void generateInterrupt()
Function to generate interrupt.
Tick pioDelay
Delay that the device experinces on an access.
void setLE(T v)
Set the value in the data pointer to v as little endian.
std::ostream CheckpointOut
virtual void writeData(uint8_t c)=0
Transmit a character from the host interface to the device.
Pl011(const Pl011Params *p)
const bool endOnEOT
Should the simulation end on an EOT.
static const int UART_LCRH
EventFunctionWrapper intEvent
Wrapper to create an event out of the thing.
static const int UART_FR_TXFE
static const int UART_DMACR
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
static const int UART_MIS
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:10 for gem5 by doxygen 1.8.17