[dv] Remove support for building against ibex-cosim-v0.1

This commit is contained in:
Rupert Swarbrick 2022-03-24 16:16:56 +00:00 committed by Rupert Swarbrick
parent ddb069bc1c
commit 1f6bcb9ab5

View file

@ -14,20 +14,6 @@
#include <iostream>
#include <sstream>
// For a short time, we're going to support building against version
// ibex-cosim-v0.1 (ec46119, the first version of Spike against which this was
// developed) and also ibex-cosim-v0.2 (20a886c). Unfortunately, they've got
// different APIs and spike doesn't expose a version string.
//
// However, a bit of digging around finds some defines that have been added
// between the two versions.
//
// TODO: Once there's been a bit of a window to avoid a complete flag day,
// remove this ugly hack!
#ifndef MSTATUSH_GVA
#define OLD_SPIKE
#endif
SpikeCosim::SpikeCosim(const std::string &isa_string, uint32_t start_pc,
uint32_t start_mtvec, const std::string &trace_log_path,
bool secure_ibex, bool icache_en)
@ -38,17 +24,11 @@ SpikeCosim::SpikeCosim(const std::string &isa_string, uint32_t start_pc,
log_file = log->get();
}
#ifdef OLD_SPIKE
processor = std::make_unique<processor_t>(
isa_string.c_str(), "MU", DEFAULT_VARCH, this, 0, false, log_file,
nullptr, secure_ibex, icache_en);
#else
processor =
std::make_unique<processor_t>(isa_string.c_str(), "MU", DEFAULT_VARCH,
this, 0, false, log_file, std::cerr);
processor->set_ibex_flags(secure_ibex, icache_en);
#endif
processor->set_mmu_capability(IMPL_MMU_SBARE);
processor->get_state()->pc = start_pc;
@ -348,15 +328,11 @@ void SpikeCosim::set_debug_req(bool debug_req) {
}
void SpikeCosim::set_mcycle(uint64_t mcycle) {
#ifdef OLD_SPIKE
processor->get_state()->mcycle = mcycle;
#else
// TODO: Spike decrements mcycle on write to hack around an issue it has with
// correctly writing minstret. Preferably this write would use a backdoor
// access and avoid that decrement but backdoor access isn't part of the
// public CSR interface.
processor->get_state()->mcycle->write(mcycle + 1);
#endif
}
void SpikeCosim::notify_dside_access(const DSideAccessInfo &access_info) {