-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cputester results #266
Comments
Disk full: you could spread the files on two disks and copy the contents of them to ram: together with the cputester Then you should be able to start cpu tester from ramdisk Copy df0: to ram: ALL |
🤤🤤🤤 |
Using the RAM disk is a good idea. As I understood, Toni is also working on gzip support for the .dat files. This should solve the issue for most test cases (the dat files are heavily compressible). |
LINK A7,#something makes no sense but it is still technically valid instruction. Note that different CPU models handle this differently. ("LINK stacked value is saved before SP is decreased by 4. Only affects pointless LINK A7,#x variant. (All models except 68040)" says my notes) |
The issue with the LINK instruction was actually a simple one. In my code, I explicitly subtract 4 when register A7 is used:
I did this, because I reimplemented what I saw in PiCiJi’s portable68000/Denise emulator. He implemented it that way. I’ll let him know that this is wrong. A7 needs to be handled just as every other register. And indeed. Changing line
to
fixes the issue 😎. |
Finally. I've run all tests by now 🥵. Unexpectedly, Moira only has a very few issues left:
Assuming that the five untested test suits pass, only the DIV command has issues (which should be easy to fix) 😃. Regarding the five too large test cases, I can split Scc.B into 8 separate ones (one for the 8 possible addressing modes). The others can’t be split, because they use a single addressing mode. I’ll run them inside the RAM disk tomorrow (after reading in the files from different disks). Maybe I should really add support for 1.44MB drives which would solve the issue, too. Hard-drive support is difficult I guess, so I better keep my hands away from this for the moment. Time for a beer 🍺 … |
I added quick and dirty extra option: askifmissing. if it is enabled and xxxx.dat file is not found, it asks for path and retries. Note that because there is no "this is really the last file" marker (at least not yet), it will also ask for new path even if there is no more files remaining. Empty path = exit. |
Ah clever, that means when cputester reports about the missing file, dirk can swap disks in the background ... hehe😏 |
I appended What about adding something like a Anyway, I was stupid yesterday. I simply had to reduce the number of test runs from 2 to 1 to make the (zipped) test cases fit onto a single ADF 🙄. I have also seperated Scc into multiple test cases by splitting them w.r.t. the applied addressing mode. By doing this, I noticed that cputester didn’t generate test cases for the PC-relative addressing modes PC16 and PC8r. Is this a bug? |
askifmissing is m68k test program command line parameter ("cputest instruction.x askifmissing"). It has nothing to do with generating tests. Scc does not support PC16/PC8r variants. (ILLEGAL test includes these) |
Meanwhile DIVU and DIVS are passed, too. This means that Moira passes 100% of all tests by now 🥳. Overall I think this is a shining example of the strength of open source software. With the existence and free availability of Musashi, portable68000 and cputester I was able to implement a working 68000 CPU within weeks. I am amazed myself about this short development time. Next step: I will further clean up Moira and put it into a public repo on Github. Maybe others can benefit from this as well. Thanks to everyone who helped me with this!!! |
Nice. Next step is trace :) btw, I added optional automatic gzip compression support to test generator. (Binary not yet available, need to do some testing first because of cpu emulation related changes) |
🙋🏻♀️Toni, what does "next step is trace" mean ? Two other aspects for the test of an CPU Emulation come to my mind ...
Do you maybe also have an idea or hint about this ? 🤓 I read this in your description text for cputester
Currently my understanding is that it is still possible to test the first aspect with software 🤗 as dirk did already here but the second aspect the intermediate bus access is extremely difficult to test 🤢 with software alone, ... see some thoughts here where dirk also thinks it is hardly doable in a fine grained way (search for "intermediate bus access") Maybe only possible with a thing like a logic analyser 🥴? |
Trace as in Trace mode (SR T-bit). Many protections use it ("trace vector decoder") and not all cracks remove it. Getting accurate cycle length is not possible (almost correct should be possible) in real world. Only way is to use logic analyzer (I used logic analyzer to implement accurate timing over 10 years ago or so). Another possibility is to analyze recently released fx cast core which is based on 68000 microcode. (But then you probably hardwire your emulation to 68000 only. Which can also be valid choice.) But in my opinion instruction cycle count length can be only used to check that instruction is not totally wrong in emulation, using it to do regression testing. Order of memory accesses and positions of any possible "idle" cycles are very important because it will affect timing greatly if CPU is accessing chip ram and Agnus DMA is also active. Instruction cycle count results without any DMA contention might look nice and match documentation but don't have much common with real world situation. |
That's good to know. I formerly thought that the trace functionality was only used for hardware debugging. I'll put trace support on my TODO list 🤤. |
I recommend also testing SR modifying instructions. (ANDSR/ORSR/EORSR,MOVE to SR,STOP,RTE). btw, cycle count mode is coming soon. I thought it wasn't possible to have accurate enough cycle counting without custom hardware. I was wrong. |
Thanks, I will 👍.
cputester is already a great tool, but this one is gonna be a killer feature. I'm looking forward to get my hands on the new version 🤤. |
Does default unmodified ini also crash? Does any more log files appear if you replace mode=all with mode=or.l ? (or set verbose=2) |
Default .ini file works. It crashes when I comment out
|
I can't duplicate it but I'll debug it more later today. It isn't that important because you need to disable "low memory" anyway if you want correct cycle count results. EDIT: Oops, I read it the wrong way (works if disabled), now I can duiplicate it :) |
Should be fixed now. |
In the latest revision, cputester seems to ignore my My config files has
but it generates tests for all instructions. Do I have to enable cycle count checking explicitly or is it enabled by default? I haven't found an option for that. I've also noticed that the new .ini file comes with various default settings such as
How can I tell cputester to use one of these settings? 🤔 |
Cycle count is always enabled if 68000 (or 68010 but results are useless). m68k test program has option to either ignore included cycle counts (default) or enable it (-cycles) Ini structure has changed, [cputest] section does not anymore generate anything. Only [test=] generate tests. Enabled=0: don't generate tests (This makes it easy to have multiple "profiles" in same ini). Changed it to enabled=1 and you'll get 68000_IRQ directory containing test data. "Default" test is the one that m68k tester runs by default. Other test sets/groups/profiles (whatever you want to call them) need cputest < test group name >/< name of instruction or all >. |
OK, got it. Now, I am experiencing another problem. I created tests for TST.W, but they fails in both UAE and vAmiga. I guess it has something to do with test generation and not with the emulators. What I did is to shrink the test memory size to
in the .ini file to make the test case fit on a single ADF. Could it be related to that or do you think it is something else? |
Why not just disable slow ram completely? (chip ram + 8M fast ram only) Or use fastmemfirst in WB disk but I don't think it is worth the trouble.. |
You can also "cheat": implement word size register somewhere in memory space that counts cpu cycles and call cputester with -cyclecnt (for example -cyclecnt 0xf00000 if cyclecouter is located at 0xf00000), this replaces use of dff006. Address must have normal fast ram access timing.btw, cputester small update: reported cycle count is now separated in to instruction part and exception part. |
Making progress... Test case TST.W with the old version of vAmiga (v0.55, faulty VPOSR): Test case TST.W with the latest and greatest code changes 😎: All I had to do was to fix the implementation of
Next step will be to test the other instructions as well... |
Excellent tool 😎. It just told me that I've got a timing problem in Bcc.b and Bcc.w are good though. |
Does same test pass without -cycles? (x + y) means: y = cycles taken by "exit" exception. x = cycles taken by test instruction(s). It probably is trace related (moving #$ffff to SR), trace not getting disabled when illegal instruction starts (some exceptions clear it). Trace is a special case in cycle counting, whatever exception comes first will stop cycle counting. Most likely illegal instruction was generated (as expected) and then trace started immediately (which is not correct in this situation). |
Yes, it's trace related. I've generated another test case with trace flag / supervisor flag settings and ignored cycle counting. The test fails, because the wrong exception is executed in vAmiga. Instead of triggering a privilege violation, it triggered a trace exception. |
It is tester bug, it seems some exception + trace combinations don't work correctly yet. Fix will need to wait because currently I am adding 68010 cycle count support and there are some non-trivial changes needed to support it properly. |
No worries. I'll be busy for a while testing the other instructions. BTW, vAmiga displays the exact same error as UAE which I interpret as a good sign. And if cycle checkin is disabled, the test passes (which is definitely a good sign). |
maybe just an overwhelming overflow of stunning, compelling, cool, new and modern testing stuff which is constantly being added by toni to cputester, breaking with everything which the world has seen before 🤤🤤🤤... see definition of ahistorical |
It's the MVMLE.L instruction. The overflow also happens if this test is created alone. |
Very cool 😎. cputester showed me that my MOVEP implementation is wrong. Moira falsely triggered an address error when an odd address was given. Same for MOVEM. Moira always triggered an address error when an odd address was specified. But the address error does not trigger if the register mask is 0 (I never thought about the case somebody could (theoretically) use this command with a zero 0 reg mask, because it doesn't make sense). |
what a strange instruction I never have seen it ... I wonder how many of these seldom seen instructions are actually being used by compilers when they compile to asm. I bet they only use a subset of all possible instructions. Is this the difference between RISC and CISC processors? CISC processors developers tend to invent special seldom used instructions. Maybe they had in mind to substitute a code sequence of the more common instructions in order to save some memory space ??? 🤔 |
MOVEM has also previously used too many "history" entries. I'll also check it after 68010 stuff is more complete. You need to create later tests manually without "all". MOVEM zero mask is sort of edge-case but it actually exists in real world, some early crap C(?)-compilers have created it. I have seen it some early Amiga binaries but I don't think it has ever been used to generate/not generate mysterious address errors. Actually I also didn't know this behavior until tester reported it :) MVMEL and MVMLE = MOVEM to registers and from registers. Technically they are different instructions and need different label. (Don't ask why those labels, they already existed when I started doing UAE stuff ages ago) |
Interesting. The Motorola ref manual states that only bits 0 - 4 have a meaning in the lowest word of the address error exception stack frame. Apparently, this is not the case. For two different test cases, the expected value is $4ed2 and $4ef2, respectively: Both values differ in bit 5, so this bit must have a meaning, too. Some undocumented feature of the M68000? 🤔 |
This should be the place where UAE computes the "mystery word" located at the lowest stack frame address.
So it seems that a part of the opcode shows up in the upper bits (5 - 15). Uhhhh, who could have expected that? 🤭 |
Address error frame is full of undocumented behaviors.. I/N bit don't always work as documented, opcode field sometimes contain current, sometimes next opcode and probably more.. But as I said previously, no one cares. Except tester :) |
Yeah, it is already known and fixed. JMP and JSR EA calculation is a special case (no normal prefetches) and EA calculation time was done after address error check. |
After doing some top-level GUI refinements, I am finally back at cycle counting 🤤. I am having some weird issue with the latest cputester version though (I guess my configuration is wrong, but I don't know why). My problem is that I cannot get cputester to run if SlowRam is disabled. Running with SlowRam enabled, it runs just fine: But with SlowRam disabled, it eventually freezes. I don't know why this happens, because (I think) I configured it to place the tests in FastRam, only 🤔. Here are the relevant parts of my config: test_memory_start=0x860000 [test=Default] I am running UAE 4.3.0 with Chip = 512KB, Slow = 0KB, Fast = 8MB |
Found it. It was an issue with my script that didn't update the ADF properly... |
Now I am running into issue with the JMP instruction again. With latest cputester, it still fails in UAE when address errors are combined with cycle count checking: Mem config: 512 KB Chip + 0 KB Slow + 8 MB Fast
Ist the fix part of cputester or part of UAE? In the latter case, it's clear that the test fails, because 4.3.0 came out earlier. |
It is UAE fix. |
Current status (will be updated permanently):
ABCD.B 👍
ADD.B 👍
ADD.L 👍
ADD.W 👍
ADDA.L 👍
ADDA.W 👍
ADDX.B 👍
ADDX.L 👍
ADDX.W 👍
AND.B 👍
AND.L 👍
AND.W 👍
ANDSR.B 👍
ANDSR.W 👍 (zipped, 8 MB Fast RAM)
ASL.B 👍
ASL.L 👍
ASL.W 👍
ASLW.W 👍
ASR.B 👍
ASR.L 👍
ASR.W 👍
ASRW.W 👍
BCHG.B 👍
BCHG.L 👍
BCLR.B 👍
BCLR.L 👍
BSET.B 👍
BSET.L 👍
BSR.B 👍
BSR.W 👍
Bcc.B 👍 (zipped, 8 MB Fast RAM)
Bcc.W 👍 (zipped, 8 MB Fast RAM)
CHK.W 👍
CLR.B 👍
CLR.L 👍
CLR.W 👍
CMP.B 👍
CMP.L 👍
CMP.W 👍
CMPA.L 👍
CMPA.W 👍
CMPM.B 👍
CMPM.L 👍
CMPM.W 👍
DBcc.W 👍
DIVS.W 👍
DIVU.W 👍
EOR.B 👍
EOR.L 👍
EOR.W 👍
EORSR.B 👍 OK (zipped, 8 MB Fast RAM)
EORSR.W 👍
EXG.L 👍
EXT.L 👍
EXT.W 👍
ILLEGAL 👍
ILLEGAL.B 👍
JMP 👍
JSR 👍
LEA.L 👍
LINK.W 👍
LSL.B 👍
LSL.L 👍
LSL.W 👍
LSLW.W 👍
LSR.B 👍
LSR.L 👍
LSR.W 👍
LSRW.W 👍
MOVEx.B 👍 (zipped, 8 MB Fast RAM)
MOVEx.L 👍 (zipped, 8 MB Fast RAM)
MOVEx.W 👍 (zipped, 8 MB Fast RAM)
NBCD.B 👍
NEG.B 👍
NEG.L 👍
NEG.W 👍
NEGX.B 👍
NEGX.L 👍
NEGX.W 👍
NOP 👍
NOT.B 👍
NOT.L 👍
NOT.W 👍
OR.B 👍
OR.L 👍
OR.W 👍
ORSR.B 👍
ORSR.W 👍
PEA.L 👍
RESET 👍
ROL.B 👍
ROL.L 👍
ROL.W 👍
ROLW.W 👍
ROR.B 👍
ROR.L 👍
ROR.W 👍
RORW.W 👍
ROXL.B 👍
ROXL.L 👍
ROXL.W 👍
ROXLW.W 👍
ROXR.B 👍
ROXR.L 👍
ROXR.W 👍
ROXRW.W 👍
RTE 👍
RTR 👍
RTS 👍
SBCD.B 👍
STOP 👍
SUB.B 👍
SUB.L 👍
SUB.W 👍
SUBA.L 👍
SUBA.W 👍
SUBX.B 👍
SUBX.W 👍
SWAP.W 👍
Scc.B 👍
TAS.B 👍
TRAP 👍
TRAPV 👍
TST.B 👍
TST.L 👍
TST.W 👍
UNLK.L 👍
The text was updated successfully, but these errors were encountered: