x86 CPU emulation test suite?

Emulation of old PCs, PC hardware, or PC peripherals.

x86 CPU emulation test suite?

Postby donkeyulli » 2014-2-23 @ 18:17

Hallo :)

Is there any tool around to test the complete instruction Set of an x86 CPU?

I ask, because I need a tool to test a program and see if the program emulates the CPU right or not.

I know about Benchmark Tools, but I think that these Tools are only use part of the x86 Instruction Set.

Best Regards and thanks for your help.

donkeyulli
donkeyulli
Newbie
 
Posts: 2
Joined: 2009-6-04 @ 13:10

Re: x86 CPU emulation test suite?

Postby Stiletto » 2014-2-23 @ 21:25

A x86 emulator test suite / emulator tester? I don't think one exists.

I've seen them for 6502, 6809, 8080, 8085, Z80, 68K, PPC... I don't remember one for x86.

This looks interesting:
https://code.google.com/p/corkami/sourc ... asm?r=1569

[EDIT] Qemu may have a partial x86 test suite, try them?
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4361
Joined: 2002-7-01 @ 21:57

Re: x86 CPU emulation test suite?

Postby rodimus80 » 2014-2-23 @ 22:56

Is there a thread that lists the best tools for benchmarking each operating system?
User avatar
rodimus80
Member
 
Posts: 209
Joined: 2013-12-31 @ 19:34

Re: x86 CPU emulation test suite?

Postby Stiletto » 2014-2-24 @ 18:02

Maybe? But it's not this one. This thread is actually about torture-testing x86 CPU emulators, being as it is properly placed within the "PC Emulation" subforum :)
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4361
Joined: 2002-7-01 @ 21:57

Re: x86 CPU emulation test suite?

Postby donkeyulli » 2014-2-24 @ 19:45

Thanks for the link. The Code looks interesting and as a start, I will pick it up and expand it for my needs.

Thanks for your help and your answers.

Best Regards, donkeyulli
donkeyulli
Newbie
 
Posts: 2
Joined: 2009-6-04 @ 13:10

Re: x86 CPU emulation test suite?

Postby Stiletto » 2014-2-24 @ 19:55

No problem!

I'd recommend that if you are building your own x86 emulator test suite that you look to other CPU emulator test suites for broad inspiration:
I have copies of Gwenole Beauchesne's GPL-licensed M68K-Tester and PPCTorture / PPC-Tester and their test results, though that might be still floating out there.
http://web.archive.org/web/200904172029 ... /68ktester
http://web.archive.org/web/200901312346 ... /ppctester

ZEXALL (Z80): http://mdfs.net/Software/Z80/Exerciser/

8080/8085: http://www.idb.me.uk/sunhillow/8080.html

6502: http://visual6502.org/wiki/index.php?ti ... stPrograms

I'm sure there's others. I still need to investigate if Qemu has one as rumored.
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4361
Joined: 2002-7-01 @ 21:57

Re: x86 CPU emulation test suite?

Postby Calvero » 2014-2-24 @ 20:12

You might want to try Topbench.
Calvero
Member
 
Posts: 126
Joined: 2007-8-02 @ 13:30

Re: x86 CPU emulation test suite?

Postby Stiletto » 2014-2-24 @ 21:54

Stiletto wrote:I'm sure there's others. I still need to investigate if Qemu has one as rumored.


Got it! Yes, QEMU does/did. Gimme a little bit, gonna do a write-up.
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4361
Joined: 2002-7-01 @ 21:57

Re: x86 CPU emulation test suite?

Postby Quadko » 2014-8-04 @ 18:36

Is there an existing available suite of tests I can use while developing an x86 emulator to check my CPU emulation? (ASM, I assume?) I didn't see any, much less a 'standard' set. I assume the various emulator projects have some, but not sure if it's alright to snag them for my own purposes - assuming I can locate them!

Ideally there'd be tests for each of the cpu generations, I assume, and 16 and 32 bit versions. (Yes, yes, and 64 bit, but can't say I'd use them...)

If it doesn't exist, I wonder if it would be usefully enough to start creating? I had a start 10+ years ago when I was working on a Dos emulator, but it was far from complete, very specific, and DosBox's grand success rendered my work happily irrelevant and I moved on to other stuff. I'm curious about 16 bit Win31 stuff and thought about starting a new emulator project for that, but would love to have a set of reference tests to work from if they exist. :)
User avatar
Quadko
Newbie
 
Posts: 76
Joined: 2014-7-26 @ 03:34

Re: x86 CPU emulation test suite?

Postby Stiletto » 2014-8-04 @ 19:45

Thanks for reminding me, I'd forgotten about this thread.

The answer in general is yes, Qemu has one.
http://git.qemu.org/?p=qemu.git;a=tree; ... 76;hb=HEAD

A MAME/MESS developer teammate of mine had this to say about his 01/18/2012 compiles on 7/5/2012:
Firewave wrote:I did some new compiles based on the qemu-1.0 test-i386 source with DJGPP. The archive contains a version with all tests enabled (as far as possible on Windows), only 486 ops, only 386 ops and a 386 version without any FPU. The modified sourcefile is also included.

It's not a complete test, but it is quite helpful to test i386-based emulation cores.

Since qemu 1.0, there were minor additions and adjustments. It will build on Linux, but there is no way in the official test to disable feature of smaller CPUs, that's why I did the changes. Also it won't work on Windows and that's the main reason I changed it.


It's possible this situation has changed since July 2012 though, so check the qemu git.

On the other hand, maybe you can collaborate with donkeyulli to create a new one.
Attachments
test-i386.7z
Firewave's compiles and source changes of qemu-1.0's test-i386.c from 1/18/2012
(139.33 KiB) Downloaded 144 times
Last edited by Stiletto on 2014-8-05 @ 14:47, edited 4 times in total.
Reason: fixed previous thread link.
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4361
Joined: 2002-7-01 @ 21:57

Re: x86 CPU emulation test suite?

Postby Quadko » 2014-8-04 @ 20:24

Of course. :) Thank you very much, good stuff to dive into.
User avatar
Quadko
Newbie
 
Posts: 76
Joined: 2014-7-26 @ 03:34

Re: x86 CPU emulation test suite?

Postby Stiletto » 2014-8-05 @ 14:13

I may pester Firewave, perhaps he's done more recent builds. :)

(FYI Marvin people: this utility is a bit pointless to run in hardware...)
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4361
Joined: 2002-7-01 @ 21:57

Re: x86 CPU emulation test suite?

Postby gamax92 » 2014-9-25 @ 15:32

I apologize for bumping a rather dead thread, but have some questions over this "test" utility

It seems to spew out a bunch of information, but do we have a official reference to what the values should be?
Or should I just go an run it on real hardware and compare the results.

I ask because I ran this on Bochs, QEMU, DOSBox, PCem, and my machine and got some variations, mainly floating point stuff, between all of them (Besides Bochs and My Machine, same results)
User avatar
gamax92
Newbie
 
Posts: 14
Joined: 2013-6-21 @ 13:47

Re: x86 CPU emulation test suite?

Postby crazyc » 2014-9-25 @ 22:38

gamax92 wrote:Or should I just go an run it on real hardware and compare the results.
Yup. You'll even get different results on different CPUs. Examples are flags behavior and SH[RL]D.
crazyc
Member
 
Posts: 143
Joined: 2013-2-02 @ 16:17

Re: x86 CPU emulation test suite?

Postby superfury » 2019-5-30 @ 15:42

I tried running the attachment by Stiletto on my emulator, UniPCemu. It seems to crash most of the time, due to an IRQ0 firing due to interrupts being available while it's loading the executable? Is that supposed to happen with CWSDPMI?

(sorry if I'm necroposting here, but it's related)
superfury
l33t
 
Posts: 3228
Joined: 2014-3-08 @ 11:25
Location: Netherlands


Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 4 guests