Towards Software Defined Video Display Systems

Auther:Samuel A. Falvo II
Contact: kc5tja .at. arrl.net
Revision: 20081122
Date: 2008 Nov 22
Copyright: Copyright (c) 2008 Samuel A. Falvo II.
License:Creative Commons Attribution-Share Alike 3.0 United States License. See http://creativecommons.org/licenses/by-sa/3.0/us/ for more information.

ABSTRACT

Computers have a history of using rigid video display hardware. Even with the increasing utilization of CPLDs or FPGAs, most video display needs must be statically determined, resulting in applications and operating systems designed around inherent limitations of the underlying hardware. The SEAforth-24 chip provides a platform for a stable, software-defined display interface at VGA resolutions. Software-defined video solutions greatly lowers the barrier for co-developing "display hardware" features concurrent with application software.

PROBLEM

Throughout the history of computers, video display hardware, if it existed at all, from the simplest to the most complex, proves rather rigid in their capabilities. The simplest example may be found in the Apple Macintosh computer, where video hardware consisted only of a single DMA fetcher, a shift register operating at video scan speeds, and not much else. Consequently, even supporting a single moving on-screen object, the mouse pointer, yielded noticable flicker and tear, let alone supporting games with more numerous objects. This effect may also be observed to varying degrees in computers such as the IBM PC/XT, PC/AT, and their compatibles, and the original Atari ST line. Moreover, supporting the appearance of layered objects on the screen required software to "blit" objects into the framebuffer using some variant of a painter's algorithm [Painter]. However, not enough memory existed for each application containing their own local window graphics memory; thus, most graphical user interface operating systems have highly sophisticated software mechanisms [Pike1983] to emulate proper video behavior, adding significant overhead and latency to many otherwise simple graphics drawing operations.

More sophisticated video display implementations, such as Commodore Semiconductor's VIC-II chip, supported so-called "sprites," which enabled several movable objects on the screen without incurring excessive CPU overhead. However, hardware sprites impose limitations of their own. Often, sprites only permit a certain maximum number of pixels in either the horizontal, the vertical, or both, axes. Additionally, sprites often possess fewer colors than the underlying playfield. Sprites are found in computers such as the Texas Instruments TI-99/4A, TRS-80 color computer, Commodore 64, Commodore 128, Atari 400 and 800 series, and the Commodore-Amiga series of computers.

Today, modern video hardware substitutes a simple theory of operation with known limitations with an utterly opaque, undocumented hardware interface of unprecedented complexity, thus requiring a dependency on proprietary, under-documented (if at all) software interfaces. Most software today prefers to hide behind the shield of some graphical user interface toolkit API, which often proves simpler to interface to, despite itself not being simple at all. Many programmers have serious problems understanding how modern GUI APIs function for anything beyond trivial application software, as these frameworks, or any framework for that matter, quickly overwhelms the engineer and imposes design limitations not natural to the application under development ([Falvo2008], [Ingersoll2008], and many more; simply search on Google for "framework considered harmful"). Adaptor libraries, such as Direct Frame Buffer [DFB] and Simple Direct-media Layer [SDL] become necessary to restore some semblence of sanity when trying to write game or other highly interactive software. This suggests that modern video display hardware fails to meet the simplicity needs [1] of either productivity or entertainment titles with equal facility, all the while drawing enough power to warrant one or two additional cooling fans in the process.

[1]Do not confuse simplicity with capability; in terms of raw capability, modern video architectures prove more than capable.

SOLUTION

The SEAforth series of processors from IntellaSys may provide a viable solution to the problem of display hardware rigidity. Their smallest chip, the S24, contains a four by six matrix of C18 cores [IntellaSys2008]. The C18 core, in turn, consists of 64 words of RAM, 64 words of ROM, plus a very simple microprocessor to execute software contained therein. Unlike most other microcontroller architectures, the C18 utilizes an ordinary Von Neumann architecture; thus, it may execute software from RAM with equal facility as from ROM. The simplest instructions execute in 1.5ns, while the longest execute in 5.4ns.

By programming a collection of cores to cooperate towards the goal of video signal generation, a stable display on a monitor results. As an example, please refer to the source code found at http://www.falvotech.com/content/publications/software-defined-video/s24-video-clock.tar.gz for an implementation of a completely software-synthesized clock display.

The aforementioned project consumes ten cores, leaving fourteen additional cores for other tasks. Core 12 assumes the role of a CRTC (Cathode Ray Tube Controller), responsible for generating the horizontal and vertical synchronization pulses to the monitor. Additionally, it serves as the master timebase for the remaining nine cores. Core 13 uses the synchronization information from core 12 to keep track of which line to draw next on the screen. Core 12 communicates this to core 19, which relays this information to cores 20 through 22, which collectively compute which graphics to render based on the line number. Upon receiving a response from these cores, 19 then schedules the display of the bitmapped data so as to ensure proper spacing on the monitor. Core 18 serves as a trivially implemented, monochrome dot shifter driving one of the chip's integrated digital to analog converters. Cores 14 through 16 serve to assist cores 20 through 22 in rendering the clock's indicators.

It should be noted that the complexity of the code linked above stems directly from the lack of SDRAM on the ForthDrive demonstrator product. Without the benefit of a bitmapped memory image, no other choice than per-raster computation of what to display remained. Had external RAM been present, I would have utilized cores 0, 1, and 6 to implement DMA fetch logic for a bitmapped display.

As can be noted by reviewing the source code, the software exists entirely in on-chip RAM. Supporting dynamic code replacement proves trivial by altering each core to rely primarily on a feature unique to the SEAforth architecture: port execution [root2008]. With the ability to reprogram cores on a whim, even in a live system, even the most fundamental characteristics of the display subsystem may be altered on demand.

Let's suppose, for the sake of argument, we implement a computer with a screen-based user interface analogous to the Commodore-Amiga, where users may re-arrange screens as easily as windows. Reprogramming relevant cores between different screens on the physical display allows for differing resolutions, color capabilities, sprite support, pixel and/or character encoding methods, and more. Assuming an allotment of ten cores allocated to the task of video generation, with each core possessing 64 words of RAM, it takes only 640 words fetched via DMA to prepare the SEAforth chip for the next screen's display program. With a 10MHz bus, it takes 64 microseconds to fetch those 640 words -- only two VGA scanlines in the worst possible case. The Commodore-Amiga required no less than six NTSC scanlines for its Copper hardware to affect changes to its display registers between screens. Faster buses and fewer cores updated obviously results in less time spent reprogramming. As you can see, the SEAforth architecture trivially meets the real-time constraints for supporting multiple display methods driving the same physical monitor.

WORKS CITED

[Atari2008]"Atari 8-bit family". Wikipedia. 2008 Nov 13. 2008 Nov 21. Wikimedia Foundation, Inc. <http://en.wikipedia.org/wiki/Atari_8-bit_family>
[Collins1998]Collins, Steven. "Game Graphics During the 8-bit Computer Era". ACM Siggraph. 32.2. (1998 May)
[Commodore1989]Commodore-Amiga, Inc. Amiga Hardware Reference Manual. Addison-Wesley, Inc. 1989.
[DFB]"DirectFB". 2008 Nov 15. 2008 Nov 22. <http://www.directfb.org/>
[Falvo2008]Falvo II, Samuel A. "Middleware Considered Harmful, Part 1". 2008 May 24. 2008 Nov 21. <http://falvotech.com/blog/index.php?/archives/359-Middleware-Considered-Harmful,-Part-1.html>
[Hamblen1998]Hamblen, James. "Using Large CPLDs and FPGAs for Prototyping and VGA Video Display Generation in Computer Architecture Design Laboratories". School of Electrical and Computer Engineering. 1998. Georgia Institute of Technology. 2008 Nov 21. <http://www.ece.gatech.edu/users/hamblen/wcae98.PDF>
[Ingersoll2008]Ingersoll, Grant. "Logging Frameworks Considered Harmful." 2008 Apr 25. 2008 Nov 21. <http://grantingersoll.com/2008/04/25/logging-frameworks-considered-harmful/>
[Kohn]Kohn, Michael. "VGA Graphics Using A Parallax SX Microcontroller". 2008 Nov 21. <http://www.mikekohn.net/micro/sx_micro_vga.php>
[painter]"Painter's Algorithm". Wikipedia. 2008 Aug 14. Wikimedia Foundation, Inc. 2008 Nov 21. <http://en.wikipedia.org/wiki/Painter's_algorithm>
[Pike1983]Pike, Robert. "Graphics in Overlapping Bitmap Layers". ACM Trans. on Graph. 2. (1983): 135-160.
[Rautiainen2002]Rautiainen, Sami. "Commodore 64 Programmer's Reference Guide". 2002 Dec 27. 2008 Nov 21. On-line transcription of an out-of-print book of the same title. <http://www.devili.iki.fi/Computers/Commodore/C64/Programmers_Reference/page_i.html>
[Rictor2008]Rictor, Daryl. "Daryl's 65C02 Hobby Page". 2008 Sep 5. 2008 Nov 21. <http://sbc.rictor.org/sbc31/info.html>
[root2008]root. "64 words of RAM and ROM". 2008 Jan 08. IntellaSys, Inc. 2008 Nov 21. <http://www.intellasys.net/phpBB/viewtopic.php?f=6&t=10>
[SDL]"Simple Direct Media Layer". 2008 Nov 22. <http://www.libsdl.org/>
[IntellaSys2008]"SEAforth-24". IntellaSys, Inc. 2008 Nov 21. <http://www.intellasys.net/index.php?option=com_content&task=view&id=35&Itemid=63>
[TingMoore]Ting, C.H. and Charles H. Moore. "MuP21--A High Performance MISC Processor". Offete Enterprises, Inc. 1995. Ultra Technology. 2008 Nov 21. <http://www.ultratechnology.com/mup21.html>
[tinyvga]"VGA Microcontroller Projects". SECONS Ltd. 2008 Nov 21. <http://www.tinyvga.com/>