{"id":24756334,"url":"https://github.com/dalance/sv4state","last_synced_at":"2025-10-11T02:31:37.447Z","repository":{"id":57669021,"uuid":"403805900","full_name":"dalance/sv4state","owner":"dalance","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-13T06:59:33.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T23:35:39.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"dalance"}},"created_at":"2021-09-07T01:41:24.000Z","updated_at":"2023-04-27T02:12:09.000Z","dependencies_parsed_at":"2022-08-27T01:40:57.356Z","dependency_job_id":null,"html_url":"https://github.com/dalance/sv4state","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fsv4state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fsv4state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fsv4state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fsv4state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalance","download_url":"https://codeload.github.com/dalance/sv4state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236026026,"owners_count":19083306,"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":[],"created_at":"2025-01-28T13:50:53.650Z","updated_at":"2025-10-11T02:31:32.181Z","avatar_url":"https://github.com/dalance.png","language":"Rust","funding_links":["https://github.com/sponsors/dalance"],"categories":[],"sub_categories":[],"readme":"# sv4state\n\nsv4state is a Rust library for SystemVerilog 4-state value.\n`logic` value which is passed throgh SystemVerilog DPI can be handled by this library.\n\n[![Actions Status](https://github.com/dalance/sv4state/workflows/Rust/badge.svg)](https://github.com/dalance/sv4state/actions)\n[![Crates.io](https://img.shields.io/crates/v/sv4state.svg)](https://crates.io/crates/sv4state)\n[![Docs.rs](https://docs.rs/sv4state/badge.svg)](https://docs.rs/sv4state)\n\n## Example\n\n`svLogicVecVal` shows a 32bit `logic` value of SystemVerilog.\nSo `logic [127:0]` corresponds to `[svLogicVecVal; 4]`.\n\n```rust\nuse sv4state::{svLogicVecVal, Sv4State};\n\n#[no_mangle]\npub extern \"C\" fn get_data(data: \u0026[svLogicVecVal; 4]) {\n    let sv_u32 = Sv4State::\u003cu32\u003e::from_dpi(data);\n    println!(\"{:x}\", sv_u32[0]);\n    println!(\"{:x}\", sv_u32[1]);\n    println!(\"{:x}\", sv_u32[2]);\n    println!(\"{:x}\", sv_u32[3]);\n}\n```\n\nThe `get_data()` can be call through SystemVerilog DPI like below:\n\n```SystemVerilog\nimport \"DPI-C\" function void get_data(\n  input logic [127:0] data\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fsv4state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalance%2Fsv4state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fsv4state/lists"}