04 December 2017, 21:06 | #1 |
Registered User
Join Date: May 2014
Location: Italy
Posts: 419
|
[Feature Request] Cycle Exact for other Cpu
Hy Tony,
it possibile emulate cycle exact for 68030,68040 and 68060. Thanks a lot. By Zilog. Last edited by Zilog; 05 December 2017 at 20:00. |
04 December 2017, 22:01 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,567
|
68020 isn't very accurate either.
It is only possible if someone finds out how CPU internal instruction sequencer work. exactly. (68040+ isn't really worth the trouble, programs that need 68040+ usually is well behaving enough to not care about exact accuracy) |
05 December 2017, 10:57 | #3 |
Registered User
Join Date: May 2014
Location: Italy
Posts: 419
|
Ok. Thanks Tony.
|
05 December 2017, 14:12 | #4 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
I guess even 68020 is not too important to have 100% cycle accurate since most 020 code is not timing-critical like 68000 demos and games which could be very dependent on raster timing etc. This was not really the case with 020 since there was no real 'standard' 020-based Amiga except for the 1200, but by that time several other 020-solutions already existed in Amiga-land so people knew that it was not wise to code towards a specific device. Also, many people put accelerators in their 1200s, so doing something timing-critical would not sell well.
The only 020-based platform that did not 'suffer' from accelerators being common etc. would maybe be the CD32, but then I think that most games for that one would also have been released for A1200/A4000. |
05 December 2017, 14:49 | #5 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Yet it's a pain when optimising code for 020-030 because it can't be tested on anything but real hw...
|
05 December 2017, 15:09 | #6 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
Even on real HW you still have several versions to choose from, i.e. multiple clock frequencies which will interfere with the timing since the chip mem is still running as slow as ever.
But I can see that it would be nice to be able to measure the timing reasonably well so you validate code optimizations in loops etc. But just how inaccurate is the 020 emulation timing? |
05 December 2017, 16:33 | #7 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
I don't know if it has been changed since, but 3.1.0 on which i tested isn't even remotely exact. I found something taking 4 clocks isn't twice the time as something taking 2, etc. In fact, nothing appeared to be right at all |
|
05 December 2017, 16:53 | #8 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
|
05 December 2017, 17:02 | #9 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,567
|
Not again?
68020 cycle exact is very important but as I said, unless someone tells me how internal cycle sequencer work (or gets access to internal cycle sequencer bus request signal!). I have totally lost interest with 68020 cycle accuracy unless someone finds something that is actually helpful. Average timing or those tables in 68020/030 manual are practically useless for accurate emulation purposes. Then there is DIV and MUL that are variable cycle count. Totally unknown cycle usage. 68000 documented average values were also useless. Fortunately someone bothered to examine 68000 patent microcode listings to decode the actual logic. |
05 December 2017, 17:12 | #10 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 44
Posts: 4,190
|
I guess someone could etch the top off an 68020 and implement all the gates 100% accurately in VHDL. Then you'd have something to work with. :-)
|
05 December 2017, 17:55 | #11 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
And anyway this doesn't change the timing when the code is in icache. Yes, again Quote:
Quote:
If we have two instructions with same timing on real hw then the emulator should at least use the same timing for them - and it doesn't appear to be the case today. Some are 2,4,6, or 8 clocks if in icache and this does not depend on anything external so timing ratios should at least be respected in the general case. Quote:
DIV is too rare for exact timing to be that important ; keeping what we have now is enough. A good estimate would be to take the best timing and add 2 clocks. So once again, even if cycle exact can not be reached, something close enough can still be done. If i get a timing that's 2% different than real hw, it's quite acceptable. NOT if i get 25% difference (or something so chaotic i cannot even get a clock rate estimate). Do you agree ? |
||||
05 December 2017, 18:12 | #12 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,567
|
It does not work that way because if instruction accesses chip ram (which is main reason for 68020 ce, running unexpanded A1200 demos accurately), length of instruction can change greatly and trying to fit it with cached instructions correctly is the problem. It requires more accurate cycle sequencer emulation, even switching data <> prefetch access order can change speed of execution in chip ram bandwidth starved situation much more than 2x! And this is the problem with unexpanded A1200. (AGA chipset/chip ram CPU access still takes 2 color clocks = same as 68000 memory cycle! Fortunately it is at least 32-bit wide)
Your use case is something totally different, "fixing" that would not help my goal and most likely would only make it worse. It needs proper improvement that works with both cases. |
05 December 2017, 18:50 | #13 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
So what is done currently that would break with more accurate timings for full-in-icache loops ?
|
05 December 2017, 19:08 | #14 |
Registered User
Join Date: Oct 2014
Location: Klagenfurt / Austria
Posts: 1,571
|
can a moderator please rename "fectures" into "features" in both thread titles?
this is driving me up the wall, totally makes me nuts! maybe some kind of ocd?... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Request: 68030/A3000 cycle-exact | Aegis | request.UAE Wishlist | 14 | 18 February 2019 18:54 |
Cycle-exact CPU speed shows as 0.000000 initially | mark_k | support.WinUAE | 0 | 16 October 2016 17:27 |
cycle exact cpu emulation speed, accurate ? | turrican3 | support.WinUAE | 1 | 23 December 2013 18:20 |
Emulation Speed/Cycle-exact fail to update when changing CPU | hceline | support.WinUAE | 2 | 16 November 2013 21:00 |
Problem with cycle-exact and custum CPU emulation speed | pintcat | support.WinUAE | 14 | 11 May 2010 20:12 |
|
|