48 int main(
int argc,
const char *argv[])
57 std::cout <<
"=== Setting up configurations ===" << std::endl;
62 std::cout <<
"=== Finished setting up configurations ===" << std::endl << std::endl;
64 std::cout <<
"=== Setting up test system ===" << std::endl;
65 std::cout <<
" Setting up Memory" << std::endl;
71 std::cout <<
" CPU architecture was not set anywhere! Please set it manually using the arch.cpu configuration option!";
77 std::list<etiss::uint32> instructions;
79 instructions.push_back(0x80b584b0);
83 for (
auto it_instr : instructions)
86 buf[0] = it_instr >> 24;
87 buf[1] = it_instr >> 16;
88 buf[2] = it_instr >> 8;
96 std::cout <<
" Setting up CPUCore" << std::endl;
98 std::string CPUArchName =
etiss::cfg().
get<std::string>(
"arch.cpu",
"");
100 std::cout <<
" CPU start address: 0x" << std::hex << sa << std::dec << std::endl;
108 cpu->setTimer(
false);
121 std::cout <<
"=== Finished Setting up test system ===" << std::endl << std::endl;
123 std::cout <<
"=== Setting up plug-ins ===" << std::endl;
125 auto irq_handler = std::make_shared<etiss::InterruptHandler>(cpu->getInterruptVector(), cpu->getInterruptEnable(), cpu->getArch(),
etiss::LEVEL_TRIGGERED,
false);
126 cpu->addPlugin(irq_handler);
131 if (
etiss::cfg().get<bool>(
"etiss.log_pc",
false)) {
133 cpu->addPlugin(std::shared_ptr<etiss::Plugin>(
new TracePrinter(0x88888)));
136 std::cout <<
"=== Setting up plug-ins ===" << std::endl << std::endl;
139 std::cout << std::endl <<
"=== Simulation start ===" << std::endl;
145 std::cout <<
"=== Simulation end ===" << std::endl << std::endl;
149 std::cout <<
"CPU0 exited with exception: 0x" << std::hex << exception << std::dec <<
": "
150 << etiss::RETURNCODE::getErrorMessages()[exception] << std::endl;
154 case etiss::RETURNCODE::CPUFINISHED:
156 case etiss::RETURNCODE::CPUTERMINATED:
159 case etiss::RETURNCODE::DBUS_READ_ERROR:
160 case etiss::RETURNCODE::DBUS_WRITE_ERROR:
161 case etiss::RETURNCODE::IBUS_READ_ERROR:
162 case etiss::RETURNCODE::IBUS_WRITE_ERROR:
163 case etiss::RETURNCODE::INTERRUPT:
164 case etiss::RETURNCODE::RESET:
165 case etiss::RETURNCODE::ILLEGALINSTRUCTION:
166 case etiss::RETURNCODE::ILLEGALJUMP:
167 case etiss::RETURNCODE::INSTR_PAGEFAULT:
168 case etiss::RETURNCODE::LOAD_PAGEFAULT:
169 case etiss::RETURNCODE::STORE_PAGEFAULT:
170 case etiss::RETURNCODE::GDBNOERROR:
171 case etiss::RETURNCODE::SYSCALL:
172 case etiss::RETURNCODE::PAGEFAULT:
175 case etiss::RETURNCODE::JITERROR:
176 case etiss::RETURNCODE::JITCOMPILATIONERROR:
179 case etiss::RETURNCODE::GENERALERROR:
180 case etiss::RETURNCODE::RELOADBLOCKS:
181 case etiss::RETURNCODE::RELOADCURRENTBLOCK:
182 case etiss::RETURNCODE::BREAKPOINT:
183 case etiss::RETURNCODE::ARCHERROR:
184 case etiss::RETURNCODE::EMULATIONNOTSUPPORTED:
185 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.