Skip to main content

dv-solve

dv-solve is a constraint solver for design verification. It finds values for bit-vector variables that satisfy a set of constraints, and when asked for many solutions it spreads them across the solution space. That suits it both to constrained-random stimulus generation and to answering yes/no questions from formal tools. Answers are sound: sat and unsat are definitive, and when dv-solve can't decide a problem it says unknown rather than guessing.

Documentation: https://dvkit.org/fvutils/dv-solve/

Ways to use it

If you are... Use Start here
Building constraint problems from Python the dv_solve package Python quick start
Running SMT-LIB2 files, or plugging a solver into a tool that speaks SMT-LIB2 the dv-solve-smt2 executable SMT-LIB2 quick start
Randomizing SystemVerilog classes in Verilator dv-solve-smt2 as Verilator's constraint solver Verilator quick start
Randomizing from SystemVerilog through DPI, on any simulator dvs_dpi_pkg and libdv_solve_dpi DPI guide
Embedding the solver in a C or C++ program libdv_solve and dv_solve.h C API

Install

pip install dv-solve

The wheel holds the Python package, the native libraries, the C header, the SystemVerilog packages and the dv-solve-smt2 executable, which pip puts on PATH:

dv-solve-smt2 --version

To build everything from source instead:

cmake -S . -B build -DDVS_WITH_CADICAL=OFF
cmake --build build

See Installation for the details, including the optional CaDiCaL back end.

To develop in a checkout, set up the workspace with IVPM and build in place:

ivpm update -d dev
packages/python/bin/python setup.py build_ext --inplace

That fetches CaDiCaL and the Python environment into packages/, then builds the libraries into build/lib and dv-solve-smt2 into build/bin. The dv_solve package in src/ loads the library from build/lib.

Quick start

from dv_solve.builder import SolveProblemBuilder
from dv_solve.ctx import SolveCtx, SOLVE_OK
from dv_solve.problem import BIN_GT

b = SolveProblemBuilder()
X = 0
b.add_var(X, width=8, is_signed=False, lo=0, hi=255)
b.add_constraint(b.expr_binary(BIN_GT, b.expr_var(X), b.expr_const(100)))
problem, _ = b.finalize()

with SolveCtx(problem) as ctx:
    assert ctx.solve(seed=1, fair_pick=True) == SOLVE_OK
    print("x =", ctx.get_value(X))

Public API

Module Purpose
dv_solve.builder SolveProblemBuilder: declare variables and constraints
dv_solve.ctx SolveCtx: compile and solve; status codes and exceptions
dv_solve.problem operator constants (BIN_*, UN_*)
dv_solve get_libs(), get_libdirs(), get_incdirs(), get_svdirs(), get_dpi_lib() for build systems

Other modules are internal and may change. The C API is the one header dv_solve.h; other installed headers are internal. See the reference.

License

Apache-2.0.

Metadata

Release files for dv-solve 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for dv-solve 0.6.2
File Actions
dv_solve-0.6.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for dv_solve-0.6.2-py3-none-win_amd64.whl
dv_solve-0.6.2-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for dv_solve-0.6.2-py3-none-manylinux_2_34_x86_64.whl
dv_solve-0.6.2-py3-none-manylinux_2_34_aarch64.whl Python 3 none Linux glibc 2.34+ ARM64 Details for dv_solve-0.6.2-py3-none-manylinux_2_34_aarch64.whl
dv_solve-0.6.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details for dv_solve-0.6.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
dv_solve-0.6.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for dv_solve-0.6.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
dv_solve-0.6.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for dv_solve-0.6.2-py3-none-macosx_11_0_arm64.whl
dv_solve-0.6.2-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details for dv_solve-0.6.2-py3-none-macosx_10_9_x86_64.whl

Total release size: 50.7 MB

Release files / dv_solve-0.6.2-py3-none-win_amd64.whl

Download URL dv_solve-0.6.2-py3-none-win_amd64.whl
Size 4.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6728d5e701e9807b09f03be9125e1ce06f70f102193bbeca3724600b4f246148
BLAKE2b-256 checksum
How to use checksums
527b7a96d97d16c3d69626b216197387d7874f2bd557761925d312b5d7937beb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dv_solve-0.6.2-py3-none-manylinux_2_34_x86_64.whl

Download URL dv_solve-0.6.2-py3-none-manylinux_2_34_x86_64.whl
Size 6.4 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2ae13708448a3649ca952f74873c3bba5252868a212e2b73b21532a4c744bb09
BLAKE2b-256 checksum
How to use checksums
1f6fbe83e12dc48d9410a2406fba04d2f80a37ee6ca245b716d7975bcd961580
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dv_solve-0.6.2-py3-none-manylinux_2_34_aarch64.whl

Download URL dv_solve-0.6.2-py3-none-manylinux_2_34_aarch64.whl
Size 6.1 MB
Tags Linux glibc 2.34+ ARM64 Python 3
SHA-256 checksum
How to use checksums
90b7339bb1ffb8403d036aab6faec53fd9f1cba946728a01a6da14c05b8c8535
BLAKE2b-256 checksum
How to use checksums
d34680657e2914f1d1890c2ac9380c0de2ef900115b9f36ee655e80a37f5a084
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dv_solve-0.6.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL dv_solve-0.6.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 6.4 MB
Tags Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b565625684a594f350efae59dfe1504e18d6176846b60a979c75078d37a3a75d
BLAKE2b-256 checksum
How to use checksums
29a748efed97a3450878a6d4630eb1e7da72bb90f399d0aa4e59a0668e5ed441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dv_solve-0.6.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL dv_solve-0.6.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 6.1 MB
Tags Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f1ce6bcdebba179e034dc7e8c94b761b317929113c0e4a88998963a05805c0fc
BLAKE2b-256 checksum
How to use checksums
f0b972485f965d7fe966a0128e3538fd41209fbdf1579d9b4d18544004ca086b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dv_solve-0.6.2-py3-none-macosx_11_0_arm64.whl

Download URL dv_solve-0.6.2-py3-none-macosx_11_0_arm64.whl
Size 10.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4650480c240028d2e754ffb1d3b2e663718fecc9a0db038d2b83add576a0ed6f
BLAKE2b-256 checksum
How to use checksums
20318b9a10aea3771c713222f73f9065b57b39ada3e274a03d6c60ade454de01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dv_solve-0.6.2-py3-none-macosx_10_9_x86_64.whl

Download URL dv_solve-0.6.2-py3-none-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
801839f2674392976311d20dac857dd87fc6887c457bb7e53836f837a782ff4d
BLAKE2b-256 checksum
How to use checksums
83f17d48b407f5f6a8d0edab1e3b2b20875a53893488b80a5e7026e7a641d552
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for dv-solve 0.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page