Go to the documentation of this file.
43 #include "debug/Checkpoint.hh"
44 #include "debug/HDLcd.hh"
47 #include "enums/ImageFormat.hh"
50 #include "params/HDLcd.hh"
61 workaroundSwapRB(
p->workaround_swap_rb),
62 workaroundDmaLineCount(
p->workaround_dma_line_count),
64 enableCapture(
p->enable_capture),
65 pixelBufferSize(
p->pixel_buffer_size),
66 virtRefreshRate(
p->virt_refresh_rate),
69 version(VERSION_RESETV),
70 int_rawstat(0), int_mask(0),
72 fb_base(0), fb_line_length(0), fb_line_count(0), fb_line_pitch(0),
73 bus_options(BUS_OPTIONS_RESETV),
75 v_sync(0), v_back_porch(0), v_data(0), v_front_porch(0),
76 h_sync(0), h_back_porch(0), h_data(0), h_front_porch(0),
82 red_select(0), green_select(0), blue_select(0),
84 virtRefreshEvent([
this]{ virtRefresh(); },
name()),
87 pixelPump(*
this, *
p->pxl_clk,
p->pixel_chunk)
90 vnc->setFrameBuffer(&pixelPump.fb);
104 using namespace Stats;
107 .name(
name() +
".underruns")
108 .desc(
"number of buffer underruns")
116 DPRINTF(Checkpoint,
"Serializing ARM HDLCD\n");
153 DPRINTF(Checkpoint,
"Unserializing ARM HDLCD\n");
242 "Unhandled read size (address: 0x.4x, size: %u)",
262 "Unhandled read size (address: 0x.4x, size: %u)",
264 const uint32_t
data(pkt->
getLE<uint32_t>());
281 panic(
"HDLCD INT_CLEAR register is Write-Only\n");
308 panic(
"Tried to read HDLCD register that doesn't exist\n",
offset);
317 panic(
"HDLCD VERSION register is read-Only\n");
329 panic(
"HDLCD INT_STATUS register is read-Only\n");
352 if (
bus_options.max_outstanding != old_bus_options.max_outstanding) {
354 "Changing HDLcd outstanding DMA transactions: %d -> %d\n",
360 if (
bus_options.burst_len != old_bus_options.burst_len) {
362 "Changing HDLcd DMA burst flags: 0x%x -> 0x%x\n",
400 if (new_command.enable !=
command.enable) {
402 new_command.enable ?
"on" :
"off");
404 if (new_command.enable) {
428 panic(
"Tried to write HDLCD register that doesn't exist\n",
offset);
436 ByteOrder byte_order(
437 pixel_format.big_endian ? ByteOrder::big : ByteOrder::little);
469 warn(
"Maximum number of outstanding DMA transfers set to 0.");
473 const uint32_t dma_burst_flags(
bus_options.burst_len);
474 const uint32_t dma_burst_len(
482 const uint32_t dma_lines(
550 DPRINTF(
HDLcd,
"Buffer underrun, stopping DMA fill.\n");
562 warn(
"HDLCD %u bytes still in FIFO after frame: Ensure that DMA "
563 "and PixelPump configuration is consistent\n",
602 unsigned request_size,
unsigned max_pending,
603 size_t line_size, ssize_t line_pitch,
unsigned num_lines)
608 lineSize(line_size), linePitch(line_pitch), numLines(num_lines),
635 frameEnd =
fb_base + numLines * linePitch;
637 startFill(nextLineAddr, lineSize);
643 nextLineAddr = frameEnd;
652 inform(
"DMA line size: %u bytes", lineSize);
653 inform(
"DMA line pitch: %i bytes", linePitch);
654 inform(
"DMA num lines: %u", numLines);
660 if (nextLineAddr == frameEnd)
665 nextLineAddr += linePitch;
666 if (nextLineAddr != frameEnd)
667 startFill(nextLineAddr, lineSize);
673 parent.intRaise(INT_DMA_END);
681 inform(
"PixelPump width: %u",
t.width);
682 inform(
"PixelPump height: %u",
t.height);
684 inform(
"PixelPump horizontal back porch: %u",
t.hBackPorch);
685 inform(
"PixelPump horizontal fron porch: %u",
t.hFrontPorch);
686 inform(
"PixelPump horizontal fron porch: %u",
t.hSync);
688 inform(
"PixelPump vertical back porch: %u",
t.vBackPorch);
689 inform(
"PixelPump vertical fron porch: %u",
t.vFrontPorch);
690 inform(
"PixelPump vertical fron porch: %u",
t.vSync);
695 HDLcdParams::create()
697 return new HDLcd(
this);
void intMask(uint32_t mask)
Convenience function to update the interrupt mask.
virtual void regStats()
Callback to set stat parameters.
TimingReg v_data
Vertical data width register.
bool scheduled() const
Determine if the current event is scheduled.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void makeAtomicResponse()
DmaEngine(HDLcd &_parent, size_t size, unsigned request_size, unsigned max_pending, size_t line_size, ssize_t line_pitch, unsigned num_lines)
static constexpr uint32_t INT_UNDERRUN
const bool workaroundDmaLineCount
#define UNSERIALIZE_SCALAR(scalar)
static constexpr size_t MAX_PIXEL_SIZE
Maximum number of bytes per pixel.
DisplayTimings displayTimings() const
Configurable RGB pixel converter.
void regStats() override
Callback to set stat parameters.
bool active() const
Is the pixel pump active and refreshing the display?
int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
uint32_t fb_base
Frame buffer base address register.
virtual void clear()=0
Clear a signalled interrupt.
TimingReg v_back_porch
Vertical back porch width register.
HDLcd(const HDLcdParams *p)
TimingReg h_front_porch
Horizontal front porch width reg.
ColorSelectReg blue_select
Blue color select register.
CommandReg command
Command register.
virtual void raise()=0
Signal an interrupt.
uint64_t Tick
Tick count type.
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
void unserialize(CheckpointIn &cp) override
Unserialize an object.
static const PixelConverter rgba8888_le
Predefined 32-bit RGB (red in least significant bits, 8 bits/channel, little endian) conversion helpe...
void deschedule(Event &event)
ColorSelectReg green_select
Green color select register.
EventFunctionWrapper virtRefreshEvent
const Addr pixelBufferSize
std::unique_ptr< DmaEngine > dmaEngine
uint32_t intStatus() const
Masked interrupt status register.
Pixel toPixel(uint32_t word) const
Get the Pixel representation of a color word.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void intClear(uint32_t ints)
Convenience function to clear interrupts.
PixelFormatReg pixel_format
Pixel format register.
PolaritiesReg polarities
Polarities register.
void start()
Starting pushing pixels in timing mode.
virtual void drainResume()
Resume execution after a successful drain.
BusOptsReg bus_options
Bus options register.
static constexpr size_t MAX_BURST_LEN
max number of beats delivered in one dma burst
ArmInterruptPin *const interrupt
uint32_t fb_line_length
Frame buffer Line length register.
std::unique_ptr< ImgWriter > createImgWriter(Enums::ImageFormat type, const FrameBuffer *fb)
Factory Function which allocates a ImgWriter object and returns a smart pointer to it.
void schedule(Event &event, Tick when)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void setInterrupts(uint32_t ints, uint32_t mask)
Assign new interrupt values and update interrupt signals.
const Tick virtRefreshRate
TimingReg h_back_porch
Horizontal back porch width register.
void onEndOfBlock() override
End of block callback.
std::ostream * stream() const
Get the output underlying output stream.
unsigned length
Bytes per pixel when stored in memory (including padding)
#define SERIALIZE_OBJ(obj)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
TimingReg v_front_porch
Vertical front porch width register.
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...
AddrRange RangeSize(Addr start, Addr size)
TimingReg h_sync
Horizontal sync width register.
static constexpr size_t AXI_PORT_WIDTH
AXI port width in bytes.
bool bypassCaches() const
Should caches be bypassed?
OutputStream * pic
Picture of what the current frame buffer looks like.
void startFrame(Addr fb_base)
uint32_t int_mask
Interrupt mask register.
Buffered DMA engine helper class.
PixelConverter conv
Cached pixel converter, set when the converter is enabled.
Internal gem5 representation of a Pixel.
int32_t fb_line_pitch
Frame buffer Line pitch register.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void updateTimings(const DisplayTimings &timings)
Update frame size using display timing.
const std::string & name()
#define SERIALIZE_SCALAR(scalar)
TimingReg h_data
Horizontal data width register.
const FlagsType nozero
Don't print if this is zero.
virtual const std::string name() const
void writeReg(Addr offset, uint32_t value)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
std::unique_ptr< ImgWriter > imgWriter
Helper to write out bitmaps.
uint32_t readReg(Addr offset)
uint32_t int_rawstat
Interrupt raw status register.
static constexpr uint32_t INT_VSYNC
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void virtRefresh()
Handler for fast frame refresh in KVM-mode.
void intRaise(uint32_t ints)
Convenience function to raise a new interrupt.
void setLE(T v)
Set the value in the data pointer to v as little endian.
ColorSelectReg red_select
Red color select register.
void onIdle() override
Last response received callback.
std::ostream CheckpointOut
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
static const std::string & currentSection()
Gets the fully-qualified name of the active section.
PixelConverter pixelConverter() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
const bool workaroundSwapRB
void stop()
Immediately stop pushing pixels.
TimingReg v_sync
Vertical sync width register.
void drainResume() override
Resume execution after a successful drain.
void renderFrame()
Render an entire frame in KVM execution mode.
std::string csprintf(const char *format, const Args &...args)
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
Bitfield< 11, 8 > max_outstanding
Generated on Wed Sep 30 2020 14:02:10 for gem5 by doxygen 1.8.17