lowRISC / lowRISC/dvsim

Non-C DPI-C libraries

Open
#97 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13
Forks
21
Avg merge
1d 11h
Merged PRs (30d)
8

Description

If I'm not mistaken, `dvsim` supports building DPI-C libraries by adding files with `file_type: cppSource` (example [here](https://github.com/lowRISC/opentitan/blob/8fd1edd83d7fc97d359119127d47af4a1d793c61/hw/dv/dpi/spidpi/spidpi.core)).

To be honest I couldn't follow the labyrinth of Python packages to the place that actually takes effect (in Edalize?) so I'm not 100% sure how it works...

Anyway I would like to use a DPI-C library that *isn't* written in C (in Rust specifically). So I need to:

1. Run a build command automatically.
2. Add the `-sv_lib foo.so` (or whatever) to the simulator command.

Is that possible? I did find that Edalize supports `file_type: dpiLibrary`, but [only for Xcelium??](https://github.com/search?q=repo%3Aolofk%2Fedalize%20dpiLibrary&type=code). So maybe that just needs to be extended to other simulators... and then how would you run the actual library build command before running the simulation?

Any help appreciated!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how dvsim passes file_type: cppSource into Edalize, then compare Edalize's dpiLibrary handling across simulators. Identify how a library build command could run before simulation and how the simulator receives -sv_lib; validate the behavior with a minimal Rust DPI-C example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.