Go to the documentation of this file.
47 unsigned hbp,
unsigned h_sync,
unsigned hfp,
48 unsigned vbp,
unsigned v_sync,
unsigned vfp)
49 :
width(_width), height(_height),
50 hBackPorch(hbp), hFrontPorch(hfp), hSync(h_sync),
51 vBackPorch(vbp), vFrontPorch(vfp), vSync(v_sync)
89 pixelChunk(pixel_chunk),
91 evVSyncBegin(
"evVSyncBegin", this, &
BasePixelPump::onVSyncBegin),
93 evHSyncBegin(
"evHSyncBegin", this, &
BasePixelPump::onHSyncBegin),
96 evRenderPixels(
"evRenderPixels", this, &
BasePixelPump::renderPixels),
98 line(0), _posX(0), _underrun(false)
117 event->serializeSection(
cp,
event->name());
134 event->unserializeSection(
cp,
event->name());
140 panic_if(
active(),
"Trying to update timings in active PixelPump\n");
195 const Cycles h_sync_begin(0);
219 const unsigned pxl_count(x_end -
_posX);
220 const unsigned pos_y(
posY());
222 Pixel pixel(0, 0, 0);
223 const Pixel underrun_pixel(0, 0, 0);
226 warn(
"Input buffer underrun in BasePixelPump (%u, %u)\n",
230 pixel = underrun_pixel;
284 const unsigned pos_y(
posY());
286 Pixel pixel(0, 0, 0);
289 panic(
"Unexpected underrun in BasePixelPump (%u, %u)\n",
300 _name(
name), parent(*_parent), func(_func),
325 assert(!scheduled());
337 assert(!scheduled());
347 relativeTick = when() -
curTick();
348 parent.deschedule(
this);
354 assert(!scheduled());
356 parent.schedule(
this, relativeTick +
curTick());
Cycles cyclesPerLine() const
How many pixel clocks are required for one line?
bool scheduled() const
Determine if the current event is scheduled.
#define UNSERIALIZE_OBJ(obj)
unsigned lineVSyncStart() const
Calculate the first line of the vsync signal.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
BasePixelPump(EventManager &em, ClockDomain &pxl_clk, unsigned pixel_chunk)
unsigned linesPerFrame() const
Calculate the total number of lines in a frame.
Helper class for objects that need to be clocked.
#define UNSERIALIZE_SCALAR(scalar)
static const DisplayTimings vga
bool active() const
Is the pixel pump active and refreshing the display?
Basic support for object serialization.
void resize(unsigned width, unsigned height)
Resize the frame buffer.
unsigned vBackPorch
Vertical back porch in lines.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
unsigned lineVBackPorchStart() const
Calculate the first line of the vertical back porch.
virtual void onHSyncBegin()
Start of the HSync region.
void drainResume() override
Resume execution after a successful drain.
void deschedule(Event &event)
const Pixel & pixel(unsigned x, unsigned y) const
Get a pixel from an (x, y) coordinate.
unsigned vFrontPorch
Vertical front porch in lines.
PixelEvent evRenderPixels
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain.
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::vector< PixelEvent * > pixelEvents
Convenience vector when doing operations on all events.
@ Drained
Buffers drained, ready for serialization/handover.
Timing generator for a pixel-based display.
unsigned posY() const
Current pixel position within the visible area.
DrainState
Object drain/handover states.
void start()
Starting pushing pixels in timing mode.
virtual void onFrameDone()
Finished displaying the visible region of a frame.
unsigned lineFrontPorchStart() const
Calculate the first line of the back porch.
void schedule(Event &event, Tick when)
Callback helper class with suspend support.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Interface for objects that might require draining before checkpointing.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
#define SERIALIZE_OBJ(obj)
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
unsigned hBackPorch
Horizontal back porch in pixels.
FrameBuffer fb
Output frame buffer.
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...
virtual bool nextPixel(Pixel &p)=0
Get the next pixel from the scan line buffer.
unsigned width
Display width in pixels.
virtual void onHSyncEnd()
Start of the first pixel after the HSync region.
const DisplayTimings & timings() const
Get a constant reference of the current display timings.
Internal gem5 representation of a Pixel.
void updateTimings(const DisplayTimings &timings)
Update frame size using display timing.
const std::string & name()
#define SERIALIZE_SCALAR(scalar)
unsigned line
Current line (including back porch, front porch, and vsync) within a frame.
unsigned height
Display height in pixels.
virtual void onUnderrun(unsigned x, unsigned y)
Buffer underrun occurred on a frame.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
unsigned lineFirstVisible() const
Calculate the first line of the visible region.
Cycles is a wrapper class for representing cycle counts, i.e.
unsigned hFrontPorch
Horizontal front porch in pixels.
std::ostream CheckpointOut
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
unsigned width() const
Frame buffer width in pixels.
unsigned height() const
Frame buffer height in pixels.
unsigned vSync
Vertical sync signal in lines.
unsigned _posX
X-coordinate within the visible region of a frame.
PixelEvent(const char *name, BasePixelPump *parent, CallbackType func)
virtual void onVSyncBegin()
First pixel clock of the first VSync line.
void stop()
Immediately stop pushing pixels.
DisplayTimings(unsigned width, unsigned height, unsigned hbp, unsigned h_sync, unsigned hfp, unsigned vbp, unsigned v_sync, unsigned vfp)
Create a display timing configuration struct.
void renderLine()
Fast and event-free line rendering function.
virtual void onVSyncEnd()
Callback on the first pixel of the line after the end VSync region (typically the first pixel of the ...
void renderFrame()
Render an entire frame in KVM execution mode.
const unsigned pixelChunk
Maximum number of pixels to handle per render callback.
bool _underrun
Did a buffer underrun occur within this refresh interval?
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define panic(...)
This implements a cprintf based panic() function.
unsigned hSync
Horizontal sync signal length in pixels.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17