diff --git a/test/sim/tb_cxxrtl/tb.cpp b/test/sim/tb_cxxrtl/tb.cpp index 2c12080..7a14697 100644 --- a/test/sim/tb_cxxrtl/tb.cpp +++ b/test/sim/tb_cxxrtl/tb.cpp @@ -12,6 +12,13 @@ #include "dut.cpp" #include +// There must be a better way +#ifdef __x86_64__ +#define I64_FMT "%ld" +#else +#define I64_FMT "%lld" +#endif + // ----------------------------------------------------------------------------- static const int MEM_SIZE = 16 * 1024 * 1024; @@ -556,7 +563,7 @@ int main(int argc, char **argv) { if (memio.exit_req) { printf("CPU requested halt. Exit code %d\n", memio.exit_code); - printf("Ran for %lld cycles\n", cycle + 1); + printf("Ran for " I64_FMT " cycles\n", cycle + 1); break; } if (cycle + 1 == max_cycles)