dirkwhoffmann / Moira

A Motorola 68000 emulator written in C++
https://dirkwhoffmann.github.io/Moira
Other
106 stars 12 forks source link

testRunner issue #24

Open maxsbano opened 5 months ago

maxsbano commented 5 months ago

I describe the output of the testRunner and its backtrace, the executable is not compiled in debug, I cannot trace the assert line:

Moira CPU tester. (C) Dirk W. Hoffmann, 2019 - 2023

The test program runs Moira agains Musashi with randomly generated data.

Test rounds : 1

Random seed : 222

Exec range : (opcode >= 0x0000 && opcode <= 0xEFFF) Dasm range : (opcode >= 0x0000 && opcode <= 0xFFFF)

Round 1:

68000 CPU ................................ PASSED (Moira: 1.28s Musashi: 1.11s)

68010 CPU ................................ PASSED (Moira: 2.62s Musashi: 2.32s)

EC020 CPU ................................ PASSED (Moira: 4.01s Musashi: 3.53s)

68020 CPU .......................

Program received signal SIGFPE, Arithmetic exception.

0x0000555555a11a9c in m68k_op_divl_32_d ()

(gdb) bt

0 0x0000555555a11a9c in m68k_op_divl_32_d ()

1 0x00005555559e2292 in m68k_execute ()

2 0x00005555555830e0 in runMusashi(Setup&, Result&) ()

3 0x0000555555582e08 in runSingleTest(Setup&, unsigned short) ()

4 0x00005555555829dc in runCPU(long) ()

5 0x0000555555582858 in run() ()

6 0x0000555555581a00 in main ()

runned on Windows and Ubuntu, same result

dirkwhoffmann commented 5 months ago

Strange. Hard-coding yesterday's seed (222), it runs flawlessly on the Mac (clang):

Moira CPU tester. (C) Dirk W. Hoffmann, 2019 - 2023

The test program runs Moira agains Musashi with randomly generated data.

    Test rounds : 1
    Random seed : 222
     Exec range : (opcode >= 0x0000 && opcode <= 0xEFFF)
     Dasm range : (opcode >= 0x0000 && opcode <= 0xFFFF)

Round 1:

68000 CPU ................................ PASSED  (Moira: 0.62s  Musashi: 0.85s)
68010 CPU ................................ PASSED  (Moira: 1.24s  Musashi: 1.71s)
EC020 CPU ................................ PASSED  (Moira: 1.89s  Musashi: 2.60s)
68020 CPU ................................ PASSED  (Moira: 2.54s  Musashi: 3.48s)

Maybe it's compiler-dependent. Does anybody have gcc at hand and can run the app after compiling it in debug mode?

To hard-code a seed, change this function before compiling:

int
Randomizer::init()
{
    std::time_t t = std::time(0);
    std::tm* now = std::localtime(&t);

    auto seed = 222; // now->tm_year + now->tm_yday;

    srand(seed);
    return seed;
}
maxsbano commented 4 months ago

Correct result today....

Moira CPU tester. (C) Dirk W. Hoffmann, 2019 - 2023 The test program runs Moira agains Musashi with randomly generated data. Test rounds : 1 Random seed : 226 Exec range : (opcode >= 0x0000 && opcode <= 0xEFFF) Dasm range : (opcode >= 0x0000 && opcode <= 0xFFFF) Round 1: 68000 CPU ................................ PASSED (Moira: 1.43s Musashi: 1.29s) 68010 CPU ................................ PASSED (Moira: 2.85s Musashi: 2.57s) EC020 CPU ................................ PASSED (Moira: 4.26s Musashi: 3.84s) 68020 CPU ................................ PASSED (Moira: 5.65s Musashi: 5.08s) EC030 CPU ................................ PASSED (Moira: 6.99s Musashi: 6.29s) 68030 CPU ................................ PASSED (Moira: 8.41s Musashi: 7.56s) 68030 MMU ................................ PASSED (Moira: 8.41s Musashi: 7.56s) EC040 CPU ................................ PASSED (Moira: 9.72s Musashi: 8.75s) LC040 CPU ................................ PASSED (Moira: 11.01s Musashi: 9.92s) LC040 MMU ................................ PASSED (Moira: 11.01s Musashi: 9.92s) 68040 CPU ................................ PASSED (Moira: 12.39s Musashi: 11.16s) 68040 MMU ................................ PASSED (Moira: 12.39s Musashi: 11.16s) 68040 FPU ................................ PASSED (Moira: 12.39s Musashi: 11.16s) All tests completed

with gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)

Moira CPU tester. (C) Dirk W. Hoffmann, 2019 - 2023

The test program runs Moira agains Musashi with randomly generated data.

Test rounds : 1

Random seed : 226

 Exec range : (opcode >= 0x0000 && opcode <= 0xEFFF)

 Dasm range : (opcode >= 0x0000 && opcode <= 0xFFFF)

Round 1:

68000 CPU ................................ PASSED (Moira: 1.36s Musashi: 1.24s)

68010 CPU ................................ PASSED (Moira: 2.93s Musashi: 2.65s)

EC020 CPU ................................ PASSED (Moira: 3.81s Musashi: 3.41s)

68020 CPU ................................ PASSED (Moira: 4.71s Musashi: 4.08s)

EC030 CPU ................................ PASSED (Moira: 5.88s Musashi: 5.09s)

68030 CPU ................................ PASSED (Moira: 7.19s Musashi: 6.11s)

68030 MMU ................................ PASSED (Moira: 7.19s Musashi: 6.11s)

EC040 CPU ................................ PASSED (Moira: 8.69s Musashi: 7.58s)

LC040 CPU ................................ PASSED (Moira: 10.17s Musashi: 9.00s)

LC040 MMU ................................ PASSED (Moira: 10.17s Musashi: 9.00s)

68040 CPU ................................ PASSED (Moira: 12.17s Musashi: 10.31s)

68040 MMU ................................ PASSED (Moira: 12.17s Musashi: 10.31s)

68040 FPU ................................ PASSED (Moira: 12.17s Musashi: 10.31s)

All tests completed

with gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

I don't want to investigate the problem, but it is strange ... Thank you for your time in developing this application ... I want to run an oscilloscope sw!