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

Fix verilator build #778

Merged
merged 2 commits into from
Sep 11, 2024
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
8 changes: 4 additions & 4 deletions difftest/spike_interfaces/spike_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ ffi_callback ffi_addr_to_mem;
extern void *ffi_target;
std::vector<uint32_t> reg_write_index_vec;

class sim_t : public simif_t {
class t1_sim_t : public simif_t {
public:
sim_t() {}
~sim_t() {}
t1_sim_t() {}
~t1_sim_t() {}
char *addr_to_mem(reg_t addr) override {
return ffi_addr_to_mem(ffi_target, addr);
}
Expand Down Expand Up @@ -50,7 +50,7 @@ class Spike {

private:
cfg_t cfg;
sim_t sim;
t1_sim_t sim;
isa_parser_t isa;
processor_t proc;
};
Expand Down
5 changes: 4 additions & 1 deletion nix/t1/conversion/sv-to-verilator-emulator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ rec {
verilatorTop
]
++ extraVerilatorArgs
++ lib.optionals (enableTrace) [ "--trace-fst" ];
++ lib.optionals (enableTrace) [
"+define+T1_ENABLE_TRACE"
"--trace-fst"
];

buildPhase = ''
runHook preBuild
Expand Down
2 changes: 2 additions & 0 deletions nix/t1/t1rocket.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
verilator-dpi-lib = scope.makeDifftest {
outputName = "t1rocket-verilator-dpi-lib";
moduleType = "dpi_t1rocket";
emuType = "verilator";
};
verilator-dpi-lib-trace = scope.makeDifftest {
outputName = "t1rocket-verilator-trace-dpi-lib";
moduleType = "dpi_t1rocket";
emuType = "verilator";
enableTrace = true;
};

Expand Down