add SystemC ISS factory

This commit is contained in:
2023-07-14 11:11:03 +02:00
parent 0b719a4b57
commit 957145ca84
10 changed files with 144 additions and 70 deletions

View File

@ -16,6 +16,7 @@
#include <iss/vm_types.h>
#include <iostream>
namespace sysc {
template<typename PLAT>
class sc_core_adapter : public PLAT, public sc_core_adapter_if {
public:
@ -25,6 +26,8 @@ public:
sc_core_adapter(sysc::tgfs::core_complex *owner)
: owner(owner) { }
iss::arch_if* get_arch_if() override { return this;}
void set_mhartid(unsigned id) override { PLAT::set_mhartid(id); }
uint32_t get_mode() override { return this->reg.PRIV; }
@ -144,6 +147,5 @@ private:
sysc::tgfs::core_complex *const owner;
sc_core::sc_event wfi_evt;
};
}
#endif /* _SYSC_SC_CORE_ADAPTER_H_ */