# mukullokhande99/vehicle-number-plate-detection-soc architecture

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

- Interactive diagram: https://gitdiagram.com/mukullokhande99/vehicle-number-plate-detection-soc
- Repository: https://github.com/mukullokhande99/vehicle-number-plate-detection-soc

## Overview

This repository implements a synthesizable RISC-V-controlled camera and vision SoC for a quantized vehicle-plate detection and OCR flow. The intended runtime path is camera input through image preprocessing and frame storage, accelerator inference, and CTC decoding, under CPU/SoC control. Separate tools export or package quantized model images. The README establishes the product scope, but the sampled source covers only model-export tools; RTL connections below are therefore dashed and unverified rather than asserted as inspected call paths.

Main entry points: [`rtl/plate_ocr_soc_top.sv`](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_soc_top.sv) (SoC Top), [`rtl/plate_ocr_accel.sv`](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_accel.sv) (Plate OCR Accelerator), [`rtl/plate_ocr_model_core.sv`](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_model_core.sv) (Model Core), [`rtl/local_sram_slave.sv`](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/local_sram_slave.sv) (Local SRAM Slave)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["SoC Platform"]
  node_cpu["RISC-V Core<br/>[rv32i_core.sv]"]
  node_top["SoC Top"]
  node_boot[("Boot ROM<br/>[boot_rom.sv]")]
  node_localmem["Local SRAM Slave"]
  node_sram[("ASIC SRAM<br/>[asic_mem_1rw.sv]")]
end

subgraph group_vision["Camera Vision"]
  node_qspi["Camera QSPI Receiver<br/>[qspi_camera_rx.sv]"]
  node_decimate["RGB565 Decimator"]
  node_framestore[("Vision Frame Store")]
  node_visionmem[("Vision Memory<br/>[vision_mem_2r1w.sv]")]
end

subgraph group_inference["OCR Inference"]
  node_accel["Plate OCR Accelerator<br/>[plate_ocr_accel.sv]"]
  node_core["Model Core"]
  node_dot["W4A8 Dot Product<br/>[w4a8_dot8.sv]"]
  node_requant["INT24 Requantizer"]
  node_decoder["CTC Decoder"]
end

subgraph group_modeltools["Model Images"]
  node_exporter["PTQ Exporter"]
  node_demo["Demo Checkpoint"]
  node_packer["Model Image Packer"]
end

node_camera(("Camera"))

node_camera -.->|"supplies frames"| node_qspi
node_qspi -.->|"sends pixels"| node_decimate
node_decimate -.->|"stores frames"| node_framestore
node_framestore -.->|"provides data"| node_visionmem
node_cpu -.->|"controls"| node_top
node_top -.->|"uses"| node_boot
node_top -.->|"uses"| node_localmem
node_localmem -.->|"accesses"| node_sram
node_top -.->|"controls"| node_accel
node_accel -.->|"dispatches"| node_core
node_core -.->|"computes"| node_dot
node_core -.->|"requantizes"| node_requant
node_accel -.->|"reads data"| node_visionmem
node_accel -.->|"decodes output"| node_decoder
node_demo -.->|"creates checkpoint"| node_exporter
node_exporter -.->|"exports weights"| node_packer

click node_cpu "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/rv32i_core.sv"
click node_top "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_soc_top.sv"
click node_boot "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/boot_rom.sv"
click node_localmem "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/local_sram_slave.sv"
click node_sram "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/asic_mem_1rw.sv"
click node_qspi "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/qspi_camera_rx.sv"
click node_decimate "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/rgb565_decimate2.sv"
click node_framestore "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/vision_frame_store.sv"
click node_visionmem "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/vision_mem_2r1w.sv"
click node_accel "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_accel.sv"
click node_core "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_model_core.sv"
click node_dot "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/w4a8_dot8.sv"
click node_requant "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/int24_requantize.sv"
click node_decoder "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/ctc_greedy_decoder.sv"
click node_exporter "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/tools/export_plateocr_w4.py"
click node_demo "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/tools/make_demo_plateocr_npz.py"
click node_packer "https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/tools/pack_plateocr_w4.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_cpu,node_top,node_boot,node_localmem,node_sram toneBlue
class node_qspi,node_decimate,node_framestore,node_visionmem toneAmber
class node_accel,node_core,node_dot,node_requant,node_decoder toneMint
class node_exporter,node_demo,node_packer toneRose
class node_camera toneIndigo
```

## Components

### SoC Platform

- [RISC-V Core](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/rv32i_core.sv): `rtl/rv32i_core.sv`
- [SoC Top](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_soc_top.sv): `rtl/plate_ocr_soc_top.sv`
- [Boot ROM](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/boot_rom.sv): `rtl/boot_rom.sv`
- [Local SRAM Slave](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/local_sram_slave.sv): `rtl/local_sram_slave.sv`
- [ASIC SRAM](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/asic_mem_1rw.sv): `rtl/asic_mem_1rw.sv`

### Camera Vision

- [Camera QSPI Receiver](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/qspi_camera_rx.sv): `rtl/qspi_camera_rx.sv`
- [RGB565 Decimator](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/rgb565_decimate2.sv): `rtl/rgb565_decimate2.sv`
- [Vision Frame Store](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/vision_frame_store.sv): `rtl/vision_frame_store.sv`
- [Vision Memory](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/vision_mem_2r1w.sv): `rtl/vision_mem_2r1w.sv`

### OCR Inference

- [Plate OCR Accelerator](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_accel.sv): `rtl/plate_ocr_accel.sv`
- [Model Core](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/plate_ocr_model_core.sv): `rtl/plate_ocr_model_core.sv`
- [W4A8 Dot Product](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/w4a8_dot8.sv): `rtl/w4a8_dot8.sv`
- [INT24 Requantizer](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/int24_requantize.sv): `rtl/int24_requantize.sv`
- [CTC Decoder](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/rtl/ctc_greedy_decoder.sv): `rtl/ctc_greedy_decoder.sv`

### Model Images

- [PTQ Exporter](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/tools/export_plateocr_w4.py): `tools/export_plateocr_w4.py`
- [Demo Checkpoint](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/tools/make_demo_plateocr_npz.py): `tools/make_demo_plateocr_npz.py`
- [Model Image Packer](https://github.com/mukullokhande99/vehicle-number-plate-detection-soc/blob/master/tools/pack_plateocr_w4.py): `tools/pack_plateocr_w4.py`

### Other components

- **Camera**

## Connections

- Camera → Camera QSPI Receiver: supplies frames
- Camera QSPI Receiver → RGB565 Decimator: sends pixels
- RGB565 Decimator → Vision Frame Store: stores frames
- Vision Frame Store → Vision Memory: provides data
- RISC-V Core → SoC Top: controls
- SoC Top → Boot ROM: uses
- SoC Top → Local SRAM Slave: uses
- Local SRAM Slave → ASIC SRAM: accesses
- SoC Top → Plate OCR Accelerator: controls
- Plate OCR Accelerator → Model Core: dispatches
- Model Core → W4A8 Dot Product: computes
- Model Core → INT24 Requantizer: requantizes
- Plate OCR Accelerator → Vision Memory: reads data
- Plate OCR Accelerator → CTC Decoder: decodes output
- Demo Checkpoint → PTQ Exporter: creates checkpoint
- PTQ Exporter → Model Image Packer: exports weights
