47 int main(
int argc,
const char *argv[])
56 std::cout <<
"=== Setting up configurations ===" << std::endl;
61 std::cout <<
"=== Finished setting up configurations ===" << std::endl << std::endl;
63 std::cout <<
"=== Setting up test system ===" << std::endl;
64 std::cout <<
" Setting up Memory" << std::endl;
70 std::cout <<
" CPU architecture was not set anywhere! Please set it manually using the arch.cpu configuration option!";
76 std::list<etiss::uint32> instructions;
78 instructions.push_back(0x80b584b0);
82 for (
auto it_instr : instructions)
85 buf[0] = it_instr >> 24;
86 buf[1] = it_instr >> 16;
87 buf[2] = it_instr >> 8;
95 std::cout <<
" Setting up CPUCore" << std::endl;
97 std::string CPUArchName =
etiss::cfg().
get<std::string>(
"arch.cpu",
"");
99 std::cout <<
" CPU start address: 0x" << std::hex << sa << std::dec << std::endl;
107 cpu->setTimer(
false);
120 std::cout <<
"=== Finished Setting up test system ===" << std::endl << std::endl;
122 std::cout <<
"=== Setting up plug-ins ===" << std::endl;
124 auto irq_handler = std::make_shared<etiss::InterruptHandler>(cpu->getInterruptVector(), cpu->getInterruptEnable(), cpu->getArch(),
etiss::LEVEL_TRIGGERED,
false);
125 cpu->addPlugin(irq_handler);
130 if (
etiss::cfg().get<bool>(
"etiss.log_pc",
false)) {
132 cpu->addPlugin(std::shared_ptr<etiss::Plugin>(
new TracePrinter(0x88888)));
135 std::cout <<
"=== Setting up plug-ins ===" << std::endl << std::endl;
138 std::cout << std::endl <<
"=== Simulation start ===" << std::endl;
144 std::cout <<
"=== Simulation end ===" << std::endl << std::endl;
148 std::cout <<
"CPU0 exited with exception: 0x" << std::hex << exception << std::dec <<
": "
149 << etiss::RETURNCODE::getErrorMessages()[exception] << std::endl;
152 case etiss::RETURNCODE::CPUFINISHED:
154 case etiss::RETURNCODE::CPUTERMINATED:
157 case etiss::RETURNCODE::DBUS_READ_ERROR:
158 case etiss::RETURNCODE::DBUS_WRITE_ERROR:
159 case etiss::RETURNCODE::IBUS_READ_ERROR:
160 case etiss::RETURNCODE::IBUS_WRITE_ERROR:
161 case etiss::RETURNCODE::INTERRUPT:
162 case etiss::RETURNCODE::RESET:
163 case etiss::RETURNCODE::ILLEGALINSTRUCTION:
164 case etiss::RETURNCODE::ILLEGALJUMP:
165 case etiss::RETURNCODE::INSTR_PAGEFAULT:
166 case etiss::RETURNCODE::LOAD_PAGEFAULT:
167 case etiss::RETURNCODE::STORE_PAGEFAULT:
168 case etiss::RETURNCODE::GDBNOERROR:
169 case etiss::RETURNCODE::SYSCALL:
170 case etiss::RETURNCODE::PAGEFAULT:
173 case etiss::RETURNCODE::JITERROR:
174 case etiss::RETURNCODE::JITCOMPILATIONERROR:
177 case etiss::RETURNCODE::GENERALERROR:
178 case etiss::RETURNCODE::RELOADBLOCKS:
179 case etiss::RETURNCODE::RELOADCURRENTBLOCK:
180 case etiss::RETURNCODE::BREAKPOINT:
181 case etiss::RETURNCODE::ARCHERROR:
182 case etiss::RETURNCODE::EMULATIONNOTSUPPORTED:
183 case etiss::RETURNCODE::INVALIDSYSTEM:
Header file of the ETISS library.
simple test system implementation
static __inline__ uint64_t
A simple logger dedicated to print PC trace.
static std::shared_ptr< CPUCore > create(std::string archname, std::string instancename="", std::map< std::string, std::string > archoptions=std::map< std::string, std::string >())
Create a CPUCore instance.
bool set(const std::string &key, T value)
template function to set the value of a configuration key.
T get(const std::string &key, T default_, bool *default_used=0)
template function to read the value of a configuration key.
Wrapper for the initialize and shutdown of the ETISS environment.
void loadIniPlugins(std::shared_ptr< etiss::CPUCore > cpu)
loads the plugins given with the previous loaded .ini files
void loadIniJIT(std::shared_ptr< etiss::CPUCore > cpu)
sets the JIT given with the previous loaded .ini files
simple etiss:System implementation for testing
etiss::uint64 get_startaddr(void)
etiss::int32 dbg_write(etiss::uint64 addr, etiss::uint8 *buf, etiss::uint32 len)
Debug write operation.
static std::shared_ptr< VirtualStruct > root()
int main(int argc, const char *argv[])
MM_EXPORT const int32_t NOERROR
Configuration & cfg(const std::string &cfgName)
Get reference of the global ETISS configuration object.
void log(Verbosity level, std::string msg)
write log message at the given level.