Added use of CCI and support of LLVM 5.0

changed load_file to adhere to API change in DBT-RISE
This commit is contained in:
2018-03-27 19:49:11 +02:00
parent 36be8b87f1
commit 3ea9651665
16 changed files with 61 additions and 36 deletions

View File

@ -451,7 +451,7 @@ public:
void reset(uint64_t address) override;
void load_file(std::string name, int type = -1) override;
std::pair<uint64_t,bool> load_file(std::string name, int type = -1) override;
virtual phys_addr_t virt2phys(const iss::addr_t &addr) override;
@ -551,7 +551,7 @@ riscv_hart_msu_vp<BASE>::riscv_hart_msu_vp()
csr_wr_cb[satp] = &riscv_hart_msu_vp<BASE>::write_satp;
}
template <typename BASE> void riscv_hart_msu_vp<BASE>::load_file(std::string name, int type) {
template <typename BASE> std::pair<uint64_t,bool> riscv_hart_msu_vp<BASE>::load_file(std::string name, int type) {
FILE *fp = fopen(name.c_str(), "r");
if (fp) {
std::array<char, 5> buf;
@ -587,7 +587,8 @@ template <typename BASE> void riscv_hart_msu_vp<BASE>::load_file(std::string nam
fromhost = tohost + 0x40;
}
}
return;
return std::make_pair(reader.get_entry(), true);
}
throw std::runtime_error("memory load file is not a valid elf file");
}

View File

@ -109,7 +109,7 @@ int main(int argc, char *argv[]) {
} else if (isa_opt.substr(0, 4)=="rv32") {
iss::arch::rv32imac* cpu = new iss::arch::riscv_hart_msu_vp<iss::arch::rv32imac>();
vm = iss::create(cpu, clim["gdb-port"].as<unsigned>());
vm->register_plugin(cc_plugin);
// vm->register_plugin(cc_plugin);
} else {
LOG(ERROR) << "Illegal argument value for '--isa': " << clim["isa"].as<std::string>() << std::endl;
return 127;