Go to the documentation of this file.
44 #include "debug/Checkpoint.hh"
45 #include "debug/Uart.hh"
50 #include "params/Pl011.hh"
59 control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12),
61 endOnEOT(
p.end_on_eot), interrupt(
p.interrupt->get()),
90 DPRINTF(
Uart,
"Re-raising interrupt due to more data "
91 "after UART_DR read\n");
107 "Reading FR register as %#x rawInt=0x%x "
108 "imsc=0x%x maskInt=0x%x\n",
138 warn(
"PL011: DMA not supported\n");
148 panic(
"Tried to read PL011 at offset %#x that doesn't exist\n", daddr);
166 DPRINTF(
Uart,
" write register %#x value %#x size=%d\n", daddr,
212 DPRINTF(
Uart,
"Re-raising interrupt due to more data after "
221 panic(
"Tried to enable DMA on PL011\n");
223 warn(
"PL011: DMA not supported\n");
226 panic(
"Tried to write PL011 at offset %#x that doesn't exist\n", daddr);
238 DPRINTF(
Uart,
"Data available, scheduling interrupt\n");
245 DPRINTF(
Uart,
"Generate Interrupt: imsc=0x%x rawInt=0x%x maskInt=0x%x\n",
257 const bool old_ints(!!
maskInt());
265 }
else if (old_ints && !
maskInt()) {
275 DPRINTF(Checkpoint,
"Serializing Arm PL011\n");
290 DPRINTF(Checkpoint,
"Unserializing Arm PL011\n");
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick curTick()
The universal simulation clock.
static const int UART_LCRH
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Addr pioAddr
Address that the device listens to.
uint16_t imsc
interrupt mask register.
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_IBRD
#define UNSERIALIZE_SCALAR(scalar)
static const uint64_t AMBA_ID
static const int UART_FR_TXFE
static const int UART_FBRD
void dataAvailable() override
Inform the uart that there is data available.
static const int UART_RSR
void schedule(Event &event, Tick when)
Pl011(const Pl011Params &p)
void makeAtomicResponse()
virtual bool dataAvailable() const =0
Check if there is pending data from the serial device.
uint16_t lcrh
Line control register.
void setInterruptMask(uint16_t mask)
Convenience function to update the interrupt mask.
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 (...
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
static const int UART_MIS
uint16_t ibrd
integer baud rate divisor.
static const int UART_ECR
virtual void writeData(uint8_t c)=0
Transmit a character from the host interface to the device.
static const int UART_IFLS
ArmInterruptPin *const interrupt
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
static const int UART_RIS
uint64_t Tick
Tick count type.
virtual void clear()=0
Clear a signalled interrupt.
uint16_t fbrd
fractional baud rate divisor.
Tick pioDelay
Delay that the device experinces on an access.
static const int UART_ICR
static const uint16_t UART_TXINTR
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const std::string & name()
#define SERIALIZE_SCALAR(scalar)
static const int UART_IMSC
static const int UART_FR_RXFE
uint16_t ifls
interrupt fifo level register.
static const int UART_DMACR
static const uint16_t UART_RTINTR
void generateInterrupt()
Function to generate interrupt.
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
void serialize(CheckpointOut &cp) const override
Serialize an object.
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
void setInterrupts(uint16_t ints, uint16_t mask)
Assign new interrupt values and update interrupt signals.
EventFunctionWrapper intEvent
Wrapper to create an event out of the thing.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Addr pioSize
Size that the device's address range.
std::ostream CheckpointOut
virtual void raise()=0
Signal an interrupt.
static const int UART_FR_CTS
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
uint16_t maskInt() const
Masked interrupt status register.
uint16_t rawInt
raw interrupt status register
void raiseInterrupts(uint16_t ints)
Convenience function to raise a new interrupt.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
virtual uint8_t readData()=0
Read a character from the device.
const bool endOnEOT
Should the simulation end on an EOT.
static const uint16_t UART_RXINTR
const Tick intDelay
Delay before interrupting.
bool scheduled() const
Determine if the current event is scheduled.
static const int UART_FR_RXFF
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Jul 13 2022 10:39:19 for gem5 by doxygen 1.8.17