# sjrai007/gp_pae architecture

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

- Interactive diagram: https://gitdiagram.com/sjrai007/gp_pae
- Repository: https://github.com/sjrai007/gp_pae

## Overview

GP_PAE is a reprogrammable protocol-emulator ASIC: a host loads instructions into independent sequencer lanes, which execute pin-oriented operations through a shared crossbar to emulate external protocols. The Hardcaml sources define the design, and the checked-in generated Verilog and Tiny Tapeout wrapper deliver it as hardware. The README documents the lane, instruction-store, and pin model; source excerpts were not available for the core modules, so internal connections below are limited to relationships documented there.

Main entry points: [`hardcaml/lib/sequencer.ml`](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/sequencer.ml) (Sequencer lanes), [`hardcaml/lib/config_port.ml`](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/config_port.ml) (SPI config port), [`hardcaml/lib/core.ml`](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/core.ml) (Writable instruction store), [`src/generated/core.v`](https://github.com/sjrai007/gp_pae/blob/main/src/generated/core.v) (Generated Verilog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_programming["Programming interface"]
  node_config["SPI config port<br/>[config_port.ml]"]
end

subgraph group_engine["Emulator core"]
  node_store[("Writable instruction store<br/>[core.ml]")]
  node_isa["Instruction set<br/>[isa.ml]"]
  node_lanes["Sequencer lanes<br/>[sequencer.ml]"]
  node_core["Shared pin crossbar<br/>[core.ml]"]
end

subgraph group_delivery["Hardware delivery"]
  node_wrapper["Tiny Tapeout wrapper<br/>[project.v]"]
  node_rtl["Generated Verilog<br/>[core.v]"]
end

node_host(("Configuring host"))
node_pins(("Protocol pins"))

node_host -->|"loads instructions"| node_config
node_config -->|"writes instructions"| node_store
node_store -->|"supplies instructions"| node_lanes
node_lanes -->|"executes instruction set"| node_isa
node_lanes -->|"drives pin operations"| node_core
node_core -->|"emulates protocols"| node_pins
node_rtl -.->|"wrapped for delivery"| node_wrapper

click node_config "https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/config_port.ml"
click node_store "https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/core.ml"
click node_isa "https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/isa.ml"
click node_lanes "https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/sequencer.ml"
click node_core "https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/core.ml"
click node_wrapper "https://github.com/sjrai007/gp_pae/blob/main/src/project.v"
click node_rtl "https://github.com/sjrai007/gp_pae/blob/main/src/generated/core.v"

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_config toneBlue
class node_store,node_isa,node_lanes,node_core toneAmber
class node_wrapper,node_rtl toneMint
class node_host,node_pins toneIndigo
```

## Components

### Programming interface

- [SPI config port](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/config_port.ml): `hardcaml/lib/config_port.ml`

### Emulator core

- [Writable instruction store](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/core.ml): `hardcaml/lib/core.ml`
- [Instruction set](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/isa.ml): `hardcaml/lib/isa.ml`
- [Sequencer lanes](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/sequencer.ml): `hardcaml/lib/sequencer.ml`
- [Shared pin crossbar](https://github.com/sjrai007/gp_pae/blob/main/hardcaml/lib/core.ml): `hardcaml/lib/core.ml`

### Hardware delivery

- [Tiny Tapeout wrapper](https://github.com/sjrai007/gp_pae/blob/main/src/project.v): `src/project.v`
- [Generated Verilog](https://github.com/sjrai007/gp_pae/blob/main/src/generated/core.v): `src/generated/core.v`

### Other components

- **Configuring host**
- **Protocol pins**

## Connections

- Configuring host → SPI config port: loads instructions (evidence: `README.md`)
- SPI config port → Writable instruction store: writes instructions (evidence: `README.md`)
- Writable instruction store → Sequencer lanes: supplies instructions (evidence: `README.md`)
- Sequencer lanes → Instruction set: executes instruction set (evidence: `README.md`)
- Sequencer lanes → Shared pin crossbar: drives pin operations (evidence: `README.md`)
- Shared pin crossbar → Protocol pins: emulates protocols (evidence: `README.md`)
- Generated Verilog → Tiny Tapeout wrapper: wrapped for delivery
