Skip to main content

Hardware verification framework enabling Python to call SystemVerilog UVM APIs for writing test cases and dynamically configuring verification environments

Project description

uvm-bridge Documentation

English | 简体中文

Overview

svuvm is a hardware verification framework that allows users to call SystemVerilog UVM common APIs in Python to write test cases or dynamically configure environments, thereby saving compilation time and improving development efficiency. Compared to mainstream Python-based hardware verification frameworks like cocotb, svuvm has better compatibility with the SystemVerilog UVM framework, can make full use of commercial VIPs and rich Python ecosystems based on UVM, and does not destructively impact existing UVM-based verification environments. Users can freely choose to write some functions in Python without affecting other users who use SystemVerilog in the environment.

Highlights

  • Support writing SystemVerilog UVM test cases in Python and dynamically configuring environments
  • Significantly reduce the number of compilations
  • Can utilize the rich ecosystem of Python
  • Compatible with the standard UVM framework, can make full use of the commercial VIP ecosystem
  • Convenient for existing UVM users to migrate

Installation

Dependencies:

  • Python 3.9.0+
  • pybind11, pyslang (not required at runtime)

Commands:

pip install .

Compilation

The compilation command needs to add $(python -m svuvm.config)

Quick Reference

  • Write register: svuvm.write_reg("rm.reg_a", 0x12345678)
  • Read register: data = svuvm.read_reg("rm.reg_a")
  • Check register: svuvm.check_reg("rm.reg_a", 0x12345678)
  • Start sequence: svuvm.start_seq("my_seq", "uvm_test_top.m_env.m_agent.my_sqr")
  • Wait for 500 time units: svuvm.wait_unit(500)
  • Force signal: svuvm.uvm_hdl_force("tb.dut.sig", svuvm.vpi.VpiVecVal(0,1))
  • Release signal: svuvm.uvm_hdl_release("tb.dut.sig")
  • Read signal: data = svuvm.uvm_hdl_read("tb.dut.sig")
  • Print info: svuvm.uvm_info("msg", svuvm.UVM_LOW)
  • Print error: svuvm.uvm_error("msg")

Usage Example

Start Python function in SV

// top.sv
module top ();
    import uvm_pkg::*;
    `include "uvm_macros.svh"
    import python_bridge_pkg::*;

    class example_test extends uvm_test;
        `uvm_component_utils(example_test)
        `uvm_new_func

        virtual task main_phase(uvm_phase phase);
            phase.raise_objection(this);
            py_func(get_type_name(), "main", dirname(`__FILE__));
            phase.drop_objection(this);
        endtask
    endclass

    logic clk/*verilator public_flat*/ = 1'b0;
    always #5 clk = ~clk;

    initial begin 
        run_test();
    end
endmodule

Call API in Python

# example_test.py
import svuvm

def main():
    svuvm.uvm_info("example_test",svuvm.UVM_LOW)

Compilation command

git clone https://github.com/Dragon-Git/uvm-verilator.git # Workaround version, verilator has not fully supported UVM yet
mkdir build
verilator -j $(nproc) --vpi --binary -top top -Mdir build --output-groups $(($(nproc))) \
+incdir+$PWD/uvm-verilator/src $PWD/uvm-verilator/src/uvm_pkg.sv \
$(python -m svuvm.config) $PWD/top.sv \
-Wno-lint -Wno-style -Wno-SYMRSVDWORD -Wno-IGNOREDRETURN -Wno-CONSTRAINTIGN -Wno-ZERODLY \
$PWD/uvm-verilator/src/dpi/uvm_dpi.cc \
-CFLAGS "-I$PWD/uvm-verilator/src/dpi -I$PWD/inc -DVERILATOR" \

./build/Vtop +UVM_TESTNAME=example_test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

svuvm-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (316.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

svuvm-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (285.5 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

svuvm-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (316.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

svuvm-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (284.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

svuvm-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (316.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

svuvm-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (284.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

svuvm-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (326.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

svuvm-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (281.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

svuvm-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (325.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

svuvm-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (280.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

svuvm-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (325.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

svuvm-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (280.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file svuvm-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 971815b0bbbc4ca16d33132903c1b3a34c83d30c709a1a4f2fb1df0b2f55b8f7
MD5 be0fe8328f4630c07a1f14d363e82a0d
BLAKE2b-256 b60d7ad85ea7c77fbbac3b93ec8865480f443ee132bc5942cb52c04b56ac81e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f22a861a9d0a044f0b5608c314ea68015d45a81ba0e902fc9d9e41ced490f6f3
MD5 ea403e373887a8be8e3e6c1c72326534
BLAKE2b-256 91f75cfafd3040d4806de75fcd71d577d45f91af3eac544148c82edf4a71209b

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f2f0b877ae8b138fed255d4807670684df5cd451ee342d7a522419b4f7315bd4
MD5 526a5483c1bbbf068d767bacaa7eaeae
BLAKE2b-256 adfdfe8c98ce2a5cb24e1dc65b333e4f11ff12b8e9d5e5733a1d8dfbff6e0754

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc7079e70ee2f99789e85460dbcf5a0ca3a411c97f7e4aa66b3bdd833b6253a5
MD5 177d3a9f6b3beec66a9a908d0f402337
BLAKE2b-256 afa1d322d3f7f13e7190dd2a1e97f33757b2c23e60dbd7672fb6514cfa9e3c95

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7171908267e69608f519248b32bfce7de9118baa2974688bedff3d997c0f39da
MD5 82e8356a85d3b8da9ae1a100f0cd68ca
BLAKE2b-256 92f30cc4fbe414790a989aee310e71f51988d10bbf81b5226c5bcd611defbb81

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f80f699ace0666279bbf734c4f06e32bb840f1e34cea5683e0dff0a8c97b4b04
MD5 bdf612923cee7f29c3826696c0f18d39
BLAKE2b-256 064525c67351f17234bdf811af9309a04509f4bc4190e59c8bbb46032c4d0211

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eb57a1fa9f5f43d573c3aa345f449a15201d6939dfd7d3596eed0ec5787d2707
MD5 b6ee5ed87b19044beecf702c0e6b646f
BLAKE2b-256 dfef78b2b19da07b9f4d0a744ac02edeb04a2c175b387db011777b0b9d0612ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2001e1069c597feb5714bae615fb1f62eb214d049827d04bc2e761f6e91da019
MD5 4a9f0a5a5a17fcecddef720bce1d64ac
BLAKE2b-256 1be9e7722315593d2f897d332147b175a5c82379833c0db7787d05f04eac3a86

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4e5cde0340ddbb38f27a05db464cfe3816ee8c5b20491d6be5f450fa3b1f5518
MD5 93e57b5e9a9fcce68b0d827893544585
BLAKE2b-256 1f8f212e003cf251a005566e83dd6a28043d89eb607143963842dce496166802

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca0e24d8c855bf9a6762a8ee824b71fc6c15c96f9e15a9904d70709a0503a8cf
MD5 5ae7a55f01c13379ba46bef92fd8af2f
BLAKE2b-256 2bc4ed4a53969cb878191810f7c730fefb2b3a91a6a06261fb43dcc64c885da4

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for svuvm-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 33ff7c0e2b74946ad9ae5f45e5d3013d019a284c7c7817f7256d2e6242f81bc9
MD5 a9978dccc5650fedba4788f24fc39925
BLAKE2b-256 52505433194981359b728b6cf06f123a5943daa0ed9d970d5915db5b36fb99bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svuvm-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: svuvm-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 280.5 kB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svuvm-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1947316a0b0efbeb31a9e5783c05ff197d2194c445399ce1fa0a6a68644f6e0f
MD5 7133dac275bd2a873f3298182b2d47ff
BLAKE2b-256 5502466cb749e5b2dee4a56af8236a6048a8e6c79aad9d95183d75ca4320c311

See more details on using hashes here.

Provenance

The following attestation bundles were made for svuvm-0.1.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: release.yml on Dragon-Git/uvm_bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page