# nmikstas/dsp-in-fpga architecture

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

- Interactive diagram: https://gitdiagram.com/nmikstas/dsp-in-fpga
- Repository: https://github.com/nmikstas/dsp-in-fpga

## Overview

##### Main Components
- FIR Filter – Located in the FIR folder with its HLS and Matlab implementations.
- Digital Up-Converter (DUC) – Found in the DUC directory.
- Digital Down-Converter (DDC) – Found in the DDC directory.
- Direct Digital Synthesizer (DDS) – Found in the DDS directory.
- Supporting Simulation/Verification Environment – Represented by the Matlab directories that accompany each module. This shows how simulation data (e.g., input and output .dat files) and error calculations are integrated.

##### Relationships and Interactions
- Data Flow: Identify that each DSP block (whether FIR, DUC, DDC, or DDS) interacts with data files (e.g., coefficient files, testbench inputs, and golden results) to simulate real-world signals.
- Interconnection Between Blocks: Although the modules are developed as distinct components, in a full system they could be connected in series (for example, a synthesizer generating the signal that is then conditioned by a filter, or up-/down-conversion stages in a chain). If applicable, indicate potential data pipelines or control signal flows between these DSP blocks.

##### Architectural Patterns and Technologies
- Separation of Concerns: The design clearly splits the hardware implementation (HLS code) and the simulation/analysis (Matlab scripts), which should be visually distinct.
- File-based Data Interfacing: Many modules interact via external files (.dat files) for coefficients, input, output, and error calculation. This indicates that file I/O is an integral part of the simulation environment.
- DSP Functionality: Emphasize that the system is designed for FPGA DSP implementations, meaning that timing, precision (handling of fixed-point arithmetic in HLS, for instance), and integration with hardware are key design principles.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Hardware Implementation (HLS)"
        FIR_HLS["FIR Filter (HLS)"]
        DUC_HLS["DUC (HLS)"]
        DDC_HLS["DDC (HLS)"]
        DDS_HLS["DDS (HLS)"]
    end

    subgraph "Simulation & Verification (Matlab)"
        FIR_Matlab["FIR Filter (Matlab)"]
        DUC_Matlab["DUC (Matlab)"]
        DDC_Matlab["DDC (Matlab)"]
        DDS_Matlab["DDS (Matlab)"]
    end

    subgraph "File I/O (.dat)"
        Files["Data Files (Coefficients,Testbench,Golden)"]
    end

    %% Data flow connections between Simulation and Hardware blocks
    DDS_Matlab -->|"simulate"| DDS_HLS
    DDS_HLS -->|"signalOut"| DUC_HLS
    DUC_Matlab -->|"verify"| DUC_HLS
    DUC_HLS -->|"signalOut"| FIR_HLS
    FIR_Matlab -->|"verify"| FIR_HLS
    FIR_HLS -->|"signalOut"| DDC_HLS
    DDC_Matlab -->|"verify"| DDC_HLS

    %% Additional verification/testbench links (dotted lines)
    FIR_Matlab --- FIR_HLS
    DUC_Matlab --- DUC_HLS
    DDC_Matlab --- DDC_HLS
    DDS_Matlab --- DDS_HLS

    %% File I/O interfacing nodes
    FIR_Matlab -->|"inputFiles"| Files
    DUC_Matlab -->|"inputFiles"| Files
    DDC_Matlab -->|"inputFiles"| Files
    DDS_Matlab -->|"inputFiles"| Files

    FIR_HLS -->|"outputFiles"| Files
    DUC_HLS -->|"outputFiles"| Files
    DDC_HLS -->|"outputFiles"| Files
    DDS_HLS -->|"outputFiles"| Files

    %% Click Events for Components
    click FIR_HLS "https://github.com/nmikstas/dsp-in-fpga/tree/master/FIR/HLS"
    click FIR_Matlab "https://github.com/nmikstas/dsp-in-fpga/tree/master/FIR/Matlab"
    click DUC_HLS "https://github.com/nmikstas/dsp-in-fpga/tree/master/DUC/HLS"
    click DUC_Matlab "https://github.com/nmikstas/dsp-in-fpga/tree/master/DUC/Matlab"
    click DDC_HLS "https://github.com/nmikstas/dsp-in-fpga/tree/master/DDC/HLS"
    click DDC_Matlab "https://github.com/nmikstas/dsp-in-fpga/tree/master/DDC/Matlab"
    click DDS_HLS "https://github.com/nmikstas/dsp-in-fpga/tree/master/DDS/HLS"
    click DDS_Matlab "https://github.com/nmikstas/dsp-in-fpga/tree/master/DDS/Matlab"

    %% Class Definitions for Colors
    classDef hls fill:#AED6F1,stroke:#5DADE2,stroke-width:2px;
    classDef matlab fill:#A9DFBF,stroke:#58D68D,stroke-width:2px;
    classDef files fill:#F9E79F,stroke:#F4D03F,stroke-width:2px;

    class FIR_HLS,DUC_HLS,DDC_HLS,DDS_HLS hls;
    class FIR_Matlab,DUC_Matlab,DDC_Matlab,DDS_Matlab matlab;
    class Files files;
```
