| 1 |
8 |
robfinch |
|
| 2 |
|
|
Description:
|
| 3 |
|
|
|
| 4 |
|
|
This core is a low to medium resolution bitmap display controller. It was engineered for use on the
|
| 5 |
|
|
Nexsys2 board, a Spartan3e FPGA board, but is readily adaptable to other environments.
|
| 6 |
|
|
|
| 7 |
|
|
|
| 8 |
|
|
Features
|
| 9 |
|
|
|
| 10 |
|
|
- small size
|
| 11 |
|
|
- low to mid resolution bitmap display
|
| 12 |
|
|
- fixed format display
|
| 13 |
|
|
- 32 byte burst fetching
|
| 14 |
|
|
- memory bandwidth consideration
|
| 15 |
|
|
- line buffer
|
| 16 |
|
|
- independent video and bus clocks
|
| 17 |
|
|
|
| 18 |
|
|
While small, this controller core has a number of interesting features. It features low resolution
|
| 19 |
|
|
(low resolution these days) bitmap display. The resolution is 416 x 262 x 8bpp. Memory usage is
|
| 20 |
|
|
about 128Kb. The controller is of a fixed display format, and hence doesn't need any software
|
| 21 |
|
|
control. It does have a control signal to allow page flipping between two different address ranges.
|
| 22 |
|
|
The design of the controller takes into consideration the amount of memory bandwidth available to
|
| 23 |
|
|
the system, using 32 byte burst fetches to fill a line cache. A trick to achieving a low resolution
|
| 24 |
|
|
bitmap display, is to use a video line cache instead of a video fifo.
|
| 25 |
|
|
|
| 26 |
|
|
|
| 27 |
|
|
Operation:
|
| 28 |
|
|
|
| 29 |
|
|
The line cache allows the same video data to be retrieved several times for a given video display
|
| 30 |
|
|
row, without accessing main memory.
|
| 31 |
|
|
|
| 32 |
|
|
Briefly, a fifo works by filling the fifo buffer once it becomes a certain percentage empty. As data
|
| 33 |
|
|
is retrieved for display from the fifo, new data for future display is fetched and loaded into the
|
| 34 |
|
|
fifo. A video line cache works slightly differently, by buffering entire video display lines in
|
| 35 |
|
|
a line buffer.
|
| 36 |
|
|
|
| 37 |
|
|
The video line cache is periodically filled at a rate that keeps up with the video
|
| 38 |
|
|
display. While one video row is being displayed, a to-be-displayed video row is being fetched from
|
| 39 |
|
|
memory and stored in the line cache. The advantage of a line cache over a fifo is that the same
|
| 40 |
|
|
video data may be redisplayed without refetching the data. This allows data for the display to be
|
| 41 |
|
|
fetched across the duration of several scan lines, when a lower resolution mode is in use.
|
| 42 |
|
|
|
| 43 |
|
|
A video fifo is driven by the fifo status, if the status indicates that the fifo is
|
| 44 |
|
|
becoming empty, more data is fetched. The line cache is driven directly by video timing instead.
|
| 45 |
|
|
Rather than monitoring empty/full status, it simply automatically fetches data at periodic
|
| 46 |
|
|
intervals.
|
| 47 |
|
|
|
| 48 |
|
|
The disadvantage of a video line cache is that it requires a larger memory reousrce than a video
|
| 49 |
|
|
fifo would require. Often a fifo only needs to be a few dozen bytes in size. The line cache needs to
|
| 50 |
|
|
buffer at least two entire lines, which can result in it being several kilobytes in size, depending
|
| 51 |
|
|
on the video mode. Timing control for a line cache is more complex than a fifo.
|
| 52 |
|
|
|
| 53 |
|
|
The controller fetches data in 32 byte bursts at periodic intervals. One might think that it would
|
| 54 |
|
|
be a lot simpler and more efficient to just fetch an entire line in a long burst. However this would
|
| 55 |
|
|
have the drawback of consuming memory bandwidth for an extended duration of time. The 32 byte
|
| 56 |
|
|
burst fetches are geared towards allowing other devices in the system to access the same memory. So
|
| 57 |
|
|
that the peformance of the entire system isn't adverse. The controller relies on the memory system
|
| 58 |
|
|
to support burst mode fetchs. In this case page-mode of the PSRAM is used.
|
| 59 |
|
|
|
| 60 |
|
|
The controller uses two independent clocks, one each for bus timing and video timing. Except for
|
| 61 |
|
|
the video request flip-flop, all cross clock domain data is handled using a block ram resource. The
|
| 62 |
|
|
block ram itself allows a different clock to be used on each port. Data is written to the block
|
| 63 |
|
|
ram under control of the bus clock, and read from the block ram on the second port using the
|
| 64 |
|
|
video timing clock. A clock domain crossing synchronizer is used to allow the video request signal
|
| 65 |
|
|
to cross the clock domain.
|
| 66 |
|
|
|