#include // Copied from spike main. // TODO: This should really be provided in libriscv static std::vector> make_mems(const std::vector &layout) { std::vector> mems; mems.reserve(layout.size()); for (const auto &cfg : layout) { mems.push_back(std::make_pair(cfg.get_base(), new mem_t(cfg.get_size()))); } return mems; } int main() { cfg_t cfg; std::vector plugin_devices; std::vector htif_args {"pk", "hello"}; debug_module_config_t dm_config = { .progbufsize = 2, .max_sba_data_width = 0, .require_authentication = false, .abstract_rti = 0, .support_hasel = true, .support_abstract_csr_access = true, .support_abstract_fpr_access = true, .support_haltgroups = true, .support_impebreak = true }; std::vector> mems = make_mems(cfg.mem_layout); sim_t sim(&cfg, false, mems, plugin_devices, htif_args, dm_config, nullptr, true, nullptr, false, nullptr); sim.run(); }