Skip to content

[tooling]: Add Nix devshells for core_ibex functional DV and example synthesis flow#2437

Open
hcallahan-lowrisc wants to merge 7 commits into
lowRISC:masterfrom
hcallahan-lowrisc:nix_devshells
Open

[tooling]: Add Nix devshells for core_ibex functional DV and example synthesis flow#2437
hcallahan-lowrisc wants to merge 7 commits into
lowRISC:masterfrom
hcallahan-lowrisc:nix_devshells

Conversation

@hcallahan-lowrisc
Copy link
Copy Markdown
Contributor

Add some nix development shells for reproducibly bootstrapping the FOSS project dependencies for the core_ibex UVM environment and the example synthesis flow.

This is a spiritual successor to #2156, which has remained useful as a PoC and should have been completed and merged long ago. The missing link, and what cause me many headaches in the interim period, was modifying the spike derivation to build using a suitably old toolchain and statically-linking some libraries such that host dependencies are minimized and the symbol version floor is low. This allows the library to be successfully linked and remain ABI compatible with proprietary simulators running on older distro releases using relatively-ancient bundled C/Cpp toolchains (such as gcc93).

To get a devShell with deps for the UVM / cosim DV flow in dv/uvm/core_ibex/:

nix develop .#eda_shell
# Then assuming you already have the proprietary EDA tool on your path / system...
cd dv/uvm/core_ibex
make SIMULATOR=xlm/vcs ITERATIONS=1 SEED=1 TEST=riscv_arithmetic_basic_test

To get a devShell for running the example yosys synthesis flow in syn:

nix develop .#syn_shell
# All the deps for this flow are FOSS, so you can simply do..\
cd syn/
./syn_yosys.sh

Replace hardcoded #!/bin/bash shebangs with #!/usr/bin/env bash and
drop the absolute /bin/bash path in subprocess calls, for compatibility
with systems (e.g. NixOS) where bash is not at /bin/bash.

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
…arnings

Pass -Wno-error=implicit-function-declaration and -Wno-error=int-conversion
via -Xcflags to VCS in both the vendored google_riscv-dv simulator config and
the ibex rtl_simulation config, fixing build failures with newer compilers that
treat these as errors by default.

This allows VCS to be used with a more modern toolchain under some conditions.

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
The .#eda_shell can be used to bootstrap dependencies for running the core_ibex
uvm environment, which requires a cosimulation model of spike to be present.
This shell correctly sets up environment variables to point to the model.

The basic .#shell can be used to simulate the Ibex simple system.

Future documentation improvements are needed to explain how these environments
can be used to run each verification environment.

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
On Linux, build spike via pkgsCompat (nixos-20.09, GCC 9.3 / glibc 2.32)
so the resulting shared libraries carry only GLIBC_2.32 / GLIBCXX_3.4.28
symbol version requirements — compatible with older toolchains / libs such as
xcelium cdsgcc/gcc/9.3 toolchain and Ubuntu 22.04.

Without this, the default nixpkgs GCC 14 build produces shared libraries
requiring GLIBCXX_3.4.32, which is not provided by cdsgcc/gcc/9.3. The shared
libraries are also linked with -static-libstdc++/-static-libgcc so they carry
no DT_NEEDED on libstdc++.so.6 themselves.

On other platforms (e.g. aarch64-darwin) the normal lowrisc-nix package
is used since Xcelium ABI constraints don't apply there.

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
… from assign.

SV2V does not like the explicit lifetime, so use this approach to keep both this
and stricter tools (like xcelium) happy.
Provide a .#syn_shell development environment in which the sample synthesis flow
using yosys can be executed. This shell provisions the nangate45 PDK into the
nix store and sets an environment variable pointing to it which is picked up by
the synthesis scripts.

A quick-start for how to use this shell is added to the syn/README.

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant