Commit 68438c40 authored by John Zacarias Jekel's avatar John Zacarias Jekel
Browse files

Create a wrapper.h header and put all IEEE 1800 defs in the crate root

This makes life a bit easier as it avoids conflicting definitions
when including bindgen-generated code in the same module scope
and is more similar to what other bindings crates (ex. libc) do.
parent 8f00fffa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"

[[package]]
name = "sv-bindings"
version = "0.1.0"
version = "0.1.1"
dependencies = [
 "bindgen",
]
+3 −9
Original line number Diff line number Diff line
[package]
name = "sv-bindings"
version = "0.1.0"
description = "Raw FFI bindings for the SystemVerilog DPI, PLI, and VPI interfaces (IEEE 1800)."
version = "0.1.1"
description = "Raw FFI bindings for the (System)Verilog DPI, PLI, and VPI interfaces (IEEE 1800)."
authors = ["John Zacarias Jekel <john@jekel.ca>"]
readme = "README.md"
#homepage = ""
@@ -14,13 +14,7 @@ keywords = ["verilog", "systemverilog", "dpi", "vpi", "bindings"]
#documentation = ""

[features]
default = ["svdpi", "vpi_user", "vpi_compatibility", "sv_vpi_user"]

#Raw bindings
svdpi = []
vpi_user = []
vpi_compatibility = []
sv_vpi_user = []
default = []

[build-dependencies]
bindgen = "0.69.1"
+2 −0
Original line number Diff line number Diff line
@@ -3,3 +3,5 @@
Raw FFI bindings for the SystemVerilog DPI, PLI, and VPI interfaces (IEEE 1800).

TODO better readme with examples

If there is enough interest in this crate, and others wish to contribute, I can move the repo to GitHub or Gitlab.
+7 −10
Original line number Diff line number Diff line
/*
 * File:    build.rs
 * Brief:   TODO
 * Brief:   Build script for the sv-bindings crate
 *
 * Copyright (C) TODO John Jekel
 * Copyright (C) 2023 John Jekel
 * See the LICENSE file at the root of the project for licensing info.
 *
 * TODO longer description
@@ -38,14 +38,11 @@
 * --------------------------------------------------------------------------------------------- */

const HEADERS_TO_BINDINGS: &[(&str, &str)] = &[
    #[cfg(feature = "svdpi")]
    ("include/svdpi.h", "svdpi.rs"),
    #[cfg(feature = "vpi_user")]
    ("include/vpi_user.h", "vpi_user.rs"),
    #[cfg(feature = "vpi_compatibility")]
    ("include/vpi_compatibility.h", "vpi_compatibility.rs"),
    #[cfg(feature = "sv_vpi_user")]
    ("include/sv_vpi_user.h", "sv_vpi_user.rs"),
    //("include/svdpi.h", "svdpi.rs"),
    //("include/vpi_user.h", "vpi_user.rs"),
    //("include/vpi_compatibility.h", "vpi_compatibility.rs"),
    //("include/sv_vpi_user.h", "sv_vpi_user.rs"),
    ("include/wrapper.h", "wrapper.rs")//Switching to a wrapper to make life easier
];

/* ------------------------------------------------------------------------------------------------

include/wrapper.h

0 → 100644
+41 −0
Original line number Diff line number Diff line
/**
 * @file    wrapper.h
 * @brief   Wrapper around (System)Verilog headers to make life easier.
 * 
 * @copyright Copyright (C) 2023 John Jekel
 * See the LICENSE file at the root of the project for licensing info.
 * 
 * TODO longer description
 *
*/

#ifndef WRAPPER_H
#define WRAPPER_H

/* ------------------------------------------------------------------------------------------------
 * Constants/Defines
 * --------------------------------------------------------------------------------------------- */

//TODO

/* ------------------------------------------------------------------------------------------------
 * Includes
 * --------------------------------------------------------------------------------------------- */

#include "svdpi.h"
#include "vpi_user.h"
#include "sv_vpi_user.h"

/* ------------------------------------------------------------------------------------------------
 * Type/Class Declarations
 * --------------------------------------------------------------------------------------------- */

//TODO

/* ------------------------------------------------------------------------------------------------
 * Function Declarations
 * --------------------------------------------------------------------------------------------- */

//TODO

#endif//WRAPPER_H
Loading