Skip to content

Commit

Permalink
Add opentitan python environment to edaExtraDeps for otbnsim
Browse files Browse the repository at this point in the history
OTBN block level DV uses a python ISS, which is invoked via
DPI code for cosimulation using an RTL simulator.

Our current wrappers use 'execl' to launch the python interpreter, and then
communicate with the ISS via stdstreams. To allow the EDA tools to see the
python interpreter and package set, we need to pass it into their FHSenv
wrappers using the 'edaExtraDeps' argument.

```
execl("/usr/bin/env", "/usr/bin/env", "python3", "-u", model_path.c_str(), NULL);
```

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
  • Loading branch information
hcallahan-lowrisc committed May 23, 2024
1 parent 80dad3c commit c5f0fe8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev/opentitan.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
extraPkgs ? [],
...
}: let
# These dependencies are required for building user DPI C/C++ code.
edaExtraDeps = with pkgs; [elfutils openssl];
# These dependencies are required for building user DPI C/C++ code, and cosimulation models.
edaExtraDeps = with pkgs; [elfutils openssl python_ot];

# Bazel rules_rust expects build PIE binary in opt build but doesn't request PIE/PIC, so force PIC
gcc-patched = wrapCCWith {
Expand Down Expand Up @@ -44,10 +44,17 @@ in
# For serde-annotate which can be built with just cargo
rustup

# For the OTBN simulator
ninja

# dvsim uses git for logging/tagging purposes
git

# Bazel downloads Rust compilers which are not patchelfed and they need this.
zlib
openssl
curl
util-linux # flock for bazelisk

gcc-patched
pkg-config-patched
Expand Down

0 comments on commit c5f0fe8

Please sign in to comment.