# raphaelpinheiro26/tt_um_fp8_fpu architecture

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

- Interactive diagram: https://gitdiagram.com/raphaelpinheiro26/tt_um_fp8_fpu
- Repository: https://github.com/raphaelpinheiro26/tt_um_fp8_fpu

## Overview

This repository implements an FP8 E4M3 floating-point unit for Tiny Tapeout, alongside exact reference modeling and verification. The principal workflow is an operation request entering the RTL interface, being processed by the FPU, and producing a result with flags and exceptions. Separate branches generate reference vectors, check RTL behavior through simulation and UVM, prove selected protocol properties formally, and characterize hardening metrics. RTL internals are represented at module level, but their call relationships are not established by the sampled source; those links are therefore omitted or marked unverified.

Main entry points: [`verification/uvm/pyuvm/fp8_components.py`](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_components.py) (UVM Components), [`Golden_model/fp8_math.py`](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/fp8_math.py) (Exact FP8 Model), [`Golden_model/gen_vectors_math.py`](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/gen_vectors_math.py) (Vector Generator), [`verification/uvm/pyuvm/fp8_bfm.py`](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_bfm.py) (Pin-Level BFM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rtl["FP8 RTL"]
  node_tiny_top["Tiny Tapeout Wrapper<br/>[tt_um_fp8_fpu.v]"]
  node_fpu_unit["FP8 Unit<br/>[tiny_fp8_unit.v]"]
  node_controller["Operation Controller<br/>[fp8_controller.v]"]
  node_elastic["Elastic Pipeline"]
  node_execute["Execute Datapath<br/>[fp8_execute_comb.v]"]
  node_direct_ops["Direct Operations<br/>[fp8_direct_ops.v]"]
  node_division["Iterative Division<br/>[fp8_div_iter.v]"]
  node_unpack["Operand Unpack<br/>[fp8_unpack.v]"]
  node_normalize["Result Normalize<br/>[fp8_normalize.v]"]
  node_round["Result Rounding<br/>[fp8_round.v]"]
  node_handshake["Handshake Register"]
  node_preexecute["Pre-Execute<br/>[fp8_pre_execute.v]"]
  node_fp8_format["Format And Opcodes<br/>[header_fp8.v]"]
end

subgraph group_model["Reference Model"]
  node_common["Format Utilities<br/>[fp8_common.py]"]
  node_math["Exact FP8 Model<br/>[fp8_math.py]"]
  node_vectors["Vector Generator"]
  node_vector_files["Reference Vectors<br/>[vectors.hex]"]
end

subgraph group_verify["Verification"]
  node_uvm_seq["UVM Sequences<br/>[fp8_seq.py]"]
  node_uvm_item["UVM Transactions<br/>[fp8_item.py]"]
  node_uvm_bfm["Pin-Level BFM<br/>[fp8_bfm.py]"]
  node_uvm_components["UVM Components<br/>[fp8_components.py]"]
  node_uvm_ref["UVM Reference Adapter<br/>[fp8_ref.py]"]
  node_formal["Formal Properties"]
  node_dft["Scan Verification"]
end

subgraph group_physical["Hardening Metrics"]
  node_metrics["Metrics Collector<br/>[collect_metrics.py]"]
  node_clock_sweep["Clock Sweep<br/>[sweep_clock.py]"]
end

node_operator(("Operation Source"))

node_operator -.->|"sends operation"| node_tiny_top
node_common -->|"provides format utilities"| node_math
node_math -->|"computes expected values"| node_vectors
node_vectors -->|"writes vectors"| node_vector_files
node_uvm_seq -->|"creates transactions"| node_uvm_item
node_uvm_components -->|"drives and monitors"| node_uvm_bfm
node_uvm_components -->|"publishes transactions"| node_uvm_item
node_uvm_components -->|"predicts results"| node_uvm_ref
node_math -->|"supplies reference math"| node_uvm_ref
node_uvm_bfm -.->|"drives and samples pins"| node_tiny_top
node_clock_sweep -->|"reads metrics"| node_metrics

click node_tiny_top "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/tt_um_fp8_fpu.v"
click node_fpu_unit "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/tiny_fp8_unit.v"
click node_controller "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_controller.v"
click node_elastic "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_elastic_pipeline.v"
click node_execute "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_execute_comb.v"
click node_direct_ops "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_direct_ops.v"
click node_division "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_div_iter.v"
click node_unpack "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_unpack.v"
click node_normalize "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_normalize.v"
click node_round "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_round.v"
click node_handshake "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_handshake_reg.v"
click node_preexecute "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_pre_execute.v"
click node_fp8_format "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/header_fp8.v"
click node_common "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/fp8_common.py"
click node_math "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/fp8_math.py"
click node_vectors "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/gen_vectors_math.py"
click node_vector_files "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/vectors.hex"
click node_uvm_seq "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_seq.py"
click node_uvm_item "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_item.py"
click node_uvm_bfm "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_bfm.py"
click node_uvm_components "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_components.py"
click node_uvm_ref "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_ref.py"
click node_formal "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/tree/master/verification/formal"
click node_dft "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/tree/master/verification/dft"
click node_metrics "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/flow/collect_metrics.py"
click node_clock_sweep "https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/flow/sweep_clock.py"

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_tiny_top,node_fpu_unit,node_controller,node_elastic,node_execute,node_direct_ops,node_division,node_unpack,node_normalize,node_round,node_handshake,node_preexecute,node_fp8_format toneBlue
class node_common,node_math,node_vectors,node_vector_files toneAmber
class node_uvm_seq,node_uvm_item,node_uvm_bfm,node_uvm_components,node_uvm_ref,node_formal,node_dft toneMint
class node_metrics,node_clock_sweep toneRose
class node_operator toneIndigo
```

## Components

### FP8 RTL

- [Tiny Tapeout Wrapper](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/tt_um_fp8_fpu.v): `src/tt_um_fp8_fpu.v`
- [FP8 Unit](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/tiny_fp8_unit.v): `src/tiny_fp8_unit.v`
- [Operation Controller](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_controller.v): `src/fp8_controller.v`
- [Elastic Pipeline](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_elastic_pipeline.v): `src/fp8_elastic_pipeline.v`
- [Execute Datapath](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_execute_comb.v): `src/fp8_execute_comb.v`
- [Direct Operations](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_direct_ops.v): `src/fp8_direct_ops.v`
- [Iterative Division](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_div_iter.v): `src/fp8_div_iter.v`
- [Operand Unpack](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_unpack.v): `src/fp8_unpack.v`
- [Result Normalize](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_normalize.v): `src/fp8_normalize.v`
- [Result Rounding](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_round.v): `src/fp8_round.v`
- [Handshake Register](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_handshake_reg.v): `src/fp8_handshake_reg.v`
- [Pre-Execute](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/fp8_pre_execute.v): `src/fp8_pre_execute.v`
- [Format And Opcodes](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/src/header_fp8.v): `src/header_fp8.v`

### Reference Model

- [Format Utilities](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/fp8_common.py): `Golden_model/fp8_common.py`
- [Exact FP8 Model](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/fp8_math.py): `Golden_model/fp8_math.py`
- [Vector Generator](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/gen_vectors_math.py): `Golden_model/gen_vectors_math.py`
- [Reference Vectors](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/Golden_model/vectors.hex): `Golden_model/vectors.hex`

### Verification

- [UVM Sequences](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_seq.py): `verification/uvm/pyuvm/fp8_seq.py`
- [UVM Transactions](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_item.py): `verification/uvm/pyuvm/fp8_item.py`
- [Pin-Level BFM](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_bfm.py): `verification/uvm/pyuvm/fp8_bfm.py`
- [UVM Components](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_components.py): `verification/uvm/pyuvm/fp8_components.py`
- [UVM Reference Adapter](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/verification/uvm/pyuvm/fp8_ref.py): `verification/uvm/pyuvm/fp8_ref.py`
- [Formal Properties](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/tree/master/verification/formal): `verification/formal`
- [Scan Verification](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/tree/master/verification/dft): `verification/dft`

### Hardening Metrics

- [Metrics Collector](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/flow/collect_metrics.py): `flow/collect_metrics.py`
- [Clock Sweep](https://github.com/raphaelpinheiro26/tt_um_fp8_fpu/blob/master/flow/sweep_clock.py): `flow/sweep_clock.py`

### Other components

- **Operation Source**

## Connections

- Operation Source → Tiny Tapeout Wrapper: sends operation
- Format Utilities → Exact FP8 Model: provides format utilities (evidence: `Golden_model/fp8_math.py`)
- Exact FP8 Model → Vector Generator: computes expected values (evidence: `Golden_model/gen_vectors_math.py`)
- Vector Generator → Reference Vectors: writes vectors (evidence: `Golden_model/gen_vectors_math.py`)
- UVM Sequences → UVM Transactions: creates transactions (evidence: `verification/uvm/pyuvm/fp8_seq.py`)
- UVM Components → Pin-Level BFM: drives and monitors (evidence: `verification/uvm/pyuvm/fp8_components.py`)
- UVM Components → UVM Transactions: publishes transactions (evidence: `verification/uvm/pyuvm/fp8_components.py`)
- UVM Components → UVM Reference Adapter: predicts results (evidence: `verification/uvm/pyuvm/fp8_components.py`)
- Exact FP8 Model → UVM Reference Adapter: supplies reference math (evidence: `verification/uvm/pyuvm/fp8_ref.py`)
- Pin-Level BFM → Tiny Tapeout Wrapper: drives and samples pins
- Clock Sweep → Metrics Collector: reads metrics (evidence: `flow/sweep_clock.py`)
