# lelocquocthinh/8-bit-risc-architecture-cpu architecture

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

- Interactive diagram: https://gitdiagram.com/lelocquocthinh/8-bit-risc-architecture-cpu
- Repository: https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu

## Overview

##### Main components
- Simulation Environment: Represent the “project_1.sim” directory which holds the test benches (e.g., TB_CPU_right, tb_clock_gene, testbenchForCPU) used to verify the design.
- Synthesis and Implementation Outputs: Include blocks for “project_1.runs/synth_1” and “project_1.runs/impl_1” showing the synthesis results (e.g., .dcp files, reports) and implementation results (e.g., bitstream files like CPU.bit, reports, .tcl scripts).
- Vivado Project and IP/User Files: Optionally add a component denoting project configurations (from folders such as “project_1.hw” and “project_1.ip_user_files”) that hold additional project and IP configuration data.
- Target Hardware: At the highest level, show the Arty Z7 board as the physical deployment target.

##### Relationships and interactions
- Flow from RTL source → Synthesis → Implementation → Bitstream Generation.
- Link simulation test benches (from “project_1.sim”) with the RTL source modules to indicate verification.
- Dependencies where design configuration files (in project_1.hw and project_1.ip_user_files) feed into the synthesis and implementation stages.
- That the Vivado toolchain (represented as an overarching process) orchestrates these interactions.

##### Important architectural patterns and principles
- Design flow typical of FPGA projects – starting with RTL design entry (using modular blocks), moving through simulation for verification, then synthesis and physical implementation.
- Usage of design constraints (such as .xdc files visible in some run directories) and configuration scripts (.tcl files) as integral parts of the process.
- If applicable, note that there is a separation between design creation (in the “srcs” folder), simulation/verification (in the “sim” folder), and hardware implementation (in the “runs” folders). This separation reflects best practices in hardware design.

##### Relevant technologies and tools
- Vivado Platform: Show that the entire development and build process uses Vivado.
- Verilog/VHDL: Mention that the source files (e.g., CPU.v, ALU_real.v) are implemented in a hardware description language.
- Simulation tools (e.g., XSIM) – which are evident in the simulation directories under the “behav/xsim” sub-folders.
- Target Board: Arty Z7 board is your physical device.

##### Elements
- Clear labels: Each block or module should be clearly named (e.g., “CPU Core”, “ALU”, “Clock Generator”, “Synthesis Process”, “Implementation Process”, “Simulation Test Bench”, “Arty Z7 Board”).

- At the top, place a block “Vivado Environment” that encapsulates the design flow.
- RTL Design & Source Files: Represent the “project_1.srcs/sources_1/new” modules.
- Simulation/Verification: Represent test benches from “project_1.sim”.
- Synthesis & Implementation: Represent outputs from “project_1.runs/synth_1” and “project_1.runs/impl_1”, including configuration and bitstream generation.
- Finally, indicate deployment onto the “Arty Z7 Board” — showing that the bitstream generated is programmed onto this hardware.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Vivado Environment"
        direction TB
        subgraph "RTL Design & Source Files"
            direction TB
            RTL["RTL Source Modules"]:::rtl
        end
        subgraph "Simulation/Verification"
            direction TB
            SIM["Simulation Environment"]:::sim
        end
        subgraph "Synthesis & Implementation"
            direction TB
            SYN["Synthesis Outputs"]:::synth
            IMPL["Implementation Outputs"]:::impl
            PC["Project Configuration"]:::config
            IP["IP/User Files"]:::config
            BITS["Bitstream Generation"]:::bit
        end
    end
    BOARD["Arty Z7 Board"]:::board

    %% Connections for design flow
    RTL -->|"synthesized_by"| SYN
    SYN -->|"implemented_by"| IMPL
    IMPL -->|"generates"| BITS
    BITS -->|"programs"| BOARD

    %% Connections for simulation feedback
    RTL ---|"verified_by"| SIM
    SIM ---|"feedback_to"| RTL

    %% Connections for configuration support
    PC -->|"supports"| SYN
    IP -->|"supports"| IMPL

    %% Click Events
    click RTL "https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu/tree/main/project_1.srcs/sources_1/new"
    click SIM "https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu/blob/main/project_1.sim"
    click SYN "https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu/tree/main/project_1.runs/synth_1"
    click IMPL "https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu/tree/main/project_1.runs/impl_1"
    click PC "https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu/blob/main/project_1.hw"
    click IP "https://github.com/lelocquocthinh/8-bit-risc-architecture-cpu/blob/main/project_1.ip_user_files"

    %% Styles
    classDef rtl fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef sim fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef synth fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef impl fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef config fill:#9370DB,stroke:#000,stroke-width:1px;
    classDef bit fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef board fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
