56 if ((addr & customH->mask) != customH->addr)
58 return customH->origSys->dwrite(customH->origSys->handle, cpu, addr, buf, len);
68 std::cout << (char)buf[0];
74 std::cout <<
" <char> ";
75 for (
unsigned i = 0; i < len; i++)
77 iout |= buf[i] << (len - i - 1) * 8;
78 fbuf |= buf[i] << (len - i - 1) * 8;
79 bool isChar = (buf[i] > 32 && buf[i] < 127);
83 std::cout << (isChar ? std::string(
"\033[1;31m") : std::string(
"")) << std::setw(2) << (char)buf[i]
84 << (isChar ? std::string(
"\033[0m") : std::string(
""));
86 float *fout =
reinterpret_cast<float *
>(&fbuf);
88 std::cout << std::setfill(
'0') << std::hex <<
" | <hex> 0x" << std::setw(8) << iout << std::dec
90 std::cout <<
" | <int> " << std::setw(10) << iout;
91 std::cout <<
" | <float> " << *fout;
92 std::cout << std::endl;
95 std::flush(std::cout);
107 "read/writes exclusively to this logger instance.");
static __inline__ uint64_t
ETISS_System getWrapInfo(ETISS_System *origSystem) final
Defines which System functions to wrap.
Logger(uint64_t addr_value, uint64_t addr_mask)
CustomHandle customHandle_
etiss_int32 log(void *handle, ETISS_CPU *cpu, etiss_uint64 addr, etiss_uint8 *buf, etiss_uint32 len)
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
void log(Verbosity level, std::string msg)
write log message at the given level.
basic cpu state structure needed for execution of any cpu architecture.
memory access and time synchronization functions.
etiss_int32(* dwrite)(void *handle, ETISS_CPU *cpu, etiss_uint64 addr, etiss_uint8 *buffer, etiss_uint32 length)
write data
void * handle
custom handle that will be passed to the functions of this structure