# freecores/dma_ahb architecture

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

- Interactive diagram: https://gitdiagram.com/freecores/dma_ahb
- Repository: https://github.com/freecores/dma_ahb

## Overview

##### Project Type and Purpose
- This is an open-source hardware IP core written in Verilog: a generic, high-performance dual-core AHB DMA engine.
- It provides two builds (32-bit and 64-bit) for on-chip data movement via the AMBA AHB bus, with an APB-based register interface for control.

##### File Structure Analysis
- Top-level:
- README.txt (project overview)
- doc/PR201_trm_rev1.5.pdf (technical reference manual)
- src/
– dma_ahb32/ (32-bit build)
– dma_ahb64/ (64-bit build)
- Each build directory contains:
- dma_ahbXX.v (top-level wrapper)
- dma_ahbXX_dual_core.v (combines two cores)
- dma_ahbXX_core0*.v (core‐specific channel, arbiter, timeout, FIFO, etc.)
- dma_ahbXX_reg*.v (APB slave register interface)
- prgen_*.v (generic helper modules: mux, FIFO, stall logic, min, scatter/gather, etc.)

##### Key Insights from README
- The core instantiates two identical “core0” engines under a dual-core wrapper.
- Control/configuration is performed over an APB slave interface (register block).
- Data movement occurs as an AHB master, with separate read/write channels per core.
- The prgen_* library provides reusable building blocks across both builds.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Interfaces
    CPU["CPU / APB Bus"]:::external
    MEM["Memory / Peripherals\n(AHB Bus)"]:::external

    %% Control Plane
    APB_SLAVE["APB Slave Interface"]:::control
    click APB_SLAVE "https://github.com/freecores/dma_ahb/blob/master/src/dma_ahb32/dma_ahb32_reg.v"

    %% Top-Level Wrapper
    TOP_WRAPPER["DMA AHB32 Top-Level Wrapper"]:::data
    click TOP_WRAPPER "https://github.com/freecores/dma_ahb/blob/master/src/dma_ahb32/dma_ahb32.v"

    %% Dual-Core Wrapper
    DUAL_CORE["Dual-Core DMA Wrapper"]:::data
    click DUAL_CORE "https://github.com/freecores/dma_ahb/blob/master/src/dma_ahb32/dma_ahb32_dual_core.v"

    %% Data Plane Channels
    AHB_RD["AHB Master Read Channel"]:::data
    click AHB_RD "https://github.com/freecores/dma_ahb/blob/master/src/dma_ahb32/dma_ahb32_core0_ahbm_rd.v"

    AHB_WR["AHB Master Write Channel"]:::data
    click AHB_WR "https://github.com/freecores/dma_ahb/blob/master/src/dma_ahb32/dma_ahb32_core0_ahbm_wr.v"

    %% PRGEN Library
    subgraph "prgen Library" 
        PRGEN_MUX["prgen_* Modules"]:::prgen
    end
    click PRGEN_MUX "https://github.com/freecores/dma_ahb/blob/master/src/dma_ahb32/prgen_*.v"

    %% Connections
    CPU --> APB_SLAVE
    APB_SLAVE --> TOP_WRAPPER
    TOP_WRAPPER --> DUAL_CORE

    DUAL_CORE --> AHB_RD
    AHB_RD --> MEM
    MEM --> AHB_WR
    AHB_WR --> DUAL_CORE

    DUAL_CORE --> PRGEN_MUX

    %% Styles
    classDef control fill:#cce5ff,stroke:#337ab7,color:#337ab7
    classDef data fill:#dff0d8,stroke:#3c763d,color:#3c763d
    classDef prgen fill:#fcf8e3,stroke:#8a6d3b,color:#8a6d3b
    classDef external fill:#f5f5f5,stroke:#ccc,color:#666
```
