adds initial semihosting host capabilities
This commit is contained in:
@@ -31,8 +31,10 @@
|
||||
*******************************************************************************/
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <iss/factory.h>
|
||||
#include <iss/semihosting/semihosting.h>
|
||||
#include <vector>
|
||||
|
||||
#include "iss/arch/tgc_mapper.h"
|
||||
@@ -52,7 +54,6 @@
|
||||
#endif
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
/*
|
||||
* Define and parse the program options
|
||||
@@ -116,6 +117,7 @@ int main(int argc, char* argv[]) {
|
||||
// instantiate the simulator
|
||||
iss::vm_ptr vm{nullptr};
|
||||
iss::cpu_ptr cpu{nullptr};
|
||||
std::function<void(iss::arch_if*, uint32_t, uint32_t)> semihosting_cb = &semihosting_callback<uint32_t>;
|
||||
std::string isa_opt(clim["isa"].as<std::string>());
|
||||
if(isa_opt.size() == 0 || isa_opt == "?") {
|
||||
auto list = f.get_names();
|
||||
@@ -123,7 +125,8 @@ int main(int argc, char* argv[]) {
|
||||
std::cout << "Available implementations (core|platform|backend):\n - " << util::join(list, "\n - ") << std::endl;
|
||||
return 0;
|
||||
} else if(isa_opt.find('|') != std::string::npos) {
|
||||
std::tie(cpu, vm) = f.create(isa_opt + "|" + clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
|
||||
std::tie(cpu, vm) =
|
||||
f.create(isa_opt + "|" + clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>(), &semihosting_cb);
|
||||
} else {
|
||||
auto base_isa = isa_opt.substr(0, 5);
|
||||
if(base_isa == "tgc5d" || base_isa == "tgc5e") {
|
||||
@@ -131,7 +134,7 @@ int main(int argc, char* argv[]) {
|
||||
} else {
|
||||
isa_opt += "|m_p|" + clim["backend"].as<std::string>();
|
||||
}
|
||||
std::tie(cpu, vm) = f.create(isa_opt, clim["gdb-port"].as<unsigned>());
|
||||
std::tie(cpu, vm) = f.create(isa_opt, clim["gdb-port"].as<unsigned>(), &semihosting_cb);
|
||||
}
|
||||
if(!cpu) {
|
||||
LOG(ERR) << "Could not create cpu for isa " << isa_opt << " and backend " << clim["backend"].as<std::string>() << std::endl;
|
||||
|
Reference in New Issue
Block a user