# kenji-ishimaru/polyphony architecture

> Architecture diagram of the GitHub repository kenji-ishimaru/polyphony, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kenji-ishimaru/polyphony
- Repository: https://github.com/kenji-ishimaru/polyphony

## Overview

Polyphony is an FPGA-oriented 3D graphics system: bare-metal demo applications issue GLES-style drawing commands through a C graphics library and geometry engine, which interfaces with a hardware rasterizer. The repository also includes Zedboard support and interrupt handling. The README documents major demo capabilities, but the supplied tree contains no Verilog RTL, so the rasterizer is represented as a documented subsystem rather than a source-backed implementation. Several internal links are dashed where the excerpts establish the subsystem but not the specific runtime call.

Main entry points: [`demo_app`](https://github.com/kenji-ishimaru/polyphony/tree/master/demo_app) (Bare-metal demos), [`clib/hw_dep/zedboard/hwdep.c`](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/hw_dep/zedboard/hwdep.c) (Board hardware support), [`clib/pplib/pplib_gl.c`](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pplib_gl.c) (GLES API adapter), [`clib/pplib/pplib.c`](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pplib.c) (Graphics library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Demo applications"]
  node_demo_suite["Bare-metal demos"]
  node_moving["Moving lights"]
  node_earth["Earth texture demo<br/>[app_earth.c]"]
  node_cook["Cook-Torrance demo"]
  node_skinning["Skinning demo<br/>[app_skinning.c]"]
  node_anaglyph["Anaglyph demo<br/>[app_anaglyph.c]"]
end

subgraph group_api["Graphics API"]
  node_gles["GLES API adapter<br/>[pplib_gl.c]"]
  node_library["Graphics library<br/>[pplib.c]"]
end

subgraph group_geometry["Geometry engine"]
  node_math["Vector and matrix math"]
  node_vertex["Vertex types"]
  node_vu["Vertex processing<br/>[pl_vu.c]"]
end

subgraph group_hardware["FPGA platform"]
  node_registers["Hardware register map<br/>[pl_address_table.h]"]
  node_zedboard["Board hardware support<br/>[hwdep.c]"]
  node_interrupt["Interrupt handling<br/>[inthandler.c]"]
  node_rasterizer["RTL rasterizer"]
end

node_user(("Demo operator"))
node_board["Zedboard FPGA"]

node_user -->|"runs demo"| node_demo_suite
node_demo_suite -->|"includes"| node_moving
node_demo_suite -->|"includes"| node_earth
node_demo_suite -->|"includes"| node_cook
node_demo_suite -->|"includes"| node_skinning
node_demo_suite -->|"includes"| node_anaglyph
node_moving -->|"initializes platform"| node_zedboard
node_earth -->|"initializes platform"| node_zedboard
node_moving -->|"issues drawing calls"| node_gles
node_earth -->|"issues drawing calls"| node_gles
node_cook -.->|"uses graphics API"| node_gles
node_skinning -.->|"uses graphics API"| node_gles
node_anaglyph -.->|"uses graphics API"| node_gles
node_gles -.->|"delegates graphics"| node_library
node_library -.->|"uses vertex processing"| node_vu
node_vu -.->|"uses transforms"| node_math
node_vu -.->|"processes vertices"| node_vertex
node_library -.->|"programs hardware"| node_registers
node_zedboard -.->|"accesses registers"| node_registers
node_zedboard -.->|"configures interrupts"| node_interrupt
node_zedboard -.->|"references processing"| node_vu
node_zedboard -->|"targets board"| node_board
node_rasterizer -->|"implemented on"| node_board
node_library -.->|"submits rendering work"| node_rasterizer

click node_demo_suite "https://github.com/kenji-ishimaru/polyphony/tree/master/demo_app"
click node_moving "https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_moving_lights.c"
click node_earth "https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_earth.c"
click node_cook "https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_cook_torrance.c"
click node_skinning "https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_skinning.c"
click node_anaglyph "https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_anaglyph.c"
click node_gles "https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pplib_gl.c"
click node_library "https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pplib.c"
click node_math "https://github.com/kenji-ishimaru/polyphony/tree/master/clib/pplib"
click node_vertex "https://github.com/kenji-ishimaru/polyphony/tree/master/clib/pplib"
click node_vu "https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pl_vu.c"
click node_registers "https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pl_address_table.h"
click node_zedboard "https://github.com/kenji-ishimaru/polyphony/blob/master/clib/hw_dep/zedboard/hwdep.c"
click node_interrupt "https://github.com/kenji-ishimaru/polyphony/blob/master/clib/hw_dep/zedboard/inthandler.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_demo_suite,node_moving,node_earth,node_cook,node_skinning,node_anaglyph toneBlue
class node_gles,node_library toneAmber
class node_math,node_vertex,node_vu toneMint
class node_registers,node_zedboard,node_interrupt,node_rasterizer toneRose
class node_user,node_board toneIndigo
```

## Components

### Demo applications

- [Bare-metal demos](https://github.com/kenji-ishimaru/polyphony/tree/master/demo_app): `demo_app`
- [Moving lights](https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_moving_lights.c): `demo_app/app_moving_lights.c`
- [Earth texture demo](https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_earth.c): `demo_app/app_earth.c`
- [Cook-Torrance demo](https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_cook_torrance.c): `demo_app/app_cook_torrance.c`
- [Skinning demo](https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_skinning.c): `demo_app/app_skinning.c`
- [Anaglyph demo](https://github.com/kenji-ishimaru/polyphony/blob/master/demo_app/app_anaglyph.c): `demo_app/app_anaglyph.c`

### Graphics API

- [GLES API adapter](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pplib_gl.c): `clib/pplib/pplib_gl.c`
- [Graphics library](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pplib.c): `clib/pplib/pplib.c`

### Geometry engine

- [Vector and matrix math](https://github.com/kenji-ishimaru/polyphony/tree/master/clib/pplib): `clib/pplib`
- [Vertex types](https://github.com/kenji-ishimaru/polyphony/tree/master/clib/pplib): `clib/pplib`
- [Vertex processing](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pl_vu.c): `clib/pplib/pl_vu.c`

### FPGA platform

- [Hardware register map](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/pplib/pl_address_table.h): `clib/pplib/pl_address_table.h`
- [Board hardware support](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/hw_dep/zedboard/hwdep.c): `clib/hw_dep/zedboard/hwdep.c`
- [Interrupt handling](https://github.com/kenji-ishimaru/polyphony/blob/master/clib/hw_dep/zedboard/inthandler.c): `clib/hw_dep/zedboard/inthandler.c`
- **RTL rasterizer**

### Other components

- **Demo operator**
- **Zedboard FPGA**

## Connections

- Demo operator → Bare-metal demos: runs demo
- Bare-metal demos → Moving lights: includes (evidence: `demo_app/app_moving_lights.c`)
- Bare-metal demos → Earth texture demo: includes (evidence: `demo_app/app_earth.c`)
- Bare-metal demos → Cook-Torrance demo: includes (evidence: `demo_app/app_cook_torrance.c`)
- Bare-metal demos → Skinning demo: includes (evidence: `demo_app/app_skinning.c`)
- Bare-metal demos → Anaglyph demo: includes (evidence: `demo_app/app_anaglyph.c`)
- Moving lights → Board hardware support: initializes platform (evidence: `demo_app/app_moving_lights.c`)
- Earth texture demo → Board hardware support: initializes platform (evidence: `demo_app/app_earth.c`)
- Moving lights → GLES API adapter: issues drawing calls (evidence: `demo_app/app_moving_lights.c`)
- Earth texture demo → GLES API adapter: issues drawing calls (evidence: `demo_app/app_earth.c`)
- Cook-Torrance demo → GLES API adapter: uses graphics API
- Skinning demo → GLES API adapter: uses graphics API
- Anaglyph demo → GLES API adapter: uses graphics API
- GLES API adapter → Graphics library: delegates graphics
- Graphics library → Vertex processing: uses vertex processing
- Vertex processing → Vector and matrix math: uses transforms (evidence: `clib/pplib/pl_vu.c`)
- Vertex processing → Vertex types: processes vertices (evidence: `clib/pplib/pl_vu.c`)
- Graphics library → Hardware register map: programs hardware
- Board hardware support → Hardware register map: accesses registers
- Board hardware support → Interrupt handling: configures interrupts
- Board hardware support → Vertex processing: references processing
- Board hardware support → Zedboard FPGA: targets board
- RTL rasterizer → Zedboard FPGA: implemented on
- Graphics library → RTL rasterizer: submits rendering work
