Skip to content

Commit

Permalink
deploy: bf1cea9
Browse files Browse the repository at this point in the history
  • Loading branch information
danodus committed Jun 4, 2024
0 parents commit 67fd294
Show file tree
Hide file tree
Showing 75 changed files with 7,924 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 409810c2db8c7b41c8058e67f819e7c6
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/clock.doctree
Binary file not shown.
Binary file added .doctrees/config.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/features.doctree
Binary file not shown.
Binary file added .doctrees/graphite.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/keyboard.doctree
Binary file not shown.
Binary file added .doctrees/led.doctree
Binary file not shown.
Binary file added .doctrees/memory_map.doctree
Binary file not shown.
Binary file added .doctrees/mouse.doctree
Binary file not shown.
Binary file added .doctrees/sd_card.doctree
Binary file not shown.
Binary file added .doctrees/uart.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
29 changes: 29 additions & 0 deletions _sources/clock.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Clock
=====

Provides a clock value in milliseconds.

Registers
---------

======== =============
Register Address
======== =============
CLOCK BASE_IO + 0
======== =============

CLOCK
^^^^^

Read:

====== ============================
Field Description
====== ============================
[31:0] Clock value in milliseconds
====== ============================



Write: -

33 changes: 33 additions & 0 deletions _sources/config.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Configuration
=============

System configuration.

Registers
---------

=============== =============
Register Address
=============== =============
CONFIG BASE_IO + 36
=============== =============

CONFIG
^^^^^^

Read:

======= ============================
Field Description
======= ============================
[15:0] Vertical video resolution
[31:16] Horizontal video resolution
======= ============================

Write:

======= ============================
Field Description
======= ============================
[0] 0=no action, 1=flush cache
======= ============================
12 changes: 12 additions & 0 deletions _sources/features.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Features
========

- RISC-V (RV32I + Graphite extension)
- UART (2000000-N-8-1)
- SDRAM (32MiB shared between CPU and video)
- Set associative cache (4-way with LRU replacement policy)
- VGA (60 Hz), 480p (60Hz), 720p (60Hz) or 1080p (30Hz) HDMI video output with framebuffer (ARGB4444)
- 2D/3D graphics accelerator (textured triangles)
- PS/2 keyboard
- PS/2 mouse
- SD Card with hardware SPI
156 changes: 156 additions & 0 deletions _sources/graphite.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
Graphite
========

2D/3D accelerator.

After a reset, the frame buffer address is 0x01000000.

Registers
---------

=============== =============
Register Address
=============== =============
GRAPHITE BASE_IO + 32
=============== =============

GRAPHITE
^^^^^^^^

Read:

===== ============================
Field Description
===== ============================
[0] Ready?
===== ============================

Write:

====== ============================
Field Description
====== ============================
[31:0] Command
====== ============================


Command Format
--------------

======= ============================
Field Description
======= ============================
[31:24] Opcode
[23:0] Parameter
======= ============================

Opcodes
-------

================ ===== ===========
Opcode Value Description
================ ===== ===========
OP_SET_X0 0 Set X0
OP_SET_Y0 1 Set Y0
OP_SET_Z0 2 Set 1/W0
OP_SET_X1 3 Set X1
OP_SET_Y1 4 Set Y1
OP_SET_Z1 5 Set 1/W1
OP_SET_X2 6 Set X2
OP_SET_Y2 7 Set Y2
OP_SET_Z2 8 Set 1/W2
OP_SET_R0 9 Set R0
OP_SET_G0 10 Set G0
OP_SET_B0 11 Set B0
OP_SET_R1 12 Set R1
OP_SET_G1 13 Set G1
OP_SET_B1 14 Set B1
OP_SET_R2 15 Set R2
OP_SET_G2 16 Set G2
OP_SET_B2 17 Set B2
OP_SET_S0 18 Set S0
OP_SET_T0 19 Set T0
OP_SET_S1 20 Set S1
OP_SET_T1 21 Set T1
OP_SET_S2 22 Set S2
OP_SET_T2 23 Set T2
OP_CLEAR 24 Clear frame buffer or depth buffer
OP_DRAW 25 Draw triangle
OP_SWAP 26 Swap the front and back buffer addresses
OP_SET_TEX_ADDR 27 Set texture address (in 16-bit word, address >> 1)
OP_SET_FB_ADDR 28 Set the frame buffer address (in 16-bit word, address >> 1)
================ ===== ===========

OP_SET_*
^^^^^^^^

Set a 18.14 fixed point value for a given parameter.

======= ============================
Field Description
======= ============================
[0:15] 16-bit value
[16] 0=LSB, 1=MSB
[31:24] Opcode (0..23)
======= ============================


OP_CLEAR
^^^^^^^^

======= ============================
Field Description
======= ============================
[15:0] Color (ARGB4444)
[16] 0=frame buffer, 1=depth buffer
[31:24] Opcode (24)
======= ============================

OP_DRAW
^^^^^^^

======= ============================
Field Description
======= ============================
[0] 0=not textured, 1=textured
[1] 0=wrap T, 1=clamp T
[2] 0=wrap S, 1=clamp S
[3] 0=depth test disabled, 1=depth test enabled
[4] 0=perspective correction disabled, 1=perspective correction enabled
[7:5] Texture width scale (0=32, 1=64, 2=128, 3=256, 4=512, 5=1024, 6=2048, 7=4096)
[10:8] Texture height scale (0=32, 1=64, 2=128, 3=256, 4=512, 5=1024, 6=2048, 7=4096)
[31:24] Opcode (25)
======= ============================

OP_SWAP
^^^^^^^

======= ============================
Field Description
======= ============================
[0] 0=do not wait for vsync, 1=wait for vsync
[31:24] Opcode (26)
======= ============================


OP_SET_TEX_ADDR
^^^^^^^^^^^^^^^

======= ============================
Field Description
======= ============================
[0:15] 16-bit value
[16] 0=LSB, 1=MSB
[31:24] Opcode (27)
======= ============================

OP_SET_FB_ADDR
^^^^^^^^^^^^^^^

======= ============================
Field Description
======= ============================
[0:15] 16-bit value
[16] 0=LSB, 1=MSB
[31:24] Opcode (27)
======= ============================
29 changes: 29 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. Graphite documentation master file, created by
sphinx-quickstart on Sat Jan 13 10:01:42 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Graphite System
===============

.. toctree::
:maxdepth: 3
:caption: Contents:

features.rst
memory_map.rst
clock.rst
led.rst
uart.rst
sd_card.rst
keyboard.rst
mouse.rst
graphite.rst
config.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
40 changes: 40 additions & 0 deletions _sources/keyboard.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Keyboard
========

PS/2 keyboard.

Registers
---------

=============== =============
Register Address
=============== =============
KEYBOARD_STATUS BASE_IO + 24
KEYBOARD_DATA BASE_IO + 28
=============== =============

KEYBOARD_STATUS
^^^^^^^^^^^^^^^

Read:

===== ============================
Field Description
===== ============================
[28] Key available?
===== ============================

Write: -

KEYBOARD_DATA
^^^^^^^^^^^^^

Read:

====== ============================
Field Description
====== ============================
[7:0] Character
====== ============================

Write: -
26 changes: 26 additions & 0 deletions _sources/led.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
LED
===

LED display.

Registers
---------

======== =============
Register Address
======== =============
LED BASE_IO + 4
======== =============

LED
^^^

Read: -

Write:

===== ============================
Field Description
===== ============================
[7:0] LED value
===== ============================
25 changes: 25 additions & 0 deletions _sources/memory_map.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Memory Map
==========

======================== ==============
Address Range Description
======================== ==============
0x00000000 - 0x002000000 SDRAM (32 MiB)
0xE0000000 - 0xE000000FF Devices
0xF0000000 - 0xF000007FF ROM (2 KiB)
======================== ==============

BASE_IO: 0xE0000000

================== ===============
Device Address
================== ===============
CLOCK BASE_IO + 0
LED BASE_IO + 4
UART BASE_IO + 8
SD_CARD BASE_IO + 16
KEYBOARD BASE_IO + 24
MOUSE BASE_IO + 24
GRAPHITE BASE_IO + 32
CONFIG BASE_IO + 36
================== ===============
30 changes: 30 additions & 0 deletions _sources/mouse.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Mouse
=====

PS/2 mouse.

Registers
---------

=============== =============
Register Address
=============== =============
MOUSE BASE_IO + 24
=============== =============

MOUSE
^^^^^

Read:

======= ============================
Field Description
======= ============================
[9:0] X position
[21:12] Y position
[24] Left button
[25] Middle button
[26] Right button
======= ============================

Write: -
Loading

0 comments on commit 67fd294

Please sign in to comment.