# gangheejo/echo architecture

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

- Interactive diagram: https://gitdiagram.com/gangheejo/echo
- Repository: https://github.com/gangheejo/echo

## Overview

ECHO is an FPGA accelerator for particle-filter LiDAR localization scoring. A particle’s pose and observed ranges enter a scorer; per-beam expected distances are ray-marched, converted with observed ranges into sensor-model table addresses, arbitrated across particle lanes, and accumulated as log weights. The README documents baseline and shared-table variants, plus earlier ray-marching implementations. Edges below follow those documented relationships; unsampled RTL details and optional direction-generation wiring are not inferred.

Main entry points: [`rtl/particle_scorer_arb.v`](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_arb.v) (Arbitrated scorer), [`rtl/particle_scorer.v`](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer.v) (Particle scorer), [`rtl/table_mem.v`](https://github.com/gangheejo/echo/blob/main/rtl/table_mem.v) (Log-probability table), [`rtl/ray_march_edt.v`](https://github.com/gangheejo/echo/blob/main/rtl/ray_march_edt.v) (EDT ray marcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ray["Ray marching"]
  node_ray_edt["EDT ray marcher<br/>[ray_march_edt.v]"]
  node_ray_bram["BRAM ray marcher<br/>[ray_march_bram.v]"]
  node_ray_base["Grid ray marcher<br/>[ray_march.v]"]
end

subgraph group_scoring["Sensor scoring"]
  node_scorer["Particle scorer<br/>[particle_scorer.v]"]
  node_arb_scorer["Arbitrated scorer"]
  node_addr["Address generator<br/>[addr_gen.v]"]
  node_sensor["Sensor PE<br/>[sensor_pe.v]"]
end

subgraph group_sharing["Table sharing"]
  node_arb2["Two-way arbiter<br/>[arbiter2.v]"]
  node_arb4["Four-way arbiter<br/>[arbiter4.v]"]
  node_arb8["Eight-way arbiter<br/>[arbiter8.v]"]
  node_pair["Two-particle scorer"]
  node_quad["Four-particle scorer"]
  node_oct["Eight-particle scorer"]
  node_shared["External-table scorer"]
  node_pair_dp["Dual-port pair"]
end

subgraph group_memory["Lookup storage"]
  node_table[("Log-probability table<br/>[table_mem.v]")]
  node_table_dp[("Dual-port table<br/>[table_mem_dp.v]")]
end

node_filter(("Particle filter"))

node_filter -->|"supplies pose and ranges"| node_scorer
node_scorer -->|"ray-marches beams"| node_ray_edt
node_scorer -->|"forms lookup address"| node_addr
node_scorer -->|"scores beams"| node_sensor
node_sensor -->|"reads log probabilities"| node_table
node_scorer -->|"returns log weight"| node_filter
node_ray_bram -.->|"implements mapped march"| node_ray_base
node_ray_edt -.->|"optimizes mapped march"| node_ray_bram
node_arb_scorer -->|"ray-marches beams"| node_ray_edt
node_arb_scorer -->|"forms lookup address"| node_addr
node_arb_scorer -->|"scores beams"| node_sensor
node_pair -->|"instantiates lanes"| node_arb_scorer
node_pair -->|"arbitrates requests"| node_arb2
node_quad -->|"instantiates lanes"| node_arb_scorer
node_quad -->|"arbitrates requests"| node_arb4
node_oct -->|"instantiates lanes"| node_arb_scorer
node_oct -->|"arbitrates requests"| node_arb8
node_arb2 -->|"shares table port"| node_table
node_arb4 -->|"shares table port"| node_table
node_arb8 -->|"shares table port"| node_table
node_shared -.->|"uses external table"| node_table_dp
node_pair_dp -->|"instantiates pair"| node_shared
node_pair_dp -->|"shares dual ports"| node_table_dp

click node_scorer "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer.v"
click node_arb_scorer "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_arb.v"
click node_ray_edt "https://github.com/gangheejo/echo/blob/main/rtl/ray_march_edt.v"
click node_ray_bram "https://github.com/gangheejo/echo/blob/main/rtl/ray_march_bram.v"
click node_ray_base "https://github.com/gangheejo/echo/blob/main/rtl/ray_march.v"
click node_addr "https://github.com/gangheejo/echo/blob/main/rtl/addr_gen.v"
click node_sensor "https://github.com/gangheejo/echo/blob/main/rtl/sensor_pe.v"
click node_table "https://github.com/gangheejo/echo/blob/main/rtl/table_mem.v"
click node_arb2 "https://github.com/gangheejo/echo/blob/main/rtl/arbiter2.v"
click node_arb4 "https://github.com/gangheejo/echo/blob/main/rtl/arbiter4.v"
click node_arb8 "https://github.com/gangheejo/echo/blob/main/rtl/arbiter8.v"
click node_pair "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_pair_arb.v"
click node_quad "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_quad_arb.v"
click node_oct "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_oct_arb.v"
click node_shared "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_shared.v"
click node_pair_dp "https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_pair.v"
click node_table_dp "https://github.com/gangheejo/echo/blob/main/rtl/table_mem_dp.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_ray_edt,node_ray_bram,node_ray_base toneBlue
class node_scorer,node_arb_scorer,node_addr,node_sensor toneAmber
class node_arb2,node_arb4,node_arb8,node_pair,node_quad,node_oct,node_shared,node_pair_dp toneMint
class node_table,node_table_dp toneRose
class node_filter toneIndigo
```

## Components

### Ray marching

- [EDT ray marcher](https://github.com/gangheejo/echo/blob/main/rtl/ray_march_edt.v): `rtl/ray_march_edt.v`
- [BRAM ray marcher](https://github.com/gangheejo/echo/blob/main/rtl/ray_march_bram.v): `rtl/ray_march_bram.v`
- [Grid ray marcher](https://github.com/gangheejo/echo/blob/main/rtl/ray_march.v): `rtl/ray_march.v`

### Sensor scoring

- [Particle scorer](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer.v): `rtl/particle_scorer.v`
- [Arbitrated scorer](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_arb.v): `rtl/particle_scorer_arb.v`
- [Address generator](https://github.com/gangheejo/echo/blob/main/rtl/addr_gen.v): `rtl/addr_gen.v`
- [Sensor PE](https://github.com/gangheejo/echo/blob/main/rtl/sensor_pe.v): `rtl/sensor_pe.v`

### Table sharing

- [Two-way arbiter](https://github.com/gangheejo/echo/blob/main/rtl/arbiter2.v): `rtl/arbiter2.v`
- [Four-way arbiter](https://github.com/gangheejo/echo/blob/main/rtl/arbiter4.v): `rtl/arbiter4.v`
- [Eight-way arbiter](https://github.com/gangheejo/echo/blob/main/rtl/arbiter8.v): `rtl/arbiter8.v`
- [Two-particle scorer](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_pair_arb.v): `rtl/particle_scorer_pair_arb.v`
- [Four-particle scorer](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_quad_arb.v): `rtl/particle_scorer_quad_arb.v`
- [Eight-particle scorer](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_oct_arb.v): `rtl/particle_scorer_oct_arb.v`
- [External-table scorer](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_shared.v): `rtl/particle_scorer_shared.v`
- [Dual-port pair](https://github.com/gangheejo/echo/blob/main/rtl/particle_scorer_pair.v): `rtl/particle_scorer_pair.v`

### Lookup storage

- [Log-probability table](https://github.com/gangheejo/echo/blob/main/rtl/table_mem.v): `rtl/table_mem.v`
- [Dual-port table](https://github.com/gangheejo/echo/blob/main/rtl/table_mem_dp.v): `rtl/table_mem_dp.v`

### Other components

- **Particle filter**

## Connections

- Particle filter → Particle scorer: supplies pose and ranges (evidence: `README.md`)
- Particle scorer → EDT ray marcher: ray-marches beams (evidence: `README.md`)
- Particle scorer → Address generator: forms lookup address (evidence: `README.md`)
- Particle scorer → Sensor PE: scores beams (evidence: `README.md`)
- Sensor PE → Log-probability table: reads log probabilities (evidence: `README.md`)
- Particle scorer → Particle filter: returns log weight (evidence: `README.md`)
- BRAM ray marcher → Grid ray marcher: implements mapped march (evidence: `README.md`)
- EDT ray marcher → BRAM ray marcher: optimizes mapped march (evidence: `README.md`)
- Arbitrated scorer → EDT ray marcher: ray-marches beams (evidence: `README.md`)
- Arbitrated scorer → Address generator: forms lookup address (evidence: `README.md`)
- Arbitrated scorer → Sensor PE: scores beams (evidence: `README.md`)
- Two-particle scorer → Arbitrated scorer: instantiates lanes (evidence: `README.md`)
- Two-particle scorer → Two-way arbiter: arbitrates requests (evidence: `README.md`)
- Four-particle scorer → Arbitrated scorer: instantiates lanes (evidence: `README.md`)
- Four-particle scorer → Four-way arbiter: arbitrates requests (evidence: `README.md`)
- Eight-particle scorer → Arbitrated scorer: instantiates lanes (evidence: `README.md`)
- Eight-particle scorer → Eight-way arbiter: arbitrates requests (evidence: `README.md`)
- Two-way arbiter → Log-probability table: shares table port (evidence: `README.md`)
- Four-way arbiter → Log-probability table: shares table port (evidence: `README.md`)
- Eight-way arbiter → Log-probability table: shares table port (evidence: `README.md`)
- External-table scorer → Dual-port table: uses external table (evidence: `README.md`)
- Dual-port pair → External-table scorer: instantiates pair (evidence: `README.md`)
- Dual-port pair → Dual-port table: shares dual ports (evidence: `README.md`)
