# mooreslabaiv1/public architecture

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

- Interactive diagram: https://gitdiagram.com/mooreslabaiv1/public
- Repository: https://github.com/mooreslabaiv1/public

## Overview

##### Project Type and Purpose
- This repository is an open-source hardware IP demo library. Each top-level folder named IP_<name> contains a standalone RTL design (in SystemVerilog), its specification and testplan, plus a fully featured UVM-based verification environment.
- Purpose: showcase how to package, verify, and document basic accelerator, FSM, encoder, serial interface, and arbiter IPs.

##### Main Components
For each IP_<module> directory:
a. RTL Block
- rtl/full_rtl.sv or crc32_accelerator_p.sv – the synthesizable design
b. Specs & Testplan
- specs/*.txt or .pdf – high-level architecture and micro-arch spec
- testplan/*.txt or .csv – test cases and coverage goals
c. Verification Environment (verif/)
- env/ – UVM.env, agent instantiations
- src/ – drivers, monitors, sequences, reference models, scoreboard (for weighted_round_robin2)
- / – common include files (interfaces.incl, tb_src.incl)
- run/ – Makefile, rtl.f, testlist.f, run.sh scripts to compile and simulate
- tb/ – top-level testbench module

##### Relationships & Data Flow
- The RTL DUT sits at the center.
- From seq. library ➔ sequences drive agent driver ➔ DUT interface ➔ DUT block.
- DUT outputs ➔ agent monitor ➔ scoreboard/reference model ➔ coverage collector.
- run.sh / Makefile orchestrates compilation of RTL + testbench + UVM libraries + simulation run, then collects reports.

##### Architectural Patterns & Design Principles
- Directory-per-IP pattern promotes isolation: each IP is self-contained.
- UVM methodology: env + agent + drivers + monitors + sequences + scoreboard.
- Consistent naming convention: IP_<name>/rtl, spec(s), testplan, verif/{env,src,include,run,tb,tests}.
- For the weighted_round_robin2 IP: shows advanced UVM with multiple agents, scoreboard package, top-level env_cfg.

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef rtl fill:#cce5ff,stroke:#004085,color:#004085;
    classDef spec fill:#ffe5b4,stroke:#cc7000,color:#8a4b08;
    classDef testplan fill:#ffe5b4,stroke:#cc7000,color:#8a4b08;
    classDef uvmEnv fill:#d4edda,stroke:#155724,color:#155724;
    classDef src fill:#d4edda,stroke:#155724,color:#155724;
    classDef include fill:#d4edda,stroke:#155724,color:#155724;
    classDef run fill:#e2e3e5,stroke:#6c757d,color:#383d41;
    classDef tb fill:#d4edda,stroke:#155724,color:#155724;
    classDef root fill:#f8f9fa,stroke:#6c757d,color:#383d41;

    subgraph "Repository Root"
        Root["README.md"]:::root
    end
    click Root "https://github.com/mooreslabaiv1/public/blob/main//README.md"

    %% CRC32 Accelerator IP
    subgraph "IP_crc32_accelerator"
        direction TB
        spec_crc32["crc32_micro_arch_spec.txt"]:::spec
        spec_crc32b["crc_compute_method.txt"]:::spec
        testplan_crc32["crc32_accelerator_p_testplan.csv/.txt"]:::testplan
        rtl_crc32["crc32_accelerator_p.sv"]:::rtl
        subgraph "Verification Environment"
            direction TB
            env_crc32["crc32_accelerator_p_env.sv"]:::uvmEnv
            agent_crc32["crc32_accelerator_agent.sv"]:::uvmEnv
            src_crc32["Drivers/Monitors/Sequences/RefModel/SBD"]:::src
            include_crc32["interfaces.incl/tb_src.incl/crc32_accelerator_p_env_inc.sv"]:::include
            run_crc32["Makefile/rtl.f/testlist.f/run.sh"]:::run
            tb_crc32["crc32_accelerator_p_tb_top.sv"]:::tb
        end
    end
    click spec_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/specs/crc32_micro_arch_spec.txt"
    click spec_crc32b "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/specs/crc_compute_method.txt"
    click testplan_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/testplan/crc32_accelerator_p_testplan.csv"
    click rtl_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/rtl/crc32_accelerator_p.sv"
    click env_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/verif/env/crc32_accelerator_p_env.sv"
    click agent_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/verif/env/crc32_accelerator_agent.sv"
    click include_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/verif/include/interfaces.incl"
    click run_crc32 "https://github.com/mooreslabaiv1/public/tree/main/IP_crc32_accelerator/verif/run/Makefile"
    click tb_crc32 "https://github.com/mooreslabaiv1/public/blob/main/IP_crc32_accelerator/verif/tb/crc32_accelerator_p_tb_top.sv"

    %% Common Flow
    Root -->|"contains"| IP_crc32_accelerator

    spec_crc32 -->|"informs"| rtl_crc32
    spec_crc32b -->|"informs"| rtl_crc32
    testplan_crc32 -->|"guides"| env_crc32
    rtl_crc32 -->|"DUT"| tb_crc32

    src_crc32 -->|"sequences drive"| agent_crc32
    agent_crc32 -->|"drives"| rtl_crc32
    rtl_crc32 -->|"outputs to"| src_crc32
    src_crc32 -->|"monitored by"| include_crc32
    tb_crc32 -->|"includes"| run_crc32

    %% Other IP Modules (simplified)
    subgraph "Other IPs"
        direction TB
        IP_fsm_bits_seek_detect["IP_fsm_bits_seek_detect"]:::root
        IP_fsm_one_hot["IP_fsm_one_hot"]:::root
        IP_priority_encoder["IP_priority_encoder"]:::root
        IP_serial_data_transfer["IP_serial_data_transfer"]:::root
        IP_weighted_round_robin["IP_weighted_round_robin"]:::root
        IP_weighted_round_robin2["IP_weighted_round_robin2"]:::root
    end

    Root --> IP_fsm_bits_seek_detect
    Root --> IP_fsm_one_hot
    Root --> IP_priority_encoder
    Root --> IP_serial_data_transfer
    Root --> IP_weighted_round_robin
    Root --> IP_weighted_round_robin2

    class Root,IP_fsm_bits_seek_detect,IP_fsm_one_hot,IP_priority_encoder,IP_serial_data_transfer,IP_weighted_round_robin,IP_weighted_round_robin2 root
```
