Graphics Verilog designs from Project F, including line and shape drawing. You can freely build on these MIT licensed designs. Get an overview of the whole lib from the Verilog Library blog.
- draw_char - Draw character glyph from bitmap font
- draw_circle - Draw circle outline
- draw_circle_fill - Draw filled circle
- draw_line - Draw arbitrary straight line with Bresenham's algorithm
- draw_line_1d.sv - Draw straight line (left to right only)
- draw_rectangle - Draw rectangle outline
- draw_rectangle_fill - Draw filled rectangle
- draw_triangle - Draw triangle outline
- draw_triangle_fill - Draw filled triangle
Locate Vivado test benches in the xc7 directory.
For modules to drive a display, see display.
Find other modules in the Library.
The following blog posts document and make use of these graphics designs:
- Lines and Triangles - drawing lines and triangles with a framebuffer
- 2D Shapes - circles, filled shapes, and drawing pictures
- Animated Shapes - animation and double-buffering
These graphic modules share a similar interface:
input: clk
- clockinput: rst
- synchronous reset (active high)input: start
- start drawing (if currently idle)input: oe
- output enable (allows drawing to be paused)input: (x0,y0)
- vertex 0input: (x1,y1)
- vertex 1input: (x2,y2)
- vertex 2 (used by triangles)input: r0
- radius (used by circles)input: ucp
- Unicode code point (used by text)output: (x,y)
- output drawing coordinateoutput: drawing
- graphics are being drawn at(x,y)
output: busy
- drawing request in progressoutput: done
- drawing is complete (high for one tick)
Graphics coordinates are signed, with a width in bits set by parameter CORDW
.
The default coordinate width is 16 bits for a range from -32,768 to 32,767.
Drawing order or direction may differ from the order coordinates are given;
for example, drawing doesn't necesserily begin from (x0,y0)
.
These modules use a little SystemVerilog to make Verilog more pleasant, see the main Library README for details.