{"id":31655484,"url":"https://github.com/thuvasooriya/verilator","last_synced_at":"2026-05-14T21:36:46.239Z","repository":{"id":318337204,"uuid":"1070637741","full_name":"thuvasooriya/verilator","owner":"thuvasooriya","description":"build verilator with zig","archived":false,"fork":false,"pushed_at":"2026-04-06T20:49:44.000Z","size":54,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T22:23:34.449Z","etag":null,"topics":["compilers","cpp","rtl","system-verilog","systemc","verilator","verilog","verilog-simulator","zig","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thuvasooriya.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T08:28:04.000Z","updated_at":"2026-04-06T20:49:47.000Z","dependencies_parsed_at":"2025-10-06T16:33:41.099Z","dependency_job_id":null,"html_url":"https://github.com/thuvasooriya/verilator","commit_stats":null,"previous_names":["thuvasooriya/verilator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thuvasooriya/verilator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuvasooriya%2Fverilator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuvasooriya%2Fverilator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuvasooriya%2Fverilator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuvasooriya%2Fverilator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thuvasooriya","download_url":"https://codeload.github.com/thuvasooriya/verilator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuvasooriya%2Fverilator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33044367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["compilers","cpp","rtl","system-verilog","systemc","verilator","verilog","verilog-simulator","zig","zig-package"],"created_at":"2025-10-07T13:14:38.020Z","updated_at":"2026-05-14T21:36:46.234Z","avatar_url":"https://github.com/thuvasooriya.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# verilator\n\nzig-based build system and setup for [verilator](https://github.com/verilator/verilator)\n\n## version compatibility\n\ntested range: **v5.018 - v5.044** (and likely newer)\n\n## quick start\n\n```bash\nzig build -Doptimize=ReleaseFast\n\n./zig-out/bin/verilator --version\n./zig-out/bin/verilator --lint-only your_design.v\n```\n\n## requirements\n\n### build dependencies\n\n| dependency  | notes                         |\n| ----------- | ----------------------------- |\n| zig 0.15.2+ | build system and c++ compiler |\n| python 3    | wrapper scripts               |\n| bison 2.3+  | parser generator              |\n\n### runtime dependencies\n\n| dependency   | notes                                |\n| ------------ | ------------------------------------ |\n| perl         | verilator wrapper scripts            |\n| make         | building verilated designs           |\n| c++ compiler | compiling verilated code (see below) |\n\n## build options\n\n| option         | default | description                                           |\n| -------------- | ------- | ----------------------------------------------------- |\n| `-Doptimize`   | Debug   | ReleaseFast, ReleaseSafe, ReleaseSmall                |\n| `-Dtarget`     | native  | cross-compile target (e.g., `aarch64-linux-gnu`)      |\n| `-Duse-zig-cc` | true    | use `zig c++`/`zig ar` for verilated code compilation |\n| `-Dcxx`        | (auto)  | override c++ compiler (e.g., `clang++`, `g++`)        |\n| `-Dar`         | (auto)  | override archiver (e.g., `llvm-ar`, `ar`)             |\n\n### compiler selection\n\nby default, verilated designs use `zig c++` as the compiler. this provides:\n\n- cross-platform builds without msvc/mingw on windows\n- consistent c++20/coroutines support\n- single toolchain\n\nto use system compiler:\n\n```bash\nzig build -Duse-zig-cc=false    # uses system c++ and ar\n```\n\nto use a specific compiler:\n\n```bash\nzig build -Dcxx=clang++ -Dar=llvm-ar\nzig build -Dcxx=g++ -Dar=ar\n```\n\n\u003e [!NOTE]\n\u003e `-Dcxx`/`-Dar` take precedence over `-Duse-zig-cc`\n\n### runtime compiler override\n\nthe generated `verilated.mk` defaults to `zig c++` but supports runtime override:\n\n```bash\n# override when building verilated designs\nVERILATOR_CXX=g++ VERILATOR_AR=ar make -f Vdesign.mk\n\n# or export for the session\nexport VERILATOR_CXX=clang++\nexport VERILATOR_AR=llvm-ar\nmake -f Vdesign.mk\n```\n\nthe makefile automatically detects compiler type (zig/clang/gcc) and adjusts:\n- coroutine flags (`-fcoroutines` for gcc)\n- precompiled header suffix (`.gch` for clang)\n- macos linker flags (`-undefined dynamic_lookup` for zig)\n\n## building\n\n```bash\nzig build\n```\n\n### switch verilator version\n\n```bash\nzig fetch --save=verilator \"git+https://github.com/verilator/verilator#v5.042\"\nzig build\n```\n\n### cross-compilation\n\n```bash\nzig build -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseFast\nzig build -Dtarget=x86_64-windows-gnu -Doptimize=ReleaseFast\n```\n\n### supported targets:\n\n- `x86_64-linux-gnu`, `aarch64-linux-gnu`\n- `x86_64-macos`, `aarch64-macos`\n- `x86_64-windows-gnu`, `aarch64-windows-gnu`\n\n## output structure\n\n```\nzig-out/\n├── bin/\n│   ├── verilator              # perl wrapper (entry point)\n│   ├── verilator_bin          # main compiler binary\n│   ├── verilator_coverage     # coverage tool wrapper\n│   └── ...\n└── include/\n    ├── verilated.h            # runtime headers\n    ├── verilated.mk           # makefile for verilated designs\n    └── vltstd/                # standard library\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthuvasooriya%2Fverilator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthuvasooriya%2Fverilator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthuvasooriya%2Fverilator/lists"}