Skip to content
Open
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
15 changes: 13 additions & 2 deletions nix/t1/run/run-emulator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,23 @@
, ...
}@args:

let
DEFAULT = {
dramsim3_config = ../../../difftest/config/dramsim3-config.ini;
};

# The OVERRIDE mechanism is only used for local development
OVERRIDE = DEFAULT // {
# uncomment to disable dramsim
# dramsim3_config = "no";
};
in
assert if emulator.enableTrace
then (lib.assertMsg (waveFileName != null) "waveFileName shall be set for trace build")
else (lib.assertMsg (waveFileName == null) "waveFileName must not be set for non-trace build");
let
overrides = builtins.removeAttrs args [ "emulator" "emuExtraArgs" "testCase" "waveFileName" ];
dramsim3_config = ../../../difftest/config/dramsim3-config.ini;

plusargs = [
"+t1_elf_file=${testCase}/bin/${testCase.pname}.elf"
"+t1_rtl_event_path=rtl-event.jsonl"
Expand All @@ -29,7 +40,7 @@ let
"+t1_wave_path=${waveFileName}"
]
++ lib.optionals (topName == "t1rocketemu") [
"+t1_dramsim3_cfg=${dramsim3_config}"
"+t1_dramsim3_cfg=${OVERRIDE.dramsim3_config}"
"+t1_dramsim3_path=dramsim3_out"
];
emuDriverWithArgs = emulator.driverWithArgs ++ plusargs ++ emuExtraArgs;
Expand Down