# kowdoorshashank/uvm_learning architecture

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

- Interactive diagram: https://gitdiagram.com/kowdoorshashank/uvm_learning
- Repository: https://github.com/kowdoorshashank/uvm_learning

## Overview

##### Project Type and Purpose
- This project is a UVM-based SystemVerilog testbench for verifying an Up/Down counter (see Up_Down_Counter.sv and tb.sv).
- Its purpose is to apply stimulus via UVM sequences, drive the DUT, monitor responses, check assertions, and collect coverage.

##### File Structure
- Top-level DUT and testbench:
- Up_Down_Counter.sv – the design under test (DUT)
- tb.sv – top testbench module that instantiates DUT and UVM test
- UVM environment files:
- Counter_intf.sv – defines the SystemVerilog interface connecting testbench and DUT
- Counter_env.sv – top UVM environment container
- Counter_agent.sv – UVM agent (bundles driver, monitor, sequencer)
- Counter_driver.sv – drives DUT inputs based on sequence items
- Counter_monitor.sv – samples DUT outputs for checks and coverage
- Counter_sequencer.sv – arbitrates sequence item issuance
- Counter_sequence.sv – sequence of operations (transactions)
- Counter_sequence_item.sv – single transaction definition
- Test control:
- Counter_test.sv – UVM test class that configures environment and starts sequences
- Verification aid:
- Counter_Sequencer.sv appears to be a duplicate or variant naming of Counter_sequencer.sv
- Conter_Sequencer.sv – likely a typo’d copy; can be merged/removed

##### README for Additional Insights
- Asserts on up/down counter behavior are included (likely inside Up_Down_Counter.sv or in UVM scoreboard/assertion blocks).

##### Detail & Clarity
- Both transaction-level and pin-level flows.
- Notes on where assertions reside.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Testbench Layer
    subgraph "Testbench"
        tb["tb.sv"]:::uvm
        test["Counter_test.sv"]:::uvm
        env["Counter_env.sv"]:::uvm
        tb -->|"runs"| test
        test -->|"configure()"| env

        subgraph "Environment"
            agent["Counter_agent.sv"]:::uvm
            env -->|"start()"| agent

            subgraph "Agent"
                seq["Conter_Sequencer.sv"]:::uvm
                drv["Counter_driver.sv"]:::uvm
                mon["Counter_moniter.sv"]:::uvm
            end

            agent --> seq
            agent --> drv
            agent --> mon
        end
    end

    %% Sequence Library
    subgraph "Sequence Library"
        seq_lib["Counter_Sequence.sv"]:::sequence
        item["Counter_Sequence_Item.sv"]:::sequence
        seq_lib --> item
        seq -->|"uvm_do(sequence)"| seq_lib
    end

    %% Interface and DUT
    intf["Counter_intf.sv"]:::interface
    dut["Up_Down_Counter.sv"]:::hardware
    drv -->|"drive(...)"| intf
    intf -->|"pins"| dut
    dut -->|"outputs"| intf

    %% Monitor and Scoreboard
    intf -->|"sample()"| mon
    sb["Scoreboard/Coverage"]:::scoreboard
    mon -->|"analysis port"| sb
    mon -->|"check/assert"| sb

    %% Click Events
    click tb "https://github.com/kowdoorshashank/uvm_learning/blob/main/tb.sv"
    click test "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_test.sv"
    click env "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_env.sv"
    click agent "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_agent.sv"
    click seq "https://github.com/kowdoorshashank/uvm_learning/blob/main/Conter_Sequencer.sv"
    click drv "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_driver.sv"
    click mon "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_moniter.sv"
    click seq_lib "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_Sequence.sv"
    click item "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_Sequence_Item.sv"
    click intf "https://github.com/kowdoorshashank/uvm_learning/blob/main/Counter_intf.sv"
    click dut "https://github.com/kowdoorshashank/uvm_learning/blob/main/Up_Down_Counter.sv"

    %% Styles
    classDef hardware fill:#DDDDDD,stroke:#333,stroke-width:1px
    classDef interface fill:#AADDFF,stroke:#333,stroke-width:1px
    classDef uvm fill:#AAFFAA,stroke:#333,stroke-width:1px
    classDef sequence fill:#FFFFAA,stroke:#333,stroke-width:1px
    classDef scoreboard fill:#FFDD99,stroke:#333,stroke-width:1px
```
