# mudumanojkumarnaik/spi_nor_flash_controller_sv architecture

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

- Interactive diagram: https://gitdiagram.com/mudumanojkumarnaik/spi_nor_flash_controller_sv
- Repository: https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv

## Overview

This repository implements an SPI NOR flash controller and documents a class-based verification environment. The principal workflow is a test running the environment, which generates and drives transactions against the controller and checks observed behavior. The controller supports read, page program, sector erase, status-register read, and JEDEC-ID read operations. Relationships below follow the README’s architecture description; source excerpts were unavailable, so internal wiring and less explicit verification data flows are omitted.

Main entry points: [`TB/spi_flash_env.sv`](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_env.sv) (Environment), [`RTL/spi_flash_controller.sv`](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_controller.sv) (SPI Controller), [`TB/spi_flash_monitor.sv`](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_monitor.sv) (Monitor), [`TB/spi_flash_driver.sv`](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_driver.sv) (Driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controller["Flash Controller"]
  node_dut["SPI Controller"]
  node_spi_interface["SPI Interface<br/>[spi_flash_if.sv]"]
end

subgraph group_verification["Verification Environment"]
  node_testbench["Testbench Top"]
  node_test["Test<br/>[spi_flash_test.sv]"]
  node_environment["Environment<br/>[spi_flash_env.sv]"]
  node_transaction["Transaction"]
  node_generator["Generator"]
  node_driver["Driver"]
  node_monitor["Monitor"]
  node_scoreboard["Scoreboard"]
  node_coverage["Coverage Collector"]
  node_assertions["Assertions"]
end

subgraph group_flash["Flash Device"]
  node_flash_model[("Flash Model<br/>[spi_flash_model.sv]")]
end

node_host(("Host System"))

node_host -->|"requests operations"| node_dut
node_dut -->|"uses signals"| node_spi_interface
node_dut -->|"communicates via SPI"| node_flash_model
node_testbench -->|"runs"| node_test
node_test -->|"starts"| node_environment
node_environment -->|"coordinates"| node_generator
node_environment -->|"coordinates"| node_driver
node_environment -->|"coordinates"| node_monitor
node_environment -->|"coordinates"| node_scoreboard
node_environment -->|"coordinates"| node_coverage
node_generator -->|"creates"| node_transaction
node_driver -->|"uses"| node_transaction
node_driver -->|"drives"| node_spi_interface
node_monitor -->|"observes"| node_spi_interface
node_scoreboard -->|"checks observations"| node_monitor
node_coverage -->|"collects coverage"| node_monitor
node_assertions -->|"checks behavior"| node_dut

click node_dut "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_controller.sv"
click node_spi_interface "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_if.sv"
click node_flash_model "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_model.sv"
click node_testbench "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/tb_spi_flash_controller.sv"
click node_test "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_test.sv"
click node_environment "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_env.sv"
click node_transaction "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_transaction.sv"
click node_generator "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_generator.sv"
click node_driver "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_driver.sv"
click node_monitor "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_monitor.sv"
click node_scoreboard "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_scoreboard.sv"
click node_coverage "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_coverage.sv"
click node_assertions "https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_assertions.sv"

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_dut,node_spi_interface toneBlue
class node_testbench,node_test,node_environment,node_transaction,node_generator,node_driver,node_monitor,node_scoreboard,node_coverage,node_assertions toneAmber
class node_flash_model toneMint
class node_host toneIndigo
```

## Components

### Flash Controller

- [SPI Controller](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_controller.sv): `RTL/spi_flash_controller.sv`
- [SPI Interface](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_if.sv): `RTL/spi_flash_if.sv`

### Verification Environment

- [Testbench Top](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/tb_spi_flash_controller.sv): `TB/tb_spi_flash_controller.sv`
- [Test](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_test.sv): `TB/spi_flash_test.sv`
- [Environment](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_env.sv): `TB/spi_flash_env.sv`
- [Transaction](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_transaction.sv): `TB/spi_flash_transaction.sv`
- [Generator](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_generator.sv): `TB/spi_flash_generator.sv`
- [Driver](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_driver.sv): `TB/spi_flash_driver.sv`
- [Monitor](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_monitor.sv): `TB/spi_flash_monitor.sv`
- [Scoreboard](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_scoreboard.sv): `TB/spi_flash_scoreboard.sv`
- [Coverage Collector](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_coverage.sv): `TB/spi_flash_coverage.sv`
- [Assertions](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/TB/spi_flash_assertions.sv): `TB/spi_flash_assertions.sv`

### Flash Device

- [Flash Model](https://github.com/mudumanojkumarnaik/spi_nor_flash_controller_sv/blob/main/RTL/spi_flash_model.sv): `RTL/spi_flash_model.sv`

### Other components

- **Host System**

## Connections

- Host System → SPI Controller: requests operations
- SPI Controller → SPI Interface: uses signals
- SPI Controller → Flash Model: communicates via SPI
- Testbench Top → Test: runs
- Test → Environment: starts
- Environment → Generator: coordinates
- Environment → Driver: coordinates
- Environment → Monitor: coordinates
- Environment → Scoreboard: coordinates
- Environment → Coverage Collector: coordinates
- Generator → Transaction: creates
- Driver → Transaction: uses
- Driver → SPI Interface: drives
- Monitor → SPI Interface: observes
- Scoreboard → Monitor: checks observations
- Coverage Collector → Monitor: collects coverage
- Assertions → SPI Controller: checks behavior
