# baladhinesh/accelerating_standard_and_modified_aes128 architecture

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

- Interactive diagram: https://gitdiagram.com/baladhinesh/accelerating_standard_and_modified_aes128
- Repository: https://github.com/baladhinesh/accelerating_standard_and_modified_aes128

## Overview

##### Project type and purpose
- This is a hardware‐software co-design project for accelerating AES and two Modified-AES variants on an FPGA (Artix-7 or Zynq) using Verilog IP cores wrapped by a MicroBlaze (or Zynq PS) CPU.
- It includes:
- Baseline and two Modified AES implementations in Verilog (with testbenches)
- A VitisIDE C application (aes_encryption.c) running on the soft CPU to feed plaintext and key and read ciphertext via UART/JTAG
- A Python script to compute Hamming distance and plot Avalanche effect
- An exploration of OpenLane/SiliconCompiler flows

##### File structure
- Baseline-AES/Modified-AES-V1/Modified-AES-V2: each contains the Verilog modules (aes_top, round iteration, sub_bytes, shift_rows, mix_columns, generate_key, last_round, forward_substitution_box), plus version-specific key_schedule or modulo/addition blocks and testbench.v
- ip_repo/myip_aes_bram_1.0:
- hdl/: AES core RTL wrapped with AXI-lite slave interface
- drivers/: C driver for bare-metal access
- example_designs/: Vivado project TCL for simulation/hardware test benches
- VitisIDE/: contains aes_encryption.c which instantiates the IP via Xil_In32/Xil_Out32 over AXI, uses UART for console I/O
- Hamming_Data/: data files and a Python script for post-processing AES outputs

##### Insights from the README
- The block design (Vivado IP Integrator) ties together: MicroBlaze CPU, AXI Interconnect, AES BRAM IP, Block RAM for data buffering, UART (via JTAG), DDR controller
- Performance comparisons between software simulation on PC and hardware acceleration
- Use of Vitis to build the firmware (C code) and download bitstream

##### Final pointers
- Be exhaustive: show all 4 AES sub-modules under the AES IP if clarity is needed, or collapse them into one “AES Round Pipeline” block
- Confidence/status/control signals (start, done, interrupt) between CPU and AES IP
- If depicting the open-source ASIC flow, show a side path from Verilog RTL → Yosys → OpenRoad → GDSII
- This level of detail will give a clear, accurate view of both the hardware and software components, their interactions, and the data flow from plaintext in the PC all the way to encrypted ciphertext and post-analysis.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Subgraph: Software Domain
    subgraph "Software Domain"
        PC["Host PC"]:::software
        Python["Hamming & Avalanche Analysis"]:::software
    end

    %% Subgraph: Firmware Domain
    subgraph "Firmware Domain"
        CPU["MicroBlaze CPU"]:::firmware
        App["AES Encryption C App"]:::firmware
        UART["JTAG UART"]:::memory
    end

    %% Subgraph: Hardware Domain
    subgraph "Hardware Domain"
        interconnect["AXI Interconnect"]:::bus
        subgraph "Custom AES Accelerator IP" 
            AESIP["AES Accelerator IP"]:::hardware
            BRAM["BRAM (S-box)"]:::memory
        end
        DDR["DDR Controller"]:::memory
    end

    %% Subgraph: ASIC Flow
    subgraph "Open-Source ASIC Flow"
        RTL["Verilog RTL Repos"]:::asic
        Yosys["Yosys"]:::asic
        OpenRoad["OpenROAD"]:::asic
        GDSII["GDSII"]:::asic
    end

    %% Connections
    PC -->|"UART/JTAG"| UART
    UART -->|"plaintext & key"| CPU
    CPU -->|"AXI4-Lite Write Data[127:0]"| interconnect
    interconnect -->|"to AES IP"| AESIP
    AESIP -->|"reads S-box"| BRAM
    AESIP -->|"AXI4-Lite Read Status"| interconnect
    interconnect -->|"ciphertext"| CPU
    CPU -->|"UART print ciphertext"| UART
    UART -->|return| PC
    PC -->|"offline analysis"| Python

    CPU -->|uses| App

    %% ASIC flow connections
    RTL --> Yosys --> OpenRoad --> GDSII

    %% Click Events
    click PC "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/blob/main/README.md"
    click Python "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/blob/main/Hamming_Data/Hamming_Distance_Calculator.py"
    click App "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/blob/main/VitisIDE/aes_encryption.c"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/tree/main/Baseline-AES/"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/tree/main/Modified-AES-V1/"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/tree/main/Modified-AES-V2/"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/tree/main/ip_repo/myip_aes_bram_1.0/hdl/"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/tree/main/ip_repo/myip_aes_bram_1.0/src/"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/blob/main/ip_repo/myip_aes_bram_1.0/drivers/myip_aes_bram_v1_0/src/myip_aes_bram.c"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/tree/main/ip_repo/myip_aes_bram_1.0/example_designs/"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/blob/main/Modified-AES-V1/yosys_synthesis_report.txt"
    click RTL "https://github.com/baladhinesh/accelerating_standard_and_modified_aes128/blob/main/Modified-AES-V2/yosys_synthesis_report.txt"

    %% Styles
    classDef software fill:#D4E6F1,stroke:#2980B9,color:#1B4F72
    classDef firmware fill:#D5F5E3,stroke:#27AE60,color:#145A32
    classDef hardware fill:#D1F2EB,stroke:#16A085,color:#0E6251
    classDef memory fill:#FCF3CF,stroke:#D4AC0D,color:#7E5109
    classDef bus fill:#E5E8E8,stroke:#566573,color:#2C3E50
    classDef asic fill:#FDEDEC,stroke:#C0392B,color:#641E16
```
