{"id":17312474,"url":"https://github.com/pascalkuthe/openvaf","last_synced_at":"2025-03-17T15:12:43.090Z","repository":{"id":60196554,"uuid":"519493105","full_name":"pascalkuthe/OpenVAF","owner":"pascalkuthe","description":"An innovative Verilog-A compiler","archived":false,"fork":false,"pushed_at":"2024-08-20T20:24:30.000Z","size":10972,"stargazers_count":139,"open_issues_count":62,"forks_count":27,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-02T19:54:15.283Z","etag":null,"topics":["compiler","eda","rust","verilog-a"],"latest_commit_sha":null,"homepage":"https://openvaf.semimod.de/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pascalkuthe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG_OSDI.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-30T11:03:49.000Z","updated_at":"2025-02-13T21:57:22.000Z","dependencies_parsed_at":"2023-10-04T02:56:19.153Z","dependency_job_id":"c1c7279c-8502-47a5-8b84-2e60bf5c6cc0","html_url":"https://github.com/pascalkuthe/OpenVAF","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalkuthe%2FOpenVAF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalkuthe%2FOpenVAF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalkuthe%2FOpenVAF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalkuthe%2FOpenVAF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalkuthe","download_url":"https://codeload.github.com/pascalkuthe/OpenVAF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056425,"owners_count":20390719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","eda","rust","verilog-a"],"created_at":"2024-10-15T12:43:35.072Z","updated_at":"2025-03-17T15:12:43.059Z","avatar_url":"https://github.com/pascalkuthe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"logo_light.svg\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"logo_dark.svg\"\u003e\n  \u003cimg alt=\"OpenVAF\" src=\"logo_dark.svg\"\u003e\n\u003c/picture\u003e\n\n\u003cbr\u003e    \n\u003cbr\u003e\n\u003cbr\u003e\n\nOpenVAF is a Verilog-A compiler that can compile Verilog-A files for use in circuit simulator.\nThe major aim of this Project is to provide a high-quality standard compliant compiler for Verilog-A.\nFurthermore, the project aims to bring modern compiler construction algorithms/data structures to a field with a lack of such tooling.\n\nSome highlights of OpenVAF include:\n\n* **fast compile** times (usually below 1 second for most compact models)\n* high-quality **user interface**\n* **easy setup** (no runtime dependencies even for cross compilation)\n* **fast simulations** surpassing existing solutions by 30%-60%, often matching handwritten models\n* IDE aware design\n\nDetailed documentation, examples and precompiled binaries of all release are **available on our [website](https://openvaf.semimod.de)**. To test the latest development version you can download nightly version of OpenVAF for [linux](https://openva.fra1.digitaloceanspaces.com/openvaf_devel-x86_64-unknown-linux-gnu.tar.gz) or [windows](https://openva.fra1.digitaloceanspaces.com/openvaf_devel-x86_64-pc-windows-msvc.tar.gz).\n\n\n## Projects\n\nThe development of OpenVAF and related tools is tightly coupled and therefore happens in a single repository.\nThis repository currently contains the following useable projects:\n\n### OpenVAF\n\nOpenVAF is the main project of the repository and all other tools use OpenVAF as a library in some form.\nOpenVAF can be build as a standalone CLI program that can compile Verilog-A files to shared objects that comply with the simulator independent OSDI interface.\n\nOpenVAF has been tested with a preliminary NGSPICE prototype and Melange.\nIt can already support a large array of compact models.\nHowever, due to the larger feature set (compared to VerilogAE) additional testing and verification is still required.\nFurthermore, some Verilog-A language features are currently not supported.\n\n### VerilogAE\n\nAllows obtaining model equations (calculates the value of a single Variable) from Verilog-A files.\nVerilogAE is primarily useable from python (available on pypi) but can also be compiled as a static/shared library and called by any programming language (that supports the C ABI).\n\nVerilogAE is used in production at SemiMod and various partners.\nIts stable and ready for general use.\n\n### Melange\n\nMelange is an experimental circuit simulator that leverage OpenVAF to gain access to compact models.\nThis allows it to easily support a large array of models without the huge effort associated with traditional simulators.\nThe focus of Melange is primarily on automation.\nThat means Melange focuses on providing an ergonomic and extensible API in mainstream programming languages (python and rust currently) instead of a special purpose netlist format.\nHowever, to remain compatible with existing PDKs a subset of the spectre netlist format can be parsed.\n\nMelange is currently in early development and most features are not complete.\nSome mockups of planned usage can be found in `melange/examples`.\nSome working minimal examples (in rust) can be found in `melange/core/test.rs`.\n\n## Building OpenVAF with docker\n\nThe official docker image contains everything required for compiling OpenVAF. To build OpenVAF using the official docker containers, simply run the following commands:\n\n``` shell\ngit clone https://github.com/pascalkuthe/OpenVAF.git \u0026\u0026 cd OpenVAF\n# On REHL distros and fedora replace docker with podman\n# on all commands below. \ndocker pull ghcr.io/pascalkuthe/ferris_ci_build_x86_64-unknown-linux-gnu:latest\n# On Linux distros that enable SELinux linux RHEL based distros and fedora use $(pwd):/io:Z\ndocker run -ti -v $(pwd):/io ghcr.io/pascalkuthe/ferris_ci_build_x86_64-unknown-linux-gnu:latest\n\n# Now you are inside the docker container\ncd /io\ncargo build --release\n# OpenVAF will be build this can take a while\n# afterwards the binary is available in target/release/openvaf\n# inside the repository \n```\n\n## Build Instructions \n\nOpenVAF **requires rust/cargo 1.64 or newer** (best installed with [rustup](https://rustup.rs/)). Furthermore, the **LLVM-15** development libraries and **clang-15** are required. Newer version also work but older versions of LLVM/clang are not supported. Note that its imperative that **you clang version matches your LLVM version**. If you want to compile VerilogAE python 3.8+ is also required.\n\n\nOn Debian and Ubuntu the [LLVM Project provided packages](https://apt.llvm.org/) can be used:\n\n``` shell\nsudo bash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\n```\n\nOn fedora (37+) you can simply install LLVM from the default repositories:\n\n``` shell\nsudo dnf install clang llvm-devel\n```\n\nOn Linux distributions where packages for LLVM-15 are not available (like centos-7) and windows you can download the prebuild LLVM packages that are also used\nin our docker images. These binaries are build on centos-7 and will therefore\nwork on any linux distribution (that is supported by rustc):\n\n* [clang and LLVM for windows](https://openva.fra1.cdn.digitaloceanspaces.com/llvm-15.0.7-x86_64-pc-windows-msvc-FULL.tar.zst)\n* [clang and LLVM for linux](https://openva.fra1.cdn.digitaloceanspaces.com/llvm-15.0.7-x86_64-unknown-linux-gnu-FULL.tar.zst)\n\nSimply download and extract these tar archives and set the `LLLVM_CONFIG` (see below) environment variable to point at the downloaded files: `LLVM_CONFIG=\u003cextracted directory\u003e/bin/llvm-config`.\n\n\u003e Note: To decompress this archive you need to use the following command:\n\u003e ``` shell\n\u003e zstd -d -c --long=31 \u003cpath/to/archive.tar.zst\u003e | tar -xf -\n\u003e ```\n\u003e afterwards the decompressed files can be found in `./LLVM`\n\n\nOnce all dependencies have been installed you can build the entire project by running:\n\n``` shell\ncargo build --release\n```\n\nTo only build OpenVAF (and ignore melange/VerilogAE) you can run:\n\n``` shell\ncargo build --release --bin openvaf\n```\n\nBy default, OpenVAF will link against the static LLVM libraries, to avoid runtime dependencies. This is great for creating portable binaries but sometimes building with shared libraries is preferable. Simply set the `LLVM_LINK_SHARED` environment variable during linking to use the shared system libraries. If multiple LLVM versions are installed (often the case on debian) the `LLVM_CONFIG` environment variable can be used to specify the path of the correct `llvm-config` binary.\nAn example build invocation using shared libraries on debian is shown below:\n\n``` shell\nLLVM_LINK_SHARED=1 LLVM_CONFIG=\"llvm-config-15\" cargo build --release\n```\n\nOpenVAF includes many integration and unit tests inside its source code.\nFor development [cargo-nexttest](https://nexte.st/) is recommended to run these tests as it significantly reduces the test runtime.\nHowever, the built-in cargo test runner (requires no extra installation) can also be used.\nTo run the testsuite simply call:\n\n``` shell\ncargo test # default test runner, requires no additional installation\ncargo nextest run # using cargo-nextest, much faster but must be installed first\n```\n\nBy default, the test suite will skip slow integration tests that compile entire compact models.\nThese can be enabled by setting the `RUN_SLOW_TESTS` environment variable:\n\n``` shell\nRUN_SLOW_TESTS=1 cargo nextest run \n```\n\nDuring development, you likely don't want to run full release builds as these\ncan take a while to build. Debug builds are much faster:\n``` shell\ncargo build # debug build\ncargo run --bin opnevaf test.va # create a debug build and run it\ncargo clippy # check the sourcecode for errors/warnings without building (even faster)\n```\n\n## Acknowledgement\n\nThe architectures of the [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer) and [rustc](https://github.com/rust-lang/rust/) have heavily inspired the design of this compiler.\n\n## Copyright\n\nThis work is free software and licensed under the GPL-3.0 license.\nIt contains code that is derived from [rustc](https://github.com/rust-lang/rust/) and [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer). These projects are both licensed under the MIT license. As required a copy of the license and disclaimer can be found in `copyright/LICENSE_MIT`.\n\nMany models int integration tests folder are not licensed under a GPL compatible license. All of those models contain explicit license information. They do not endup in the openvaf binary in any way and therefore do not affect the license of the entire project. Integration tests without explicit model information (either in the model files or in a dedicated LICENSE file) fall under GPLv3.0 like the rest of the repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalkuthe%2Fopenvaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalkuthe%2Fopenvaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalkuthe%2Fopenvaf/lists"}