32#include "debug/LupioTTY.hh"
35#include "params/LupioTTY.hh"
37#define LUPIO_TTY_INVAL 0x80000000
40#define LUPIO_TTY_WBIT (1 << 0)
41#define LUPIO_TTY_RBIT (1 << 1)
48 writChar(-1), readChar(-1), writIntrEn(false), readIntrEn(false),
49 terminal(params.terminal), platform(params.platform)
79 fprintf(stderr,
"Dropping characters\n");
130 panic(
"Unexpected read to the LupioTTY device at address %d!",
141 uint32_t
val = val64;
160 panic(
"Unexpected write to the LupioTTY device at address %d!",
172 "Read request - addr: %#x, size: %#x\n", tty_addr, pkt->
getSize());
187 "Write request - addr: %#x pktAddr: %#x value: %c\n", tty_addr,
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
LupioTTY: The LupioTTY is a virtual terminal device that can both transmit characters to a screen,...
Tick read(PacketPtr pkt) override
Implement BasicPioDevice virtual functions.
LupioTTY(const Params &p)
uint64_t lupioTTYRead(const uint8_t addr)
void dataAvailable()
Inform the LupIO-TTY there is data available.
const ByteOrder byteOrder
void lupioTTYWrite(const uint8_t addr, uint64_t c)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void lupioTTYUpdateIRQ()
IRQ management.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
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 ...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
virtual uint8_t readData()=0
Read a character from the device.
virtual void writeData(uint8_t c)=0
Transmit a character from the host interface to the device.
void regInterfaceCallback(const std::function< void()> &callback)
Register a data available callback into the host interface layer.
virtual bool dataAvailable() const =0
Check if there is pending data from the serial device.
#define panic(...)
This implements a cprintf based panic() function.
#define gem5_assert(cond,...)
The assert macro will function like a normal assert, but will use panic instead of straight abort().
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.