# djuara-rbz/tt_spi_pwm architecture

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

- Interactive diagram: https://gitdiagram.com/djuara-rbz/tt_spi_pwm
- Repository: https://github.com/djuara-rbz/tt_spi_pwm

## Overview

**[Design Sources] → [Build System] → [Output Artifacts]**

##### Detailed Component Breakdown

A. Design Sources Layer (Left Side):
- edge_detector.v
- pwm.v
- spi_own_clock.v
- spi_sampled.v
- project.v (mark as top module)
- Configuration container:
- config.tcl
- info.yaml

B. Build System Layer (Middle):
- OpenLane Build Flow container
- GitHub Actions Workflows container showing:
- GDS workflow
- Documentation workflow
- Test workflow

C. Output Artifacts Layer (Right Side):
- ASIC Layout (GDS) container
- Documentation container
- Test Results container

##### Connections and Data Flow

- How source files are compiled together
- How configuration files influence the build
- The flow through the OpenLane toolchain
- Test verification paths
- Documentation generation paths

##### Additional Elements

- External dependencies (OpenLane)
- TinyTapeout platform integration
- Testing framework

- The hierarchical nature of the Verilog design
- The automated build and verification process
- The integration with TinyTapeout's manufacturing flow

Key Relationships to Highlight:
##### The final ASIC generation pipeline

- Symbols for files, processes, and external tools
- Build/verification stages with appropriate markers

Level of Detail:
- Timing or sequence information where relevant

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style definitions
    classDef source fill:#a8d1f0,stroke:#333
    classDef config fill:#90EE90,stroke:#333
    classDef build fill:#FFA500,stroke:#333
    classDef output fill:#DDA0DD,stroke:#333
    classDef external fill:#D3D3D3,stroke:#333

    subgraph Design
        Sources["Design Sources"]
        subgraph VerilogFiles
            TopMod["project.v (Top Module)"]
            Edge["edge_detector.v"]
            PWM["pwm.v"]
            SPIOwn["spi_own_clock.v"]
            SPISamp["spi_sampled.v"]
        end
        subgraph ConfigFiles
            OpenCfg["config.tcl"]
            InfoYaml["info.yaml"]
        end
    end

    subgraph BuildSystem
        OpenLane["OpenLane Build Flow"]:::external
        subgraph GHActions["GitHub Actions"]
            GDSFlow["GDS Workflow"]
            DocFlow["Documentation Workflow"]
            TestFlow["Test Workflow"]
        end
    end

    subgraph TestEnv["Test Environment"]
        TestBench["test/tb.v"]
        PyTest["test/test.py"]
        TestCfg["test/Makefile"]
    end

    subgraph Output
        GDS["ASIC Layout (GDS)"]:::output
        Docs["Documentation"]:::output
        TestResults["Test Results"]:::output
    end

    %% Connections
    Sources --> OpenLane
    VerilogFiles --> TestEnv
    ConfigFiles --> OpenLane
    OpenLane --> GDS
    TestEnv --> TestResults
    GHActions --> Docs

    %% Component Styling
    class TopMod,Edge,PWM,SPIOwn,SPISamp source
    class OpenCfg,InfoYaml config
    class GDSFlow,DocFlow,TestFlow build

    %% Click events
    click TopMod "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/src/project.v"
    click Edge "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/src/edge_detector.v"
    click PWM "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/src/pwm.v"
    click SPIOwn "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/src/spi_own_clock.v"
    click SPISamp "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/src/spi_sampled.v"
    click OpenCfg "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/src/config.tcl"
    click InfoYaml "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/info.yaml"
    click GDSFlow "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/.github/workflows/gds.yaml"
    click DocFlow "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/.github/workflows/docs.yaml"
    click TestFlow "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/.github/workflows/test.yaml"
    click TestBench "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/test/tb.v"
    click PyTest "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/test/test.py"
    click TestCfg "https://github.com/djuara-rbz/tt_spi_pwm/tree/main/test/Makefile"
    click Docs "https://github.com/djuara-rbz/tt_spi_pwm/blob/main/docs/info.md"
```
