# rajavardh/aes_128_ctr architecture

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

- Interactive diagram: https://gitdiagram.com/rajavardh/aes_128_ctr
- Repository: https://github.com/rajavardh/aes_128_ctr

## Overview

This repository is an APB-based SystemVerilog verification environment for AES-128 CTR encryption/decryption. The intended flow is to select a test, run coordinated master/slave sequences through APB agents and BFMs, then compare observed behavior with a software AES-CTR reference in the scoreboard. The tree shows the testbench structure, but most SystemVerilog implementations were not excerpted; their connections are therefore shown as unverified dashed edges. The excerpt explicitly documents the scoreboard-to-DPI reference call. No AES RTL implementation is present in the supplied tree.

Main entry points: [`src/hvl_top/test/virtual_sequences`](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/virtual_sequences) (Virtual Sequences), [`src/hvl_top/env/apb_env.sv`](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/apb_env.sv) (APB Environment), [`src/hdl_top/apb_if/apb_if.sv`](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hdl_top/apb_if/apb_if.sv) (APB Interface), [`src/hvl_top/env/apb_scoreboard.sv`](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/apb_scoreboard.sv) (Scoreboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tests["Tests and Sequences"]
  node_testlist["Regression List"]
  node_tests_pkg["Test Cases"]
  node_virtual_seq["Virtual Sequences"]
  node_master_seq["Master Sequences"]
  node_slave_seq["Slave Sequences"]
end

subgraph group_verification["UVM Verification"]
  node_env["APB Environment<br/>[apb_env.sv]"]
  node_vsequencer["Virtual Sequencer"]
  node_scoreboard["Scoreboard<br/>[apb_scoreboard.sv]"]
  node_master_agent["Master Agent"]
  node_slave_agent["Slave Agent<br/>[apb_slave_agent.sv]"]
  node_hvl_top["HVL Top<br/>[hvl_top.sv]"]
end

subgraph group_bus["APB Interface Layer"]
  node_apb_if["APB Interface<br/>[apb_if.sv]"]
  node_master_bfm["Master BFM"]
  node_slave_bfm["Slave BFM"]
  node_hdl_top["HDL Top<br/>[hdl_top.sv]"]
end

subgraph group_reference["Reference Checking"]
  node_aes_dpi["AES-CTR Reference<br/>[aes_dpi.c]"]
end

node_user(("Verification User"))
node_aes_rtl["AES DUT"]
node_engineer(("Simulation Engineer"))

node_user -.->|"chooses tests"| node_testlist
node_testlist -.->|"selects cases"| node_tests_pkg
node_tests_pkg -.->|"starts sequences"| node_virtual_seq
node_virtual_seq -.->|"coordinates"| node_vsequencer
node_virtual_seq -.->|"runs"| node_master_seq
node_virtual_seq -.->|"runs"| node_slave_seq
node_master_seq -.->|"drives transactions"| node_master_agent
node_slave_seq -.->|"drives responses"| node_slave_agent
node_hvl_top -.->|"instantiates"| node_env
node_env -.->|"configures"| node_master_agent
node_env -.->|"configures"| node_slave_agent
node_env -.->|"includes"| node_scoreboard
node_master_agent -.->|"drives"| node_master_bfm
node_slave_agent -.->|"drives"| node_slave_bfm
node_master_bfm -.->|"signals"| node_apb_if
node_slave_bfm -.->|"signals"| node_apb_if
node_hdl_top -.->|"instantiates"| node_apb_if
node_apb_if -.->|"connects APB"| node_aes_rtl
node_scoreboard -->|"calls reference"| node_aes_dpi
node_scoreboard -.->|"checks output"| node_aes_rtl
node_engineer -.->|"initiates run"| node_testlist

click node_testlist "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/testlists/apb_regression.list"
click node_tests_pkg "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test"
click node_virtual_seq "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/virtual_sequences"
click node_master_seq "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/sequences/master_sequences"
click node_slave_seq "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/sequences/slave_sequences"
click node_env "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/apb_env.sv"
click node_vsequencer "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/env/virtual_sequencer"
click node_scoreboard "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/apb_scoreboard.sv"
click node_master_agent "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/master/apb_master_agent.sv"
click node_slave_agent "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/slave/apb_slave_agent.sv"
click node_hvl_top "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/hvl_top.sv"
click node_apb_if "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hdl_top/apb_if/apb_if.sv"
click node_master_bfm "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hdl_top/master_agent_bfm"
click node_slave_bfm "https://github.com/rajavardh/aes_128_ctr/tree/main/src/hdl_top/slave_agent_bfm"
click node_hdl_top "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hdl_top/hdl_top.sv"
click node_aes_dpi "https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/aes_dpi.c"

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_testlist,node_tests_pkg,node_virtual_seq,node_master_seq,node_slave_seq,node_user toneBlue
class node_env,node_vsequencer,node_scoreboard,node_master_agent,node_slave_agent,node_hvl_top toneAmber
class node_apb_if,node_master_bfm,node_slave_bfm,node_hdl_top toneMint
class node_aes_dpi toneRose
class node_aes_rtl,node_engineer toneIndigo
```

## Components

### Tests and Sequences

- [Regression List](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/testlists/apb_regression.list): `src/hvl_top/testlists/apb_regression.list`
- [Test Cases](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test): `src/hvl_top/test`
- [Virtual Sequences](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/virtual_sequences): `src/hvl_top/test/virtual_sequences`
- [Master Sequences](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/sequences/master_sequences): `src/hvl_top/test/sequences/master_sequences`
- [Slave Sequences](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/test/sequences/slave_sequences): `src/hvl_top/test/sequences/slave_sequences`

### UVM Verification

- [APB Environment](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/apb_env.sv): `src/hvl_top/env/apb_env.sv`
- [Virtual Sequencer](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hvl_top/env/virtual_sequencer): `src/hvl_top/env/virtual_sequencer`
- [Scoreboard](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/apb_scoreboard.sv): `src/hvl_top/env/apb_scoreboard.sv`
- [Master Agent](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/master/apb_master_agent.sv): `src/hvl_top/master/apb_master_agent.sv`
- [Slave Agent](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/slave/apb_slave_agent.sv): `src/hvl_top/slave/apb_slave_agent.sv`
- [HVL Top](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/hvl_top.sv): `src/hvl_top/hvl_top.sv`

### APB Interface Layer

- [APB Interface](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hdl_top/apb_if/apb_if.sv): `src/hdl_top/apb_if/apb_if.sv`
- [Master BFM](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hdl_top/master_agent_bfm): `src/hdl_top/master_agent_bfm`
- [Slave BFM](https://github.com/rajavardh/aes_128_ctr/tree/main/src/hdl_top/slave_agent_bfm): `src/hdl_top/slave_agent_bfm`
- [HDL Top](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hdl_top/hdl_top.sv): `src/hdl_top/hdl_top.sv`

### Reference Checking

- [AES-CTR Reference](https://github.com/rajavardh/aes_128_ctr/blob/main/src/hvl_top/env/aes_dpi.c): `src/hvl_top/env/aes_dpi.c`

### Other components

- **Verification User**
- **AES DUT**
- **Simulation Engineer**

## Connections

- Verification User → Regression List: chooses tests
- Regression List → Test Cases: selects cases
- Test Cases → Virtual Sequences: starts sequences
- Virtual Sequences → Virtual Sequencer: coordinates
- Virtual Sequences → Master Sequences: runs
- Virtual Sequences → Slave Sequences: runs
- Master Sequences → Master Agent: drives transactions
- Slave Sequences → Slave Agent: drives responses
- HVL Top → APB Environment: instantiates
- APB Environment → Master Agent: configures
- APB Environment → Slave Agent: configures
- APB Environment → Scoreboard: includes
- Master Agent → Master BFM: drives
- Slave Agent → Slave BFM: drives
- Master BFM → APB Interface: signals
- Slave BFM → APB Interface: signals
- HDL Top → APB Interface: instantiates
- APB Interface → AES DUT: connects APB
- Scoreboard → AES-CTR Reference: calls reference (evidence: `src/hvl_top/env/aes_dpi.c`)
- Scoreboard → AES DUT: checks output
- Simulation Engineer → Regression List: initiates run
