adds windows compatibility fixes

This commit is contained in:
Eyck Jentzsch 2022-07-18 11:02:17 +02:00
parent a53ee42e13
commit 4876f18ba9
5 changed files with 262 additions and 254 deletions

View File

@ -30,10 +30,10 @@
* *
*******************************************************************************/ *******************************************************************************/
#include <iss/arch/${coreDef.name.toLowerCase()}.h>
#include <iss/arch/riscv_hart_m_p.h>
#include <iss/debugger/gdb_session.h> #include <iss/debugger/gdb_session.h>
#include <iss/debugger/server.h> #include <iss/debugger/server.h>
#include <iss/arch/${coreDef.name.toLowerCase()}.h>
#include <iss/arch/riscv_hart_m_p.h>
#include <iss/iss.h> #include <iss/iss.h>
#include <iss/llvm/vm_base.h> #include <iss/llvm/vm_base.h>
#include <util/logging.h> #include <util/logging.h>

View File

@ -45,7 +45,7 @@ namespace iss {
namespace plugin { namespace plugin {
class cycle_estimate: public iss::vm_plugin { class cycle_estimate: public vm_plugin {
BEGIN_BF_DECL(instr_desc, uint32_t) BEGIN_BF_DECL(instr_desc, uint32_t)
BF_FIELD(taken, 24, 8) BF_FIELD(taken, 24, 8)
BF_FIELD(not_taken, 16, 8) BF_FIELD(not_taken, 16, 8)

View File

@ -31,7 +31,7 @@
*******************************************************************************/ *******************************************************************************/
#include <iostream> #include <iostream>
#include <iss/factory.h> #include "iss/factory.h"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
@ -43,7 +43,9 @@
#include "iss/plugin/cycle_estimate.h" #include "iss/plugin/cycle_estimate.h"
#include "iss/plugin/instruction_count.h" #include "iss/plugin/instruction_count.h"
#include "iss/plugin/pctrace.h" #include "iss/plugin/pctrace.h"
#ifndef WIN32
#include <iss/plugin/loader.h> #include <iss/plugin/loader.h>
#endif
#if defined(HAS_LUA) #if defined(HAS_LUA)
#include <iss/plugin/lua.h> #include <iss/plugin/lua.h>
#endif #endif
@ -181,13 +183,16 @@ int main(int argc, char *argv[]) {
vm->register_plugin(*plugin); vm->register_plugin(*plugin);
plugin_list.push_back(plugin); plugin_list.push_back(plugin);
} else { } else {
#ifndef WIN32
std::array<char const*, 1> a{{filename.c_str()}}; std::array<char const*, 1> a{{filename.c_str()}};
iss::plugin::loader l(plugin_name, {{"initPlugin"}}); iss::plugin::loader l(plugin_name, {{"initPlugin"}});
auto* plugin = l.call_function<iss::vm_plugin*>("initPlugin", a.size(), a.data()); auto* plugin = l.call_function<iss::vm_plugin*>("initPlugin", a.size(), a.data());
if(plugin){ if(plugin){
vm->register_plugin(*plugin); vm->register_plugin(*plugin);
plugin_list.push_back(plugin); plugin_list.push_back(plugin);
} else { } else
#endif
{
LOG(ERR) << "Unknown plugin name: " << plugin_name << ", valid names are 'ce', 'ic'" << std::endl; LOG(ERR) << "Unknown plugin name: " << plugin_name << ", valid names are 'ce', 'ic'" << std::endl;
return 127; return 127;
} }

View File

@ -37,7 +37,9 @@
#include <iss/debugger/target_adapter_if.h> #include <iss/debugger/target_adapter_if.h>
#include <iss/iss.h> #include <iss/iss.h>
#include <iss/vm_types.h> #include <iss/vm_types.h>
#ifndef WIN32
#include <iss/plugin/loader.h> #include <iss/plugin/loader.h>
#endif
#include "core_complex.h" #include "core_complex.h"
#include <iss/arch/tgc_mapper.h> #include <iss/arch/tgc_mapper.h>
#include <scc/report.h> #include <scc/report.h>
@ -409,6 +411,7 @@ void core_complex::before_end_of_elaboration() {
cpu->vm->register_plugin(*plugin); cpu->vm->register_plugin(*plugin);
plugin_list.push_back(plugin); plugin_list.push_back(plugin);
} else { } else {
#ifndef WIN32
std::array<char const*, 1> a{{filename.c_str()}}; std::array<char const*, 1> a{{filename.c_str()}};
iss::plugin::loader l(plugin_name, {{"initPlugin"}}); iss::plugin::loader l(plugin_name, {{"initPlugin"}});
auto* plugin = l.call_function<iss::vm_plugin*>("initPlugin", a.size(), a.data()); auto* plugin = l.call_function<iss::vm_plugin*>("initPlugin", a.size(), a.data());
@ -416,6 +419,7 @@ void core_complex::before_end_of_elaboration() {
cpu->vm->register_plugin(*plugin); cpu->vm->register_plugin(*plugin);
plugin_list.push_back(plugin); plugin_list.push_back(plugin);
} else } else
#endif
SCCERR(SCMOD) << "Unknown plugin '" << plugin_name << "' or plugin not found"; SCCERR(SCMOD) << "Unknown plugin '" << plugin_name << "' or plugin not found";
} }
} }

View File

@ -30,11 +30,10 @@
* *
*******************************************************************************/ *******************************************************************************/
#include <vm/fp_functions.h>
#include <iss/arch/tgc_c.h>
#include <iss/arch/riscv_hart_m_p.h>
#include <iss/debugger/gdb_session.h> #include <iss/debugger/gdb_session.h>
#include <iss/debugger/server.h> #include <iss/debugger/server.h>
#include <iss/arch/tgc_c.h>
#include <iss/arch/riscv_hart_m_p.h>
#include <iss/iss.h> #include <iss/iss.h>
#include <iss/interp/vm_base.h> #include <iss/interp/vm_base.h>
#include <util/logging.h> #include <util/logging.h>