CPU speed discrepancies oddity

Troubles with your machine? Just want to speak about the latest improvements? This is the place!

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

ijor
Hardware Guru
Hardware Guru
Posts: 3790
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: CPU speed discrepancies oddity

Postby ijor » Tue May 03, 2016 1:36 pm

dml wrote:BTW another source of timing weirdness could result from any tests which themselves have wait-for-interrupt behaviour. e.g. if some part of AES/VDI waits for a vblank or timerc to synchronize something, then the game is up.


There are several possible reasons for different type of timing issues ... But none of them explains the behavior that Chris is describing. He is saying that is perfectly stable with one CPU, and it is 5% off with the other. That has to be related to the CPU.

troed wrote:(My doubt is "only" 99.9% though ... because there seems to be a wakestate effect on [some] interrupts which in theory would add 4 cycles to wakestates 2,3 & 4 each interrupt .. )

Can different CPUs cause the same motherboard to prefer one wakestate over another?


It is possible. But a couple of cycles per interrupt shouldn't yield 5% difference in the benchmarks. Even with HBL interrupts enabled you wouldn't get that difference.

User avatar
stimpy
Captain Atari
Captain Atari
Posts: 305
Joined: Mon Aug 22, 2005 2:47 pm
Location: Somerset, UK
Contact:

Re: CPU speed discrepancies oddity

Postby stimpy » Tue May 03, 2016 3:33 pm

Hit the CPU or booster with freezer spray. See if that makes a good CPU bad, or the reverse, a bad CPU good. Sounds like timing issues. :?:
Netus-Bee,Repairs,Upgrades,EtherNEC,Eiffel

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: CPU speed discrepancies oddity

Postby exxos » Tue May 03, 2016 3:46 pm

stimpy wrote:Hit the CPU or booster with freezer spray. See if that makes a good CPU bad, or the reverse, a bad CPU good. Sounds like timing issues. :?:


Theres so many things which could be causing it, its confusing. I need to get some freezer spray and try that actually..

There is something else to consider... These CPUs come from all over the place in China. I've not ever had any issues with them in general, but maybe there is something wrong with them somehow internally, like some factory rejects. :shrug:

Some GAL's arrived today, I tried one, verifies fine, refuses to work in the booster. Seems to run fine for a intermittent length of the time then the ST resets. So something is up with those for a start.

I have also noticed the CPU clock is a little sluggish on the master 8mhz clock. Its buffered going though a GAL, but I am looking into that at the moment. Maybe the 8mhz clock itself causes a timing error with something else. I know from previous tests if I just buffer /AS to the GLUE a couple ns delay causes the video to jump 16 pixels out. So some random skew on the 8mhz clock could cause some timing error somewhere. Its possible that if we assumed thats true, and I change the CPU, it may or may not have a few pF difference on its inputs which could slow the rise and fall a few more ns. Some CPU's might push it over the edge at some point and that is why I see 5% difference over other CPUs.

I have been checking some lines such as DTACK, AS, and some others, and all seem pretty sharp signals. I've even added 1K pull ups on them to see if that did anything.



@troed..

Yesterday I got WS2, WS3, but today I am getting WS? :shrug:
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
troed
Atari God
Atari God
Posts: 1438
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: CPU speed discrepancies oddity

Postby troed » Tue May 03, 2016 3:59 pm

exxos wrote:Yesterday I got WS2, WS3, but today I am getting WS? :shrug:


Is this at 8Mhz with your board? "WS?" means that the CPU-GLUE offset was not WS1, WS2, WS3, WS4 or STE. That is, the timing of instructions as seen from the CPU did not take effect at the known locations the GLUE-CPU(MMU) offsets can be in (known as wakestates).

This should not, as far as is known, be able to happen on an Atari produced motherboard :P I'm actually surprised it can happen at all even if you start poking around at the signals.

/Troed

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: CPU speed discrepancies oddity

Postby exxos » Tue May 03, 2016 4:01 pm

troed wrote:
exxos wrote:Yesterday I got WS2, WS3, but today I am getting WS? :shrug:


Is this at 8Mhz with your board? "WS?" means that the CPU-GLUE offset was not WS1, WS2, WS3, WS4 or STE. That is, the timing of instructions as seen from the CPU did not take effect at the known locations the GLUE-CPU(MMU) offsets can be in (known as wakestates).

This should not, as far as is known, be able to happen on an Atari produced motherboard :P I'm actually surprised it can happen at all even if you start poking around at the signals.

/Troed


Maybe small brain fart here, but I've started in 16mhz mode again, so likely that is why ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
troed
Atari God
Atari God
Posts: 1438
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: CPU speed discrepancies oddity

Postby troed » Tue May 03, 2016 4:05 pm

exxos wrote:Maybe small brain fart here, but I've started in 16mhz mode again, so likely that is why ?


Yes ;)

/Troed

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: CPU speed discrepancies oddity

Postby exxos » Tue May 03, 2016 4:54 pm

A couple more tests, not much help though.

I swapped the 100R resistor in the CPU clock line to 68R. Now the rise and fall are a lot faster and now it only boots at all with the scope probe on the clock pin 8) :roll: :lol:

So, I changed the CPU. This one gave 102% speed before it crashed out.. Oddly the same tests gave 99% on the previous CPU.

cpu.jpg


So then I changed the GAL which wouldn't work before, and now it boots fine and now shows a stable 100%. The GAL in question only really drives the CPU clock. So looking closer this GAL has 20ns delay the others which worked fine had 12ns delay.

How this looks to me is the 8mhz clock is causing speed variations. Clearly the load of the scope probe is having huge impact on whats going on. So its possible different CPUs are putting different loads on the 8mhz clock causing these variations in speeds. The scope probe isn't currently on the board and now it works with a different CPU.

It seems if the 8mhz clock is a few ns faster , the CPU runs faster and its more prone to crashing. A few ns slower and things are more stable and show 100% scores, not unstable 102%.

I will try and find a IMP MMU, I have a feeling the rise and fall times are a bit faster on those, which is why they generally suck , ironically :lol:

EDIT1:
Put in the other CPU and now that is now also showing 100% scores! Stable in 16mhz and 8mhz!

EDIT2:
Tried both CPU's at 16mhz, both done several tests and all solid 100% scores. Just changed the CPU for a 3rd one, its done 5 full benchmark passes and still 100% scores.

So it seems to be, that if the CPU clock is 100% in sync with the master 8mhz (aka stock machine) it of course is all happy. Up to somewhere around 10ns delay on the clock, something starts going a bit wonky where I then get random values which can be anything between 95% - 103%. Its never crashed like that, just random scores. So now delays from around 20ns it all seems happy again and get solid 100% scores.

So for whatever reason, something doesn't like the CPU being somewhere around 10-20ns out of sync with the master 8mhz clock. Pretty much should just say 15ns delay causes the issue :shrug:

This probably explains why I had such varied results when I first did my 32mhz testing and it only worked with 1 particular GLUE chip. Any other GLUE chip an 32mhz either didn't work at all, or wasn't stable.

Still no idea why its doing that, but at least it seems to be related to the 8mhz clock sync with the CPU.
You do not have the required permissions to view the files attached to this post.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

GadgetUK164
Captain Atari
Captain Atari
Posts: 272
Joined: Tue Jul 23, 2013 11:12 am

Re: CPU speed discrepancies oddity

Postby GadgetUK164 » Tue May 03, 2016 9:30 pm

Wow, that was an interesting problem =O Glad it looks like you've sorted it! =D

User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1439
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: CPU speed discrepancies oddity

Postby Greenious » Fri May 13, 2016 3:46 am

Hey guys, long time no see. recent lurker here...

Exxos, I love your work, been peeking at your projects... :)

And I think you are actually answering your own question.

8MHz clock. each cycle is 1/8000000 secs. or 12,5ns.

The problem isn't the delay per se. It's that you place the CPU out of whack with the ST ram access cycle. Aim for a delay of 25ns and you should be good.
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: CPU speed discrepancies oddity

Postby exxos » Fri May 13, 2016 9:59 am

Greenious wrote:Exxos, I love your work, been peeking at your projects... :)

And I think you are actually answering your own question.

8MHz clock. each cycle is 1/8000000 secs. or 12,5ns.

The problem isn't the delay per se. It's that you place the CPU out of whack with the ST ram access cycle. Aim for a delay of 25ns and you should be good.


Hey Greenious, Glad to see some other hardware guru's here for a change!

The delay isn't the whole problem though, though is a big part of it. My main issue was some CPU's run either slightly faster or slower than others. Though the second batch of booster I built (different supplier of CPU's) they are all constant speed now. I've just put it down to the loading of the signals (IE clock) of the CPU causing random slow downs or something. I don't get the problem with the "new" batch of CPU's I fitted to the last few boosters. Very odd indeed.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1439
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: CPU speed discrepancies oddity

Postby Greenious » Fri May 13, 2016 10:12 am

exxos wrote:
Greenious wrote:Exxos, I love your work, been peeking at your projects... :)

And I think you are actually answering your own question.

8MHz clock. each cycle is 1/8000000 secs. or 12,5ns.

The problem isn't the delay per se. It's that you place the CPU out of whack with the ST ram access cycle. Aim for a delay of 25ns and you should be good.


Hey Greenious, Glad to see some other hardware guru's here for a change!

The delay isn't the whole problem though, though is a big part of it. My main issue was some CPU's run either slightly faster or slower than others. Though the second batch of booster I built (different supplier of CPU's) they are all constant speed now. I've just put it down to the loading of the signals (IE clock) of the CPU causing random slow downs or something. I don't get the problem with the "new" batch of CPU's I fitted to the last few boosters. Very odd indeed.


I think it is due to various tolerances and iterations of the CPUs. Since every 2 clockcycles are used by mmu/glue/shifter, every 2 clockcycles are allocated to the CPU. If you get a 2 clockcycle (25ns) displacement of the CPU, it does not matter since it waits for it's turn, and aligns automatically, but if it is delay is small enough, the read/write window get's smaller and when the bussignal from the GLUE comes, it will go for it, even if it is a few ns late... and if it is late enough, weird things are likely to happen. That's why you get those problems I bet, and if you get your timing in sync with the original 8MHz clock, they will go away I'm sure.
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

mlynn1974
Captain Atari
Captain Atari
Posts: 266
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: CPU speed discrepancies oddity

Postby mlynn1974 » Wed Nov 23, 2016 9:52 pm

I don't know if this is relevant but in the scrolltext for Pompey Pirates Menu 26 Alien says:

Did you know that the 68000 in your ST is meant to run at 8MHz? Yes? Not necessarily
true... When writing this menu, I found 4 different ST's ran at completely different speeds...
Genie's one is slower than mine, Sledgehammers's really crawls along and a half meg old TOS one we
borrowed ran about the same speed as Genie's. Now either mine and Neil G.'s run faster than
normal or Motorola's quality control is sloppy! Sorry to everyone who thinks this scroll is
too fast- I had to turbo boost the damn thing so it would still run on Genie's ST!

(I normalized the text case so it's not all bold).

This may be an anecdote but there might be a grain of truth in it and at least Alien knew about it back in the day.
I don't know how widespread this problem is and it's not something I've personally experienced myself.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: CPU speed discrepancies oddity

Postby exxos » Wed Nov 23, 2016 9:57 pm

mlynn1974 wrote:I don't know if this is relevant but in the scrolltext for Pompey Pirates Menu 26 Alien says:

Did you know that the 68000 in your ST is meant to run at 8MHz? Yes? Not necessarily
true... When writing this menu, I found 4 different ST's ran at completely different speeds...
Genie's one is slower than mine, Sledgehammers's really crawls along and a half meg old TOS one we
borrowed ran about the same speed as Genie's. Now either mine and neil g.'s run faster than
normal or Motorola's quality control is sloppy! Sorry to everyone who thinks this scroll is
too fast- I had to turbo boost the damn thing so it would still run on Genie's ST!

- Text case normalised for sanity

This may be an anecdote but there might be a grain of truth in it and at least the Alien knew about it back in the day.
I don't know how widespread this problem is and it's not something I've personally experienced myself.


It is known that there is ( I think ) 4 speeds of oscillators used in the ST's. So machines can run at different speeds. Its known in GB6 that some people will see 99% scores simple because their 8mhz speed is like 0.1mhz slower than the machine I benchmarked.

Though I have also seen it can depend on the actual CPU used aswell. one brand to another can be a factor. Also as the CPU can be in effect stalled by other bus masters, its more of a random time event where the CPU might have several bus cycles less "time" in one test than another. Its never consistent.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
troed
Atari God
Atari God
Posts: 1438
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: CPU speed discrepancies oddity

Postby troed » Thu Nov 24, 2016 12:32 pm

exxos wrote:It is known that there is ( I think ) 4 speeds of oscillators used in the ST's. So machines can run at different speeds. Its known in GB6 that some people will see 99% scores simple because their 8mhz speed is like 0.1mhz slower than the machine I benchmarked.


8.007 (very very few, maybe even a botched purchase of clock chips by Atari)
8.01 (early STF, PAL & NTSC I think)
8.02 (PAL units, STFM and STE)
8.05 (NTSC STFM and STE)

exxos wrote:Though I have also seen it can depend on the actual CPU used aswell. one brand to another can be a factor. Also as the CPU can be in effect stalled by other bus masters, its more of a random time event where the CPU might have several bus cycles less "time" in one test than another. Its never consistent.


It's not something that shows up in pure CPU loops (demo code, fullscreens etc) at least. Involving other chips ... maybe.

/Troed

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: CPU speed discrepancies oddity

Postby exxos » Thu Nov 24, 2016 1:01 pm

troed wrote:
It's not something that shows up in pure CPU loops (demo code, fullscreens etc) at least. Involving other chips ... maybe.

/Troed


dml turned off the floppy polling in GB6 code to rule out that as adding random time "glitches" into the test loops. Its like the classic case of moving the mouse while something is running and it slows down whatever its doing while the mouse is being moved. So mouse and keyboard are also turned off in the test loops in GB6.

But still, sometimes it does give 99% or even 102% in some tests. Though its not just the Atari design on how everything runs on the bus, its also down to the hardware as I found with different CPUs while testing my V2 boosters out. But even using less resistance on DTACK can seem to help keep things more stable.

So if the CPU was just running one instruction constantly, in theory , it would always run the same amount of instructions in the same amount of time (excluding, blitter/ floppy / keyboard polling etc) .

Though I am skeptical a little of that as changing DTACK resistance alters test times in GB6 aswell. Its like sometimes the CPU "misses" DTACK and has to wait a extra cycle for basically no reason. Though these "misses" add up to a few timer ticks at the end of each GB6 test.

I'm not really sure of all causes of slow downs in tests. Think its a lot of things all just adding up :shrug:
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

joska
Hardware Guru
Hardware Guru
Posts: 4376
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: CPU speed discrepancies oddity

Postby joska » Thu Nov 24, 2016 1:33 pm

exxos wrote:dml turned off the floppy polling in GB6 code to rule out that as adding random time "glitches" into the test loops. Its like the classic case of moving the mouse while something is running and it slows down whatever its doing while the mouse is being moved. So mouse and keyboard are also turned off in the test loops in GB6.


But the 200Hz timer is still running, and most likely also the VBL.

exxos wrote:I'm not really sure of all causes of slow downs in tests. Think its a lot of things all just adding up :shrug:


A tiny bit of variation caused by the 200Hz timer combined with rounding issues and you'll easily end up with 1% deviation. Especially on faster machines where some of the tests are done in the blink of an eye. You can be pretty sure that the CPU does not miss a beat, at least on an unmodified ST.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64


Social Media

     

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 5 guests