@obinexusltd/verilog-polycall
v0.1.0
Published
Verilog/SystemVerilog DPI-C binding for libpolycall 1.5.0.
Maintainers
Readme
verilog-polycall
Verilog/SystemVerilog binding for libpolycall 1.5.0. The binding is a thin
adapter: it maps an HDL call onto polycall_ffi_run_config(config_path, 1) and
contains no configuration parser or runtime logic.
API
Compile src/verilog_polycall.sv before modules that
import the package:
import verilog_polycall::*;
initial begin
run_config_or_fatal("verilog-polycallrc");
endrun_config(path) returns the libpolycall status unchanged.
run_config_or_fatal(path) raises the Verilog-native $fatal error when that
status is non-zero.
The HDL boundary uses SystemVerilog DPI-C because Verilog itself has no direct
C foreign-function syntax. Link src/verilog_polycall.c and a libpolycall v1.5
library that exports polycall_ffi_run_config into the simulator executable.
npm package
Install the source package:
npm install @obinexusltd/verilog-polycallThe CommonJS entry point exposes absolute paths that build tooling can pass to an HDL simulator or C compiler:
const polycall = require('@obinexusltd/verilog-polycall');
console.log(polycall.systemVerilog);
console.log(polycall.nativeAdapter);
console.log(polycall.publicHeader);
console.log(polycall.ffiHeader);
console.log(polycall.config);The npm tarball explicitly includes src/, include/, generated/,
examples/, scripts/, and tests/, together with the Makefile, manifest,
and runtime configuration. Compiled platform-specific output is excluded.
Build and test
Build the native adapter archive:
makeRun the boundary test, which uses a mock core to prove the adapter forwards the
path, fixes run=1, and propagates statuses without needing a running service:
make test
make verify-dryWith Verilator installed, run the HDL smoke test as well:
make test-hdlThe same workflow is available through npm:
npm run build
npm test
npm run verify
npm run test:hdlA real integration run requires a libpolycall v1.5 library that exports
polycall_ffi_run_config. Point POLYCALL_CPPFLAGS and POLYCALL_LDFLAGS at
that core and run:
make example \
POLYCALL_CPPFLAGS="-I/path/to/libpolycall/include" \
POLYCALL_LDFLAGS="-L/path/to/libpolycall/lib -lpolycall"The runnable HDL is in examples/basic.sv, and the
read-only shared-schema override is verilog-polycallrc.
