Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nix] use vcs rtlink in all cases #978

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions nix/t1/conversion/sv-to-vcs-simulator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
assert lib.assertMsg (builtins.typeOf vsrc == "list") "vsrc should be a list of file path";
assert lib.assertMsg (builtins.typeOf vcsLinkLibs == "list") "vcsLinkLibs should be list of strings";

# Technically we could static link some libs and rtlink others,
# but currently we don't use it in such a way, so just assert it to catch error
assert lib.assertMsg (vcsLinkLibs != [] -> rtLinkDpiLib) "vcsLinkLibs and rtLinkDpiLib are both set";

let
# VCS simulation profiling
# This is a debug feature, thus intentionally not exposed
Expand Down
5 changes: 2 additions & 3 deletions nix/t1/run/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
, verilator-emu
, verilator-emu-trace
, vcs-emu
, vcs-emu-rtlink
, vcs-emu-cover
, vcs-emu-trace
, vcs-dpi-lib
Expand Down Expand Up @@ -44,7 +43,7 @@ let

vcs-emu = runEmu {
inherit testCase;
emulator = vcs-emu-rtlink;
emulator = vcs-emu;
};

vcs-emu-trace = runEmu {
Expand Down Expand Up @@ -73,7 +72,7 @@ let

vcs-prof-vcd = runFsdb2vcd (runEmu {
inherit testCase;
emulator = vcs-emu-rtlink;
emulator = vcs-emu;
emuExtraArgs = {
vcsDpiLib = vcs-dpi-lib;
};
Expand Down
14 changes: 8 additions & 6 deletions nix/t1/t1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,19 @@ forEachTop (topName: generator: self: {

inherit (t1Scope) sim-checker;

# We do not use vcs-emu-static every day,
# but we may switch back to static once rtLink breaks
vcs-emu-static = self.vcs-emu.override {
mainProgram = "${topName}-vcs-simulator-static";
vcsLinkLibs = [ "${self.vcs-dpi-lib}/lib/libdpi_${topName}.a" ];
rtLinkDpiLib = null;
};

vcs-emu = t1Scope.sv-to-vcs-simulator {
mainProgram = "${topName}-vcs-simulator";
topModule = "TestBench";
rtl = self.rtl;
vsrc = lib.filesystem.listFilesRecursive self.clean-vsrc.outPath;
vcsLinkLibs = [ "${self.vcs-dpi-lib}/lib/libdpi_${topName}.a" ];
rtLinkDpiLib = self.vcs-dpi-lib;
};
vcs-emu-rtlink = self.vcs-emu.override {
mainProgram = "${topName}-vcs-simulator-rtlink";
vcsLinkLibs = [ ];
rtLinkDpiLib = self.vcs-dpi-lib;
};
vcs-emu-cover = self.vcs-emu.override {
Expand Down
Loading