|
gem5 [DEVELOP-FOR-25.0]
|
Timing generator for a pixel-based display. More...
#include <pixelpump.hh>
Classes | |
| class | PixelEvent |
| Callback helper class with suspend support. More... | |
Public Member Functions | |
| BasePixelPump (EventManager &em, ClockDomain &pxl_clk, unsigned pixel_chunk) | |
| virtual | ~BasePixelPump () |
| void | serialize (CheckpointOut &cp) const override |
| Serialize an object. | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. | |
| void | updateTimings (const DisplayTimings &timings) |
| Update frame size using display timing. | |
| void | renderFrame () |
| Render an entire frame in non-caching mode. | |
| void | start () |
| Starting pushing pixels in timing mode. | |
| void | stop () |
| Immediately stop pushing pixels. | |
| const DisplayTimings & | timings () const |
| Get a constant reference of the current display timings. | |
| bool | active () const |
| Is the pixel pump active and refreshing the display? | |
| bool | underrun () const |
| Did a buffer underrun occur within this refresh interval? | |
| bool | visibleLine () const |
| Is the current line within the visible range? | |
| unsigned | posX () const |
| Current pixel position within the visible area. | |
| unsigned | posY () const |
| Current pixel position within the visible area. | |
Public Member Functions inherited from gem5::EventManager | |
| EventQueue * | eventQueue () const |
| void | schedule (Event &event, Tick when) |
| void | deschedule (Event &event) |
| void | reschedule (Event &event, Tick when, bool always=false) |
| void | schedule (Event *event, Tick when) |
| void | deschedule (Event *event) |
| void | reschedule (Event *event, Tick when, bool always=false) |
| void | wakeupEventQueue (Tick when=(Tick) -1) |
| This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
| void | setCurTick (Tick newVal) |
| EventManager (EventManager &em) | |
| Event manger manages events in the event queue. | |
| EventManager (EventManager *em) | |
| EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Clocked | |
| void | updateClockPeriod () |
| Update the tick to the current tick. | |
| 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 caller to determine a future cycle. | |
| Cycles | curCycle () const |
| Determine the current cycle, corresponding to a tick aligned to a clock edge. | |
| Tick | nextCycle () const |
| Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. | |
| uint64_t | frequency () const |
| Tick | clockPeriod () const |
| double | voltage () const |
| Cycles | ticksToCycles (Tick t) const |
| Tick | cyclesToTicks (Cycles c) const |
Public Member Functions inherited from gem5::Serializable | |
| Serializable () | |
| virtual | ~Serializable () |
| void | serializeSection (CheckpointOut &cp, const char *name) const |
| Serialize an object into a new section. | |
| void | serializeSection (CheckpointOut &cp, const std::string &name) const |
| void | unserializeSection (CheckpointIn &cp, const char *name) |
| Unserialize an a child object. | |
| void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
| FrameBuffer | fb |
| Output frame buffer. | |
Protected Member Functions | |
| virtual bool | nextPixel (Pixel &p)=0 |
| Get the next pixel from the scan line buffer. | |
| virtual size_t | nextLine (std::vector< Pixel >::iterator ps, size_t line_length) |
| Get the next line of pixels directly from memory. | |
| virtual void | onVSyncBegin () |
| First pixel clock of the first VSync line. | |
| virtual void | onVSyncEnd () |
| Callback on the first pixel of the line after the end VSync region (typically the first pixel of the vertical back porch). | |
| virtual void | onHSyncBegin () |
| Start of the HSync region. | |
| virtual void | onHSyncEnd () |
| Start of the first pixel after the HSync region. | |
| virtual void | onUnderrun (unsigned x, unsigned y) |
| Buffer underrun occurred on a frame. | |
| virtual void | onFrameDone () |
| Finished displaying the visible region of a frame. | |
Protected Member Functions inherited from gem5::Clocked | |
| Clocked (ClockDomain &clk_domain) | |
| Create a clocked object and set the clock domain based on the parameters. | |
| Clocked (Clocked &)=delete | |
| Clocked & | operator= (Clocked &)=delete |
| virtual | ~Clocked () |
| Virtual destructor due to inheritance. | |
| void | resetClock () const |
| Reset the object's clock using the current global tick value. | |
| virtual void | clockPeriodUpdated () |
| A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. | |
Private Member Functions | |
| void | beginLine () |
| void | renderPixels () |
| void | renderLine () |
| Fast and event-free line rendering function. | |
Private Attributes | |
| const unsigned | pixelChunk |
| Maximum number of pixels to handle per render callback. | |
| std::vector< PixelEvent * > | pixelEvents |
| Convenience vector when doing operations on all events. | |
| PixelEvent | evVSyncBegin |
| PixelEvent | evVSyncEnd |
| PixelEvent | evHSyncBegin |
| PixelEvent | evHSyncEnd |
| PixelEvent | evBeginLine |
| PixelEvent | evRenderPixels |
| DisplayTimings | _timings |
| unsigned | line |
| Current line (including back porch, front porch, and vsync) within a frame. | |
| unsigned | _posX |
| X-coordinate within the visible region of a frame. | |
| bool | _underrun |
| Did a buffer underrun occur within this refresh interval? | |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::Serializable | |
| static const std::string & | currentSection () |
| Gets the fully-qualified name of the active section. | |
| static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
| Generate a checkpoint file so that the serialization can be routed to it. | |
Protected Attributes inherited from gem5::EventManager | |
| EventQueue * | eventq |
| A pointer to this object's event queue. | |
Timing generator for a pixel-based display.
Pixels are ordered relative to the top left corner of the display. Scan lines appear in the following order:
Pixel order within a scan line:
Definition at line 163 of file pixelpump.hh.
| gem5::BasePixelPump::BasePixelPump | ( | EventManager & | em, |
| ClockDomain & | pxl_clk, | ||
| unsigned | pixel_chunk ) |
Definition at line 91 of file pixelpump.cc.
References _posX, _timings, _underrun, BasePixelPump(), beginLine(), gem5::Clocked::Clocked(), gem5::X86ISA::em, evBeginLine, gem5::EventManager::EventManager(), evHSyncBegin, evHSyncEnd, evRenderPixels, evVSyncBegin, evVSyncEnd, line, onHSyncBegin(), onHSyncEnd(), onVSyncBegin(), onVSyncEnd(), pixelChunk, pixelEvents, renderPixels(), and gem5::Serializable::Serializable().
Referenced by BasePixelPump(), gem5::BasePixelPump::PixelEvent::PixelEvent(), and gem5::HDLcd::PixelPump::PixelPump().
|
virtual |
Definition at line 107 of file pixelpump.cc.
|
inline |
Is the pixel pump active and refreshing the display?
Definition at line 192 of file pixelpump.hh.
References evBeginLine.
Referenced by updateTimings().
|
private |
Definition at line 185 of file pixelpump.cc.
References _posX, _timings, _underrun, gem5::Clocked::clockEdge(), evBeginLine, evHSyncBegin, evHSyncEnd, evRenderPixels, line, onVSyncBegin(), onVSyncEnd(), and gem5::EventManager::schedule().
Referenced by BasePixelPump().
|
inlineprotectedvirtual |
Get the next line of pixels directly from memory.
This is for use from the renderFrame which is called in non-caching mode.
The default implementation falls back to calling nextPixel over and over, but a more efficient implementation could retrieve the entire line of pixels all at once using fewer access to memory which bypass any intermediate structures like an incoming FIFO.
| ps | A vector iterator to store retrieved pixels into. |
| line_length | The number of pixels being requested. |
Reimplemented in gem5::HDLcd::PixelPump.
Definition at line 241 of file pixelpump.hh.
References gem5::X86ISA::count, nextPixel(), and gem5::ArmISA::ps.
Referenced by renderLine().
|
protectedpure virtual |
Get the next pixel from the scan line buffer.
| p | Output pixel value, undefined on underrun |
Implemented in gem5::HDLcd::PixelPump.
References gem5::MipsISA::p.
Referenced by nextLine(), and renderPixels().
|
inlineprotectedvirtual |
Finished displaying the visible region of a frame.
Reimplemented in gem5::HDLcd::PixelPump.
Definition at line 287 of file pixelpump.hh.
Referenced by renderFrame(), and renderPixels().
|
inlineprotectedvirtual |
Start of the HSync region.
Definition at line 264 of file pixelpump.hh.
Referenced by BasePixelPump(), and renderFrame().
|
inlineprotectedvirtual |
Start of the first pixel after the HSync region.
Definition at line 272 of file pixelpump.hh.
Referenced by BasePixelPump(), and renderFrame().
|
inlineprotectedvirtual |
Buffer underrun occurred on a frame.
This method is called once if there is buffer underrun while refreshing the display. The underrun state is reset on the next refresh.
| x | Coordinate within the visible region. |
| y | Coordinate within the visible region. |
Reimplemented in gem5::HDLcd::PixelPump.
Definition at line 284 of file pixelpump.hh.
References gem5::RiscvISA::x.
Referenced by renderPixels().
|
inlineprotectedvirtual |
First pixel clock of the first VSync line.
Reimplemented in gem5::HDLcd::PixelPump.
Definition at line 250 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), and renderFrame().
|
inlineprotectedvirtual |
Callback on the first pixel of the line after the end VSync region (typically the first pixel of the vertical back porch).
Reimplemented in gem5::HDLcd::PixelPump.
Definition at line 256 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), and renderFrame().
|
inline |
Current pixel position within the visible area.
Definition at line 206 of file pixelpump.hh.
References _posX.
|
inline |
Current pixel position within the visible area.
Definition at line 210 of file pixelpump.hh.
References _timings, line, and visibleLine().
Referenced by renderLine(), and renderPixels().
| void gem5::BasePixelPump::renderFrame | ( | ) |
Render an entire frame in non-caching mode.
Definition at line 255 of file pixelpump.cc.
References _posX, _timings, _underrun, line, onFrameDone(), onHSyncBegin(), onHSyncEnd(), onVSyncBegin(), onVSyncEnd(), and renderLine().
|
private |
Fast and event-free line rendering function.
Definition at line 287 of file pixelpump.cc.
References fb, nextLine(), panic_if, and posY().
Referenced by renderFrame().
|
private |
Definition at line 218 of file pixelpump.cc.
References _posX, _timings, _underrun, gem5::Clocked::clockEdge(), evRenderPixels, fb, nextPixel(), onFrameDone(), onUnderrun(), pixelChunk, posY(), gem5::EventManager::schedule(), and warn.
Referenced by BasePixelPump().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 112 of file pixelpump.cc.
References _posX, _timings, _underrun, gem5::MipsISA::event, fb, line, pixelEvents, SERIALIZE_OBJ, and SERIALIZE_SCALAR.
| void gem5::BasePixelPump::start | ( | ) |
Starting pushing pixels in timing mode.
Definition at line 159 of file pixelpump.cc.
References gem5::Clocked::clockEdge(), evBeginLine, and gem5::EventManager::schedule().
| void gem5::BasePixelPump::stop | ( | ) |
Immediately stop pushing pixels.
Definition at line 166 of file pixelpump.cc.
References gem5::EventManager::deschedule(), evBeginLine, evHSyncBegin, evHSyncEnd, evRenderPixels, and evVSyncEnd.
|
inline |
Get a constant reference of the current display timings.
Definition at line 189 of file pixelpump.hh.
References _timings.
Referenced by gem5::HDLcd::PixelPump::dumpSettings(), and updateTimings().
|
inline |
Did a buffer underrun occur within this refresh interval?
Definition at line 195 of file pixelpump.hh.
References _underrun.
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 126 of file pixelpump.cc.
References _posX, _timings, _underrun, gem5::MipsISA::event, fb, line, pixelEvents, UNSERIALIZE_OBJ, and UNSERIALIZE_SCALAR.
| void gem5::BasePixelPump::updateTimings | ( | const DisplayTimings & | timings | ) |
|
inline |
Is the current line within the visible range?
Definition at line 199 of file pixelpump.hh.
References _timings, and line.
Referenced by posY().
|
private |
X-coordinate within the visible region of a frame.
Definition at line 362 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), posX(), renderFrame(), renderPixels(), serialize(), and unserialize().
|
private |
Definition at line 354 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), posY(), renderFrame(), renderPixels(), serialize(), timings(), unserialize(), updateTimings(), and visibleLine().
|
private |
Did a buffer underrun occur within this refresh interval?
Definition at line 365 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), renderFrame(), renderPixels(), serialize(), underrun(), and unserialize().
|
private |
Definition at line 351 of file pixelpump.hh.
Referenced by active(), BasePixelPump(), beginLine(), start(), and stop().
|
private |
Definition at line 349 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), and stop().
|
private |
Definition at line 350 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), and stop().
|
private |
Definition at line 352 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), renderPixels(), and stop().
|
private |
Definition at line 347 of file pixelpump.hh.
Referenced by BasePixelPump().
|
private |
Definition at line 348 of file pixelpump.hh.
Referenced by BasePixelPump(), and stop().
| FrameBuffer gem5::BasePixelPump::fb |
Output frame buffer.
Definition at line 216 of file pixelpump.hh.
Referenced by renderLine(), renderPixels(), serialize(), unserialize(), and updateTimings().
|
private |
Current line (including back porch, front porch, and vsync) within a frame.
Definition at line 360 of file pixelpump.hh.
Referenced by BasePixelPump(), beginLine(), posY(), renderFrame(), serialize(), unserialize(), updateTimings(), and visibleLine().
|
private |
Maximum number of pixels to handle per render callback.
Definition at line 291 of file pixelpump.hh.
Referenced by BasePixelPump(), and renderPixels().
|
private |
Convenience vector when doing operations on all events.
Definition at line 345 of file pixelpump.hh.
Referenced by BasePixelPump(), serialize(), and unserialize().